mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-17 02:55:07 +00:00
Protect against storage upgrades with illegal level values
This commit is contained in:
1 parent
ae565e9ee8
commit
ea45a709ac
2 files changed
+5
-2
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ buildscript {
|
|||||||
|
|
||||||
apply plugin: 'forge'
|
apply plugin: 'forge'
|
||||||
|
|
||||||
version = "1.7.10-1.10.8"
|
version = "1.7.10-1.10.9"
|
||||||
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
archivesBaseName = "StorageDrawers"
|
archivesBaseName = "StorageDrawers"
|
||||||
|
|
||||||
|
|||||||
@@ -536,7 +536,7 @@ public class BlockDrawers extends BlockContainer implements IExtendedBlockClickH
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void dropItemStack (World world, int x, int y, int z, EntityPlayer player, ItemStack stack) {
|
private void dropItemStack (World world, int x, int y, int z, EntityPlayer player, ItemStack stack) {
|
||||||
EntityItem entity = new EntityItem(world, x + .5f, y + .1f, z + .5f, stack);
|
EntityItem entity = new EntityItem(world, x + .5f, y + .5f, z + .5f, stack);
|
||||||
entity.addVelocity(-entity.motionX, -entity.motionY, -entity.motionZ);
|
entity.addVelocity(-entity.motionX, -entity.motionY, -entity.motionZ);
|
||||||
world.spawnEntityInWorld(entity);
|
world.spawnEntityInWorld(entity);
|
||||||
}
|
}
|
||||||
@@ -804,6 +804,8 @@ public class BlockDrawers extends BlockContainer implements IExtendedBlockClickH
|
|||||||
if (level == 0)
|
if (level == 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
level = (level < 0 || level >= iconOverlayTrim.length) ? 0 : level;
|
||||||
|
|
||||||
return iconOverlayTrim[level];
|
return iconOverlayTrim[level];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -811,6 +813,7 @@ public class BlockDrawers extends BlockContainer implements IExtendedBlockClickH
|
|||||||
protected IIcon getIcon (IBlockAccess blockAccess, int x, int y, int z, int side, int level) {
|
protected IIcon getIcon (IBlockAccess blockAccess, int x, int y, int z, int side, int level) {
|
||||||
int meta = blockAccess.getBlockMetadata(x, y, z);
|
int meta = blockAccess.getBlockMetadata(x, y, z);
|
||||||
meta = (meta < 0 || meta >= iconSide.length) ? 0 : meta;
|
meta = (meta < 0 || meta >= iconSide.length) ? 0 : meta;
|
||||||
|
level = (level < 0 || level >= iconOverlay.length) ? 0 : level;
|
||||||
|
|
||||||
TileEntityDrawers tile = getTileEntity(blockAccess, x, y, z);
|
TileEntityDrawers tile = getTileEntity(blockAccess, x, y, z);
|
||||||
if (tile == null || side == tile.getDirection()) {
|
if (tile == null || side == tile.getDirection()) {
|
||||||
|
|||||||
Reference in new issue
Block a user