mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-18 19:39:37 +00:00
Protect against other mods providing bad meta values for logs (#523)
This commit is contained in:
1 parent
765dade9bd
commit
87ccfb36c4
2 files changed
+17
-10
No files matched your search
@@ -128,7 +128,11 @@ public class BlockETLog extends BlockLog implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise("extratrees.block.log.name", ILogType.ExtraTreeLog.values()[meta].getName());
|
||||
ILogType.ExtraTreeLog[] logs= ILogType.ExtraTreeLog.values();
|
||||
if(meta < 0 || meta >= logs.length) {
|
||||
meta = 0;
|
||||
}
|
||||
return I18N.localise("extratrees.block.log.name", logs[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user