mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
TiCon tools lose their broken tag when repairing them in an item repairer
Closes #142
This commit is contained in:
parent
589d94894e
commit
b4decddd4b
1 changed files with 13 additions and 4 deletions
|
@ -77,9 +77,10 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!this.worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(this.slots[SLOT_OUTPUT] == null && canBeRepaired(this.slots[SLOT_INPUT])){
|
ItemStack input = this.slots[SLOT_INPUT];
|
||||||
if(this.slots[SLOT_INPUT].getItemDamage() <= 0){
|
if(this.slots[SLOT_OUTPUT] == null && canBeRepaired(input)){
|
||||||
this.slots[SLOT_OUTPUT] = this.slots[SLOT_INPUT].copy();
|
if(input.getItemDamage() <= 0){
|
||||||
|
this.slots[SLOT_OUTPUT] = input.copy();
|
||||||
this.slots[SLOT_INPUT] = null;
|
this.slots[SLOT_INPUT] = null;
|
||||||
this.nextRepairTick = 0;
|
this.nextRepairTick = 0;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +90,15 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I
|
||||||
this.storage.extractEnergy(ENERGY_USE, false);
|
this.storage.extractEnergy(ENERGY_USE, false);
|
||||||
if(this.nextRepairTick >= 2){
|
if(this.nextRepairTick >= 2){
|
||||||
this.nextRepairTick = 0;
|
this.nextRepairTick = 0;
|
||||||
this.slots[SLOT_INPUT].setItemDamage(this.slots[SLOT_INPUT].getItemDamage()-1);
|
input.setItemDamage(input.getItemDamage()-1);
|
||||||
|
|
||||||
|
if(input.hasTagCompound()){
|
||||||
|
//TiCon un-break tools
|
||||||
|
if("tconstruct".equalsIgnoreCase(input.getItem().getRegistryName().getResourceDomain())){
|
||||||
|
NBTTagCompound stats = input.getTagCompound().getCompoundTag("Stats");
|
||||||
|
stats.removeTag("Broken");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue