LoadingScreenRenderer,Minecraft,GuiContainerCreative,PlayerControllerMP,LanguageManager,Locale,SimpleReloadableResourceManager,EntityList,EntityLivingBase,EntityWither,EntityMinecart,EntityPlayerMP

NethanlderPlayClient patch is now in vanilla. The FMLCommonHandler future exception catcher is not needed anymore, it's in Util. The caching of player profiles is now in vanilla (SkinManager).
This commit is contained in:
cpw 2015-11-11 10:33:37 -05:00
parent 5147742049
commit 13c7d038eb
29 changed files with 767 additions and 711 deletions

View file

@ -179,7 +179,7 @@
}
protected ItemStack createStackedBlock(IBlockState state)
@@ -1015,6 +1035,1033 @@
@@ -1015,6 +1035,1029 @@
return "Block{" + blockRegistry.getNameForObject(this) + "}";
}
@ -939,11 +939,7 @@
+ */
+ public boolean canEntityDestroy(IBlockAccess world, BlockPos pos, Entity entity)
+ {
+ if (entity instanceof net.minecraft.entity.boss.EntityWither)
+ {
+ return this != net.minecraft.init.Blocks.barrier && this != net.minecraft.init.Blocks.bedrock && this != net.minecraft.init.Blocks.end_portal && this != net.minecraft.init.Blocks.end_portal_frame && this != net.minecraft.init.Blocks.command_block;
+ }
+ else if (entity instanceof net.minecraft.entity.boss.EntityDragon)
+ if (entity instanceof net.minecraft.entity.boss.EntityDragon)
+ {
+ return this != net.minecraft.init.Blocks.barrier && this != net.minecraft.init.Blocks.obsidian && this != net.minecraft.init.Blocks.end_stone && this != net.minecraft.init.Blocks.bedrock && this != net.minecraft.init.Blocks.command_block;
+ }

View file

@ -11,3 +11,16 @@
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
@@ -175,6 +179,12 @@
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
this.mc.fontRendererObj.drawStringWithShadow(this.currentlyDisplayedText, (float)((k - this.mc.fontRendererObj.getStringWidth(this.currentlyDisplayedText)) / 2), (float)(l / 2 - 4 - 16), 16777215);
this.mc.fontRendererObj.drawStringWithShadow(this.message, (float)((k - this.mc.fontRendererObj.getStringWidth(this.message)) / 2), (float)(l / 2 - 4 + 8), 16777215);
+ }
+ }
+ catch (java.io.IOException e)
+ {
+ com.google.common.base.Throwables.propagate(e);
+ } //FML End
this.framebuffer.unbindFramebuffer();
if (OpenGlHelper.isFramebufferEnabled())

View file

@ -139,7 +139,19 @@
if (guiScreenIn instanceof GuiMainMenu)
{
this.gameSettings.showDebugInfo = false;
@@ -1380,7 +1396,7 @@
@@ -1033,9 +1049,11 @@
if (!this.skipRenderWorld)
{
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickStart(this.timer.renderPartialTicks);
this.mcProfiler.endStartSection("gameRenderer");
this.entityRenderer.func_181560_a(this.timer.renderPartialTicks, i);
this.mcProfiler.endSection();
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickEnd(this.timer.renderPartialTicks);
}
this.mcProfiler.endSection();
@@ -1380,7 +1398,7 @@
if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air && this.playerController.func_180512_c(blockpos, this.objectMouseOver.sideHit))
{
@ -148,7 +160,38 @@
this.thePlayer.swingItem();
}
}
@@ -1601,6 +1617,8 @@
@@ -1466,15 +1484,19 @@
case BLOCK:
BlockPos blockpos = this.objectMouseOver.getBlockPos();
- if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air)
+ if (!this.theWorld.isAirBlock(blockpos))
{
int i = itemstack != null ? itemstack.stackSize : 0;
+
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, this.theWorld, blockpos, this.objectMouseOver.sideHit).isCanceled();
+ if (result) { //Forge: Kept separate to simplify patch
if (this.playerController.func_178890_a(this.thePlayer, this.theWorld, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec))
{
flag = false;
this.thePlayer.swingItem();
}
+ }
if (itemstack == null)
{
@@ -1497,7 +1519,8 @@
{
ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem();
- if (itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, theWorld, null, null).isCanceled();
+ if (result && itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
{
this.entityRenderer.itemRenderer.resetEquippedProgress2();
}
@@ -1601,6 +1624,8 @@
--this.rightClickDelayTimer;
}
@ -157,7 +200,16 @@
this.mcProfiler.startSection("gui");
if (!this.isGamePaused)
@@ -1750,6 +1768,7 @@
@@ -1695,6 +1720,8 @@
while (Mouse.next())
{
+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;
+
int i = Mouse.getEventButton();
KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState());
@@ -1750,6 +1777,7 @@
this.currentScreen.handleMouseInput();
}
}
@ -165,7 +217,7 @@
}
if (this.leftClickCounter > 0)
@@ -1928,6 +1947,7 @@
@@ -1928,6 +1956,7 @@
}
}
}
@ -173,7 +225,7 @@
}
for (int l = 0; l < 9; ++l)
@@ -2124,12 +2144,15 @@
@@ -2124,12 +2153,15 @@
this.myNetworkManager.processReceivedPackets();
}
@ -189,7 +241,20 @@
this.loadWorld((WorldClient)null);
System.gc();
ISaveHandler isavehandler = this.saveLoader.getSaveLoader(folderName, false);
@@ -2190,8 +2213,14 @@
@@ -2165,6 +2197,12 @@
while (!this.theIntegratedServer.serverIsInRunLoop())
{
+ if (!net.minecraftforge.fml.common.StartupQuery.check())
+ {
+ loadWorld(null);
+ displayGuiScreen(null);
+ return;
+ }
String s = this.theIntegratedServer.getUserMessage();
if (s != null)
@@ -2190,8 +2228,14 @@
SocketAddress socketaddress = this.theIntegratedServer.getNetworkSystem().addLocalEndpoint();
NetworkManager networkmanager = NetworkManager.provideLocalClient(socketaddress);
networkmanager.setNetHandler(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null));
@ -206,7 +271,7 @@
this.myNetworkManager = networkmanager;
}
@@ -2202,6 +2231,8 @@
@@ -2202,6 +2246,8 @@
public void loadWorld(WorldClient worldClientIn, String loadingMessage)
{
@ -215,7 +280,7 @@
if (worldClientIn == null)
{
NetHandlerPlayClient nethandlerplayclient = this.getNetHandler();
@@ -2215,6 +2246,18 @@
@@ -2215,6 +2261,18 @@
{
this.theIntegratedServer.initiateShutdown();
this.theIntegratedServer.setStaticInstance();
@ -234,7 +299,7 @@
}
this.theIntegratedServer = null;
@@ -2237,6 +2280,7 @@
@@ -2237,6 +2295,7 @@
this.ingameGUI.func_181029_i();
this.setServerData((ServerData)null);
this.integratedServerIsRunning = false;
@ -242,3 +307,153 @@
}
this.mcSoundHandler.stopSounds();
@@ -2341,126 +2400,10 @@
if (this.objectMouseOver != null)
{
boolean flag = this.thePlayer.capabilities.isCreativeMode;
- int i = 0;
- boolean flag1 = false;
- TileEntity tileentity = null;
- Item item;
-
- if (this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
- {
- BlockPos blockpos = this.objectMouseOver.getBlockPos();
- Block block = this.theWorld.getBlockState(blockpos).getBlock();
-
- if (block.getMaterial() == Material.air)
- {
- return;
- }
-
- item = block.getItem(this.theWorld, blockpos);
-
- if (item == null)
- {
- return;
- }
-
- if (flag && GuiScreen.isCtrlKeyDown())
- {
- tileentity = this.theWorld.getTileEntity(blockpos);
- }
-
- Block block1 = item instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem(item) : block;
- i = block1.getDamageValue(this.theWorld, blockpos);
- flag1 = item.getHasSubtypes();
- }
- else
- {
- if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag)
- {
- return;
- }
-
- if (this.objectMouseOver.entityHit instanceof EntityPainting)
- {
- item = Items.painting;
- }
- else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot)
- {
- item = Items.lead;
- }
- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame)
- {
- EntityItemFrame entityitemframe = (EntityItemFrame)this.objectMouseOver.entityHit;
- ItemStack itemstack = entityitemframe.getDisplayedItem();
-
- if (itemstack == null)
- {
- item = Items.item_frame;
- }
- else
- {
- item = itemstack.getItem();
- i = itemstack.getMetadata();
- flag1 = true;
- }
- }
- else if (this.objectMouseOver.entityHit instanceof EntityMinecart)
- {
- EntityMinecart entityminecart = (EntityMinecart)this.objectMouseOver.entityHit;
-
- switch (entityminecart.getMinecartType())
- {
- case FURNACE:
- item = Items.furnace_minecart;
- break;
- case CHEST:
- item = Items.chest_minecart;
- break;
- case TNT:
- item = Items.tnt_minecart;
- break;
- case HOPPER:
- item = Items.hopper_minecart;
- break;
- case COMMAND_BLOCK:
- item = Items.command_block_minecart;
- break;
- default:
- item = Items.minecart;
- }
- }
- else if (this.objectMouseOver.entityHit instanceof EntityBoat)
- {
- item = Items.boat;
- }
- else if (this.objectMouseOver.entityHit instanceof EntityArmorStand)
- {
- item = Items.armor_stand;
- }
- else
- {
- item = Items.spawn_egg;
- i = EntityList.getEntityID(this.objectMouseOver.entityHit);
- flag1 = true;
-
- if (!EntityList.entityEggs.containsKey(Integer.valueOf(i)))
- {
- return;
- }
- }
- }
-
InventoryPlayer inventoryplayer = this.thePlayer.inventory;
- if (tileentity == null)
- {
- inventoryplayer.setCurrentItem(item, i, flag1, flag);
- }
- else
- {
- ItemStack itemstack1 = this.func_181036_a(item, i, tileentity);
- inventoryplayer.setInventorySlotContents(inventoryplayer.currentItem, itemstack1);
- }
-
+ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld)) return;
+ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions
if (flag)
{
int j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + inventoryplayer.currentItem;
@@ -2773,18 +2716,8 @@
public static int getGLMaximumTextureSize()
{
- for (int i = 16384; i > 0; i >>= 1)
- {
- GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)((ByteBuffer)null));
- int j = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
-
- if (j != 0)
- {
- return i;
- }
- }
-
- return -1;
+ //Forge we redirect this to our code which caches the value before any splash screen stuff is done.
+ return net.minecraftforge.fml.client.SplashProgress.getMaxTextureSize();
}
public boolean isSnooperEnabled()

