diff --git a/conf/deobfuscateJar/deobfed.jar b/conf/deobfuscateJar/deobfed.jar index 5f0eb4a..f652479 100644 --- a/conf/deobfuscateJar/deobfed.jar +++ b/conf/deobfuscateJar/deobfed.jar Binary files differ diff --git a/conf/mcp.exc b/conf/mcp.exc index 217125e..33d2a33 100644 --- a/conf/mcp.exc +++ b/conf/mcp.exc @@ -3541,23 +3541,3 @@ net/minecraft/world/storage/WorldInfo.(Lnet/minecraft/nbt/NBTTagCompound;)V=|p_i2157_1_ net/minecraft/world/storage/WorldInfo.(Lnet/minecraft/world/WorldSettings;Ljava/lang/String;)V=|p_i2158_1_,p_i2158_2_ net/minecraft/world/storage/WorldInfo.(Lnet/minecraft/world/storage/WorldInfo;)V=|p_i2159_1_ -net/minecraft/server/management/ServerConfigurationManager.initializeConnectionToPlayer(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V=|p_72355_1_,p_72355_2_,nethandlerplayserver -net/minecraft/client/particle/EntityDiggingFX.(Lnet/minecraft/world/World;DDDDDDLnet/minecraft/block/Block;II)V=|p_i1234_1_,p_i1234_2_,p_i1234_4_,p_i1234_6_,p_i1234_8_,p_i1234_10_,p_i1234_12_,p_i1234_14_,p_i1234_15_,side -net/minecraft/client/renderer/ItemRenderer.renderItem(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;ILnet/minecraftforge/client/IItemRenderer$ItemRenderType;)V=|p_78443_1_,p_78443_2_,p_78443_3_,type -net/minecraft/client/renderer/RenderGlobal.drawBlockDamageTexture(Lnet/minecraft/client/renderer/Tessellator;Lnet/minecraft/entity/EntityLivingBase;F)V=|p_72717_1_,p_72717_2_,p_72717_3_ -net/minecraft/client/renderer/entity/RenderItem.renderDroppedItem(Lnet/minecraft/entity/item/EntityItem;Lnet/minecraft/util/IIcon;IFFFFI)V=|p_77020_1_,p_77020_2_,p_77020_3_,p_77020_4_,p_77020_5_,p_77020_6_,p_77020_7_,pass -net/minecraft/client/renderer/entity/RenderItem.renderItemIntoGUI(Lnet/minecraft/client/gui/FontRenderer;Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/item/ItemStack;IIZ)V=|p_77015_1_,p_77015_2_,p_77015_3_,p_77015_4_,p_77015_5_,renderEffect -net/minecraft/server/management/ServerConfigurationManager.transferPlayerToDimension(Lnet/minecraft/entity/player/EntityPlayerMP;ILnet/minecraft/world/Teleporter;)V=|p_72356_1_,p_72356_2_,teleporter -net/minecraft/server/management/ServerConfigurationManager.transferEntityToWorld(Lnet/minecraft/entity/Entity;ILnet/minecraft/world/WorldServer;Lnet/minecraft/world/WorldServer;Lnet/minecraft/world/Teleporter;)V=|p_82448_1_,p_82448_2_,p_82448_3_,p_82448_4_,teleporter -net/minecraft/world/World.getBiomeGenForCoordsBody(II)Lnet/minecraft/world/biome/BiomeGenBase;=|p_72807_1_,p_72807_2_ -net/minecraft/world/World.getSunBrightnessFactor(F)F=|p_72967_1_ -net/minecraft/world/World.getSunBrightnessBody(F)F=|p_72971_1_ -net/minecraft/world/World.getSkyColorBody(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/util/Vec3;=|p_72833_1_,p_72833_2_ -net/minecraft/world/World.drawCloudsBody(F)Lnet/minecraft/util/Vec3;=|p_72824_1_ -net/minecraft/world/World.canBlockFreezeBody(IIIZ)Z=|p_72834_1_,p_72834_2_,p_72834_3_,p_72834_4_ -net/minecraft/world/biome/BiomeGenBase.(IZ)V=|p_i1971_1_,register -net/minecraft/world/chunk/storage/AnvilChunkLoader.loadChunk__Async(Lnet/minecraft/world/World;II)[Ljava/lang/Object;=|p_75815_1_,p_75815_2_,p_75815_3_ -net/minecraft/world/chunk/storage/AnvilChunkLoader.checkedReadChunkFromNBT__Async(Lnet/minecraft/world/World;IILnet/minecraft/nbt/NBTTagCompound;)[Ljava/lang/Object;=|p_75822_1_,p_75822_2_,p_75822_3_,p_75822_4_ -net/minecraft/world/chunk/storage/AnvilChunkLoader.loadEntities(Lnet/minecraft/world/World;Lnet/minecraft/nbt/NBTTagCompound;Lnet/minecraft/world/chunk/Chunk;)V=|p_75823_1_,p_75823_2_,chunk -net/minecraft/world/gen/ChunkProviderServer.loadChunk(II;Ljava/lang/Runnable;)Lnet/minecraft/world/chunk/Chunk;=|p_73158_1,p_73158_2,runnable -net/minecraft/world/gen/ChunkProviderServer.originalLoadChunk(II)Lnet/minecraft/world/chunk/Chunk;=|p_73158_1_,p_73158_2_ diff --git a/conf/mcp2notch.srg b/conf/mcp2notch.srg index ce89aa5..76437b2 100644 --- a/conf/mcp2notch.srg +++ b/conf/mcp2notch.srg @@ -11400,7 +11400,6 @@ MD: net/minecraft/entity/boss/EntityDragon/canBeCollidedWith ()Z xa/R ()Z MD: net/minecraft/server/gui/StatsComponent$1/actionPerformed (Ljava/awt/event/ActionEvent;)V mg/actionPerformed (Ljava/awt/event/ActionEvent;)V MD: net/minecraft/world/chunk/EmptyChunk/func_150812_a (IIILnet/minecraft/tileentity/TileEntity;)V apw/a (IIILaor;)V -MD: net/minecraft/server/management/ServerConfigurationManager/initializeConnectionToPlayer (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V oi/a (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V MD: net/minecraft/entity/EntityLiving/writeEntityToNBT (Lnet/minecraft/nbt/NBTTagCompound;)V sw/b (Ldh;)V MD: net/minecraft/network/login/client/C00PacketLoginStart/processPacket (Lnet/minecraft/network/INetHandler;)V jw/a (Lfb;)V MD: net/minecraft/tileentity/TileEntityBeacon/isItemValidForSlot (ILnet/minecraft/item/ItemStack;)Z aoq/b (ILadd;)Z diff --git a/conf/mcp2srg.srg b/conf/mcp2srg.srg index 133f5e5..9084f6b 100644 --- a/conf/mcp2srg.srg +++ b/conf/mcp2srg.srg @@ -11393,7 +11393,6 @@ MD: net/minecraft/entity/boss/EntityDragon/canBeCollidedWith ()Z net/minecraft/entity/boss/EntityDragon/func_70067_L ()Z MD: net/minecraft/server/gui/StatsComponent$1/actionPerformed (Ljava/awt/event/ActionEvent;)V net/minecraft/server/gui/StatsComponent$1/actionPerformed (Ljava/awt/event/ActionEvent;)V MD: net/minecraft/world/chunk/EmptyChunk/func_150812_a (IIILnet/minecraft/tileentity/TileEntity;)V net/minecraft/world/chunk/EmptyChunk/func_150812_a (IIILnet/minecraft/tileentity/TileEntity;)V -MD: net/minecraft/server/management/ServerConfigurationManager/initializeConnectionToPlayer (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V net/minecraft/server/management/ServerConfigurationManager/func_72355_a (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V MD: net/minecraft/entity/EntityLiving/writeEntityToNBT (Lnet/minecraft/nbt/NBTTagCompound;)V net/minecraft/entity/EntityLiving/func_70014_b (Lnet/minecraft/nbt/NBTTagCompound;)V MD: net/minecraft/network/login/client/C00PacketLoginStart/processPacket (Lnet/minecraft/network/INetHandler;)V net/minecraft/network/login/client/C00PacketLoginStart/func_148833_a (Lnet/minecraft/network/INetHandler;)V MD: net/minecraft/tileentity/TileEntityBeacon/isItemValidForSlot (ILnet/minecraft/item/ItemStack;)Z net/minecraft/tileentity/TileEntityBeacon/func_94041_b (ILnet/minecraft/item/ItemStack;)Z diff --git a/conf/notch2mcp.srg b/conf/notch2mcp.srg index d4ea6da..3d1ad1f 100644 --- a/conf/notch2mcp.srg +++ b/conf/notch2mcp.srg @@ -11400,7 +11400,6 @@ MD: xa/R ()Z net/minecraft/entity/boss/EntityDragon/canBeCollidedWith ()Z MD: mg/actionPerformed (Ljava/awt/event/ActionEvent;)V net/minecraft/server/gui/StatsComponent$1/actionPerformed (Ljava/awt/event/ActionEvent;)V MD: apw/a (IIILaor;)V net/minecraft/world/chunk/EmptyChunk/func_150812_a (IIILnet/minecraft/tileentity/TileEntity;)V -MD: oi/a (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V net/minecraft/server/management/ServerConfigurationManager/initializeConnectionToPlayer (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V MD: sw/b (Ldh;)V net/minecraft/entity/EntityLiving/writeEntityToNBT (Lnet/minecraft/nbt/NBTTagCompound;)V MD: jw/a (Lfb;)V net/minecraft/network/login/client/C00PacketLoginStart/processPacket (Lnet/minecraft/network/INetHandler;)V MD: aoq/b (ILadd;)Z net/minecraft/tileentity/TileEntityBeacon/isItemValidForSlot (ILnet/minecraft/item/ItemStack;)Z diff --git a/conf/notch2srg.srg b/conf/notch2srg.srg index fa7cfa8..e56dcd0 100644 --- a/conf/notch2srg.srg +++ b/conf/notch2srg.srg @@ -11400,7 +11400,6 @@ MD: xa/R ()Z net/minecraft/entity/boss/EntityDragon/func_70067_L ()Z MD: mg/actionPerformed (Ljava/awt/event/ActionEvent;)V net/minecraft/server/gui/StatsComponent$1/actionPerformed (Ljava/awt/event/ActionEvent;)V MD: apw/a (IIILaor;)V net/minecraft/world/chunk/EmptyChunk/func_150812_a (IIILnet/minecraft/tileentity/TileEntity;)V -MD: oi/a (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V net/minecraft/server/management/ServerConfigurationManager/func_72355_a (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V MD: sw/b (Ldh;)V net/minecraft/entity/EntityLiving/func_70014_b (Lnet/minecraft/nbt/NBTTagCompound;)V MD: jw/a (Lfb;)V net/minecraft/network/login/client/C00PacketLoginStart/func_148833_a (Lnet/minecraft/network/INetHandler;)V MD: aoq/b (ILadd;)Z net/minecraft/tileentity/TileEntityBeacon/func_94041_b (ILnet/minecraft/item/ItemStack;)Z diff --git a/conf/srg.exc b/conf/srg.exc index 71128b4..5b38967 100644 --- a/conf/srg.exc +++ b/conf/srg.exc @@ -3541,23 +3541,3 @@ net/minecraft/world/storage/WorldInfo.(Lnet/minecraft/nbt/NBTTagCompound;)V=|p_i2157_1_ net/minecraft/world/storage/WorldInfo.(Lnet/minecraft/world/WorldSettings;Ljava/lang/String;)V=|p_i2158_1_,p_i2158_2_ net/minecraft/world/storage/WorldInfo.(Lnet/minecraft/world/storage/WorldInfo;)V=|p_i2159_1_ -net/minecraft/server/management/ServerConfigurationManagerinitializeConnectionToPlayer(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V=|p_72355_1_,p_72355_2_,nethandlerplayserver -net/minecraft/client/particle/EntityDiggingFX(Lnet/minecraft/world/World;DDDDDDLnet/minecraft/block/Block;II)V=|p_i1234_1_,p_i1234_2_,p_i1234_4_,p_i1234_6_,p_i1234_8_,p_i1234_10_,p_i1234_12_,p_i1234_14_,p_i1234_15_,side -net/minecraft/client/renderer/ItemRendererrenderItem(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;ILnet/minecraftforge/client/IItemRenderer$ItemRenderType;)V=|p_78443_1_,p_78443_2_,p_78443_3_,type -net/minecraft/client/renderer/RenderGlobaldrawBlockDamageTexture(Lnet/minecraft/client/renderer/Tessellator;Lnet/minecraft/entity/EntityLivingBase;F)V=|p_72717_1_,p_72717_2_,p_72717_3_ -net/minecraft/client/renderer/entity/RenderItemrenderDroppedItem(Lnet/minecraft/entity/item/EntityItem;Lnet/minecraft/util/IIcon;IFFFFI)V=|p_77020_1_,p_77020_2_,p_77020_3_,p_77020_4_,p_77020_5_,p_77020_6_,p_77020_7_,pass -net/minecraft/client/renderer/entity/RenderItemrenderItemIntoGUI(Lnet/minecraft/client/gui/FontRenderer;Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/item/ItemStack;IIZ)V=|p_77015_1_,p_77015_2_,p_77015_3_,p_77015_4_,p_77015_5_,renderEffect -net/minecraft/server/management/ServerConfigurationManagertransferPlayerToDimension(Lnet/minecraft/entity/player/EntityPlayerMP;ILnet/minecraft/world/Teleporter;)V=|p_72356_1_,p_72356_2_,teleporter -net/minecraft/server/management/ServerConfigurationManagertransferEntityToWorld(Lnet/minecraft/entity/Entity;ILnet/minecraft/world/WorldServer;Lnet/minecraft/world/WorldServer;Lnet/minecraft/world/Teleporter;)V=|p_82448_1_,p_82448_2_,p_82448_3_,p_82448_4_,teleporter -net/minecraft/world/WorldgetBiomeGenForCoordsBody(II)Lnet/minecraft/world/biome/BiomeGenBase;=|p_72807_1_,p_72807_2_ -net/minecraft/world/WorldgetSunBrightnessFactor(F)F=|p_72967_1_ -net/minecraft/world/WorldgetSunBrightnessBody(F)F=|p_72971_1_ -net/minecraft/world/WorldgetSkyColorBody(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/util/Vec3;=|p_72833_1_,p_72833_2_ -net/minecraft/world/WorlddrawCloudsBody(F)Lnet/minecraft/util/Vec3;=|p_72824_1_ -net/minecraft/world/WorldcanBlockFreezeBody(IIIZ)Z=|p_72834_1_,p_72834_2_,p_72834_3_,p_72834_4_ -net/minecraft/world/biome/BiomeGenBase(IZ)V=|p_i1971_1_,register -net/minecraft/world/chunk/storage/AnvilChunkLoaderloadChunk__Async(Lnet/minecraft/world/World;II)[Ljava/lang/Object;=|p_75815_1_,p_75815_2_,p_75815_3_ -net/minecraft/world/chunk/storage/AnvilChunkLoadercheckedReadChunkFromNBT__Async(Lnet/minecraft/world/World;IILnet/minecraft/nbt/NBTTagCompound;)[Ljava/lang/Object;=|p_75822_1_,p_75822_2_,p_75822_3_,p_75822_4_ -net/minecraft/world/chunk/storage/AnvilChunkLoaderloadEntities(Lnet/minecraft/world/World;Lnet/minecraft/nbt/NBTTagCompound;Lnet/minecraft/world/chunk/Chunk;)V=|p_75823_1_,p_75823_2_,chunk -net/minecraft/world/gen/ChunkProviderServerloadChunk(II;Ljava/lang/Runnable;)Lnet/minecraft/world/chunk/Chunk;=|p_73158_1,p_73158_2,runnable -net/minecraft/world/gen/ChunkProviderServeroriginalLoadChunk(II)Lnet/minecraft/world/chunk/Chunk;=|p_73158_1_,p_73158_2_ diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java index f941651..46fd027 100644 --- a/src/main/java/net/minecraft/client/Minecraft.java +++ b/src/main/java/net/minecraft/client/Minecraft.java @@ -897,11 +897,12 @@ } this.displayCrashReport(this.crashReporter); + return; } } catch (MinecraftError minecrafterror) { - break; + ; } catch (ReportedException reportedexception) { @@ -909,7 +910,6 @@ this.freeMemory(); logger.fatal("Reported exception thrown!", reportedexception); this.displayCrashReport(reportedexception.getCrashReport()); - break; } catch (Throwable throwable1) { @@ -917,7 +917,6 @@ this.freeMemory(); logger.fatal("Unreported exception thrown!", throwable1); this.displayCrashReport(crashreport); - break; } finally { diff --git a/src/main/java/net/minecraft/client/gui/GuiSleepMP.java b/src/main/java/net/minecraft/client/gui/GuiSleepMP.java index 8158cbc..6d40f84 100644 --- a/src/main/java/net/minecraft/client/gui/GuiSleepMP.java +++ b/src/main/java/net/minecraft/client/gui/GuiSleepMP.java @@ -33,7 +33,7 @@ if (!s.isEmpty()) { - this.mc.thePlayer.sendChatMessage(s); + this.func_146403_a(s); // Forge: fix vanilla not adding messages to the sent list while sleeping } this.inputField.setText(""); diff --git a/src/main/java/net/minecraft/client/renderer/RenderBlocks.java b/src/main/java/net/minecraft/client/renderer/RenderBlocks.java index 2fbd5b6..1f1b0d7 100644 --- a/src/main/java/net/minecraft/client/renderer/RenderBlocks.java +++ b/src/main/java/net/minecraft/client/renderer/RenderBlocks.java @@ -2728,10 +2728,10 @@ double d16 = (double)p_147733_2_ + 0.5D + 0.0625D; double d17 = (double)p_147733_4_ + 0.5D - 0.0625D; double d18 = (double)p_147733_4_ + 0.5D + 0.0625D; - boolean flag = flag5 ? ((BlockStainedGlassPane)p_147733_1_).canPaneConnectToBlock(this.blockAccess.getBlock(p_147733_2_, p_147733_3_, p_147733_4_ - 1)) : ((BlockPane)p_147733_1_).canPaneConnectToBlock(this.blockAccess.getBlock(p_147733_2_, p_147733_3_, p_147733_4_ - 1)); - boolean flag1 = flag5 ? ((BlockStainedGlassPane)p_147733_1_).canPaneConnectToBlock(this.blockAccess.getBlock(p_147733_2_, p_147733_3_, p_147733_4_ + 1)) : ((BlockPane)p_147733_1_).canPaneConnectToBlock(this.blockAccess.getBlock(p_147733_2_, p_147733_3_, p_147733_4_ + 1)); - boolean flag2 = flag5 ? ((BlockStainedGlassPane)p_147733_1_).canPaneConnectToBlock(this.blockAccess.getBlock(p_147733_2_ - 1, p_147733_3_, p_147733_4_)) : ((BlockPane)p_147733_1_).canPaneConnectToBlock(this.blockAccess.getBlock(p_147733_2_ - 1, p_147733_3_, p_147733_4_)); - boolean flag3 = flag5 ? ((BlockStainedGlassPane)p_147733_1_).canPaneConnectToBlock(this.blockAccess.getBlock(p_147733_2_ + 1, p_147733_3_, p_147733_4_)) : ((BlockPane)p_147733_1_).canPaneConnectToBlock(this.blockAccess.getBlock(p_147733_2_ + 1, p_147733_3_, p_147733_4_)); + boolean flag = ((BlockPane)p_147733_1_).canPaneConnectTo(this.blockAccess, p_147733_2_, p_147733_3_, p_147733_4_ - 1, NORTH); + boolean flag1 = ((BlockPane)p_147733_1_).canPaneConnectTo(this.blockAccess, p_147733_2_, p_147733_3_, p_147733_4_ + 1, SOUTH); + boolean flag2 = ((BlockPane)p_147733_1_).canPaneConnectTo(this.blockAccess, p_147733_2_ - 1, p_147733_3_, p_147733_4_, WEST ); + boolean flag3 = ((BlockPane)p_147733_1_).canPaneConnectTo(this.blockAccess, p_147733_2_ + 1, p_147733_3_, p_147733_4_, EAST ); double d19 = 0.001D; double d20 = 0.999D; double d21 = 0.001D; diff --git a/src/main/java/net/minecraft/client/renderer/ThreadDownloadImageData.java b/src/main/java/net/minecraft/client/renderer/ThreadDownloadImageData.java index f612bc5..ede4606 100644 --- a/src/main/java/net/minecraft/client/renderer/ThreadDownloadImageData.java +++ b/src/main/java/net/minecraft/client/renderer/ThreadDownloadImageData.java @@ -124,33 +124,33 @@ httpurlconnection.setDoOutput(false); httpurlconnection.connect(); - if (httpurlconnection.getResponseCode() / 100 != 2) + if (httpurlconnection.getResponseCode() / 100 == 2) { + BufferedImage bufferedimage; + + if (ThreadDownloadImageData.this.field_152434_e != null) + { + FileUtils.copyInputStreamToFile(httpurlconnection.getInputStream(), ThreadDownloadImageData.this.field_152434_e); + bufferedimage = ImageIO.read(ThreadDownloadImageData.this.field_152434_e); + } + else + { + bufferedimage = ImageIO.read(httpurlconnection.getInputStream()); + } + + if (ThreadDownloadImageData.this.imageBuffer != null) + { + bufferedimage = ThreadDownloadImageData.this.imageBuffer.parseUserSkin(bufferedimage); + } + + ThreadDownloadImageData.this.setBufferedImage(bufferedimage); return; } - - BufferedImage bufferedimage; - - if (ThreadDownloadImageData.this.field_152434_e != null) - { - FileUtils.copyInputStreamToFile(httpurlconnection.getInputStream(), ThreadDownloadImageData.this.field_152434_e); - bufferedimage = ImageIO.read(ThreadDownloadImageData.this.field_152434_e); - } - else - { - bufferedimage = ImageIO.read(httpurlconnection.getInputStream()); - } - - if (ThreadDownloadImageData.this.imageBuffer != null) - { - bufferedimage = ThreadDownloadImageData.this.imageBuffer.parseUserSkin(bufferedimage); - } - - ThreadDownloadImageData.this.setBufferedImage(bufferedimage); } catch (Exception exception) { ThreadDownloadImageData.logger.error("Couldn\'t download http texture", exception); + return; } finally { diff --git a/src/main/java/net/minecraft/client/renderer/texture/Stitcher.java b/src/main/java/net/minecraft/client/renderer/texture/Stitcher.java index c6ac306..5c7d2a8 100644 --- a/src/main/java/net/minecraft/client/renderer/texture/Stitcher.java +++ b/src/main/java/net/minecraft/client/renderer/texture/Stitcher.java @@ -161,7 +161,7 @@ if (flag4 ^ flag5) { - flag1 = flag5 && flag3; //Forge: Bug fix: Attempt to fill all downward space before expanding width + flag1 = !flag4; } else { diff --git a/src/main/java/net/minecraft/command/CommandEnchant.java b/src/main/java/net/minecraft/command/CommandEnchant.java index f8850c6..5ac3405 100644 --- a/src/main/java/net/minecraft/command/CommandEnchant.java +++ b/src/main/java/net/minecraft/command/CommandEnchant.java @@ -76,7 +76,7 @@ { Enchantment enchantment1 = Enchantment.enchantmentsList[short1]; - if (!enchantment1.canApplyTogether(enchantment)) + if (!enchantment1.canApplyTogether(enchantment) || !enchantment.canApplyTogether(enchantment1)) //Forge BugFix: Let Both enchantments veto being together { throw new CommandException("commands.enchant.cantCombine", new Object[] {enchantment.getTranslatedName(j), enchantment1.getTranslatedName(nbttaglist.getCompoundTagAt(k).getShort("lvl"))}); } diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java index f453eb9..d1e7cf8 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java @@ -393,7 +393,9 @@ { EnchantmentData enchantmentdata1 = (EnchantmentData)iterator1.next(); - if (enchantmentdata1.enchantmentobj.canApplyTogether(Enchantment.enchantmentsList[integer.intValue()])) + Enchantment e1 = enchantmentdata1.enchantmentobj; + Enchantment e2 = Enchantment.enchantmentsList[integer.intValue()]; + if (e1.canApplyTogether(e2) && e2.canApplyTogether(e1)) //Forge BugFix: Let Both enchantments veto being together { continue; } diff --git a/src/main/java/net/minecraft/entity/EntityLivingBase.java b/src/main/java/net/minecraft/entity/EntityLivingBase.java index 3634466..2d2e3cb 100644 --- a/src/main/java/net/minecraft/entity/EntityLivingBase.java +++ b/src/main/java/net/minecraft/entity/EntityLivingBase.java @@ -712,6 +712,8 @@ public void heal(float p_70691_1_) { + p_70691_1_ = net.minecraftforge.event.ForgeEventFactory.onLivingHeal(this, p_70691_1_); + if (p_70691_1_ <= 0) return; float f1 = this.getHealth(); if (f1 > 0.0F) diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecart.java b/src/main/java/net/minecraft/entity/item/EntityMinecart.java index 71b2af2..5af1442 100644 --- a/src/main/java/net/minecraft/entity/item/EntityMinecart.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecart.java @@ -1171,7 +1171,7 @@ { return new ItemStack(Items.hopper_minecart); } - else if (this instanceof EntityMinecartHopper) + else if (this instanceof EntityMinecartCommandBlock) { return new ItemStack(Items.command_block_minecart); } diff --git a/src/main/java/net/minecraft/entity/player/EntityPlayer.java b/src/main/java/net/minecraft/entity/player/EntityPlayer.java index 260e15d..753e74d 100644 --- a/src/main/java/net/minecraft/entity/player/EntityPlayer.java +++ b/src/main/java/net/minecraft/entity/player/EntityPlayer.java @@ -236,7 +236,7 @@ { this.updateItemUse(itemstack, 5); } - + if (--this.itemInUseCount == 0 && !this.worldObj.isRemote) { this.onItemUseFinish(); @@ -1449,7 +1449,7 @@ public void wakeUpPlayer(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) { - MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerWakeUpEvent(this)); + MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerWakeUpEvent(this, p_70999_1_, p_70999_2_, p_70999_3_)); this.setSize(0.6F, 1.8F); this.resetHeight(); ChunkCoordinates chunkcoordinates = this.playerLocation; @@ -2289,7 +2289,7 @@ public float eyeHeight; private String displayname; - + /** * Returns the default eye height of the player * @return player default eye height diff --git a/src/main/java/net/minecraft/inventory/ContainerRepair.java b/src/main/java/net/minecraft/inventory/ContainerRepair.java index 456ec22..c0398ff 100644 --- a/src/main/java/net/minecraft/inventory/ContainerRepair.java +++ b/src/main/java/net/minecraft/inventory/ContainerRepair.java @@ -68,7 +68,7 @@ } float breakChance = ForgeHooks.onAnvilRepair(p_82870_1_, p_82870_2_, ContainerRepair.this.inputSlots.getStackInSlot(0), ContainerRepair.this.inputSlots.getStackInSlot(1)); - + ContainerRepair.this.inputSlots.setInventorySlotContents(0, (ItemStack)null); if (ContainerRepair.this.stackSizeToBeUsedInRepair > 0) @@ -262,7 +262,8 @@ { int j2 = ((Integer)iterator.next()).intValue(); - if (j2 != i1 && !enchantment.canApplyTogether(Enchantment.enchantmentsList[j2])) + Enchantment e2 = Enchantment.enchantmentsList[j2]; + if (j2 != i1 && !(enchantment.canApplyTogether(e2) && e2.canApplyTogether(enchantment))) //Forge BugFix: Let Both enchantments veto being together { flag1 = false; i += i2; diff --git a/src/main/java/net/minecraft/item/Item.java b/src/main/java/net/minecraft/item/Item.java index 22b2b24..b5ab43b 100644 --- a/src/main/java/net/minecraft/item/Item.java +++ b/src/main/java/net/minecraft/item/Item.java @@ -74,7 +74,7 @@ protected String iconString; private static final String __OBFID = "CL_00000041"; - public final cpw.mods.fml.common.registry.RegistryDelegate delegate = + public final cpw.mods.fml.common.registry.RegistryDelegate delegate = ((cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry)itemRegistry).getDelegate(this, Item.class); public static int getIdFromItem(Item p_150891_0_) { @@ -955,9 +955,9 @@ } /** - * Called by the default implemetation of EntityItem's onUpdate method, allowing for cleaner + * Called by the default implemetation of EntityItem's onUpdate method, allowing for cleaner * control over the update of the item without having to write a subclass. - * + * * @param entityItem The entity Item * @return Return true to skip any further update code. */ @@ -1028,7 +1028,7 @@ * * Should this item, when held, allow sneak-clicks to pass through to the underlying block? * - * @param world The world + * @param world The world * @param x The X Position * @param y The X Position * @param z The X Position @@ -1088,12 +1088,12 @@ } /** - * Called by RenderBiped and RenderPlayer to determine the armor texture that + * Called by RenderBiped and RenderPlayer to determine the armor texture that * should be use for the currently equiped item. - * This will only be called on instances of ItemArmor. - * + * This will only be called on instances of ItemArmor. + * * Returning null from this function will use the default value. - * + * * @param stack ItemStack for the equpt armor * @param entity The entity wearing the armor * @param slot The slot the armor is in @@ -1108,7 +1108,7 @@ /** * Returns the font renderer used to render tooltips and overlays for this item. * Returning null will use the standard font renderer. - * + * * @param stack The current item stack * @return A instance of FontRenderer or null to use default */ @@ -1120,11 +1120,11 @@ /** * Override this method to have an item handle its own armor rendering. - * - * @param entityLiving The entity wearing the armor - * @param itemStack The itemStack to render the model of + * + * @param entityLiving The entity wearing the armor + * @param itemStack The itemStack to render the model of * @param armorSlot 0=head, 1=torso, 2=legs, 3=feet - * + * * @return A ModelBiped to render instead of the default */ @SideOnly(Side.CLIENT) @@ -1135,10 +1135,10 @@ /** * Called when a entity tries to play the 'swing' animation. - * + * * @param entityLiving The entity swinging the item. * @param stack The Item stack - * @return True to cancel any further processing by EntityLiving + * @return True to cancel any further processing by EntityLiving */ public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack) { @@ -1146,9 +1146,9 @@ } /** - * Called when the client starts rendering the HUD, for whatever item the player currently has as a helmet. + * Called when the client starts rendering the HUD, for whatever item the player currently has as a helmet. * This is where pumpkins would render there overlay. - * + * * @param stack The ItemStack that is equipped * @param player Reference to the current client entity * @param resolution Resolution information about the current viewport and configured GUI Scale @@ -1181,7 +1181,7 @@ * Determines if the durability bar should be rendered for this item. * Defaults to vanilla stack.isDamaged behavior. * But modders can use this for any data they wish. - * + * * @param stack The current Item Stack * @return True if it should render the 'durability' bar. */ @@ -1192,7 +1192,7 @@ /** * Queries the percentage of the 'Durability' bar that should be drawn. - * + * * @param stack The current ItemStack * @return 1.0 for 100% 0 for 0% */ @@ -1200,9 +1200,9 @@ { return (double)stack.getItemDamageForDisplay() / (double)stack.getMaxDamage(); } - + /** - * Return the maxDamage for this ItemStack. Defaults to the maxDamage field in this item, + * Return the maxDamage for this ItemStack. Defaults to the maxDamage field in this item, * but can be overridden here for other sources such as NBT. * * @param stack The itemstack that is damaged @@ -1239,14 +1239,14 @@ } /** - * ItemStack sensitive version of {@link #canHarvestBlock(Block)} + * ItemStack sensitive version of {@link #canHarvestBlock(Block)} * @param par1Block The block trying to harvest * @param itemStack The itemstack used to harvest the block * @return true if can harvest the block */ public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) { - return func_150897_b(par1Block); + return func_150897_b(par1Block); } /** @@ -1259,9 +1259,9 @@ } /** - * Gets the maximum number of items that this stack should be able to hold. + * Gets the maximum number of items that this stack should be able to hold. * This is a ItemStack (and thus NBT) sensitive version of Item.getItemStackLimit() - * + * * @param stack The ItemStack * @return THe maximum number this item can be stacked to */ @@ -1273,7 +1273,7 @@ private HashMap toolClasses = new HashMap(); /** * Sets or removes the harvest level for the specified tool class. - * + * * @param toolClass Class * @param level Harvest level: * Wood: 0 @@ -1298,7 +1298,7 @@ /** * Queries the harvest level of this item stack for the specifred tool class, * Returns -1 if this tool is not of the specified type - * + * * @param stack This item stack instance * @param toolClass Tool Class * @return Harvest level, or -1 if not the specified tool type. @@ -1306,12 +1306,12 @@ public int getHarvestLevel(ItemStack stack, String toolClass) { Integer ret = toolClasses.get(toolClass); - return ret == null ? -1 : ret; + return ret == null ? -1 : ret; } - + /** * ItemStack sensitive version of getItemEnchantability - * + * * @param stack The ItemStack * @return the item echantability value */ @@ -1319,7 +1319,7 @@ { return getItemEnchantability(); } - + /** * Whether this Item can be used as a payment to activate the vanilla beacon. * @param stack the ItemStack @@ -1347,7 +1347,8 @@ private static final String __OBFID = "CL_00000042"; //Added by forge for custom Tool materials. - public Item customCraftingMaterial = null; + @Deprecated public Item customCraftingMaterial = null; + private ItemStack repairMaterial = null; private ToolMaterial(int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_) { @@ -1383,6 +1384,7 @@ return this.enchantability; } + @Deprecated // Use getRepairItemStack below public Item func_150995_f() { switch (this) @@ -1395,5 +1397,23 @@ default: return customCraftingMaterial; } } + + public ToolMaterial setRepairItem(ItemStack stack) + { + if (this.repairMaterial != null || customCraftingMaterial != null) throw new RuntimeException("Can not change already set repair material"); + if (this == WOOD || this == STONE || this == GOLD || this == IRON || this == EMERALD) throw new RuntimeException("Can not change vanilla tool repair materials"); + this.repairMaterial = stack; + this.customCraftingMaterial = stack.getItem(); + return this; + } + + public ItemStack getRepairItemStack() + { + if (repairMaterial != null) return repairMaterial; + Item ret = this.func_150995_f(); + if (ret == null) return null; + repairMaterial = new ItemStack(ret, 1, net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE); + return repairMaterial; + } } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/item/ItemSword.java b/src/main/java/net/minecraft/item/ItemSword.java index 0e2a9e5..d7b6a07 100644 --- a/src/main/java/net/minecraft/item/ItemSword.java +++ b/src/main/java/net/minecraft/item/ItemSword.java @@ -101,7 +101,9 @@ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { - return this.field_150933_b.func_150995_f() == p_82789_2_.getItem() ? true : super.getIsRepairable(p_82789_1_, p_82789_2_); + ItemStack mat = this.field_150933_b.getRepairItemStack(); + if (mat != null && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, p_82789_2_, false)) return true; + return super.getIsRepairable(p_82789_1_, p_82789_2_); } public Multimap getItemAttributeModifiers() diff --git a/src/main/java/net/minecraft/item/ItemTool.java b/src/main/java/net/minecraft/item/ItemTool.java index 193cebe..4ca46d5 100644 --- a/src/main/java/net/minecraft/item/ItemTool.java +++ b/src/main/java/net/minecraft/item/ItemTool.java @@ -88,7 +88,9 @@ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { - return this.toolMaterial.func_150995_f() == p_82789_2_.getItem() ? true : super.getIsRepairable(p_82789_1_, p_82789_2_); + ItemStack mat = this.toolMaterial.getRepairItemStack(); + if (mat != null && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, p_82789_2_, false)) return true; + return super.getIsRepairable(p_82789_1_, p_82789_2_); } public Multimap getItemAttributeModifiers() diff --git a/src/main/java/net/minecraft/network/NetHandlerPlayServer.java b/src/main/java/net/minecraft/network/NetHandlerPlayServer.java index 3ff4a50..ec05c12 100644 --- a/src/main/java/net/minecraft/network/NetHandlerPlayServer.java +++ b/src/main/java/net/minecraft/network/NetHandlerPlayServer.java @@ -719,7 +719,7 @@ } else { - ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] {this.playerEntity.func_145748_c_(), s}); + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] {this.playerEntity.func_145748_c_(), ForgeHooks.newChatWithLinks(s)}); // Fixes chat links chatcomponenttranslation1 = ForgeHooks.onServerChatEvent(this, s, chatcomponenttranslation1); if (chatcomponenttranslation1 == null) return; this.serverController.getConfigurationManager().sendChatMsgImpl(chatcomponenttranslation1, false); @@ -1077,20 +1077,20 @@ { itemstack = packetbuffer.readItemStackFromBuffer(); - if (itemstack != null) + if (itemstack == null) { - if (!ItemWritableBook.func_150930_a(itemstack.getTagCompound())) - { - throw new IOException("Invalid book tag!"); - } + return; + } - itemstack1 = this.playerEntity.inventory.getCurrentItem(); + if (!ItemWritableBook.func_150930_a(itemstack.getTagCompound())) + { + throw new IOException("Invalid book tag!"); + } - if (itemstack1 == null) - { - return; - } + itemstack1 = this.playerEntity.inventory.getCurrentItem(); + if (itemstack1 != null) + { if (itemstack.getItem() == Items.writable_book && itemstack.getItem() == itemstack1.getItem()) { itemstack1.setTagInfo("pages", itemstack.getTagCompound().getTagList("pages", 8)); @@ -1119,20 +1119,20 @@ { itemstack = packetbuffer.readItemStackFromBuffer(); - if (itemstack == null) + if (itemstack != null) { - return; - } + if (!ItemEditableBook.validBookTagContents(itemstack.getTagCompound())) + { + throw new IOException("Invalid book tag!"); + } - if (!ItemEditableBook.validBookTagContents(itemstack.getTagCompound())) - { - throw new IOException("Invalid book tag!"); - } + itemstack1 = this.playerEntity.inventory.getCurrentItem(); - itemstack1 = this.playerEntity.inventory.getCurrentItem(); + if (itemstack1 == null) + { + return; + } - if (itemstack1 != null) - { if (itemstack.getItem() == Items.written_book && itemstack1.getItem() == Items.writable_book) { itemstack1.setTagInfo("author", new NBTTagString(this.playerEntity.getCommandSenderName())); diff --git a/src/main/java/net/minecraft/network/PingResponseHandler.java b/src/main/java/net/minecraft/network/PingResponseHandler.java index 1a42d19..4c2b9e7 100644 --- a/src/main/java/net/minecraft/network/PingResponseHandler.java +++ b/src/main/java/net/minecraft/network/PingResponseHandler.java @@ -30,13 +30,8 @@ try { - try + if (bytebuf.readUnsignedByte() == 254) { - if (bytebuf.readUnsignedByte() != 254) - { - return; - } - InetSocketAddress inetsocketaddress = (InetSocketAddress)p_channelRead_1_.channel().remoteAddress(); MinecraftServer minecraftserver = this.field_151257_b.func_151267_d(); int i = bytebuf.readableBytes(); @@ -90,11 +85,12 @@ bytebuf.release(); flag = false; + return; } - catch (RuntimeException runtimeexception) - { - ; - } + } + catch (RuntimeException runtimeexception) + { + return; } finally { diff --git a/src/main/java/net/minecraft/network/rcon/RConThreadClient.java b/src/main/java/net/minecraft/network/rcon/RConThreadClient.java index 3ae9a63..a61c7f7 100644 --- a/src/main/java/net/minecraft/network/rcon/RConThreadClient.java +++ b/src/main/java/net/minecraft/network/rcon/RConThreadClient.java @@ -53,16 +53,16 @@ BufferedInputStream bufferedinputstream = new BufferedInputStream(this.clientSocket.getInputStream()); int i = bufferedinputstream.read(this.buffer, 0, 1460); - if (10 <= i) + if (10 > i) { - byte b0 = 0; - int j = RConUtils.getBytesAsLEInt(this.buffer, 0, i); + return; + } - if (j != i - 4) - { - return; - } + byte b0 = 0; + int j = RConUtils.getBytesAsLEInt(this.buffer, 0, i); + if (j == i - 4) + { int i1 = b0 + 4; int k = RConUtils.getBytesAsLEInt(this.buffer, i1, i); i1 += 4; diff --git a/src/main/java/net/minecraft/server/management/PlayerManager.java b/src/main/java/net/minecraft/server/management/PlayerManager.java index f072182..74e310f 100644 --- a/src/main/java/net/minecraft/server/management/PlayerManager.java +++ b/src/main/java/net/minecraft/server/management/PlayerManager.java @@ -537,7 +537,7 @@ { int l; - if (this.numberOfTilesToUpdate == net.minecraftforge.common.ForgeModContainer.clumpingThreshold) + if (this.numberOfTilesToUpdate >= net.minecraftforge.common.ForgeModContainer.clumpingThreshold) { i = this.chunkLocation.chunkXPos * 16; j = this.chunkLocation.chunkZPos * 16; @@ -562,7 +562,7 @@ { this.sendToAllPlayersWatchingChunk(new S22PacketMultiBlockChange(this.numberOfTilesToUpdate, this.locationOfBlockChange, PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos))); } - + { //Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small WorldServer world = PlayerManager.this.theWorldServer; for (i = 0; i < this.numberOfTilesToUpdate; ++i) diff --git a/src/main/java/net/minecraft/server/management/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/management/ServerConfigurationManager.java index 13ba666..6412aec 100644 --- a/src/main/java/net/minecraft/server/management/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/management/ServerConfigurationManager.java @@ -112,7 +112,7 @@ String s = gameprofile1 == null ? gameprofile.getName() : gameprofile1.getName(); playerprofilecache.func_152649_a(gameprofile); NBTTagCompound nbttagcompound = this.readPlayerDataFromFile(p_72355_2_); - + World playerWorld = this.mcServer.worldServerForDimension(p_72355_2_.dimension); if (playerWorld==null) { @@ -121,7 +121,7 @@ ChunkCoordinates spawnPoint = playerWorld.provider.getRandomizedSpawnPoint(); p_72355_2_.setPosition(spawnPoint.posX, spawnPoint.posY, spawnPoint.posZ); } - + p_72355_2_.setWorld(playerWorld); p_72355_2_.theItemInWorldManager.setWorld((WorldServer)p_72355_2_.worldObj); String s1 = "local"; @@ -485,7 +485,7 @@ WorldServer worldserver = this.mcServer.worldServerForDimension(p_72356_1_.dimension); p_72356_1_.dimension = p_72356_2_; WorldServer worldserver1 = this.mcServer.worldServerForDimension(p_72356_1_.dimension); - p_72356_1_.playerNetServerHandler.sendPacket(new S07PacketRespawn(p_72356_1_.dimension, p_72356_1_.worldObj.difficultySetting, p_72356_1_.worldObj.getWorldInfo().getTerrainType(), p_72356_1_.theItemInWorldManager.getGameType())); + p_72356_1_.playerNetServerHandler.sendPacket(new S07PacketRespawn(p_72356_1_.dimension, worldserver1.difficultySetting, worldserver1.getWorldInfo().getTerrainType(), p_72356_1_.theItemInWorldManager.getGameType())); // Forge: Use new dimensions information worldserver.removePlayerEntityDangerously(p_72356_1_); p_72356_1_.isDead = false; this.transferEntityToWorld(p_72356_1_, j, worldserver, worldserver1, teleporter); diff --git a/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java b/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java index e815ae3..27b0325 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java @@ -12,8 +12,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.potion.PotionHelper; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.brewing.PotionBrewedEvent; public class TileEntityBrewingStand extends TileEntity implements ISidedInventory { @@ -139,6 +137,7 @@ private void brewPotions() { + if (net.minecraftforge.event.ForgeEventFactory.onPotionAttemptBreaw(brewingItemStacks)) return; if (this.canBrew()) { ItemStack itemstack = this.brewingItemStacks[3]; @@ -179,7 +178,7 @@ this.brewingItemStacks[3] = null; } } - MinecraftForge.EVENT_BUS.post(new PotionBrewedEvent(brewingItemStacks)); + net.minecraftforge.event.ForgeEventFactory.onPotionBrewed(brewingItemStacks); } } diff --git a/src/main/java/net/minecraft/util/HttpUtil.java b/src/main/java/net/minecraft/util/HttpUtil.java index 4634195..6721feb 100644 --- a/src/main/java/net/minecraft/util/HttpUtil.java +++ b/src/main/java/net/minecraft/util/HttpUtil.java @@ -143,109 +143,105 @@ try { - try + byte[] abyte = new byte[4096]; + URL url = new URL(p_151223_1_); + urlconnection = url.openConnection(p_151223_6_); + float f = 0.0F; + float f1 = (float)p_151223_3_.entrySet().size(); + Iterator iterator = p_151223_3_.entrySet().iterator(); + + while (iterator.hasNext()) { - byte[] abyte = new byte[4096]; - URL url = new URL(p_151223_1_); - urlconnection = url.openConnection(p_151223_6_); - float f = 0.0F; - float f1 = (float)p_151223_3_.entrySet().size(); - Iterator iterator = p_151223_3_.entrySet().iterator(); - - while (iterator.hasNext()) - { - Entry entry = (Entry)iterator.next(); - urlconnection.setRequestProperty((String)entry.getKey(), (String)entry.getValue()); - - if (p_151223_5_ != null) - { - p_151223_5_.setLoadingProgress((int)(++f / f1 * 100.0F)); - } - } - - inputstream = urlconnection.getInputStream(); - f1 = (float)urlconnection.getContentLength(); - int i = urlconnection.getContentLength(); + Entry entry = (Entry)iterator.next(); + urlconnection.setRequestProperty((String)entry.getKey(), (String)entry.getValue()); if (p_151223_5_ != null) { - p_151223_5_.resetProgresAndWorkingMessage(String.format("Downloading file (%.2f MB)...", new Object[] {Float.valueOf(f1 / 1000.0F / 1000.0F)})); + p_151223_5_.setLoadingProgress((int)(++f / f1 * 100.0F)); } + } - if (p_151223_0_.exists()) + inputstream = urlconnection.getInputStream(); + f1 = (float)urlconnection.getContentLength(); + int i = urlconnection.getContentLength(); + + if (p_151223_5_ != null) + { + p_151223_5_.resetProgresAndWorkingMessage(String.format("Downloading file (%.2f MB)...", new Object[] {Float.valueOf(f1 / 1000.0F / 1000.0F)})); + } + + if (p_151223_0_.exists()) + { + long j = p_151223_0_.length(); + + if (j == (long)i) { - long j = p_151223_0_.length(); + p_151223_2_.func_148522_a(p_151223_0_); - if (j == (long)i) + if (p_151223_5_ != null) { - p_151223_2_.func_148522_a(p_151223_0_); - - if (p_151223_5_ != null) - { - p_151223_5_.func_146586_a(); - } - - return; + p_151223_5_.func_146586_a(); } - HttpUtil.logger.warn("Deleting " + p_151223_0_ + " as it does not match what we currently have (" + i + " vs our " + j + ")."); - p_151223_0_.delete(); + return; } - else if (p_151223_0_.getParentFile() != null) + + HttpUtil.logger.warn("Deleting " + p_151223_0_ + " as it does not match what we currently have (" + i + " vs our " + j + ")."); + p_151223_0_.delete(); + } + else if (p_151223_0_.getParentFile() != null) + { + p_151223_0_.getParentFile().mkdirs(); + } + + dataoutputstream = new DataOutputStream(new FileOutputStream(p_151223_0_)); + + if (p_151223_4_ > 0 && f1 > (float)p_151223_4_) + { + if (p_151223_5_ != null) { - p_151223_0_.getParentFile().mkdirs(); + p_151223_5_.func_146586_a(); } - dataoutputstream = new DataOutputStream(new FileOutputStream(p_151223_0_)); + throw new IOException("Filesize is bigger than maximum allowed (file is " + f + ", limit is " + p_151223_4_ + ")"); + } - if (p_151223_4_ > 0 && f1 > (float)p_151223_4_) + boolean flag = false; + int k; + + while ((k = inputstream.read(abyte)) >= 0) + { + f += (float)k; + + if (p_151223_5_ != null) + { + p_151223_5_.setLoadingProgress((int)(f / f1 * 100.0F)); + } + + if (p_151223_4_ > 0 && f > (float)p_151223_4_) { if (p_151223_5_ != null) { p_151223_5_.func_146586_a(); } - throw new IOException("Filesize is bigger than maximum allowed (file is " + f + ", limit is " + p_151223_4_ + ")"); + throw new IOException("Filesize was bigger than maximum allowed (got >= " + f + ", limit was " + p_151223_4_ + ")"); } - boolean flag = false; - int k; - - while ((k = inputstream.read(abyte)) >= 0) - { - f += (float)k; - - if (p_151223_5_ != null) - { - p_151223_5_.setLoadingProgress((int)(f / f1 * 100.0F)); - } - - if (p_151223_4_ > 0 && f > (float)p_151223_4_) - { - if (p_151223_5_ != null) - { - p_151223_5_.func_146586_a(); - } - - throw new IOException("Filesize was bigger than maximum allowed (got >= " + f + ", limit was " + p_151223_4_ + ")"); - } - - dataoutputstream.write(abyte, 0, k); - } - - p_151223_2_.func_148522_a(p_151223_0_); - - if (p_151223_5_ != null) - { - p_151223_5_.func_146586_a(); - return; - } + dataoutputstream.write(abyte, 0, k); } - catch (Throwable throwable) + + p_151223_2_.func_148522_a(p_151223_0_); + + if (p_151223_5_ != null) { - throwable.printStackTrace(); + p_151223_5_.func_146586_a(); } } + catch (Throwable throwable) + { + throwable.printStackTrace(); + } finally { try diff --git a/src/main/java/net/minecraft/world/Explosion.java b/src/main/java/net/minecraft/world/Explosion.java index a359ce3..38d0620 100644 --- a/src/main/java/net/minecraft/world/Explosion.java +++ b/src/main/java/net/minecraft/world/Explosion.java @@ -113,6 +113,7 @@ int l = MathHelper.floor_double(this.explosionZ - (double)this.explosionSize - 1.0D); int j2 = MathHelper.floor_double(this.explosionZ + (double)this.explosionSize + 1.0D); List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.exploder, AxisAlignedBB.getBoundingBox((double)i, (double)k, (double)l, (double)j, (double)i2, (double)j2)); + net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(this.worldObj, this, list, this.explosionSize); Vec3 vec3 = Vec3.createVectorHelper(this.explosionX, this.explosionY, this.explosionZ); for (int i1 = 0; i1 < list.size(); ++i1) diff --git a/src/main/java/net/minecraft/world/World.java b/src/main/java/net/minecraft/world/World.java index 19a670e..deb2b22 100644 --- a/src/main/java/net/minecraft/world/World.java +++ b/src/main/java/net/minecraft/world/World.java @@ -1507,12 +1507,12 @@ f2 = 1.0F - f2; return (int)(f2 * 11.0F); } - + /** * The current sun brightness factor for this dimension. * 0.0f means no light at all, and 1.0f means maximum sunlight. * Highly recommended for sunlight detection like solar panel. - * + * * @return The current brightness factor * */ public float getSunBrightnessFactor(float p_72967_1_) @@ -1546,7 +1546,7 @@ { return provider.getSunBrightness(p_72971_1_); } - + @SideOnly(Side.CLIENT) public float getSunBrightnessBody(float p_72971_1_) { @@ -1658,7 +1658,7 @@ { return provider.getCurrentMoonPhaseFactor(); } - + public float getCurrentMoonPhaseFactorBody() { return WorldProvider.moonPhaseFactors[this.provider.getMoonPhase(this.worldInfo.getWorldTime())]; @@ -2408,6 +2408,7 @@ Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); explosion.isFlaming = p_72885_9_; explosion.isSmoking = p_72885_10_; + if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; explosion.doExplosionA(); explosion.doExplosionB(true); return explosion; @@ -3419,7 +3420,7 @@ public int getIndirectPowerLevelTo(int p_72878_1_, int p_72878_2_, int p_72878_3_, int p_72878_4_) { - Block block = this.getBlock(p_72878_1_, p_72878_2_, p_72878_3_); + Block block = this.getBlock(p_72878_1_, p_72878_2_, p_72878_3_); return block.shouldCheckWeakPower(this, p_72878_1_, p_72878_2_, p_72878_3_, p_72878_4_) ? this.getBlockPowerInput(p_72878_1_, p_72878_2_, p_72878_3_) : block.isProvidingWeakPower(this, p_72878_1_, p_72878_2_, p_72878_3_, p_72878_4_); } @@ -3872,7 +3873,7 @@ Block block1 = this.getBlock(i1, y, j1); block1.onNeighborChange(this, i1, y, j1, p_147453_1_, p_147453_2_, p_147453_3_); - if (block1.isNormalCube(this, i1, p_147453_2_, j1)) + if (block1.isNormalCube(this, i1, y, j1)) { i1 += dir.offsetX; y += dir.offsetY; diff --git a/src/main/java/net/minecraft/world/WorldServer.java b/src/main/java/net/minecraft/world/WorldServer.java index d3e05a1..e622ac9 100644 --- a/src/main/java/net/minecraft/world/WorldServer.java +++ b/src/main/java/net/minecraft/world/WorldServer.java @@ -724,6 +724,7 @@ } else { + if (net.minecraftforge.event.ForgeEventFactory.onCreateWorldSpawn(this, p_73052_1_)) return; this.findingSpawnPoint = true; WorldChunkManager worldchunkmanager = this.provider.worldChunkMgr; List list = worldchunkmanager.getBiomesToSpawnIn(); @@ -896,6 +897,7 @@ Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); explosion.isFlaming = p_72885_9_; explosion.isSmoking = p_72885_10_; + if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; explosion.doExplosionA(); explosion.doExplosionB(false); diff --git a/src/main/java/net/minecraft/world/chunk/Chunk.java b/src/main/java/net/minecraft/world/chunk/Chunk.java index ff92f4f..e3de3fe 100644 --- a/src/main/java/net/minecraft/world/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/chunk/Chunk.java @@ -1266,7 +1266,7 @@ int y = tileentity.yCoord; int z = tileentity.zCoord & 15; Block block = tileentity.getBlockType(); - if (block != getBlock(x, y, z) || tileentity.blockMetadata != this.getBlockMetadata(x, y, z)) + if ((block != getBlock(x, y, z) || tileentity.blockMetadata != this.getBlockMetadata(x, y, z)) && tileentity.shouldRefresh(block, getBlock(x, y, z), tileentity.blockMetadata, this.getBlockMetadata(x, y, z), worldObj, x, y, z)) { invalidList.add(tileentity); } diff --git a/src/main/java/net/minecraftforge/common/ForgeHooks.java b/src/main/java/net/minecraftforge/common/ForgeHooks.java index 2dc3457..e254a74 100644 --- a/src/main/java/net/minecraftforge/common/ForgeHooks.java +++ b/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -1,8 +1,11 @@ package net.minecraftforge.common; +import java.net.URI; import java.util.ArrayList; import java.util.List; import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.relauncher.ReflectionHelper; @@ -11,6 +14,7 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.event.ClickEvent; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.Container; @@ -32,8 +36,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityNote; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.DamageSource; +import net.minecraft.util.IChatComponent; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition.MovingObjectType; @@ -178,6 +184,7 @@ Blocks.iron_block.setHarvestLevel("pickaxe", 1); Blocks.lapis_ore.setHarvestLevel("pickaxe", 1); Blocks.lapis_block.setHarvestLevel("pickaxe", 1); + Blocks.quartz_ore.setHarvestLevel("pickaxe", 0); } public static int getTotalArmorValue(EntityPlayer player) @@ -379,6 +386,50 @@ return event.component; } + public static IChatComponent newChatWithLinks(String string) + { + // Includes ipv4 and domain pattern + // Matches an ip (xx.xxx.xx.xxx) or a domain (something.com) with or + // without a protocol or path. + final Pattern URL_PATTERN = Pattern.compile( + // schema ipv4 OR namespace port path ends + // |-----------------| |-------------------------| |----------------------------| |---------| |--| |---------------| + "((?:[a-z0-9]{2,}:\\/\\/)?(?:(?:[0-9]{1,3}\\.){3}[0-9]{1,3}|(?:[-\\w_\\.]{1,}\\.[a-z]{2,}?))(?::[0-9]{1,5})?.*?(?=[!\"\u00A7 \n]|$))", + Pattern.CASE_INSENSITIVE); + IChatComponent ichat = new ChatComponentText(""); + Matcher matcher = URL_PATTERN.matcher(string); + int lastEnd = 0; + String remaining = string; + + // Find all urls + while (matcher.find()) + { + int start = matcher.start(); + int end = matcher.end(); + + // Append the previous left overs. + ichat.appendText(string.substring(lastEnd, start)); + lastEnd = end; + String url = string.substring(start, end); + IChatComponent link = new ChatComponentText(url); + + // Add schema so client doesn't crash. + if (URI.create(url).getScheme() == null) + { + url = "http://" + url; + } + + // Set the click event and append the link. + ClickEvent click = new ClickEvent(ClickEvent.Action.OPEN_URL, url); + link.getChatStyle().setChatClickEvent(click); + ichat.appendSibling(link); + } + + // Append the rest of the message. + ichat.appendText(string.substring(lastEnd)); + return ichat; + } + public static boolean canInteractWith(EntityPlayer player, Container openContainer) { PlayerOpenContainerEvent event = new PlayerOpenContainerEvent(player, openContainer); diff --git a/src/main/java/net/minecraftforge/common/ForgeModContainer.java b/src/main/java/net/minecraftforge/common/ForgeModContainer.java index a423d06..0d5c51f 100644 --- a/src/main/java/net/minecraftforge/common/ForgeModContainer.java +++ b/src/main/java/net/minecraftforge/common/ForgeModContainer.java @@ -280,6 +280,11 @@ MinecraftForge.EVENT_BUS.register(MinecraftForge.INTERNAL_HANDLER); ForgeChunkManager.captureConfig(evt.getModConfigurationDirectory()); FMLCommonHandler.instance().bus().register(this); + + if (!ForgeModContainer.disableVersionCheck) + { + ForgeVersion.startVersionCheck(); + } } @Subscribe diff --git a/src/main/java/net/minecraftforge/common/MinecraftForge.java b/src/main/java/net/minecraftforge/common/MinecraftForge.java index 3979a7f..b05b634 100644 --- a/src/main/java/net/minecraftforge/common/MinecraftForge.java +++ b/src/main/java/net/minecraftforge/common/MinecraftForge.java @@ -46,11 +46,6 @@ OreDictionary.getOreName(0); - if (!ForgeModContainer.disableVersionCheck) - { - ForgeVersion.startVersionCheck(); - } - //Force these classes to be defined, Should prevent derp error hiding. new CrashReport("ThisIsFake", new Exception("Not real")); diff --git a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java index 8f5d4e3..31b49f8 100644 --- a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java +++ b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java @@ -2,7 +2,9 @@ import java.io.File; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; + import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.eventhandler.Event.Result; import net.minecraft.block.Block; @@ -16,15 +18,21 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.world.Explosion; import net.minecraft.world.World; import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.storage.IPlayerFileData; import net.minecraft.world.storage.SaveHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.BlockSnapshot; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.brewing.PotionBrewEvent; +import net.minecraftforge.event.brewing.PotionBrewedEvent; import net.minecraftforge.event.entity.EntityStruckByLightningEvent; +import net.minecraftforge.event.entity.living.LivingHealEvent; import net.minecraftforge.event.entity.living.LivingPackSizeEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent.AllowDespawn; @@ -38,6 +46,7 @@ import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.BlockEvent.MultiPlaceEvent; import net.minecraftforge.event.world.BlockEvent.PlaceEvent; +import net.minecraftforge.event.world.ExplosionEvent; import net.minecraftforge.event.world.WorldEvent; public class ForgeEventFactory @@ -216,4 +225,62 @@ File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, "playersDirectory", "field_"+"75771_c"); MinecraftForge.EVENT_BUS.post(new PlayerEvent.LoadFromFile(player, dir, uuidString)); } + + public static boolean onExplosionStart(World world, Explosion explosion) + { + return MinecraftForge.EVENT_BUS.post(new ExplosionEvent.Start(world, explosion)); + } + + public static void onExplosionDetonate(World world, Explosion explosion, List list, double diameter) + { + //Filter entities to only those who are effected, to prevent modders from seeing more then will be hurt. + /* Enable this if we get issues with modders looping to much. + Iterator itr = list.iterator(); + while (itr.hasNext()) + { + Entity e = itr.next(); + double dist = e.getDistance(explosion.explosionX, explosion.explosionY, explosion.explosionZ) / diameter; + if (dist > 1.0F) itr.remove(); + } + */ + MinecraftForge.EVENT_BUS.post(new ExplosionEvent.Detonate(world, explosion, list)); + } + + public static boolean onCreateWorldSpawn(World world, WorldSettings settings) + { + return MinecraftForge.EVENT_BUS.post(new WorldEvent.CreateSpawnPosition(world, settings)); + } + + public static float onLivingHeal(EntityLivingBase entity, float amount) + { + LivingHealEvent event = new LivingHealEvent(entity, amount); + return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.amount); + } + + public static boolean onPotionAttemptBreaw(ItemStack[] stacks) + { + ItemStack[] tmp = new ItemStack[stacks.length]; + for (int x = 0; x < tmp.length; x++) + tmp[x] = ItemStack.copyItemStack(stacks[x]); + + PotionBrewEvent.Pre event = new PotionBrewEvent.Pre(tmp); + if (MinecraftForge.EVENT_BUS.post(event)) + { + boolean changed = false; + for (int x = 0; x < stacks.length; x++) + { + changed |= ItemStack.areItemStacksEqual(tmp[x], stacks[x]); + stacks[x] = event.getItem(x); + } + if (changed) + onPotionBrewed(stacks); + return true; + } + return false; + } + + public static void onPotionBrewed(ItemStack[] brewingItemStacks) + { + MinecraftForge.EVENT_BUS.post(new PotionBrewEvent.Post(brewingItemStacks)); + } } diff --git a/src/main/java/net/minecraftforge/event/brewing/PotionBrewEvent.java b/src/main/java/net/minecraftforge/event/brewing/PotionBrewEvent.java new file mode 100644 index 0000000..7b682a0 --- /dev/null +++ b/src/main/java/net/minecraftforge/event/brewing/PotionBrewEvent.java @@ -0,0 +1,83 @@ +package net.minecraftforge.event.brewing; + +import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.HasResult; + + +public class PotionBrewEvent extends Event +{ + private ItemStack[] stacks; + + protected PotionBrewEvent(ItemStack[] stacks) + { + this.stacks = stacks; + } + + public ItemStack getItem(int index) + { + if (index >= stacks.length) return null; + return stacks[index]; + } + + public void setItem(int index, ItemStack stack) + { + if (index < stacks.length) + { + stacks[index] = stack; + } + } + + public int getLength() + { + return stacks.length; + } + + /** + * PotionBrewEvent.Pre is fired before vanilla brewing takes place. + * All changes made to the event's array will be made to the TileEntity if the event is canceled. + *
+ * The event is fired during the TileEntityBrewingStand#brewPotions() method invocation.
+ *
+ * {@link #brewingStacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.
+ *
+ * This event is {@link Cancelable}.
+ * If the event is not canceled, the vanilla brewing will take place instead of modded brewing. + *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ *
+ * If this event is canceled, and items have been modified, PotionBrewEvent.Post will automatically be fired. + **/ + @Cancelable + public static class Pre extends PotionBrewEvent + { + public Pre(ItemStack[] stacks) + { + super(stacks); + } + } + + /** + * PotionBrewEvent.Post is fired when a potion is brewed in the brewing stand. + *
+ * The event is fired during the TileEntityBrewingStand#brewPotions() method invocation.
+ *
+ * {@link #brewingStacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ + public static class Post extends PotionBrewedEvent + { + public Post(ItemStack[] stacks) + { + super(stacks); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java b/src/main/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java index 8bca355..bc8dd23 100644 --- a/src/main/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java +++ b/src/main/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java @@ -1,5 +1,6 @@ package net.minecraftforge.event.brewing; +import cpw.mods.fml.common.eventhandler.Cancelable; import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.item.ItemStack; @@ -16,14 +17,18 @@ *
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/ -public class PotionBrewedEvent extends Event +@Deprecated //Remove in 1.8.1 +public class PotionBrewedEvent extends PotionBrewEvent { /** * The brewing stacks in the brewing stand. Each index has the possibility to be null, so make sure you check. + * Changing this array to another one has no effect. */ + @Deprecated public ItemStack[] brewingStacks; public PotionBrewedEvent(ItemStack[] brewingStacks) { + super(brewingStacks); this.brewingStacks = brewingStacks; } } diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingHealEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingHealEvent.java new file mode 100644 index 0000000..059bcff --- /dev/null +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingHealEvent.java @@ -0,0 +1,30 @@ +package net.minecraftforge.event.entity.living; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.EntityLivingBase; + +/** + * LivingHealEvent is fired when an Entity is set to be healed.
+ * This event is fired whenever an Entity is healed in EntityLivingBase#heal(float)
+ *
+ * This event is fired via the {@link ForgeHooks#onLivingHeal(EntityLivingBase, float)}.
+ *
+ * {@link #amount} contains the amount of healing done to the Entity that was healed.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the Entity is not healed.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class LivingHealEvent extends LivingEvent +{ + public float amount; + public LivingHealEvent(EntityLivingBase entity, float amount) + { + super(entity); + this.amount = amount; + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerWakeUpEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerWakeUpEvent.java index bfb8d28..0375370 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerWakeUpEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerWakeUpEvent.java @@ -9,8 +9,34 @@ */ public class PlayerWakeUpEvent extends PlayerEvent { + @Deprecated //ToDo: Remove in 1.8 public PlayerWakeUpEvent(EntityPlayer player) { + this(player, false, false, false); + } + /** + * Used for the 'wake up animation'. + * This is false if the player is considered 'sleepy' and the overlay should slowly fade away. + */ + public final boolean wakeImmediatly; + + /** + * Indicates if the server should be notified of sleeping changes. + * This will only be false if the server is considered 'up to date' already, because, for example, it initiated the call. + */ + public final boolean updateWorld; + + /** + * Indicates if the player's sleep was considered successful. + * In vanilla, this is used to determine if the spawn chunk is to be set to the bed's position. + */ + public final boolean setSpawn; + + public PlayerWakeUpEvent(EntityPlayer player, boolean wakeImmediatly, boolean updateWorld, boolean setSpawn) + { super(player); + this.wakeImmediatly = wakeImmediatly; + this.updateWorld = updateWorld; + this.setSpawn = setSpawn; } } diff --git a/src/main/java/net/minecraftforge/event/world/ExplosionEvent.java b/src/main/java/net/minecraftforge/event/world/ExplosionEvent.java new file mode 100644 index 0000000..69f7604 --- /dev/null +++ b/src/main/java/net/minecraftforge/event/world/ExplosionEvent.java @@ -0,0 +1,76 @@ +package net.minecraftforge.event.world; + +import java.util.List; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.entity.Entity; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +/** ExplosionEvent triggers when an explosion happens in the world.
+ *
+ * ExplosionEvent.Start is fired before the explosion actually occurs.
+ * ExplosionEvent.Detonate is fired once the explosion has a list of affected blocks and entities.
+ *
+ * ExplosionEvent.Start is {@link Cancelable}.
+ * ExplosionEvent.Detonate can modify the affected blocks and entities.
+ * Children do not use {@link HasResult}.
+ * Children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
+ */ +public class ExplosionEvent extends Event +{ + public final World world; + public final Explosion explosion; + + public ExplosionEvent(World world, Explosion explosion) + { + this.world = world; + this.explosion = explosion; + } + + /** ExplosionEvent.Start is fired before the explosion actually occurs. Canceling this event will stop the explosion.
+ *
+ * This event is {@link Cancelable}.
+ * This event does not use {@link HasResult}.
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ */ + @Cancelable + public static class Start extends ExplosionEvent + { + public Start(World world, Explosion explosion) + { + super(world, explosion); + } + } + + /** ExplosionEvent.Detonate is fired once the explosion has a list of affected blocks and entities. These lists can be modified to change the outcome.
+ *
+ * This event is not {@link Cancelable}.
+ * This event does not use {@link HasResult}.
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ */ + public static class Detonate extends ExplosionEvent + { + private final List entityList; + + public Detonate(World world, Explosion explosion, List entityList) + { + super(world, explosion); + this.entityList = entityList; + } + + /** return the list of blocks affected by the explosion. */ + public List getAffectedBlocks() + { + return explosion.affectedBlockPositions; + } + + /** return the list of entities affected by the explosion. */ + public List getAffectedEntities() + { + return entityList; + } + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/event/world/WorldEvent.java b/src/main/java/net/minecraftforge/event/world/WorldEvent.java index 72ef857..d06d027 100644 --- a/src/main/java/net/minecraftforge/event/world/WorldEvent.java +++ b/src/main/java/net/minecraftforge/event/world/WorldEvent.java @@ -5,13 +5,14 @@ import net.minecraft.entity.EnumCreatureType; import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; import cpw.mods.fml.common.eventhandler.Cancelable; import cpw.mods.fml.common.eventhandler.Event; /** * WorldEvent is fired when an event involving the world occurs.
- * If a method utilizes this {@link Event} as its parameter, the method will + * If a method utilizes this {@link Event} as its parameter, the method will * receive every child event of this class.
*
* {@link #world} contains the World this event is occuring in.
@@ -31,8 +32,8 @@ * WorldEvent.Load is fired when Minecraft loads a world.
* This event is fired when a world is loaded in * WorldClient#WorldClient(NetHandlerPlayClient, WorldSettings, int, EnumDifficulty, Profiler), - * MinecraftServer#loadAllWorlds(String, String, long, WorldType, String), - * DimensionManager#initDimension(int), + * MinecraftServer#loadAllWorlds(String, String, long, WorldType, String), + * DimensionManager#initDimension(int), * and ForgeInternalHandler#onDimensionLoad(Load).
*
* This event is not {@link Cancelable}.
@@ -49,10 +50,10 @@ /** * WorldEvent.Unload is fired when Minecraft unloads a world.
* This event is fired when a world is unloaded in - * Minecraft#loadWorld(WorldClient, String), - * MinecraftServer#deleteWorldAndStopServer(), - * MinecraftServer#stopServer(), - * DimensionManager#unloadWorlds(Hashtable), + * Minecraft#loadWorld(WorldClient, String), + * MinecraftServer#deleteWorldAndStopServer(), + * MinecraftServer#stopServer(), + * DimensionManager#unloadWorlds(Hashtable), * ForgeInternalHandler#onDimensionUnload(Unload).
*
* This event is not {@link Cancelable}.
@@ -69,7 +70,7 @@ /** * WorldEvent.Save is fired when Minecraft saves a world.
* This event is fired when a world is saved in - * WorldServer#saveAllChunks(boolean, IProgressUpdate), + * WorldServer#saveAllChunks(boolean, IProgressUpdate), * ForgeInternalHandler#onDimensionSave(Save).
*
* This event is not {@link Cancelable}.
@@ -113,4 +114,19 @@ } } } + + /** + * Called by WorldServer when it attempts to create a spawnpoint for a dimension. + * Canceling the event will prevent the vanilla code from running. + */ + @Cancelable + public static class CreateSpawnPosition extends WorldEvent + { + public final WorldSettings settings; + public CreateSpawnPosition(World world, WorldSettings ws) + { + super(world); + this.settings = ws; + } + } } diff --git a/src/main/java/net/minecraftforge/fluids/FluidTank.java b/src/main/java/net/minecraftforge/fluids/FluidTank.java index 92333b4..7fdc33f 100644 --- a/src/main/java/net/minecraftforge/fluids/FluidTank.java +++ b/src/main/java/net/minecraftforge/fluids/FluidTank.java @@ -37,11 +37,11 @@ if (!nbt.hasKey("Empty")) { FluidStack fluid = FluidStack.loadFluidStackFromNBT(nbt); - - if (fluid != null) - { - setFluid(fluid); - } + setFluid(fluid); + } + else + { + setFluid(null); } return this; } diff --git a/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java b/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java index 9ff0bba..bcb4bbc 100644 --- a/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java +++ b/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java @@ -191,6 +191,11 @@ tessellator.addVertexWithUV(x + 0, y + heightSW, z + 1, u1, v1); tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, u4, v4); tessellator.addVertexWithUV(x + 1, y + heightNE, z + 0, u3, v3); + + tessellator.addVertexWithUV(x + 0, y + heightNW, z + 0, u2, v2); + tessellator.addVertexWithUV(x + 1, y + heightNE, z + 0, u3, v3); + tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, u4, v4); + tessellator.addVertexWithUV(x + 0, y + heightSW, z + 1, u1, v1); } else { @@ -198,6 +203,11 @@ tessellator.addVertexWithUV(x + 1, y + 1 - heightSE, z + 1, u4, v4); tessellator.addVertexWithUV(x + 0, y + 1 - heightSW, z + 1, u1, v1); tessellator.addVertexWithUV(x + 0, y + 1 - heightNW, z + 0, u2, v2); + + tessellator.addVertexWithUV(x + 1, y + 1 - heightNE, z + 0, u3, v3); + tessellator.addVertexWithUV(x + 0, y + 1 - heightNW, z + 0, u2, v2); + tessellator.addVertexWithUV(x + 0, y + 1 - heightSW, z + 1, u1, v1); + tessellator.addVertexWithUV(x + 1, y + 1 - heightSE, z + 1, u4, v4); } } @@ -304,6 +314,11 @@ tessellator.addVertexWithUV(tx2, y + ty2, tz2, u2Flow, v2Flow); tessellator.addVertexWithUV(tx2, y + 0, tz2, u2Flow, v3Flow); tessellator.addVertexWithUV(tx1, y + 0, tz1, u1Flow, v3Flow); + + tessellator.addVertexWithUV(tx1, y + ty1, tz1, u1Flow, v1Flow); + tessellator.addVertexWithUV(tx1, y + 0, tz1, u1Flow, v3Flow); + tessellator.addVertexWithUV(tx2, y + 0, tz2, u2Flow, v3Flow); + tessellator.addVertexWithUV(tx2, y + ty2, tz2, u2Flow, v2Flow); } else { @@ -311,6 +326,11 @@ tessellator.addVertexWithUV(tx2, y + 1 - 0, tz2, u2Flow, v3Flow); tessellator.addVertexWithUV(tx2, y + 1 - ty2, tz2, u2Flow, v2Flow); tessellator.addVertexWithUV(tx1, y + 1 - ty1, tz1, u1Flow, v1Flow); + + tessellator.addVertexWithUV(tx1, y + 1 - 0, tz1, u1Flow, v3Flow); + tessellator.addVertexWithUV(tx1, y + 1 - ty1, tz1, u1Flow, v1Flow); + tessellator.addVertexWithUV(tx2, y + 1 - ty2, tz2, u2Flow, v2Flow); + tessellator.addVertexWithUV(tx2, y + 1 - 0, tz2, u2Flow, v3Flow); } } } @@ -334,4 +354,4 @@ if (icon != null) return icon; return ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); } -} \ No newline at end of file +} diff --git a/src/main/java/net/minecraftforge/oredict/OreDictionary.java b/src/main/java/net/minecraftforge/oredict/OreDictionary.java index 1f946f1..9c35e99 100644 --- a/src/main/java/net/minecraftforge/oredict/OreDictionary.java +++ b/src/main/java/net/minecraftforge/oredict/OreDictionary.java @@ -112,6 +112,7 @@ registerOre("stone", Blocks.stone); registerOre("cobblestone", Blocks.cobblestone); registerOre("sandstone", new ItemStack(Blocks.sandstone, 1, WILDCARD_VALUE)); + registerOre("sand", new ItemStack(Blocks.sand, 1, WILDCARD_VALUE)); registerOre("dye", new ItemStack(Items.dye, 1, WILDCARD_VALUE)); registerOre("record", Items.record_13); registerOre("record", Items.record_cat); @@ -201,8 +202,7 @@ new ItemStack(Blocks.jungle_stairs), new ItemStack(Blocks.acacia_stairs), new ItemStack(Blocks.dark_oak_stairs), - new ItemStack(Blocks.glass_pane), - new ItemStack(Blocks.stained_glass) + new ItemStack(Blocks.glass_pane) }; List recipes = CraftingManager.getInstance().getRecipeList(); diff --git a/src/main/resources/deobfuscation_data-1.7.10.lzma b/src/main/resources/deobfuscation_data-1.7.10.lzma index 63f48bd..aa8b27e 100644 --- a/src/main/resources/deobfuscation_data-1.7.10.lzma +++ b/src/main/resources/deobfuscation_data-1.7.10.lzma Binary files differ diff --git a/src/main/resources/fmlversion.properties b/src/main/resources/fmlversion.properties index 3b4e308..9816745 100644 --- a/src/main/resources/fmlversion.properties +++ b/src/main/resources/fmlversion.properties @@ -1,6 +1,6 @@ fmlbuild.major.number=7 fmlbuild.minor.number=10 fmlbuild.revision.number=85 -fmlbuild.build.number=21 +fmlbuild.build.number=4 fmlbuild.mcversion=1.7.10 fmlbuild.mcpversion=9.05