forked from jaquadro/StorageDrawers
-
Notifications
You must be signed in to change notification settings - Fork 13
/
patch.diff
65 lines (55 loc) · 2.79 KB
/
patch.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 4d91fe18cb11265076982fdcf1c67120b093322b Mon Sep 17 00:00:00 2001
From: Justin Aquadro <jaquadro@gmail.com>
Date: Mon, 21 Aug 2017 00:34:32 -0400
Subject: [PATCH] cherry pick Commit: ea45a709ac63f2e9cb26e25a3c829571510e6973
[ea45a70]
Protect against storage upgrades with illegal level values
---
build.gradle | 4 ++--
src/com/jaquadro/minecraft/storagedrawers/block/BlockDrawers.java | 5 ++++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/build.gradle b/build.gradle
index 4317398..13cdf37 100644
--- a/build.gradle
+++ b/build.gradle
@@ -17,7 +17,7 @@ buildscript {
apply plugin: 'forge'
-version = "1.7.10-1.10.8b"
+version = "1.7.10-1.10.9"
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "StorageDrawers"
@@ -131,4 +131,4 @@ task copyChicken(type: Copy, dependsOn: "extractUserDev") {
mustRunAfter "repackMinecraft"
}
//tasks.setupDevWorkspace.dependsOn copyChicken
-//tasks.setupDecompWorkspace.dependsOn copyChicken
\ No newline at end of file
+//tasks.setupDecompWorkspace.dependsOn copyChicken
diff --git a/src/com/jaquadro/minecraft/storagedrawers/block/BlockDrawers.java b/src/com/jaquadro/minecraft/storagedrawers/block/BlockDrawers.java
index 0425034..25134be 100644
--- a/src/com/jaquadro/minecraft/storagedrawers/block/BlockDrawers.java
+++ b/src/com/jaquadro/minecraft/storagedrawers/block/BlockDrawers.java
@@ -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) {
- 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);
world.spawnEntityInWorld(entity);
}
@@ -804,6 +804,8 @@ public class BlockDrawers extends BlockContainer implements IExtendedBlockClickH
if (level == 0)
return null;
+ level = (level < 0 || level >= iconOverlayTrim.length) ? 0 : 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) {
int meta = blockAccess.getBlockMetadata(x, y, z);
meta = (meta < 0 || meta >= iconSide.length) ? 0 : meta;
+ level = (level < 0 || level >= iconOverlay.length) ? 0 : level;
TileEntityDrawers tile = getTileEntity(blockAccess, x, y, z);
if (tile == null || side == tile.getDirection()) {
--
1.9.5.msysgit.0