View file

@ -9,6 +9,15 @@
public GuiContainerCreative(EntityPlayer p_i1088_1_)
{
@@ -176,7 +178,7 @@
return;
}
- if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2))
+ if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2) && ItemStack.areItemStackTagsEqual(itemstack1, itemstack2)) //Forge: Bugfix, Compare NBT data, allow for deletion of enchanted books, MC-12770
{
if (clickedButton == 0)
{
@@ -260,6 +262,13 @@
this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]);
this.field_147059_E = new CreativeCrafting(this.mc);
@ -32,7 +41,44 @@
{
if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat))
{
@@ -366,7 +375,7 @@
@@ -319,6 +328,14 @@
GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots;
guicontainercreative$containercreative.itemList.clear();
+ CreativeTabs tab = CreativeTabs.creativeTabArray[selectedTabIndex];
+ if (tab.hasSearchBar() && tab != CreativeTabs.tabAllSearch)
+ {
+ tab.displayAllReleventItems(guicontainercreative$containercreative.itemList);
+ updateFilteredItems(guicontainercreative$containercreative);
+ return;
+ }
+
for (Item item : Item.itemRegistry)
{
if (item != null && item.getCreativeTab() != null)
@@ -326,7 +343,13 @@
item.getSubItems(item, (CreativeTabs)null, guicontainercreative$containercreative.itemList);
}
}
+ updateFilteredItems(guicontainercreative$containercreative);
+ }
+ //split from above for custom search tabs
+ private void updateFilteredItems(GuiContainerCreative.ContainerCreative guicontainercreative$containercreative)
+ {
+ if (CreativeTabs.creativeTabArray[selectedTabIndex] == CreativeTabs.tabAllSearch) // FORGE: Only add enchanted books to the regular search
for (Enchantment enchantment : Enchantment.enchantmentsBookList)
{
if (enchantment != null && enchantment.type != null)
@@ -334,7 +357,6 @@
Items.enchanted_book.getAll(enchantment, guicontainercreative$containercreative.itemList);
}
}
-
Iterator<ItemStack> iterator = guicontainercreative$containercreative.itemList.iterator();
String s1 = this.searchField.getText().toLowerCase();
@@ -366,7 +388,7 @@
{
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex];
@ -41,7 +87,16 @@
{
GlStateManager.disableBlend();
this.fontRendererObj.drawString(I18n.format(creativetabs.getTranslatedTabLabel(), new Object[0]), 8, 6, 4210752);
@@ -414,11 +423,13 @@
@@ -401,7 +423,7 @@
for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray)
{
- if (this.func_147049_a(creativetabs, i, j))
+ if (creativetabs != null && this.func_147049_a(creativetabs, i, j))
{
this.setCurrentCreativeTab(creativetabs);
return;
@@ -414,11 +436,13 @@
private boolean needsScrollBars()
{
@ -55,7 +110,7 @@
int i = selectedTabIndex;
selectedTabIndex = p_147050_1_.getTabIndex();
GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots;
@@ -484,12 +495,14 @@
@@ -484,12 +508,14 @@
if (this.searchField != null)
{
@ -71,7 +126,89 @@
this.updateCreativeSearch();
}
else
@@ -658,6 +671,14 @@
@@ -559,20 +585,43 @@
}
super.drawScreen(mouseX, mouseY, partialTicks);
+ int start = tabPage * 10;
+ int end = Math.min(CreativeTabs.creativeTabArray.length, ((tabPage + 1) * 10) + 2);
+ if (tabPage != 0) start += 2;
+ boolean rendered = false;
- for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray)
+ for (CreativeTabs creativetabs : java.util.Arrays.copyOfRange(CreativeTabs.creativeTabArray,start,end))
{
+ if (creativetabs == null) continue;
if (this.renderCreativeInventoryHoveringText(creativetabs, mouseX, mouseY))
{
+ rendered = true;
break;
}
}
+ if (!rendered && renderCreativeInventoryHoveringText(CreativeTabs.tabAllSearch, mouseX, mouseY))
+ {
+ renderCreativeInventoryHoveringText(CreativeTabs.tabInventory, mouseX, mouseY);
+ }
+
if (this.field_147064_C != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_147064_C.xDisplayPosition, this.field_147064_C.yDisplayPosition, 16, 16, mouseX, mouseY))
{
this.drawCreativeTabHoveringText(I18n.format("inventory.binSlot", new Object[0]), mouseX, mouseY);
}
+ if (maxPages != 0)
+ {
+ String page = String.format("%d / %d", tabPage + 1, maxPages + 1);
+ int width = fontRendererObj.getStringWidth(page);
+ GlStateManager.disableLighting();
+ this.zLevel = 300.0F;
+ itemRender.zLevel = 300.0F;
+ fontRendererObj.drawString(page, guiLeft + (xSize / 2) - (width / 2), guiTop - 44, -1);
+ this.zLevel = 0.0F;
+ itemRender.zLevel = 0.0F;
+ }
+
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
}
@@ -634,16 +683,35 @@
RenderHelper.enableGUIStandardItemLighting();
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex];
- for (CreativeTabs creativetabs1 : CreativeTabs.creativeTabArray)
+ int start = tabPage * 10;
+ int end = Math.min(CreativeTabs.creativeTabArray.length, ((tabPage + 1) * 10 + 2));
+ if (tabPage != 0) start += 2;
+
+ for (CreativeTabs creativetabs1 : java.util.Arrays.copyOfRange(CreativeTabs.creativeTabArray,start,end))
{
this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
+ if (creativetabs1 == null) continue;
if (creativetabs1.getTabIndex() != selectedTabIndex)
{
this.func_147051_a(creativetabs1);
}
}
+ if (tabPage != 0)
+ {
+ if (creativetabs != CreativeTabs.tabAllSearch)
+ {
+ this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
+ func_147051_a(CreativeTabs.tabAllSearch);
+ }
+ if (creativetabs != CreativeTabs.tabInventory)
+ {
+ this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
+ func_147051_a(CreativeTabs.tabInventory);
+ }
+ }
+
this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName()));
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
this.searchField.drawTextBox();
@@ -658,6 +726,14 @@
this.drawTexturedModalRect(i, j + (int)((float)(k - j - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
}
@ -86,7 +223,31 @@
this.func_147051_a(creativetabs);
if (creativetabs == CreativeTabs.tabInventory)
@@ -790,6 +811,15 @@
@@ -668,6 +744,14 @@
protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_)
{
+ if (p_147049_1_.getTabPage() != tabPage)
+ {
+ if (p_147049_1_ != CreativeTabs.tabAllSearch && p_147049_1_ != CreativeTabs.tabInventory)
+ {
+ return false;
+ }
+ }
+
int i = p_147049_1_.getTabColumn();
int j = 28 * i;
int k = 0;
@@ -764,6 +848,8 @@
}
GlStateManager.disableLighting();
+ GlStateManager.color(1F, 1F, 1F); //Forge: Reset color in case Items change it.
+ GlStateManager.enableBlend(); //Forge: Make sure blend is enabled else tabs show a white border.
this.drawTexturedModalRect(l, i1, j, k, 28, j1);
this.zLevel = 100.0F;
this.itemRender.zLevel = 100.0F;
@@ -790,6 +876,15 @@
{
this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter()));
}

