mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 19:59:55 +00:00
Fix JABBA-related issues with crafting station slots (#54)
* Fix shift-merging tools voiding items fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11392> * Change 0-sized ItemStacks into null stacks in crafting station attached slots Fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10425> * Update buildscript * spotlessApply
This commit is contained in:
1 parent
18bfeaff32
commit
39be06c23b
571 files changed
+25959
-28223
No files matched your search
@@ -10,29 +10,23 @@ public class WeaponryActiveToolMod extends ActiveToolMod {
|
||||
@Override
|
||||
public boolean damageTool(ItemStack stack, int damage, EntityLivingBase entity) {
|
||||
// does not proc on tool 'healing'
|
||||
if(stack.getItem() == TinkerWeaponry.javelin && stack.hasTagCompound() && damage > 0) {
|
||||
if (stack.getItem() == TinkerWeaponry.javelin && stack.hasTagCompound() && damage > 0) {
|
||||
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
|
||||
IAmmo ammo =(IAmmo)stack.getItem();
|
||||
if(tags.getInteger("Damage") == 0)
|
||||
{
|
||||
IAmmo ammo = (IAmmo) stack.getItem();
|
||||
if (tags.getInteger("Damage") == 0) {
|
||||
int rem = ammo.consumeAmmo(1, stack);
|
||||
if(rem > 0)
|
||||
return true;
|
||||
}
|
||||
else if(ammo.getAmmoCount(stack) > 0)
|
||||
{
|
||||
if (rem > 0) return true;
|
||||
} else if (ammo.getAmmoCount(stack) > 0) {
|
||||
int d = tags.getInteger("Damage") + damage;
|
||||
int max = tags.getInteger("TotalDurability");
|
||||
if(d > max)
|
||||
{
|
||||
if (d > max) {
|
||||
tags.setInteger("Damage", 0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// all other ammo items can't be damaged
|
||||
else if(stack.getItem() instanceof IAmmo)
|
||||
return true;
|
||||
else if (stack.getItem() instanceof IAmmo) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user