mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Remove crossbow ammo in case something invalid got loaded somehow (or through remappings) #1278
This commit is contained in:
1 parent
4b4627c20d
commit
28ccf1236e
1 file changed
+9
-1
@@ -48,7 +48,15 @@ public class Crossbow extends ProjectileWeapon {
|
||||
if(!isLoaded(tags))
|
||||
return null;
|
||||
|
||||
return ItemStack.loadItemStackFromNBT(tags.getCompoundTag("LoadedItem"));
|
||||
ItemStack ammo = ItemStack.loadItemStackFromNBT(tags.getCompoundTag("LoadedItem"));
|
||||
|
||||
// prevent crashes from remapping corruptions..
|
||||
if(ammo != null && ammo.getItem() != null && ammo.getItem() != TinkerWeaponry.boltAmmo) {
|
||||
tags.removeTag("LoadedItem");
|
||||
ammo = null;
|
||||
}
|
||||
|
||||
return ammo;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user