View file

@ -13,6 +13,15 @@
if (this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword)
{
return false;
@@ -129,7 +135,7 @@
else
{
world.playAuxSFX(2001, pos, Block.getStateId(iblockstate));
- boolean flag = world.setBlockToAir(pos);
+ boolean flag = block1.removedByPlayer(world, pos, mc.thePlayer, false);
if (flag)
{
@@ -357,11 +363,19 @@
{
if (this.currentGameType != WorldSettings.GameType.SPECTATOR)
@ -46,3 +55,15 @@
}
}
else
@@ -421,9 +437,10 @@
{
playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = itemstack;
- if (itemstack.stackSize == 0)
+ if (itemstack.stackSize <= 0)
{
playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = null;
+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(playerIn, itemstack);
}
return true;

View file

@ -0,0 +1,10 @@
--- ../src-base/minecraft/net/minecraft/client/network/OldServerPinger.java
+++ ../src-work/minecraft/net/minecraft/client/network/OldServerPinger.java
@@ -152,6 +152,7 @@
server.setBase64EncodedIconData((String)null);
}
+ net.minecraftforge.fml.client.FMLClientHandler.instance().bindServerListData(server, serverstatusresponse);
this.field_175092_e = Minecraft.getSystemTime();
networkmanager.sendPacket(new C01PacketPing(this.field_175092_e));
this.field_147403_d = true;

View file

@ -0,0 +1,10 @@
--- ../src-base/minecraft/net/minecraft/client/resources/LanguageManager.java
+++ ../src-work/minecraft/net/minecraft/client/resources/LanguageManager.java
@@ -74,6 +74,7 @@
}
currentLocale.loadLocaleDataFiles(resourceManager, list);
+ net.minecraftforge.fml.common.registry.LanguageRegistry.instance().mergeLanguageTable(currentLocale.properties, this.currentLanguage);
StringTranslate.replaceWith(currentLocale.properties);
}

