Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Commit

Permalink
Handle #200, slated for B40
Browse files Browse the repository at this point in the history
  • Loading branch information
robotia committed Mar 4, 2016
1 parent 2f20d73 commit c96d171
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions patches/net/minecraft/entity/DataWatcher.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,32 @@

this.lock.readLock().unlock();
return arraylist;
@@ -318,7 +329,7 @@
@@ -231,8 +242,22 @@
{
int i = (p_151510_1_.getObjectType() << 5 | p_151510_1_.getDataValueId() & 31) & 255;
p_151510_0_.writeByte(i);
-
- switch (p_151510_1_.getObjectType())
+ int type = p_151510_1_.getObjectType();
+ Object object = p_151510_1_.getObject();
+ int rt = 0;
+ if(object instanceof Byte) rt = 0;
+ else if(object instanceof Short) rt = 1;
+ else if(object instanceof Integer) rt = 2;
+ else if(object instanceof Float) rt = 3;
+ else if(object instanceof String) rt = 4;
+ else if(object instanceof ItemStack) rt = 5;
+ else if(object instanceof ChunkCoordinates) rt = 6;
+ if(type != rt)
+ {
+ System.out.println("[Thermos] Watchable object type is incorrect! Appying correct type!");
+ type = rt;
+ }
+ switch (type)
{
case 0:
p_151510_0_.writeByte(((Byte)p_151510_1_.getObject()).byteValue());
@@ -318,7 +343,7 @@
while (iterator.hasNext())
{
DataWatcher.WatchableObject watchableobject = (DataWatcher.WatchableObject)iterator.next();
Expand All @@ -123,7 +148,7 @@

if (watchableobject1 != null)
{
@@ -343,13 +354,13 @@
@@ -343,13 +368,13 @@

static
{
Expand Down

0 comments on commit c96d171

Please sign in to comment.