mirror of
https://github.com/GTNewHorizons/JustEnoughCalculation.git
synced 2026-11-12 16:27:32 +00:00
fix #8
This commit is contained in:
1 parent
66a73a14e6
commit
99dfd37dc4
4 files changed
+38
-33
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ buildscript {
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.7.10-0.3.2"
|
||||
version = "1.7.10-0.3.3"
|
||||
group= "pers.towdium.justEnoughCalculation" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "je_calculation"
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class JustEnoughCalculation{
|
||||
public static class Reference {
|
||||
public static final String MODID = "je_calculation";
|
||||
public static final String MODNAME = "Just Enough Calculation";
|
||||
public static final String VERSION = "0.3.2";
|
||||
public static final String VERSION = "0.3.3";
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
|
||||
+35
-30
@@ -295,6 +295,7 @@ public class GuiCalculator extends GuiTooltipScreen{
|
||||
}
|
||||
} else {
|
||||
JustEnoughCalculation.proxy.getPlayerHandler().syncItemCalculator(inventorySlots.getSlot(0).getStack(), textFieldAmount.getText());
|
||||
|
||||
refreshRecipe();
|
||||
updateLayout();
|
||||
}
|
||||
@@ -401,40 +402,44 @@ public class GuiCalculator extends GuiTooltipScreen{
|
||||
};
|
||||
Timer t = new Timer();
|
||||
t.schedule(r, 1000);
|
||||
if(inventorySlots.getSlot(0).getStack() == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(dest == null) {
|
||||
return;
|
||||
}
|
||||
Calculator calculator = new Calculator(dest, i*100);
|
||||
costRecord = calculator.getCost();
|
||||
if(dest != null){
|
||||
dest = dest.copy();
|
||||
dest.getTagCompound().removeTag(JustEnoughCalculation.Reference.MODID);
|
||||
ItemStack calculatorItem = ((ContainerCalculator)inventorySlots).getPlayer().getHeldItem();
|
||||
ItemStack[] stack = new ItemStack[6];
|
||||
for(int j=0; j<recentLen; j++){
|
||||
stack[j] = ItemStackWrapper.NBT.getItem(calculatorItem, "recent"+j);
|
||||
}
|
||||
int duplicate = -1;
|
||||
for(int j=0; j<recentLen; j++){
|
||||
if(stack[j] != null && ItemStackWrapper.isTypeEqual(dest, stack[j])){
|
||||
duplicate = j;
|
||||
}
|
||||
}
|
||||
if(duplicate == -1){
|
||||
ItemStackWrapper.NBT.setItem(calculatorItem, "recent0", dest);
|
||||
inventorySlots.getSlot(28).putStack(dest);
|
||||
for(int j=0; j<recentLen-1; j++){
|
||||
ItemStackWrapper.NBT.setItem(calculatorItem, "recent"+(j+1), stack[j]);
|
||||
inventorySlots.getSlot(27+2+j).putStack(stack[j]);
|
||||
}
|
||||
}else {
|
||||
ItemStackWrapper.NBT.setItem(calculatorItem, "recent0", dest);
|
||||
inventorySlots.getSlot(28).putStack(dest);
|
||||
for(int j=0; j<duplicate; j++){
|
||||
ItemStackWrapper.NBT.setItem(calculatorItem, "recent"+(j+1), stack[j]);
|
||||
inventorySlots.getSlot(27+2+j).putStack(stack[j]);
|
||||
}
|
||||
}
|
||||
JustEnoughCalculation.proxy.getPlayerHandler().syncItemCalculator(dest, textFieldAmount.getText());
|
||||
dest = dest.copy();
|
||||
dest.getTagCompound().removeTag(JustEnoughCalculation.Reference.MODID);
|
||||
ItemStack calculatorItem = ((ContainerCalculator)inventorySlots).getPlayer().getHeldItem();
|
||||
ItemStack[] stack = new ItemStack[6];
|
||||
for(int j=0; j<recentLen; j++){
|
||||
stack[j] = ItemStackWrapper.NBT.getItem(calculatorItem, "recent"+j);
|
||||
}
|
||||
int duplicate = -1;
|
||||
for(int j=0; j<recentLen; j++){
|
||||
if(stack[j] != null && ItemStackWrapper.isTypeEqual(dest, stack[j])){
|
||||
duplicate = j;
|
||||
}
|
||||
}
|
||||
if(duplicate == -1){
|
||||
ItemStackWrapper.NBT.setItem(calculatorItem, "recent0", dest);
|
||||
inventorySlots.getSlot(28).putStack(dest);
|
||||
for(int j=0; j<recentLen-1; j++){
|
||||
ItemStackWrapper.NBT.setItem(calculatorItem, "recent"+(j+1), stack[j]);
|
||||
inventorySlots.getSlot(27+2+j).putStack(stack[j]);
|
||||
}
|
||||
}else {
|
||||
ItemStackWrapper.NBT.setItem(calculatorItem, "recent0", dest);
|
||||
inventorySlots.getSlot(28).putStack(dest);
|
||||
for(int j=0; j<duplicate; j++){
|
||||
ItemStackWrapper.NBT.setItem(calculatorItem, "recent"+(j+1), stack[j]);
|
||||
inventorySlots.getSlot(27+2+j).putStack(stack[j]);
|
||||
}
|
||||
}
|
||||
JustEnoughCalculation.proxy.getPlayerHandler().syncItemCalculator(dest, textFieldAmount.getText());
|
||||
}
|
||||
|
||||
protected void drawMissingTexture(){
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"modid": "je_calculation",
|
||||
"name": "Just Enough Calculation",
|
||||
"description": "A simple mod to help you with recipe calculation.",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.3",
|
||||
"mcversion": "1.7.10",
|
||||
"url": "https://github.com/Towdium/JustEnoughCalculation",
|
||||
"updateUrl": "http://minecratft.curseforge.com/projects/just-enough-calculation",
|
||||
|
||||
Reference in new issue
Block a user