View file

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/client/resources/Locale.java
+++ ../src-work/minecraft/net/minecraft/client/resources/Locale.java
@@ -96,6 +96,8 @@
private void loadLocaleData(InputStream p_135021_1_) throws IOException
{
+ p_135021_1_ = net.minecraftforge.fml.common.FMLCommonHandler.instance().loadLanguage(properties, p_135021_1_);
+ if (p_135021_1_ == null) return;
for (String s : IOUtils.readLines(p_135021_1_, Charsets.UTF_8))
{
if (!s.isEmpty() && s.charAt(0) != 35)

View file

@ -1,16 +1,17 @@
++++ REJECTED PATCH 1
public void reloadResources(List p_110541_1_)
--- ../src-base/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java
+++ ../src-work/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java
@@ -93,6 +93,7 @@
public void reloadResources(List<IResourcePack> p_110541_1_)
{
this.clearResources();
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar resReload = net.minecraftforge.fml.common.ProgressManager.push("Loading Resources", p_110541_1_.size()+1, true);
logger.info("Reloading ResourceManager: " + joinerResourcePacks.join(Iterables.transform(p_110541_1_, new Function()
logger.info("Reloading ResourceManager: " + joinerResourcePacks.join(Iterables.transform(p_110541_1_, new Function<IResourcePack, String>()
{
private static final String __OBFID = "CL_00001092";
++++ END PATCH
++++ REJECTED PATCH 2
while (iterator.hasNext())
@@ -104,23 +105,32 @@
for (IResourcePack iresourcepack : p_110541_1_)
{
IResourcePack iresourcepack = (IResourcePack)iterator.next();
+ resReload.step(iresourcepack.getPackName());
this.reloadResourcePack(iresourcepack);
}
@ -22,25 +23,21 @@
public void registerReloadListener(IResourceManagerReloadListener p_110542_1_)
{
this.reloadListeners.add(p_110542_1_);
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar resReload = net.minecraftforge.fml.common.ProgressManager.push("Loading Resource", 1);
+ resReload.step(p_110542_1_.getClass());
this.reloadListeners.add(p_110542_1_);
p_110542_1_.onResourceManagerReload(this);
+ net.minecraftforge.fml.common.ProgressManager.pop(resReload);
}
private void notifyReloadListeners()
{
Iterator iterator = this.reloadListeners.iterator();
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar resReload = net.minecraftforge.fml.common.ProgressManager.push("Reloading", this.reloadListeners.size());
while (iterator.hasNext())
for (IResourceManagerReloadListener iresourcemanagerreloadlistener : this.reloadListeners)
{
IResourceManagerReloadListener iresourcemanagerreloadlistener = (IResourceManagerReloadListener)iterator.next();
+ resReload.step(iresourcemanagerreloadlistener.getClass());
iresourcemanagerreloadlistener.onResourceManagerReload(this);
}
+ net.minecraftforge.fml.common.ProgressManager.pop(resReload);
}
}
++++ END PATCH

View file

@ -8,7 +8,19 @@
if (stringToClassMapping.containsKey(p_75618_1_))
{
throw new IllegalArgumentException("ID is already registered: " + p_75618_1_);
@@ -168,7 +169,17 @@
@@ -152,9 +153,10 @@
p_75615_0_.removeTag("Type");
}
+ Class <? extends Entity > oclass = null;
try
{
- Class <? extends Entity > oclass = (Class)stringToClassMapping.get(p_75615_0_.getString("id"));
+ oclass = stringToClassMapping.get(p_75615_0_.getString("id"));
if (oclass != null)
{
@@ -168,7 +170,17 @@
if (entity != null)
{
@ -26,7 +38,7 @@
}
else
{
@@ -344,7 +355,9 @@
@@ -344,7 +356,9 @@
public static class EntityEggInfo
{
@ -36,7 +48,7 @@
public final int primaryColor;
public final int secondaryColor;
public final StatBase field_151512_d;
@@ -358,6 +371,17 @@
@@ -358,6 +372,17 @@
this.secondaryColor = p_i1583_3_;
this.field_151512_d = StatList.getStatKillEntity(this);
this.field_151513_e = StatList.getStatEntityKilledBy(this);

View file

@ -1,5 +1,23 @@
--- ../src-base/minecraft/net/minecraft/entity/EntityLivingBase.java
+++ ../src-work/minecraft/net/minecraft/entity/EntityLivingBase.java
@@ -238,7 +238,7 @@
}
}
- if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase)
+ if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity != null && ridingEntity.shouldDismountInWater(this))
{
this.mountEntity((Entity)null);
}
@@ -320,7 +320,7 @@
if (!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && this.func_146066_aG() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot"))
{
int i = this.getExperiencePoints(this.attackingPlayer);
-
+ i = net.minecraftforge.event.ForgeEventFactory.getExperienceDrop(this, this.attackingPlayer, i);
while (i > 0)
{
int j = EntityXPOrb.getXPSplit(i);
@@ -381,6 +381,7 @@
{
this.entityLivingToAttack = livingBase;
@ -16,7 +34,16 @@
public void removePotionEffectClient(int p_70618_1_)
{
this.activePotionsMap.remove(Integer.valueOf(p_70618_1_));
@@ -733,6 +733,7 @@
@@ -713,6 +713,8 @@
public void heal(float healAmount)
{
+ healAmount = net.minecraftforge.event.ForgeEventFactory.onLivingHeal(this, healAmount);
+ if (healAmount <= 0) return;
float f = this.getHealth();
if (f > 0.0F)
@@ -733,6 +735,7 @@
public boolean attackEntityFrom(DamageSource source, float amount)
{
@ -24,7 +51,7 @@
if (this.isEntityInvulnerable(source))
{
return false;
@@ -798,9 +799,9 @@
@@ -798,9 +801,9 @@
this.recentlyHit = 100;
this.attackingPlayer = (EntityPlayer)entity;
}
@ -36,7 +63,7 @@
if (entitywolf.isTamed())
{
@@ -884,6 +885,7 @@
@@ -884,6 +887,7 @@
public void onDeath(DamageSource cause)
{
@ -44,7 +71,7 @@
Entity entity = cause.getEntity();
EntityLivingBase entitylivingbase = this.func_94060_bK();
@@ -909,6 +911,9 @@
@@ -909,6 +913,9 @@
i = EnchantmentHelper.getLootingModifier((EntityLivingBase)entity);
}
@ -54,7 +81,7 @@
if (this.func_146066_aG() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot"))
{
this.dropFewItems(this.recentlyHit > 0, i);
@@ -919,6 +924,16 @@
@@ -919,6 +926,16 @@
this.addRandomArmor();
}
}
@ -71,7 +98,7 @@
}
this.worldObj.setEntityState(this, (byte)3);
@@ -973,7 +988,7 @@
@@ -973,7 +990,7 @@
int j = MathHelper.floor_double(this.getEntityBoundingBox().minY);
int k = MathHelper.floor_double(this.posZ);
Block block = this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock();
@ -80,7 +107,7 @@
}
public boolean isEntityAlive()
@@ -983,6 +998,9 @@
@@ -983,6 +1000,9 @@
public void fall(float distance, float damageMultiplier)
{
@ -90,7 +117,7 @@
super.fall(distance, damageMultiplier);
PotionEffect potioneffect = this.getActivePotionEffect(Potion.jump);
float f = potioneffect != null ? (float)(potioneffect.getAmplifier() + 1) : 0.0F;
@@ -1095,6 +1113,8 @@
@@ -1095,6 +1115,8 @@
{
if (!this.isEntityInvulnerable(damageSrc))
{
@ -99,7 +126,7 @@
damageAmount = this.applyArmorCalculations(damageSrc, damageAmount);
damageAmount = this.applyPotionDamageCalculations(damageSrc, damageAmount);
float f = damageAmount;
@@ -1143,6 +1163,11 @@
@@ -1143,6 +1165,11 @@
public void swingItem()
{
@ -111,7 +138,7 @@
if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0)
{
this.swingProgressInt = -1;
@@ -1282,6 +1307,7 @@
@@ -1282,6 +1309,7 @@
public void dismountEntity(Entity p_110145_1_)
{
@ -119,7 +146,7 @@
double d0 = p_110145_1_.posX;
double d1 = p_110145_1_.getEntityBoundingBox().minY + (double)p_110145_1_.height;
double d2 = p_110145_1_.posZ;
@@ -1347,6 +1373,7 @@
@@ -1347,6 +1375,7 @@
}
this.isAirBorne = true;
@ -127,7 +154,7 @@
}
protected void updateAITick()
@@ -1531,6 +1558,7 @@
@@ -1531,6 +1560,7 @@
public void onUpdate()
{
@ -135,7 +162,7 @@
super.onUpdate();
if (!this.worldObj.isRemote)
@@ -1819,6 +1847,7 @@
@@ -1819,6 +1849,7 @@
public void mountEntity(Entity entityIn)
{
@ -143,7 +170,7 @@
if (this.ridingEntity != null && entityIn == null)
{
if (!this.worldObj.isRemote)
@@ -2000,4 +2029,39 @@
@@ -2000,4 +2031,39 @@
{
this.potionsNeedUpdate = true;
}

View file

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/entity/boss/EntityWither.java
+++ ../src-work/minecraft/net/minecraft/entity/boss/EntityWither.java
@@ -345,7 +345,7 @@
BlockPos blockpos = new BlockPos(i3, k, l);
Block block = this.worldObj.getBlockState(blockpos).getBlock();
- if (block.getMaterial() != Material.air && func_181033_a(block))
+ if (!block.isAir(worldObj,blockpos) && func_181033_a(block) && block.canEntityDestroy(worldObj, blockpos, this))
{
flag = this.worldObj.destroyBlock(blockpos, true) || flag;
}

View file

@ -51,7 +51,19 @@
{
this.func_180460_a(blockpos, iblockstate);
@@ -368,6 +384,7 @@
@@ -349,7 +365,10 @@
this.setRotation(this.rotationYaw, this.rotationPitch);
- for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)))
+ AxisAlignedBB box;
+ if (getCollisionHandler() != null) box = getCollisionHandler().getMinecartCollisionBox(this);
+ else box = this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D);
+ for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box))
{
if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityMinecart)
{
@@ -368,6 +387,7 @@
}
this.handleWaterMovement();
@ -59,7 +71,7 @@
}
}
@@ -382,10 +399,21 @@
@@ -382,10 +402,21 @@
protected void moveDerailedMinecart()
{
@ -82,7 +94,7 @@
if (this.onGround)
{
this.motionX *= 0.5D;
@@ -393,13 +421,13 @@
@@ -393,13 +424,13 @@
this.motionZ *= 0.5D;
}
@ -100,7 +112,38 @@
}
}
@@ -482,7 +510,7 @@
@@ -419,25 +450,25 @@
flag1 = !flag;
}
- double d0 = 0.0078125D;
+ double slopeAdjustment = getSlopeAdjustment();
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_180460_2_.getValue(blockrailbase.getShapeProperty());
switch (blockrailbase$enumraildirection)
{
case ASCENDING_EAST:
- this.motionX -= 0.0078125D;
+ this.motionX -= slopeAdjustment;
++this.posY;
break;
case ASCENDING_WEST:
- this.motionX += 0.0078125D;
+ this.motionX += slopeAdjustment;
++this.posY;
break;
case ASCENDING_NORTH:
- this.motionZ += 0.0078125D;
+ this.motionZ += slopeAdjustment;
++this.posY;
break;
case ASCENDING_SOUTH:
- this.motionZ -= 0.0078125D;
+ this.motionZ -= slopeAdjustment;
++this.posY;
}
@@ -482,7 +513,7 @@
}
}
@ -109,7 +152,29 @@
{
double d17 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
@@ -578,8 +606,14 @@
@@ -528,20 +559,8 @@
this.posX = d19 + d1 * d18;
this.posZ = d20 + d2 * d18;
this.setPosition(this.posX, this.posY, this.posZ);
- double d22 = this.motionX;
- double d23 = this.motionZ;
+ this.moveMinecartOnRail(p_180460_1_);
- if (this.riddenByEntity != null)
- {
- d22 *= 0.75D;
- d23 *= 0.75D;
- }
-
- double d13 = this.func_174898_m();
- d22 = MathHelper.clamp_double(d22, -d13, d13);
- d23 = MathHelper.clamp_double(d23, -d13, d13);
- this.moveEntity(d22, 0.0D, d23);
-
if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - p_180460_1_.getX() == aint[0][0] && MathHelper.floor_double(this.posZ) - p_180460_1_.getZ() == aint[0][2])
{
this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ);
@@ -578,8 +597,14 @@
this.motionZ = d5 * (double)(i - p_180460_1_.getZ());
}
@ -125,7 +190,7 @@
double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (d15 > 0.01D)
@@ -818,13 +852,20 @@
@@ -818,13 +843,20 @@
public void applyEntityCollision(Entity entityIn)
{
@ -147,7 +212,7 @@
{
entityIn.mountEntity(this);
}
@@ -870,7 +911,7 @@
@@ -870,7 +902,7 @@
double d7 = entityIn.motionX + this.motionX;
double d8 = entityIn.motionZ + this.motionZ;
@ -156,7 +221,7 @@
{
this.motionX *= 0.20000000298023224D;
this.motionZ *= 0.20000000298023224D;
@@ -878,7 +919,7 @@
@@ -878,7 +910,7 @@
entityIn.motionX *= 0.949999988079071D;
entityIn.motionZ *= 0.949999988079071D;
}
@ -165,7 +230,7 @@
{
entityIn.motionX *= 0.20000000298023224D;
entityIn.motionZ *= 0.20000000298023224D;
@@ -1043,6 +1084,221 @@
@@ -1043,6 +1075,221 @@
}
}

View file

@ -27,7 +27,25 @@
{
this.closeScreen();
this.openContainer = this.inventoryContainer;
@@ -425,6 +426,7 @@
@@ -265,7 +266,8 @@
if (chunk.isPopulated())
{
list.add(chunk);
- list1.addAll(((WorldServer)this.worldObj).func_147486_a(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 16, 256, chunkcoordintpair.chunkZPos * 16 + 16));
+ list1.addAll(((WorldServer)this.worldObj).func_147486_a(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 16, 256, chunkcoordintpair.chunkZPos * 16 + 15));
+ //BugFix: 16 makes it load an extra chunk, which isn't associated with a player, which makes it not unload unless a player walks near it.
iterator1.remove();
}
}
@@ -295,6 +297,7 @@
for (Chunk chunk1 : list)
{
this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk1);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.Watch(chunk1.getChunkCoordIntPair(), this));
}
}
}
@@ -425,6 +428,7 @@
public void onDeath(DamageSource cause)
{
@ -35,7 +53,7 @@
if (this.worldObj.getGameRules().getGameRuleBooleanValue("showDeathMessages"))
{
Team team = this.getTeam();
@@ -448,7 +450,20 @@
@@ -448,7 +452,20 @@
if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory"))
{
@ -56,7 +74,15 @@
}
for (ScoreObjective scoreobjective : this.worldObj.getScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.deathCount))
@@ -832,6 +847,7 @@
@@ -462,6 +479,7 @@
if (entitylivingbase != null)
{
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entitylivingbase)));
+ if (entitylist$entityegginfo == null) entitylist$entityegginfo = net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(EntityList.getEntityString(entitylivingbase));
if (entitylist$entityegginfo != null)
{
@@ -832,6 +850,7 @@
{
if (stat != null)
{

View file

@ -1,14 +0,0 @@
++++ REJECTED PATCH 2
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
this.mc.fontRendererObj.drawStringWithShadow(this.currentlyDisplayedText, (float)((l - this.mc.fontRendererObj.getStringWidth(this.currentlyDisplayedText)) / 2), (float)(i1 / 2 - 4 - 16), 16777215);
this.mc.fontRendererObj.drawStringWithShadow(this.message, (float)((l - this.mc.fontRendererObj.getStringWidth(this.message)) / 2), (float)(i1 / 2 - 4 + 8), 16777215);
+ }
+ }
+ catch (java.io.IOException e)
+ {
+ com.google.common.base.Throwables.propagate(e);
+ } //FML End
this.framebuffer.unbindFramebuffer();
if (OpenGlHelper.isFramebufferEnabled())
++++ END PATCH

View file

@ -1,240 +0,0 @@
++++ REJECTED PATCH 9
{
while (!this.scheduledTasks.isEmpty())
{
- ((FutureTask)this.scheduledTasks.poll()).run();
+ net.minecraftforge.fml.common.FMLCommonHandler.callFuture(((FutureTask)this.scheduledTasks.poll()));
}
}
++++ END PATCH
++++ REJECTED PATCH 10
if (!this.skipRenderWorld)
{
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickStart(this.timer.renderPartialTicks);
this.mcProfiler.endStartSection("gameRenderer");
this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks);
this.mcProfiler.endSection();
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickEnd(this.timer.renderPartialTicks);
}
this.mcProfiler.endSection();
++++ END PATCH
++++ REJECTED PATCH 12
case 2:
BlockPos blockpos = this.objectMouseOver.getBlockPos();
- if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air)
+ if (!this.theWorld.isAirBlock(blockpos))
{
int i = itemstack != null ? itemstack.stackSize : 0;
+
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, this.theWorld, blockpos, this.objectMouseOver.sideHit).isCanceled();
+ if (result) { //Forge: Kept separate to simplify patch
if (this.playerController.func_178890_a(this.thePlayer, this.theWorld, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec))
{
flag = false;
this.thePlayer.swingItem();
}
+ }
if (itemstack == null)
{
++++ END PATCH
++++ REJECTED PATCH 13
{
ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem();
- if (itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, theWorld, null, null).isCanceled();
+ if (result && itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
{
this.entityRenderer.itemRenderer.resetEquippedProgress2();
}
++++ END PATCH
++++ REJECTED PATCH 15
while (Mouse.next())
{
+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;
+
i = Mouse.getEventButton();
KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState());
++++ END PATCH
++++ REJECTED PATCH 19
while (!this.theIntegratedServer.serverIsInRunLoop())
{
+ if (!net.minecraftforge.fml.common.StartupQuery.check())
+ {
+ loadWorld(null);
+ displayGuiScreen(null);
+ return;
+ }
String s2 = this.theIntegratedServer.getUserMessage();
if (s2 != null)
++++ END PATCH
++++ REJECTED PATCH 24
if (this.objectMouseOver != null)
{
boolean flag = this.thePlayer.capabilities.isCreativeMode;
- int i = 0;
- boolean flag1 = false;
- TileEntity tileentity = null;
- Object object;
- if (this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
- {
- BlockPos blockpos = this.objectMouseOver.getBlockPos();
- Block block = this.theWorld.getBlockState(blockpos).getBlock();
-
- if (block.getMaterial() == Material.air)
- {
- return;
- }
-
- object = block.getItem(this.theWorld, blockpos);
-
- if (object == null)
- {
- return;
- }
-
- if (flag && GuiScreen.isCtrlKeyDown())
- {
- tileentity = this.theWorld.getTileEntity(blockpos);
- }
-
- Block block1 = object instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem((Item)object) : block;
- i = block1.getDamageValue(this.theWorld, blockpos);
- flag1 = ((Item)object).getHasSubtypes();
- }
- else
- {
- if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag)
- {
- return;
- }
-
- if (this.objectMouseOver.entityHit instanceof EntityPainting)
- {
- object = Items.painting;
- }
- else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot)
- {
- object = Items.lead;
- }
- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame)
- {
- EntityItemFrame entityitemframe = (EntityItemFrame)this.objectMouseOver.entityHit;
- ItemStack itemstack = entityitemframe.getDisplayedItem();
-
- if (itemstack == null)
- {
- object = Items.item_frame;
- }
- else
- {
- object = itemstack.getItem();
- i = itemstack.getMetadata();
- flag1 = true;
- }
- }
- else if (this.objectMouseOver.entityHit instanceof EntityMinecart)
- {
- EntityMinecart entityminecart = (EntityMinecart)this.objectMouseOver.entityHit;
-
- switch (Minecraft.SwitchEnumMinecartType.field_178901_b[entityminecart.getMinecartType().ordinal()])
- {
- case 1:
- object = Items.furnace_minecart;
- break;
- case 2:
- object = Items.chest_minecart;
- break;
- case 3:
- object = Items.tnt_minecart;
- break;
- case 4:
- object = Items.hopper_minecart;
- break;
- case 5:
- object = Items.command_block_minecart;
- break;
- default:
- object = Items.minecart;
- }
- }
- else if (this.objectMouseOver.entityHit instanceof EntityBoat)
- {
- object = Items.boat;
- }
- else if (this.objectMouseOver.entityHit instanceof EntityArmorStand)
- {
- object = Items.armor_stand;
- }
- else
- {
- object = Items.spawn_egg;
- i = EntityList.getEntityID(this.objectMouseOver.entityHit);
- flag1 = true;
-
- if (!EntityList.entityEggs.containsKey(Integer.valueOf(i)))
- {
- return;
- }
- }
- }
-
InventoryPlayer inventoryplayer = this.thePlayer.inventory;
- if (tileentity == null)
- {
- inventoryplayer.setCurrentItem((Item)object, i, flag1, flag);
- }
- else
- {
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
- tileentity.writeToNBT(nbttagcompound1);
- ItemStack itemstack1 = new ItemStack((Item)object, 1, i);
- itemstack1.setTagInfo("BlockEntityTag", nbttagcompound1);
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- NBTTagList nbttaglist = new NBTTagList();
- nbttaglist.appendTag(new NBTTagString("(+NBT)"));
- nbttagcompound.setTag("Lore", nbttaglist);
- itemstack1.setTagInfo("display", nbttagcompound);
- inventoryplayer.setInventorySlotContents(inventoryplayer.currentItem, itemstack1);
- }
-
+ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld)) return;
+ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions
if (flag)
{
int j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + inventoryplayer.currentItem;
++++ END PATCH
++++ REJECTED PATCH 25
public static int getGLMaximumTextureSize()
{
- for (int i = 16384; i > 0; i >>= 1)
- {
- GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null);
- int j = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
-
- if (j != 0)
- {
- return i;
- }
- }
-
- return -1;
+ //Forge we redirect this to our code which caches the value before any splash screen stuff is done.
+ return net.minecraftforge.fml.client.SplashProgress.getMaxTextureSize();
}
public boolean isSnooperEnabled()
++++ END PATCH

View file

@ -1,171 +0,0 @@
++++ REJECTED PATCH 2
return;
}
- if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2))
+ if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2) && ItemStack.areItemStackTagsEqual(itemstack1, itemstack2)) //Forge: Bugfix, Compare NBT data, allow for deletion of enchanted books, MC-12770
{
if (clickedButton == 0)
{
++++ END PATCH
++++ REJECTED PATCH 5
{
GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots;
containercreative.itemList.clear();
+
+ CreativeTabs tab = CreativeTabs.creativeTabArray[selectedTabIndex];
+ if (tab.hasSearchBar() && tab != CreativeTabs.tabAllSearch)
+ {
+ tab.displayAllReleventItems(containercreative.itemList);
+ updateFilteredItems(containercreative);
+ return;
+ }
+
Iterator iterator = Item.itemRegistry.iterator();
while (iterator.hasNext())
++++ END PATCH
++++ REJECTED PATCH 6
item.getSubItems(item, (CreativeTabs)null, containercreative.itemList);
}
}
+ updateFilteredItems(containercreative);
+ }
+ //split from above for custom search tabs
+ private void updateFilteredItems(GuiContainerCreative.ContainerCreative containercreative)
+ {
+ Iterator iterator;
Enchantment[] aenchantment = Enchantment.enchantmentsBookList;
int j = aenchantment.length;
+ if (CreativeTabs.creativeTabArray[selectedTabIndex] != CreativeTabs.tabAllSearch) j = 0; //Forge: Don't add enchants to custom tabs.
for (int i = 0; i < j; ++i)
{
Enchantment enchantment = aenchantment[i];
++++ END PATCH
++++ REJECTED PATCH 8
{
CreativeTabs creativetabs = acreativetabs[k1];
- if (this.func_147049_a(creativetabs, l, i1))
+ if (creativetabs != null && this.func_147049_a(creativetabs, l, i1))
{
this.setCurrentCreativeTab(creativetabs);
return;
++++ END PATCH
++++ REJECTED PATCH 11
super.drawScreen(mouseX, mouseY, partialTicks);
CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray;
- int i2 = acreativetabs.length;
+ int start = tabPage * 10;
+ int i2 = Math.min(acreativetabs.length, ((tabPage + 1) * 10) + 2);
+ if (tabPage != 0) start += 2;
+ boolean rendered = false;
- for (int j2 = 0; j2 < i2; ++j2)
+ for (int j2 = start; j2 < i2; ++j2)
{
CreativeTabs creativetabs = acreativetabs[j2];
+ if (creativetabs == null) continue;
if (this.renderCreativeInventoryHoveringText(creativetabs, mouseX, mouseY))
{
+ rendered = true;
break;
}
}
+ if (!rendered && renderCreativeInventoryHoveringText(CreativeTabs.tabAllSearch, mouseX, mouseY))
+ {
+ renderCreativeInventoryHoveringText(CreativeTabs.tabInventory, mouseX, mouseY);
+ }
+
if (this.field_147064_C != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_147064_C.xDisplayPosition, this.field_147064_C.yDisplayPosition, 16, 16, mouseX, mouseY))
{
this.drawCreativeTabHoveringText(I18n.format("inventory.binSlot", new Object[0]), mouseX, mouseY);
}
+ if (maxPages != 0)
+ {
+ String page = String.format("%d / %d", tabPage + 1, maxPages + 1);
+ int width = fontRendererObj.getStringWidth(page);
+ GlStateManager.disableLighting();
+ this.zLevel = 300.0F;
+ itemRender.zLevel = 300.0F;
+ fontRendererObj.drawString(page, guiLeft + (xSize / 2) - (width / 2), guiTop - 44, -1);
+ this.zLevel = 0.0F;
+ itemRender.zLevel = 0.0F;
+ }
+
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
}
++++ END PATCH
++++ REJECTED PATCH 12
int k = acreativetabs.length;
int l;
- for (l = 0; l < k; ++l)
+ int start = tabPage * 10;
+ k = Math.min(acreativetabs.length, ((tabPage + 1) * 10 + 2));
+ if (tabPage != 0) start += 2;
+
+ for (l = start; l < k; ++l)
{
CreativeTabs creativetabs1 = acreativetabs[l];
this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
+ if (creativetabs1 == null) continue;
if (creativetabs1.getTabIndex() != selectedTabIndex)
{
this.func_147051_a(creativetabs1);
}
}
+ if (tabPage != 0)
+ {
+ if (creativetabs != CreativeTabs.tabAllSearch)
+ {
+ this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
+ func_147051_a(CreativeTabs.tabAllSearch);
+ }
+ if (creativetabs != CreativeTabs.tabInventory)
+ {
+ this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
+ func_147051_a(CreativeTabs.tabInventory);
+ }
+ }
+
this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName()));
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
this.searchField.drawTextBox();
++++ END PATCH
++++ REJECTED PATCH 14
protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_)
{
+ if (p_147049_1_.getTabPage() != tabPage)
+ {
+ if (p_147049_1_ != CreativeTabs.tabAllSearch &&
+ p_147049_1_ != CreativeTabs.tabInventory)
+ {
+ return false;
+ }
+ }
+
int k = p_147049_1_.getTabColumn();
int l = 28 * k;
byte b0 = 0;
++++ END PATCH
++++ REJECTED PATCH 15
}
GlStateManager.disableLighting();
+ GlStateManager.color(1F, 1F, 1F); //Forge: Reset color in case Items change it.
+ GlStateManager.enableBlend(); //Forge: Make sure blend is enabled else tabs show a white border.
this.drawTexturedModalRect(l, i1, j, k, 28, b0);
this.zLevel = 100.0F;
this.itemRender.zLevel = 100.0F;
++++ END PATCH

