LanguageManager

NetHandlerPlayClient
This commit is contained in:
cpw committed 2016-03-04 21:26:17 -05:00
1 parent cb909eeb59
commit c5e10c8cb8
4 files changed
+32 -33

No files matched your search

@@ -28,7 +28,19 @@
}
}
@@ -1082,6 +1084,10 @@
@@ -848,6 +850,11 @@
float f = (float)(packetIn.getYaw() * 360) / 256.0F;
float f1 = (float)(packetIn.getPitch() * 360) / 256.0F;
EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.createEntityByID(packetIn.getEntityType(), this.gameController.theWorld);
+ if (entitylivingbase == null)
+ {
+ net.minecraftforge.fml.common.FMLLog.info("Server attempted to spawn an unknown entity using ID: {0} at ({1}, {2}, {3}) Skipping!", packetIn.getEntityType(), d0, d1, d2);
+ return;
+ }
EntityTracker.func_187254_a(entitylivingbase, d0, d1, d2);
entitylivingbase.renderYawOffset = entitylivingbase.rotationYawHead = (float)(packetIn.getHeadPitch() * 360) / 256.0F;
Entity[] aentity = entitylivingbase.getParts();
@@ -1082,6 +1089,10 @@
{
entityplayer.openContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
}
@@ -39,3 +51,12 @@
}
}
@@ -1378,7 +1389,7 @@
if (entity instanceof EntityLivingBase)
{
- Potion potion = Potion.func_188412_a(packetIn.getEffectId());
+ Potion potion = Potion.func_188412_a(packetIn.getEffectId() & 0xFF);
if (potion != null)
{
@@ -0,0 +1,10 @@
--- ../src-base/minecraft/net/minecraft/client/resources/LanguageManager.java
+++ ../src-work/minecraft/net/minecraft/client/resources/LanguageManager.java
@@ -73,6 +73,7 @@
}
currentLocale.loadLocaleDataFiles(resourceManager, list);
+ net.minecraftforge.fml.common.registry.LanguageRegistry.instance().mergeLanguageTable(currentLocale.properties, this.currentLanguage);
LanguageMap.replaceWith(currentLocale.properties);
}
@@ -1,23 +0,0 @@
++++ REJECTED PATCH 3
float f = (float)(packetIn.getYaw() * 360) / 256.0F;
float f1 = (float)(packetIn.getPitch() * 360) / 256.0F;
EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.createEntityByID(packetIn.getEntityType(), this.gameController.theWorld);
+ if (entitylivingbase == null)
+ {
+ net.minecraftforge.fml.common.FMLLog.info("Server attempted to spawn an unknown entity using ID: {0} at ({1}, {2}, {3}) Skipping!", packetIn.getEntityType(), d0, d1, d2);
+ return;
+ }
entitylivingbase.serverPosX = packetIn.getX();
entitylivingbase.serverPosY = packetIn.getY();
entitylivingbase.serverPosZ = packetIn.getZ();
++++ END PATCH
++++ REJECTED PATCH 5
if (entity instanceof EntityLivingBase)
{
- PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId(), packetIn.getDuration(), packetIn.getAmplifier(), false, packetIn.func_179707_f());
+ PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId() & 0xff, packetIn.getDuration(), packetIn.getAmplifier(), false, packetIn.func_179707_f());
potioneffect.setPotionDurationMax(packetIn.func_149429_c());
((EntityLivingBase)entity).addPotionEffect(potioneffect);
}
++++ END PATCH
@@ -1,9 +0,0 @@
++++ REJECTED PATCH 1
}
currentLocale.loadLocaleDataFiles(resourceManager, list);
+ net.minecraftforge.fml.common.registry.LanguageRegistry.instance().mergeLanguageTable(currentLocale.properties, this.currentLanguage);
StringTranslate.replaceWith(currentLocale.properties);
}
++++ END PATCH