View file

@ -1,23 +0,0 @@
++++ REJECTED PATCH 2
else
{
worldclient.playAuxSFX(2001, pos, Block.getStateId(iblockstate));
- boolean flag = worldclient.setBlockToAir(pos);
+ boolean flag = block1.removedByPlayer(worldclient, pos, mc.thePlayer, false);
if (flag)
{
++++ END PATCH
++++ REJECTED PATCH 5
{
playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = itemstack1;
- if (itemstack1.stackSize == 0)
+ if (itemstack1.stackSize <= 0)
{
playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = null;
+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(playerIn, itemstack1);
}
return true;
++++ END PATCH

View file

@ -1,11 +0,0 @@
++++ REJECTED PATCH 2
public void handleSpawnExperienceOrb(S11PacketSpawnExperienceOrb packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
- EntityXPOrb entityxporb = new EntityXPOrb(this.clientWorldController, (double)packetIn.func_148984_d(), (double)packetIn.func_148983_e(), (double)packetIn.func_148982_f(), packetIn.func_148986_g());
+ EntityXPOrb entityxporb = new EntityXPOrb(this.clientWorldController, (double)packetIn.func_148984_d() / 32.0D, (double)packetIn.func_148983_e() / 32.0D, (double)packetIn.func_148982_f() / 32.0D, packetIn.func_148986_g());
+ // FORGE: BugFix MC-12013 Wrong XP orb clientside spawn position
entityxporb.serverPosX = packetIn.func_148984_d();
entityxporb.serverPosY = packetIn.func_148983_e();
entityxporb.serverPosZ = packetIn.func_148982_f();
++++ END PATCH

View file

@ -1,9 +0,0 @@
++++ REJECTED PATCH 1
server.setBase64EncodedIconData((String)null);
}
+ net.minecraftforge.fml.client.FMLClientHandler.instance().bindServerListData(server, serverstatusresponse);
this.field_175092_e = Minecraft.getSystemTime();
networkmanager.sendPacket(new C01PacketPing(this.field_175092_e));
this.field_147403_d = true;
++++ END PATCH

View file

@ -1,9 +0,0 @@
++++ REJECTED PATCH 1
}
currentLocale.loadLocaleDataFiles(resourceManager, arraylist);
+ net.minecraftforge.fml.common.registry.LanguageRegistry.instance().mergeLanguageTable(currentLocale.properties, this.currentLanguage);
StringTranslate.replaceWith(currentLocale.properties);
}
++++ END PATCH

View file

@ -1,10 +0,0 @@
++++ REJECTED PATCH 1
private void loadLocaleData(InputStream p_135021_1_) throws IOException
{
+ p_135021_1_ = net.minecraftforge.fml.common.FMLCommonHandler.instance().loadLanguage(properties, p_135021_1_);
+ if (p_135021_1_ == null) return;
Iterator iterator = IOUtils.readLines(p_135021_1_, Charsets.UTF_8).iterator();
while (iterator.hasNext())
++++ END PATCH

View file

@ -1,12 +0,0 @@
++++ REJECTED PATCH 1
if (hashmap.isEmpty() && p_152790_1_.getId().equals(Minecraft.getMinecraft().getSession().getProfile().getId()))
{
- hashmap.putAll(SkinManager.this.sessionService.getTextures(SkinManager.this.sessionService.fillProfileProperties(p_152790_1_, false), false));
+ // FORGE: Use already filled profile from session rather
+ // than getting rate limited by filling the input profile
+ hashmap.putAll(SkinManager.this.sessionService.getTextures(Minecraft.getMinecraft().getSession().getProfile(), false));
}
Minecraft.getMinecraft().addScheduledTask(new Runnable()
++++ END PATCH

View file

@ -1,13 +0,0 @@
++++ REJECTED PATCH 2
p_75615_0_.removeTag("Type");
}
+ Class oclass = null;
try
{
- Class oclass = (Class)stringToClassMapping.get(p_75615_0_.getString("id"));
+ oclass = (Class)stringToClassMapping.get(p_75615_0_.getString("id"));
if (oclass != null)
{
++++ END PATCH

View file

@ -1,30 +0,0 @@
++++ REJECTED PATCH 1
}
}
- if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase)
+ if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity != null && ridingEntity.shouldDismountInWater(this))
{
this.mountEntity((Entity)null);
}
++++ END PATCH
++++ REJECTED PATCH 2
if (!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && this.func_146066_aG() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot"))
{
i = this.getExperiencePoints(this.attackingPlayer);
-
+ i = net.minecraftforge.event.ForgeEventFactory.getExperienceDrop(this, this.attackingPlayer, i);
while (i > 0)
{
int j = EntityXPOrb.getXPSplit(i);
++++ END PATCH
++++ REJECTED PATCH 5
public void heal(float healAmount)
{
+ healAmount = net.minecraftforge.event.ForgeEventFactory.onLivingHeal(this, healAmount);
+ if (healAmount <= 0) return;
float f1 = this.getHealth();
if (f1 > 0.0F)
++++ END PATCH

View file

@ -1,10 +0,0 @@
++++ REJECTED PATCH 1
int l = j1 + i2;
Block block = this.worldObj.getBlockState(new BlockPos(j2, k, l)).getBlock();
- if (block.getMaterial() != Material.air && block != Blocks.bedrock && block != Blocks.end_portal && block != Blocks.end_portal_frame && block != Blocks.command_block && block != Blocks.barrier)
+ if (!block.isAir(worldObj, new BlockPos(j2, k, l)) && block.canEntityDestroy(worldObj, new BlockPos(j2, k, l), this))
{
flag = this.worldObj.destroyBlock(new BlockPos(j2, k, l), true) || flag;
}
++++ END PATCH

View file

@ -1,68 +0,0 @@
++++ REJECTED PATCH 4
}
this.setRotation(this.rotationYaw, this.rotationPitch);
- Iterator iterator = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)).iterator();
+ AxisAlignedBB box;
+ if (getCollisionHandler() != null) box = this.getCollisionHandler().getMinecartCollisionBox(this);
+ else box = this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D);
+ Iterator iterator = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box).iterator();
while (iterator.hasNext())
{
++++ END PATCH
++++ REJECTED PATCH 8
flag1 = !flag;
}
- double d0 = 0.0078125D;
+ double slopeAdjustment = getSlopeAdjustment();
BlockRailBase.EnumRailDirection enumraildirection = (BlockRailBase.EnumRailDirection)p_180460_2_.getValue(blockrailbase.getShapeProperty());
switch (EntityMinecart.SwitchEnumMinecartType.RAIL_SHAPE_LOOKUP[enumraildirection.ordinal()])
{
case 1:
- this.motionX -= 0.0078125D;
+ this.motionX -= slopeAdjustment;
++this.posY;
break;
case 2:
- this.motionX += 0.0078125D;
+ this.motionX += slopeAdjustment;
++this.posY;
break;
case 3:
- this.motionZ += 0.0078125D;
+ this.motionZ += slopeAdjustment;
++this.posY;
break;
case 4:
- this.motionZ -= 0.0078125D;
+ this.motionZ -= slopeAdjustment;
++this.posY;
}
++++ END PATCH
++++ REJECTED PATCH 10
this.posX = d7 + d1 * d6;
this.posZ = d8 + d2 * d6;
this.setPosition(this.posX, this.posY, this.posZ);
- d11 = this.motionX;
- d12 = this.motionZ;
+ this.moveMinecartOnRail(p_180460_1_);
- if (this.riddenByEntity != null)
- {
- d11 *= 0.75D;
- d12 *= 0.75D;
- }
-
- double d13 = this.func_174898_m();
- d11 = MathHelper.clamp_double(d11, -d13, d13);
- d12 = MathHelper.clamp_double(d12, -d13, d13);
- this.moveEntity(d11, 0.0D, d12);
-
if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - p_180460_1_.getX() == aint[0][0] && MathHelper.floor_double(this.posZ) - p_180460_1_.getZ() == aint[0][2])
{
this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ);
++++ END PATCH

View file

@ -1,29 +0,0 @@
++++ REJECTED PATCH 3
if (chunk.isPopulated())
{
arraylist.add(chunk);
- arraylist1.addAll(((WorldServer)this.worldObj).func_147486_a(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 16, 256, chunkcoordintpair.chunkZPos * 16 + 16));
+ arraylist1.addAll(((WorldServer)this.worldObj).func_147486_a(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 15, 256, chunkcoordintpair.chunkZPos * 16 + 15));
+ //BugFix: 16 makes it load an extra chunk, which isn't associated with a player, which makes it not unload unless a player walks near it.
iterator1.remove();
}
}
++++ END PATCH
++++ REJECTED PATCH 4
{
chunk = (Chunk)iterator2.next();
this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.Watch(chunk.getChunkCoordIntPair(), this));
}
}
}
++++ END PATCH
++++ REJECTED PATCH 7
if (entitylivingbase != null)
{
EntityList.EntityEggInfo entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entitylivingbase)));
+ if (entityegginfo == null) entityegginfo = net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(EntityList.getEntityString(entitylivingbase));
if (entityegginfo != null)
{
++++ END PATCH

View file

@ -24,10 +24,18 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLeashKnot;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityItemFrame;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.item.EntityPainting;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.event.ClickEvent;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@ -38,6 +46,7 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemBucket;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemSpade;
@ -249,6 +258,127 @@ public class ForgeHooks
*/
public static boolean onPickBlock(MovingObjectPosition target, EntityPlayer player, World world)
{
/*
int i = 0;
boolean flag1 = false;
TileEntity tileentity = null;
Item item;
if (this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
BlockPos blockpos = this.objectMouseOver.getBlockPos();
Block block = this.theWorld.getBlockState(blockpos).getBlock();
if (block.getMaterial() == Material.air)
{
return;
}
item = block.getItem(this.theWorld, blockpos);
if (item == null)
{
return;
}
if (flag && GuiScreen.isCtrlKeyDown())
{
tileentity = this.theWorld.getTileEntity(blockpos);
}
Block block1 = item instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem(item) : block;
i = block1.getDamageValue(this.theWorld, blockpos);
flag1 = item.getHasSubtypes();
}
else
{
if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag)
{
return;
}
if (this.objectMouseOver.entityHit instanceof EntityPainting)
{
item = Items.painting;
}
else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot)
{
item = Items.lead;
}
else if (this.objectMouseOver.entityHit instanceof EntityItemFrame)
{
EntityItemFrame entityitemframe = (EntityItemFrame)this.objectMouseOver.entityHit;
ItemStack itemstack = entityitemframe.getDisplayedItem();
if (itemstack == null)
{
item = Items.item_frame;
}
else
{
item = itemstack.getItem();
i = itemstack.getMetadata();
flag1 = true;
}
}
else if (this.objectMouseOver.entityHit instanceof EntityMinecart)
{
EntityMinecart entityminecart = (EntityMinecart)this.objectMouseOver.entityHit;
switch (entityminecart.getMinecartType())
{
case FURNACE:
item = Items.furnace_minecart;
break;
case CHEST:
item = Items.chest_minecart;
break;
case TNT:
item = Items.tnt_minecart;
break;
case HOPPER:
item = Items.hopper_minecart;
break;
case COMMAND_BLOCK:
item = Items.command_block_minecart;
break;
default:
item = Items.minecart;
}
}
else if (this.objectMouseOver.entityHit instanceof EntityBoat)
{
item = Items.boat;
}
else if (this.objectMouseOver.entityHit instanceof EntityArmorStand)
{
item = Items.armor_stand;
}
else
{
item = Items.spawn_egg;
i = EntityList.getEntityID(this.objectMouseOver.entityHit);
flag1 = true;
if (!EntityList.entityEggs.containsKey(Integer.valueOf(i)))
{
return;
}
}
}
InventoryPlayer inventoryplayer = this.thePlayer.inventory;
if (tileentity == null)
{
inventoryplayer.setCurrentItem(item, i, flag1, flag);
}
else
{
ItemStack itemstack1 = this.func_181036_a(item, i, tileentity);
inventoryplayer.setInventorySlotContents(inventoryplayer.currentItem, itemstack1);
}
*/
ItemStack result = null;
boolean isCreative = player.capabilities.isCreativeMode;
TileEntity te = null;