Merge remote-tracking branch 'origin/snapshot15'
This commit is contained in:
commit
14c362196e
|
@ -1,8 +1,7 @@
|
|||
*.DS_Store
|
||||
/fml/
|
||||
/logs/
|
||||
/*.pyc
|
||||
/forge-*/
|
||||
/patches-old/
|
||||
/mcp/
|
||||
/eclipse/
|
||||
/eclipse/
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "fml"]
|
||||
path = fml
|
||||
url = https://github.com/MinecraftForge/FML.git
|
|
@ -1,6 +0,0 @@
|
|||
These files are taken from the GnuWin32 page, for simplicity's sake.
|
||||
Honestly, I dont understand why windows doesn't have the equivently of these programs, but whatever.
|
||||
These are only used in the git repo, and not in the released version, so they are not shipped anywhere outside the git.
|
||||
|
||||
http://gnuwin32.sourceforge.net/packages/wget.htm
|
||||
http://gnuwin32.sourceforge.net/packages/unzip.htm
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -35,188 +35,10 @@ import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*;
|
|||
|
||||
public class ForgeHooksClient
|
||||
{
|
||||
private static class TesKey implements Comparable<TesKey>
|
||||
{
|
||||
public final int texture, subid;
|
||||
public TesKey(int textureID, int subID)
|
||||
{
|
||||
texture = textureID;
|
||||
subid = subID;
|
||||
}
|
||||
|
||||
public int compareTo(TesKey key)
|
||||
{
|
||||
if (subid == key.subid)
|
||||
{
|
||||
return texture - key.texture;
|
||||
}
|
||||
return subid - key.subid;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
return compareTo((TesKey)obj) == 0;
|
||||
}
|
||||
|
||||
public int hashCode()
|
||||
{
|
||||
return texture + 31 * subid;
|
||||
}
|
||||
}
|
||||
|
||||
public static HashMap<TesKey, Tessellator> tessellators = new HashMap<TesKey, Tessellator>();
|
||||
public static HashMap<String, Integer> textures = new HashMap<String, Integer>();
|
||||
public static TreeSet<TesKey> renderTextures = new TreeSet<TesKey>();
|
||||
public static Tessellator defaultTessellator = null;
|
||||
public static boolean inWorld = false;
|
||||
public static HashMap<TesKey, IRenderContextHandler> renderHandlers = new HashMap<TesKey, IRenderContextHandler>();
|
||||
public static IRenderContextHandler unbindContext = null;
|
||||
|
||||
protected static void registerRenderContextHandler(String texture, int subID, IRenderContextHandler handler)
|
||||
{
|
||||
Integer texID = textures.get(texture);
|
||||
if (texID == null)
|
||||
{
|
||||
texID = engine().getTexture(texture);
|
||||
textures.put(texture, texID);
|
||||
}
|
||||
renderHandlers.put(new TesKey(texID, subID), handler);
|
||||
}
|
||||
|
||||
static RenderEngine engine()
|
||||
{
|
||||
return FMLClientHandler.instance().getClient().renderEngine;
|
||||
}
|
||||
public static void bindTexture(String texture, int subID)
|
||||
{
|
||||
Integer texID = textures.get(texture);
|
||||
if (texID == null)
|
||||
{
|
||||
texID = engine().getTexture(texture);
|
||||
textures.put(texture, texID);
|
||||
}
|
||||
if (!inWorld)
|
||||
{
|
||||
if (unbindContext != null)
|
||||
{
|
||||
unbindContext.afterRenderContext();
|
||||
unbindContext = null;
|
||||
}
|
||||
if (Tessellator.instance.isDrawing)
|
||||
{
|
||||
int mode = Tessellator.instance.drawMode;
|
||||
Tessellator.instance.draw();
|
||||
Tessellator.instance.startDrawing(mode);
|
||||
}
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texID);
|
||||
unbindContext = renderHandlers.get(new TesKey(texID, subID));
|
||||
if (unbindContext != null)
|
||||
{
|
||||
unbindContext.beforeRenderContext();
|
||||
}
|
||||
return;
|
||||
}
|
||||
bindTessellator(texID, subID);
|
||||
}
|
||||
|
||||
public static void unbindTexture()
|
||||
{
|
||||
if (inWorld)
|
||||
{
|
||||
Tessellator.instance = defaultTessellator;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Tessellator.instance.isDrawing)
|
||||
{
|
||||
int mode = Tessellator.instance.drawMode;
|
||||
Tessellator.instance.draw();
|
||||
if (unbindContext != null)
|
||||
{
|
||||
unbindContext.afterRenderContext();
|
||||
unbindContext = null;
|
||||
}
|
||||
Tessellator.instance.startDrawing(mode);
|
||||
}
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, engine().getTexture("/terrain.png"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
protected static void bindTessellator(int texture, int subID)
|
||||
{
|
||||
TesKey key = new TesKey(texture, subID);
|
||||
Tessellator tess = tessellators.get(key);
|
||||
|
||||
if (tess == null)
|
||||
{
|
||||
tess = new Tessellator();
|
||||
tess.textureID = texture;
|
||||
tessellators.put(key, tess);
|
||||
}
|
||||
|
||||
if (inWorld && !renderTextures.contains(key))
|
||||
{
|
||||
renderTextures.add(key);
|
||||
tess.startDrawingQuads();
|
||||
tess.setTranslation(defaultTessellator.xOffset, defaultTessellator.yOffset, defaultTessellator.zOffset);
|
||||
}
|
||||
|
||||
Tessellator.instance = tess;
|
||||
}
|
||||
|
||||
static int renderPass = -1;
|
||||
public static void beforeRenderPass(int pass)
|
||||
{
|
||||
renderPass = pass;
|
||||
defaultTessellator = Tessellator.instance;
|
||||
Tessellator.renderingWorldRenderer = true;
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, engine().getTexture("/terrain.png"));
|
||||
renderTextures.clear();
|
||||
inWorld = true;
|
||||
}
|
||||
|
||||
public static void afterRenderPass(int pass)
|
||||
{
|
||||
renderPass = -1;
|
||||
inWorld = false;
|
||||
for (TesKey info : renderTextures)
|
||||
{
|
||||
IRenderContextHandler handler = renderHandlers.get(info);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, info.texture);
|
||||
Tessellator tess = tessellators.get(info);
|
||||
if (handler == null)
|
||||
{
|
||||
tess.draw();
|
||||
}
|
||||
else
|
||||
{
|
||||
Tessellator.instance = tess;
|
||||
handler.beforeRenderContext();
|
||||
tess.draw();
|
||||
handler.afterRenderContext();
|
||||
}
|
||||
}
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, engine().getTexture("/terrain.png"));
|
||||
Tessellator.renderingWorldRenderer = false;
|
||||
Tessellator.instance = defaultTessellator;
|
||||
}
|
||||
|
||||
public static void beforeBlockRender(Block block, RenderBlocks render)
|
||||
{
|
||||
if (!block.isDefaultTexture && render.overrideBlockTexture == -1)
|
||||
{
|
||||
bindTexture(block.getTextureFile(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
public static void afterBlockRender(Block block, RenderBlocks render)
|
||||
{
|
||||
if (!block.isDefaultTexture && render.overrideBlockTexture == -1)
|
||||
{
|
||||
unbindTexture();
|
||||
}
|
||||
}
|
||||
|
||||
public static String getArmorTexture(ItemStack armor, String _default)
|
||||
{
|
||||
|
@ -247,7 +69,7 @@ public class ForgeHooksClient
|
|||
|
||||
if (item.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[item.itemID].getRenderType())))
|
||||
{
|
||||
engine.bindTexture(engine.getTexture(item.getItem().getTextureFile()));
|
||||
engine.func_98187_b("/terrain.png");
|
||||
int renderType = Block.blocksList[item.itemID].getRenderType();
|
||||
float scale = (renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2 ? 0.5F : 0.25F);
|
||||
|
||||
|
@ -279,7 +101,7 @@ public class ForgeHooksClient
|
|||
}
|
||||
else
|
||||
{
|
||||
engine.bindTexture(engine.getTexture(item.getItem().getTextureFile()));
|
||||
engine.func_98187_b("/gui/items.png");
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
customRenderer.renderItem(ENTITY, item, renderBlocks, entity);
|
||||
}
|
||||
|
@ -294,7 +116,7 @@ public class ForgeHooksClient
|
|||
return false;
|
||||
}
|
||||
|
||||
engine.bindTexture(engine.getTexture(Item.itemsList[item.itemID].getTextureFile()));
|
||||
engine.func_98187_b("/gui/items.png");
|
||||
if (customRenderer.shouldUseRenderHelper(INVENTORY, item, INVENTORY_BLOCK))
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
@ -422,6 +244,7 @@ public class ForgeHooksClient
|
|||
}
|
||||
}
|
||||
|
||||
static int renderPass = -1;
|
||||
public static void setRenderPass(int pass)
|
||||
{
|
||||
renderPass = pass;
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.client.gui.GuiControls;
|
|||
import net.minecraft.client.gui.GuiSlot;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class GuiControlsScrollPanel extends GuiSlot
|
||||
{
|
||||
|
@ -90,7 +91,7 @@ public class GuiControlsScrollPanel extends GuiSlot
|
|||
boolean flag = _mouseX >= xPosition && _mouseY >= yPosition && _mouseX < xPosition + width && _mouseY < yPosition + height;
|
||||
int k = (flag ? 2 : 1);
|
||||
|
||||
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/gui/gui.png"));
|
||||
mc.renderEngine.func_98187_b("/gui/gui.png");
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
controls.drawTexturedModalRect(xPosition, yPosition, 0, 46 + k * 20, width / 2, height);
|
||||
controls.drawTexturedModalRect(xPosition + width / 2, yPosition, 200 - width / 2, 46 + k * 20, width / 2, height);
|
||||
|
@ -105,8 +106,9 @@ public class GuiControlsScrollPanel extends GuiSlot
|
|||
break;
|
||||
}
|
||||
}
|
||||
String str = (conflict ? "\247c" : "") + options.getOptionDisplayString(index);
|
||||
str = (index == selected ? "\247f> \247e??? \247f<" : str);
|
||||
|
||||
String str = (conflict ? EnumChatFormatting.RED : "") + options.getOptionDisplayString(index);
|
||||
str = (index == selected ? EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<" : str);
|
||||
controls.drawCenteredString(mc.fontRenderer, str, xPosition + (width / 2), yPosition + (height - 8) / 2, 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,20 +18,6 @@ import net.minecraftforge.common.MinecraftForge;
|
|||
|
||||
public class MinecraftForgeClient
|
||||
{
|
||||
/** Register a new render context handler. A render context is a block
|
||||
* of rendering performed with similar OpenGL modes, for example,
|
||||
* texture name.
|
||||
* @param texture The name of the texture for this render context.
|
||||
* @param subid The subid of this render context. 0 is the default pass
|
||||
* for normal rendering, higher subids render later. All subids of 0
|
||||
* will render before all subids of 1, etc.
|
||||
* @param handler The handler to register.
|
||||
*/
|
||||
public static void registerRenderContextHandler(String texture, int subid, IRenderContextHandler handler)
|
||||
{
|
||||
ForgeHooksClient.registerRenderContextHandler(texture, subid, handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Preload a texture. Textures must be preloaded before the first
|
||||
* use, or they will cause visual anomalies.
|
||||
|
@ -41,23 +27,6 @@ public class MinecraftForgeClient
|
|||
ForgeHooksClient.engine().getTexture(texture);
|
||||
}
|
||||
|
||||
/** Render a block. Render a block which may have a custom texture.
|
||||
*/
|
||||
public static void renderBlock(RenderBlocks render, Block block, int x, int y, int z)
|
||||
{
|
||||
ForgeHooksClient.beforeBlockRender(block, render);
|
||||
render.renderBlockByRenderType(block, x, y, z);
|
||||
ForgeHooksClient.afterBlockRender(block, render);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current render pass.
|
||||
*/
|
||||
public static int getRenderPass()
|
||||
{
|
||||
return ForgeHooksClient.renderPass;
|
||||
}
|
||||
|
||||
private static IItemRenderer[] customItemRenderers = new IItemRenderer[Item.itemsList.length];
|
||||
|
||||
/**
|
||||
|
@ -82,4 +51,9 @@ public class MinecraftForgeClient
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getRenderPass()
|
||||
{
|
||||
return ForgeHooksClient.renderPass;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,134 +1,130 @@
|
|||
#Main Forge Access Transformer configuration file
|
||||
# RailLogic.getNAdjacentTracks
|
||||
public als.a(Lals;)I #MD:RailLogic/func_73650_a
|
||||
# Tessellator
|
||||
public-f baz.a #FD:Tessellator/field_78398_a #instance
|
||||
public baz.u #FD:Tessellator/field_78409_u #drawMode
|
||||
public baz.v #FD:Tessellator/field_78408_v #xOffset
|
||||
public baz.w #FD:Tessellator/field_78407_w #yOffset
|
||||
public baz.x #FD:Tessellator/field_78417_x #zOffset
|
||||
public baz.z #FD:Tessellator/field_78415_z #isDrawing
|
||||
public-f bfx.a #FD:Tessellator/field_78398_a #instance
|
||||
public bfx.u #FD:Tessellator/field_78409_u #drawMode
|
||||
public bfx.v #FD:Tessellator/field_78408_v #xOffset
|
||||
public bfx.w #FD:Tessellator/field_78407_w #yOffset
|
||||
public bfx.x #FD:Tessellator/field_78417_x #zOffset
|
||||
public bfx.z #FD:Tessellator/field_78415_z #isDrawing
|
||||
# ItemPickaxe
|
||||
public uy.<init>(ILuq;)V #MD:ItemPickaxe/<init>(ILnet/minecraft/src/EnumToolMaterial;) #constructor
|
||||
public+f uy.c #FD:ItemPickaxe/field_77867_c #blocksEffectiveAgainst
|
||||
public wo.<init>(ILwf;)V #MD:ItemPickaxe/<init>(ILnet/minecraft/src/EnumToolMaterial;) #constructor
|
||||
public+f wo.c #FD:ItemPickaxe/field_77867_c #blocksEffectiveAgainst
|
||||
# ItemAxe
|
||||
public un.<init>(ILuq;)V #MD:ItemAxe/<init>(ILnet/minecraft/src/EnumToolMaterial;) #constructor
|
||||
public+f un.c #FD:ItemAxe/field_77868_c #blocksEffectiveAgainst
|
||||
public wc.<init>(ILwf;)V #MD:ItemAxe/<init>(ILnet/minecraft/src/EnumToolMaterial;) #constructor
|
||||
public+f wc.c #FD:ItemAxe/field_77868_c #blocksEffectiveAgainst
|
||||
# ItemSpade
|
||||
public vj.<init>(ILuq;)V #MD:ItemSpade/<init>(ILnet/minecraft/src/EnumToolMaterial;) #constructor
|
||||
public+f vj.c #FD:ItemSpade/field_77866_c #blocksEffectiveAgainst
|
||||
public wz.<init>(ILwf;)V #MD:ItemSpade/<init>(ILnet/minecraft/src/EnumToolMaterial;) #constructor
|
||||
public+f wz.c #FD:ItemSpade/field_77866_c #blocksEffectiveAgainst
|
||||
# ItemTool
|
||||
public tw.a #FD:ItemTool/field_77864_a #efficiencyOnProperMaterial
|
||||
public tw.co #FD:ItemTool/field_77865_bY #damageVsEntity
|
||||
public vl.a #FD:ItemTool/field_77864_a #efficiencyOnProperMaterial
|
||||
public vl.d #FD:ItemTool/field_77865_bY #damageVsEntity
|
||||
# EntityEnderman
|
||||
public qd.d #FD:EntityEnderman/field_70827_d #carriableBlocks
|
||||
public rp.d #FD:EntityEnderman/field_70827_d #carriableBlocks
|
||||
# RenderEngine
|
||||
public bfy.f(Ljava/lang/String;)I #MD:RenderEngine/func_78341_b #getTexture
|
||||
public bfy.i #FD:RenderEngine/field_94154_l #terrainTextureMap
|
||||
public bfy.j #FD:RenderEngine/field_94155_m #itemTextureMap
|
||||
# RenderGlobal
|
||||
public bav.h #FD:RenderGlobal/field_72769_h #theWorld
|
||||
public bav.i #FD:RenderGlobal/field_72770_i #renderEngine
|
||||
public bav.q #FD:RenderGlobal/field_72777_q #mc
|
||||
public bav.r #FD:RenderGlobal/field_72776_r #globalRenderBlocks
|
||||
public bav.E #FD:RenderGlobal/field_72738_E #damagedBlocks
|
||||
public bfs.h #FD:RenderGlobal/field_72769_h #theWorld
|
||||
public bfs.i #FD:RenderGlobal/field_72770_i #renderEngine
|
||||
public bfs.q #FD:RenderGlobal/field_72777_q #mc
|
||||
public bfs.r #FD:RenderGlobal/field_72776_r #globalRenderBlocks
|
||||
public bfs.E #FD:RenderGlobal/field_72738_E #damagedBlocks
|
||||
# SoundManager
|
||||
public bev.a #FD:SoundManager/field_77381_a #sndSystem
|
||||
public bev.b #FD:SoundManager/field_77379_b #soundPoolSounds
|
||||
public bev.c #FD:SoundManager/field_77380_c #soundPoolStreaming
|
||||
public bev.d #FD:SoundManager/field_77377_d #soundPoolMusic
|
||||
public bjw.a #FD:SoundManager/field_77381_a #sndSystem
|
||||
public bjw.b #FD:SoundManager/field_77379_b #soundPoolSounds
|
||||
public bjw.c #FD:SoundManager/field_77380_c #soundPoolStreaming
|
||||
public bjw.d #FD:SoundManager/field_77377_d #soundPoolMusic
|
||||
# EntityMinecart
|
||||
protected py.* #FD:EntityMinecart/* # All private -> protected
|
||||
public py.h()Z #MD:EntityMinecart/func_70490_h #isMinecartPowered
|
||||
protected rc.* #FD:EntityMinecart/* # All private -> protected
|
||||
# -- MISSING MAPPING public py.h()Z #MD:EntityMinecart/func_70490_h #isMinecartPowered
|
||||
# Block
|
||||
public amq.<init>(ILagi;)V #MD:Block/<init>(ILnet/minecraft/src/Material;) #Constructor
|
||||
public amq.<init>(IILagi;)V #MD:Block/<init>(IILnet/minecraft/src/Material;) #Constructor
|
||||
public amq.r()Lamq; #MD:Block/func_71912_p #setRequiresSelfNotify
|
||||
public amq.a(Lamu;)Lamq; #MD:Block/func_71884_a #setStepSound
|
||||
public amq.b(F)Lamq; #MD:Block/func_71894_b #setResistance
|
||||
public amq.c(F)Lamq; #MD:Block/func_71848_c #setHardness
|
||||
public amq.h(I)Lamq; #MD:Block/func_71868_h #setLightOpacity
|
||||
public amq.a(F)Lamq; #MD:Block/func_71900_a #setLightValue
|
||||
public amq.s()Lamq; #MD:Block/func_71875_q #setBlockUnbreakable
|
||||
public amq.b(Z)Lamq; #MD:Block/func_71907_b #setTickRandomly
|
||||
public amq.a(FFFFFF)V #MD:Block/func_71905_a #setBlockBounds
|
||||
public aou.<init>(ILahz;)V #MD:Block/<init>(ILnet/minecraft/src/Material;) #Constructor
|
||||
public aou.<init>(IILahz;)V #MD:Block/<init>(IILnet/minecraft/src/Material;) #Constructor
|
||||
# -- MISSING MAPPING public amq.r()Lamq; #MD:Block/func_71912_p #setRequiresSelfNotify
|
||||
public aou.a(Laoy;)Laou; #MD:Block/func_71884_a #setStepSound
|
||||
public aou.b(F)Laou; #MD:Block/func_71894_b #setResistance
|
||||
public aou.c(F)Laou; #MD:Block/func_71848_c #setHardness
|
||||
public aou.k(I)Laou; #MD:Block/func_71868_h #setLightOpacity
|
||||
public aou.a(F)Laou; #MD:Block/func_71900_a #setLightValue
|
||||
public aou.r()Laou; #MD:Block/func_71875_q #setBlockUnbreakable
|
||||
public aou.b(Z)Laou; #MD:Block/func_71907_b #setTickRandomly
|
||||
public aou.a(FFFFFF)V #MD:Block/func_71905_a #setBlockBounds
|
||||
# NetServerHandler
|
||||
public iv.g #FD:NetServerHandler/field_72572_g #playerInAirTime
|
||||
public jh.f #FD:NetServerHandler/field_72572_g #playerInAirTime
|
||||
# TileEntity
|
||||
public any.k #FD:TileEntity/field_70331_k #worldObj
|
||||
public aqj.k #FD:TileEntity/field_70331_k #worldObj
|
||||
# BlockLeavesBase
|
||||
public amy.c #FD:BlockLeavesBase/field_72131_c #graphicsLevel
|
||||
public apc.d #FD:BlockLeavesBase/field_72131_c #graphicsLevel
|
||||
# Item
|
||||
public up.<init>(I)V #MD:Item/<init>(I) #Constructor
|
||||
public up.e(I)Lup; #MD:Item/func_77656_e #setMaxDamage
|
||||
public-f up.h(Lur;)I #MD:Item/func_77650_f #getIconIndex
|
||||
public we.<init>(I)V #MD:Item/<init>(I) #Constructor
|
||||
public we.e(I)Lwe; #MD:Item/func_77656_e #setMaxDamage
|
||||
public-f we.h(Lwg;)Llx; #MD:Item/func_77650_f #getIconIndex
|
||||
# RailLogic
|
||||
public als #CL:RailLogic
|
||||
public als.a(Lals;)I #MD:RailLogic/func_73650_a #getNAdjacentTiles
|
||||
public akw #CL:BlockBaseRailLogic
|
||||
public akw.a()I #MD:BlockBaseRailLogic/func_94505_a #getNAdjacentTiles
|
||||
# EntityPlayer
|
||||
public qx.a(Lpx;)V #MD:EntityPlayer/func_71012_a #joinEntityItemWithWorld
|
||||
public qx.i()V #MD:EntityPlayer/func_71053_j #closeScreen
|
||||
public sk.a(Lrb;)V #MD:EntityPlayer/func_71012_a #joinEntityItemWithWorld
|
||||
public sk.h()V #MD:EntityPlayer/func_71053_j #closeScreen
|
||||
# EntityPlayerMP
|
||||
public ays.a(Lpx;)V #MD:EntityClientPlayerMP/func_71012_a #joinEntityItemWithWorld
|
||||
public bdp.a(Lrb;)V #MD:EntityClientPlayerMP/func_71012_a #joinEntityItemWithWorld
|
||||
# World Gen Chests Related
|
||||
public kw.* #FD:WeightedRandomChestContent/* #all
|
||||
public in.S #FD:WorldServer/field_73069_S #bonusChestContent
|
||||
public acp.a #FD:StructureMineshaftPieces/field_78818_a #mineshaftChestContents
|
||||
public adt.i #FD:ComponentScatteredFeatureDesertPyramid/field_74941_i #itemsToGenerateInTemple
|
||||
public adu.l #FD:ComponentScatteredFeatureJunglePyramid/field_74943_l #junglePyramidsChestContents
|
||||
public adu.m #FD:ComponentScatteredFeatureJunglePyramid/field_74944_m #junglePyramidsDispenserContents
|
||||
public aee.a #FD:ComponentStrongholdChestCorridor/field_75003_a #strongholdChestContents
|
||||
public aei.b #FD:ComponentStrongholdLibrary/field_75007_b #strongholdLibraryChestContents
|
||||
public aen.c #FD:ComponentStrongholdRoomCrossing/field_75014_c #strongholdCorridorChestContents
|
||||
public afo.a #FD:ComponentVillageHouse2/field_74918_a #villageBlacksmithChestContents
|
||||
public lp.* #FD:WeightedRandomChestContent/* #all
|
||||
public iz.S #FD:WorldServer/field_73069_S #bonusChestContent
|
||||
public aeg.a #FD:StructureMineshaftPieces/field_78818_a #mineshaftChestContents
|
||||
public afk.i #FD:ComponentScatteredFeatureDesertPyramid/field_74941_i #itemsToGenerateInTemple
|
||||
public afl.l #FD:ComponentScatteredFeatureJunglePyramid/field_74943_l #junglePyramidsChestContents
|
||||
public afl.m #FD:ComponentScatteredFeatureJunglePyramid/field_74944_m #junglePyramidsDispenserContents
|
||||
public afv.a #FD:ComponentStrongholdChestCorridor/field_75003_a #strongholdChestContents
|
||||
public afz.b #FD:ComponentStrongholdLibrary/field_75007_b #strongholdLibraryChestContents
|
||||
public age.c #FD:ComponentStrongholdRoomCrossing/field_75014_c #strongholdCorridorChestContents
|
||||
public ahf.a #FD:ComponentVillageHouse2/field_74918_a #villageBlacksmithChestContents
|
||||
# AnvilChunkLoader.chunkSaveLocation
|
||||
public aam.d #FD:AnvilChunkLoader/field_75825_d
|
||||
public acd.d #FD:AnvilChunkLoader/field_75825_d
|
||||
# ChunkProviderServer.currentChunkLoader
|
||||
public im.e #FD:ChunkProviderServer/field_73247_e
|
||||
public iy.e #FD:ChunkProviderServer/field_73247_e
|
||||
# PlayerManager
|
||||
public ik.a(IIZ)Lil; #MD:PlayerManager/func_72690_a #getOrCreateChunkWatcher
|
||||
public iw.a(IIZ)Lix; #MD:PlayerManager/func_72690_a #getOrCreateChunkWatcher
|
||||
# PlayerInstance
|
||||
public il #CL:PlayerInstance
|
||||
public ix #CL:PlayerInstance
|
||||
# World
|
||||
public-f yc.B #FD:World/field_72982_D #villageCollectionObj
|
||||
public yc.G #FD:World/field_72993_I #activeChunkSet
|
||||
public-f zv.A #FD:World/field_72982_D #villageCollectionObj
|
||||
public zv.G #FD:World/field_72993_I #activeChunkSet
|
||||
# EntityLiving
|
||||
public md.bd #FD:EntityLiving/field_70728_aV #experienceValue
|
||||
public ng.be #FD:EntityLiving/field_70728_aV #experienceValue
|
||||
# GuiFlatPresets
|
||||
public aug.a(Ljava/lang/String;ILyy;Ljava/util/List;[Lacl;)V #MD:GuiFlatPresets/func_82294_a
|
||||
public aug.a(Ljava/lang/String;ILyy;[Lacl;)V #MD:GuiFlatPresets/func_82297_a
|
||||
public axg.a(Ljava/lang/String;ILaap;Ljava/util/List;[Laec;)V #MD:GuiFlatPresets/func_82294_a
|
||||
public axg.a(Ljava/lang/String;ILaap;[Laec;)V #MD:GuiFlatPresets/func_82297_a
|
||||
# BiomeGenBase
|
||||
public yy.*() #MD:BiomeGenBase/* #Everything protected->public
|
||||
public aap.*() #MD:BiomeGenBase/* #Everything protected->public
|
||||
# MapGenVillage
|
||||
public-f afc.e #FD:MapGenVillage/field_75055_e #villageSpawnBiomes
|
||||
public-f agt.e #FD:MapGenVillage/field_75055_e #villageSpawnBiomes
|
||||
# ShapedRecipes
|
||||
public+f wq.d #FD:ShapedRecipes/field_77574_d #recipeItems
|
||||
public+f wq.b #FD:ShapedRecipes/field_77576_b #recipeWidth
|
||||
public+f wq.c #FD:ShapedRecipes/field_77577_c #recipeHeight
|
||||
public+f yh.d #FD:ShapedRecipes/field_77574_d #recipeItems
|
||||
public+f yh.b #FD:ShapedRecipes/field_77576_b #recipeWidth
|
||||
public+f yh.c #FD:ShapedRecipes/field_77577_c #recipeHeight
|
||||
# ShapelessRecipes
|
||||
public wr.b #FD:ShapelessRecipes/field_77579_b #recipeItems
|
||||
public yi.b #FD:ShapelessRecipes/field_77579_b #recipeItems
|
||||
# GuiContainer
|
||||
protected avf.a(Lsr;)V #MD:GuiContainer/func_74192_a #drawSlotInventory
|
||||
protected ayf.a(Luf;)V #MD:GuiContainer/func_74192_a #drawSlotInventory
|
||||
# BlockButton
|
||||
protected ajf.o(Lyc;III)V #MD:BlockButton/func_82535_o #checkActivation
|
||||
protected-f ajf.a #FD:BlockButton/field_82537_a #sensible
|
||||
protected alc.n(Lzv;III)V #MD:BlockButton/func_82535_o #checkActivation
|
||||
protected-f alc.a #FD:BlockButton/field_82537_a #sensible
|
||||
# BiomeDecorator
|
||||
public zc.* #FD:BiomeDecorator/* # All private -> protected
|
||||
public aat.* #FD:BiomeDecorator/* # All private -> protected
|
||||
# CreativeTabs
|
||||
public-f tj.a #FD:CreativeTabs/field_78032_a # creativeTabArray non-final
|
||||
public-f uy.a #FD:CreativeTabs/field_78032_a # creativeTabArray non-final
|
||||
# Packet
|
||||
public ef.a(IZZLjava/lang/Class;)V #MD:Packet/func_73285_a #addIdClassMapping
|
||||
public ei.a(IZZLjava/lang/Class;)V #MD:Packet/func_73285_a #addIdClassMapping
|
||||
# SaveHandler
|
||||
public ahv.b()Ljava/io/File; #MD:SaveHandler/func_75765_b
|
||||
public ajn.b()Ljava/io/File; #MD:SaveHandler/func_75765_b
|
||||
# World stuff
|
||||
public yc.b(Llq;)V #MD:World/func_72847_b #releaseEntitySkin
|
||||
public yc.m #FD:World/field_73003_n #prevRainingStrength
|
||||
public yc.n #FD:World/field_73004_o #rainingStrength
|
||||
public yc.p #FD:World/field_73017_q #thunderingStrength
|
||||
public yc.o #FD:World/field_73018_p #prevThunderingStrength
|
||||
public zv.b(Lmp;)V #MD:World/func_72847_b #releaseEntitySkin
|
||||
public zv.m #FD:World/field_73003_n #prevRainingStrength
|
||||
public zv.n #FD:World/field_73004_o #rainingStrength
|
||||
public zv.p #FD:World/field_73017_q #thunderingStrength
|
||||
public zv.o #FD:World/field_73018_p #prevThunderingStrength
|
||||
#WorldClient
|
||||
public ayp.b(Llq;)V #MD:WorldClient/func_72847_b #releaseEntitySkin
|
||||
public bdm.b(Lmp;)V #MD:WorldClient/func_72847_b #releaseEntitySkin
|
||||
#WorldServer
|
||||
public in.b(Llq;)V #MD:WorldServer/func_72847_b #releaseEntitySkin
|
||||
public in.N #FD:WorldServer/field_73068_P #allPlayersSleeping
|
||||
# ChunkCache
|
||||
public ys.e # FD:ChunkCache/field_72815_e # worldObj
|
||||
# InventoryLargeChest
|
||||
public kz.c #FD:InventoryLargeChest/field_70478_c #lowerChest
|
||||
public kz.b #FD:InventoryLargeChest/field_70477_b #upperChest
|
||||
public iz.b(Lmp;)V #MD:WorldServer/func_72847_b #releaseEntitySkin
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package net.minecraftforge.common;
|
||||
|
||||
import static net.minecraftforge.common.Configuration.NEW_LINE;
|
||||
import static net.minecraftforge.common.Configuration.allowedProperties;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -7,11 +10,10 @@ import java.util.Collection;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.base.Splitter;
|
||||
|
||||
import static net.minecraftforge.common.Configuration.*;
|
||||
|
||||
public class ConfigCategory implements Map<String, Property>
|
||||
{
|
||||
private String name;
|
||||
|
@ -19,6 +21,7 @@ public class ConfigCategory implements Map<String, Property>
|
|||
private ArrayList<ConfigCategory> children = new ArrayList<ConfigCategory>();
|
||||
private Map<String, Property> properties = new TreeMap<String, Property>();
|
||||
public final ConfigCategory parent;
|
||||
private boolean changed = false;
|
||||
|
||||
public ConfigCategory(String name)
|
||||
{
|
||||
|
@ -68,7 +71,7 @@ public class ConfigCategory implements Map<String, Property>
|
|||
|
||||
public Map<String, Property> getValues()
|
||||
{
|
||||
return properties;
|
||||
return ImmutableMap.copyOf(properties);
|
||||
}
|
||||
|
||||
public void setComment(String comment)
|
||||
|
@ -86,39 +89,48 @@ public class ConfigCategory implements Map<String, Property>
|
|||
return properties.get(key);
|
||||
}
|
||||
|
||||
public void set(String key, Property value)
|
||||
private void write(BufferedWriter out, String... data) throws IOException
|
||||
{
|
||||
properties.put(key, value);
|
||||
write(out, true, data);
|
||||
}
|
||||
|
||||
private void write(BufferedWriter out, boolean new_line, String... data) throws IOException
|
||||
{
|
||||
for (int x = 0; x < data.length; x++)
|
||||
{
|
||||
out.write(data[x]);
|
||||
}
|
||||
if (new_line) out.write(NEW_LINE);
|
||||
}
|
||||
|
||||
public void write(BufferedWriter out, int indent) throws IOException
|
||||
{
|
||||
String pad = getIndent(indent);
|
||||
String pad0 = getIndent(indent);
|
||||
String pad1 = getIndent(indent + 1);
|
||||
String pad2 = getIndent(indent + 2);
|
||||
|
||||
out.write(pad + "####################" + NEW_LINE);
|
||||
out.write(pad + "# " + name + NEW_LINE);
|
||||
write(out, pad0, "####################");
|
||||
write(out, pad0, "# ", name);
|
||||
|
||||
if (comment != null)
|
||||
{
|
||||
out.write(pad + "#===================" + NEW_LINE);
|
||||
write(out, pad0, "#===================");
|
||||
Splitter splitter = Splitter.onPattern("\r?\n");
|
||||
|
||||
for (String line : splitter.split(comment))
|
||||
{
|
||||
out.write(pad + "# " + line + NEW_LINE);
|
||||
write(out, pad0, "# ", line);
|
||||
}
|
||||
}
|
||||
|
||||
out.write(pad + "####################" + NEW_LINE + NEW_LINE);
|
||||
write(out, pad0, "####################", NEW_LINE);
|
||||
|
||||
if (!allowedProperties.matchesAllOf(name))
|
||||
{
|
||||
name = '"' + name + '"';
|
||||
}
|
||||
|
||||
out.write(pad + name + " {" + NEW_LINE);
|
||||
|
||||
pad = getIndent(indent + 1);
|
||||
write(out, pad0, name, " {");
|
||||
|
||||
Property[] props = properties.values().toArray(new Property[properties.size()]);
|
||||
|
||||
|
@ -136,7 +148,7 @@ public class ConfigCategory implements Map<String, Property>
|
|||
Splitter splitter = Splitter.onPattern("\r?\n");
|
||||
for (String commentLine : splitter.split(prop.comment))
|
||||
{
|
||||
out.write(pad + "# " + commentLine + NEW_LINE);
|
||||
write(out, pad1, "# ", commentLine);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,23 +161,25 @@ public class ConfigCategory implements Map<String, Property>
|
|||
|
||||
if (prop.isList())
|
||||
{
|
||||
out.write(String.format(pad + "%s:%s <" + NEW_LINE, prop.getType().getID(), propName));
|
||||
pad = getIndent(indent + 2);
|
||||
char type = prop.getType().getID();
|
||||
|
||||
write(out, pad1, String.valueOf(type), ":", propName, " <");
|
||||
|
||||
for (String line : prop.valueList)
|
||||
for (String line : prop.getStringList())
|
||||
{
|
||||
out.write(pad + line + NEW_LINE);
|
||||
write(out, pad2, line);
|
||||
}
|
||||
|
||||
out.write(getIndent(indent + 1) + " >" + NEW_LINE);
|
||||
write(out, pad1, " >");
|
||||
}
|
||||
else if (prop.getType() == null)
|
||||
{
|
||||
out.write(String.format(pad + "%s=%s" + NEW_LINE, propName, prop.value));
|
||||
write(out, pad1, propName, "=", prop.getString());
|
||||
}
|
||||
else
|
||||
{
|
||||
out.write(String.format(pad + "%s:%s=%s" + NEW_LINE, prop.getType().getID(), propName, prop.value));
|
||||
char type = prop.getType().getID();
|
||||
write(out, pad1, String.valueOf(type), ":", propName, "=", prop.getString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,7 +188,7 @@ public class ConfigCategory implements Map<String, Property>
|
|||
child.write(out, indent + 1);
|
||||
}
|
||||
|
||||
out.write(getIndent(indent) + "}" + NEW_LINE + NEW_LINE);
|
||||
write(out, pad0, "}", NEW_LINE);
|
||||
}
|
||||
|
||||
private String getIndent(int indent)
|
||||
|
@ -187,6 +201,25 @@ public class ConfigCategory implements Map<String, Property>
|
|||
return buf.toString();
|
||||
}
|
||||
|
||||
public boolean hasChanged()
|
||||
{
|
||||
if (changed) return true;
|
||||
for (Property prop : properties.values())
|
||||
{
|
||||
if (prop.hasChanged()) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void resetChangedState()
|
||||
{
|
||||
changed = false;
|
||||
for (Property prop : properties.values())
|
||||
{
|
||||
prop.resetChangedState();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Map bouncer functions for compatibility with older mods, to be removed once all mods stop using it.
|
||||
@Override public int size(){ return properties.size(); }
|
||||
|
@ -194,12 +227,33 @@ public class ConfigCategory implements Map<String, Property>
|
|||
@Override public boolean containsKey(Object key) { return properties.containsKey(key); }
|
||||
@Override public boolean containsValue(Object value){ return properties.containsValue(value); }
|
||||
@Override public Property get(Object key) { return properties.get(key); }
|
||||
@Override public Property put(String key, Property value) { return properties.put(key, value); }
|
||||
@Override public Property remove(Object key) { return properties.remove(key); }
|
||||
@Override public void putAll(Map<? extends String, ? extends Property> m) { properties.putAll(m); }
|
||||
@Override public void clear() { properties.clear(); }
|
||||
@Override public Property put(String key, Property value)
|
||||
{
|
||||
changed = true;
|
||||
return properties.put(key, value);
|
||||
}
|
||||
@Override public Property remove(Object key)
|
||||
{
|
||||
changed = true;
|
||||
return properties.remove(key);
|
||||
}
|
||||
@Override public void putAll(Map<? extends String, ? extends Property> m)
|
||||
{
|
||||
changed = true;
|
||||
properties.putAll(m);
|
||||
}
|
||||
@Override public void clear()
|
||||
{
|
||||
changed = true;
|
||||
properties.clear();
|
||||
}
|
||||
@Override public Set<String> keySet() { return properties.keySet(); }
|
||||
@Override public Collection<Property> values() { return properties.values(); }
|
||||
@Override public Set<java.util.Map.Entry<String, Property>> entrySet() { return properties.entrySet(); }
|
||||
|
||||
@Override //Immutable copy, changes will NOT be reflected in this category
|
||||
public Set<java.util.Map.Entry<String, Property>> entrySet()
|
||||
{
|
||||
return ImmutableSet.copyOf(properties.entrySet());
|
||||
}
|
||||
|
||||
}
|
|
@ -5,31 +5,41 @@
|
|||
|
||||
package net.minecraftforge.common;
|
||||
|
||||
import java.io.*;
|
||||
import java.text.DateFormat;
|
||||
import static net.minecraftforge.common.Property.Type.BOOLEAN;
|
||||
import static net.minecraftforge.common.Property.Type.DOUBLE;
|
||||
import static net.minecraftforge.common.Property.Type.INTEGER;
|
||||
import static net.minecraftforge.common.Property.Type.STRING;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PushbackInputStream;
|
||||
import java.io.Reader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.FMLInjectionData;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import static net.minecraftforge.common.Property.Type.*;
|
||||
|
||||
/**
|
||||
* This class offers advanced configurations capabilities, allowing to provide
|
||||
* various categories for configuration variables.
|
||||
|
@ -54,13 +64,14 @@ public class Configuration
|
|||
|
||||
File file;
|
||||
|
||||
public Map<String, ConfigCategory> categories = new TreeMap<String, ConfigCategory>();
|
||||
private Map<String, ConfigCategory> categories = new TreeMap<String, ConfigCategory>();
|
||||
private Map<String, Configuration> children = new TreeMap<String, Configuration>();
|
||||
|
||||
private boolean caseSensitiveCustomCategories;
|
||||
public String defaultEncoding = DEFAULT_ENCODING;
|
||||
private String fileName = null;
|
||||
public boolean isChild = false;
|
||||
private boolean changed = false;
|
||||
|
||||
static
|
||||
{
|
||||
|
@ -148,7 +159,7 @@ public class Configuration
|
|||
|
||||
if (Block.blocksList[defaultID] == null && !configMarkers[defaultID])
|
||||
{
|
||||
prop.value = Integer.toString(defaultID);
|
||||
prop.set(defaultID);
|
||||
configMarkers[defaultID] = true;
|
||||
return prop;
|
||||
}
|
||||
|
@ -158,7 +169,7 @@ public class Configuration
|
|||
{
|
||||
if (Block.blocksList[j] == null && !configMarkers[j])
|
||||
{
|
||||
prop.value = Integer.toString(j);
|
||||
prop.set(j);
|
||||
configMarkers[j] = true;
|
||||
return prop;
|
||||
}
|
||||
|
@ -196,7 +207,7 @@ public class Configuration
|
|||
|
||||
if (Item.itemsList[defaultShift] == null && !configMarkers[defaultShift] && defaultShift >= Block.blocksList.length)
|
||||
{
|
||||
prop.value = Integer.toString(defaultID);
|
||||
prop.set(defaultID);
|
||||
configMarkers[defaultShift] = true;
|
||||
return prop;
|
||||
}
|
||||
|
@ -206,7 +217,7 @@ public class Configuration
|
|||
{
|
||||
if (Item.itemsList[x] == null && !configMarkers[x])
|
||||
{
|
||||
prop.value = Integer.toString(x - ITEM_SHIFT);
|
||||
prop.set(x - ITEM_SHIFT);
|
||||
configMarkers[x] = true;
|
||||
return prop;
|
||||
}
|
||||
|
@ -227,7 +238,7 @@ public class Configuration
|
|||
Property prop = get(category, key, Integer.toString(defaultValue), comment, INTEGER);
|
||||
if (!prop.isIntValue())
|
||||
{
|
||||
prop.value = Integer.toString(defaultValue);
|
||||
prop.set(defaultValue);
|
||||
}
|
||||
return prop;
|
||||
}
|
||||
|
@ -242,7 +253,7 @@ public class Configuration
|
|||
Property prop = get(category, key, Boolean.toString(defaultValue), comment, BOOLEAN);
|
||||
if (!prop.isBooleanValue())
|
||||
{
|
||||
prop.value = Boolean.toString(defaultValue);
|
||||
prop.set(defaultValue);
|
||||
}
|
||||
return prop;
|
||||
}
|
||||
|
@ -257,7 +268,7 @@ public class Configuration
|
|||
Property prop = get(category, key, Double.toString(defaultValue), comment, DOUBLE);
|
||||
if (!prop.isDoubleValue())
|
||||
{
|
||||
prop.value = Double.toString(defaultValue);
|
||||
prop.set(defaultValue);
|
||||
}
|
||||
return prop;
|
||||
}
|
||||
|
@ -298,7 +309,7 @@ public class Configuration
|
|||
Property prop = get(category, key, values, comment, INTEGER);
|
||||
if (!prop.isIntList())
|
||||
{
|
||||
prop.valueList = values;
|
||||
prop.set(values);
|
||||
}
|
||||
|
||||
return prop;
|
||||
|
@ -321,7 +332,7 @@ public class Configuration
|
|||
|
||||
if (!prop.isDoubleList())
|
||||
{
|
||||
prop.valueList = values;
|
||||
prop.set(values);
|
||||
}
|
||||
|
||||
return prop;
|
||||
|
@ -344,7 +355,7 @@ public class Configuration
|
|||
|
||||
if (!prop.isBooleanList())
|
||||
{
|
||||
prop.valueList = values;
|
||||
prop.set(values);
|
||||
}
|
||||
|
||||
return prop;
|
||||
|
@ -365,8 +376,8 @@ public class Configuration
|
|||
|
||||
if (prop.getType() == null)
|
||||
{
|
||||
prop = new Property(prop.getName(), prop.value, type);
|
||||
cat.set(key, prop);
|
||||
prop = new Property(prop.getName(), prop.getString(), type);
|
||||
cat.put(key, prop);
|
||||
}
|
||||
|
||||
prop.comment = comment;
|
||||
|
@ -375,7 +386,8 @@ public class Configuration
|
|||
else if (defaultValue != null)
|
||||
{
|
||||
Property prop = new Property(key, defaultValue, type);
|
||||
cat.set(key, prop);
|
||||
prop.set(defaultValue); //Set and mark as dirty to signify it should save
|
||||
cat.put(key, prop);
|
||||
prop.comment = comment;
|
||||
return prop;
|
||||
}
|
||||
|
@ -400,8 +412,8 @@ public class Configuration
|
|||
|
||||
if (prop.getType() == null)
|
||||
{
|
||||
prop = new Property(prop.getName(), prop.value, type);
|
||||
cat.set(key, prop);
|
||||
prop = new Property(prop.getName(), prop.getString(), type);
|
||||
cat.put(key, prop);
|
||||
}
|
||||
|
||||
prop.comment = comment;
|
||||
|
@ -412,7 +424,7 @@ public class Configuration
|
|||
{
|
||||
Property prop = new Property(key, defaultValue, type);
|
||||
prop.comment = comment;
|
||||
cat.set(key, prop);
|
||||
cat.put(key, prop);
|
||||
return prop;
|
||||
}
|
||||
else
|
||||
|
@ -569,7 +581,7 @@ public class Configuration
|
|||
Property prop = new Property(name, line.substring(i + 1), type, true);
|
||||
i = line.length();
|
||||
|
||||
currentCat.set(name, prop);
|
||||
currentCat.put(name, prop);
|
||||
|
||||
break;
|
||||
|
||||
|
@ -603,7 +615,7 @@ public class Configuration
|
|||
throw new RuntimeException(String.format("Malformed list property \"%s:%d\"", fileName, lineNum));
|
||||
}
|
||||
|
||||
currentCat.set(name, new Property(name, tmpList.toArray(new String[tmpList.size()]), type));
|
||||
currentCat.put(name, new Property(name, tmpList.toArray(new String[tmpList.size()]), type));
|
||||
name = null;
|
||||
tmpList = null;
|
||||
type = null;
|
||||
|
@ -647,6 +659,8 @@ public class Configuration
|
|||
} catch (IOException e){}
|
||||
}
|
||||
}
|
||||
|
||||
resetChangedState();
|
||||
}
|
||||
|
||||
public void save()
|
||||
|
@ -701,29 +715,7 @@ public class Configuration
|
|||
}
|
||||
|
||||
private void save(BufferedWriter out) throws IOException
|
||||
{
|
||||
//For compatiblitties sake just in case, Thanks Atomic, to be removed next MC version
|
||||
//TO-DO: Remove next MC version
|
||||
Object[] categoryArray = categories.values().toArray();
|
||||
for (Object o : categoryArray)
|
||||
{
|
||||
if (o instanceof TreeMap)
|
||||
{
|
||||
TreeMap treeMap = (TreeMap)o;
|
||||
ConfigCategory converted = new ConfigCategory(file.getName());
|
||||
FMLLog.warning("Forge found a Treemap saved for Configuration file " + file.getName() + ", this is deprecated behaviour!");
|
||||
|
||||
for (Object key : treeMap.keySet())
|
||||
{
|
||||
FMLLog.warning("Converting Treemap to ConfigCategory, key: " + key + ", property value: " + ((Property)treeMap.get(key)).value);
|
||||
converted.set((String)key, (Property)treeMap.get(key));
|
||||
}
|
||||
|
||||
categories.values().remove(o);
|
||||
categories.put(file.getName(), converted);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
for (ConfigCategory cat : categories.values())
|
||||
{
|
||||
if (!cat.isChild())
|
||||
|
@ -749,6 +741,7 @@ public class Configuration
|
|||
{
|
||||
parent = new ConfigCategory(hierarchy[0]);
|
||||
categories.put(parent.getQualifiedName(), parent);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
for (int i = 1; i < hierarchy.length; i++)
|
||||
|
@ -760,6 +753,7 @@ public class Configuration
|
|||
{
|
||||
child = new ConfigCategory(hierarchy[i], parent);
|
||||
categories.put(name, child);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
ret = child;
|
||||
|
@ -770,6 +764,7 @@ public class Configuration
|
|||
{
|
||||
ret = new ConfigCategory(category);
|
||||
categories.put(category, ret);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -788,12 +783,14 @@ public class Configuration
|
|||
if (!children.containsKey(name))
|
||||
{
|
||||
children.put(name, child);
|
||||
changed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Configuration old = children.get(name);
|
||||
child.categories = old.categories;
|
||||
child.fileName = old.fileName;
|
||||
old.changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -873,4 +870,40 @@ public class Configuration
|
|||
input.close();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasChanged()
|
||||
{
|
||||
if (changed) return true;
|
||||
|
||||
for (ConfigCategory cat : categories.values())
|
||||
{
|
||||
if (cat.hasChanged()) return true;
|
||||
}
|
||||
|
||||
for (Configuration child : children.values())
|
||||
{
|
||||
if (child.hasChanged()) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void resetChangedState()
|
||||
{
|
||||
changed = false;
|
||||
for (ConfigCategory cat : categories.values())
|
||||
{
|
||||
cat.resetChangedState();
|
||||
}
|
||||
|
||||
for (Configuration child : children.values())
|
||||
{
|
||||
child.resetChangedState();
|
||||
}
|
||||
}
|
||||
|
||||
public Set<String> getCategoryNames()
|
||||
{
|
||||
return ImmutableSet.copyOf(categories.keySet());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -239,7 +239,7 @@ public class DimensionManager
|
|||
ISaveHandler savehandler = overworld.getSaveHandler();
|
||||
WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());
|
||||
|
||||
WorldServer world = (dim == 0 ? overworld : new WorldServerMulti(mcServer, savehandler, overworld.getWorldInfo().getWorldName(), dim, worldSettings, overworld, mcServer.theProfiler));
|
||||
WorldServer world = (dim == 0 ? overworld : new WorldServerMulti(mcServer, savehandler, overworld.getWorldInfo().getWorldName(), dim, worldSettings, overworld, mcServer.theProfiler, overworld.func_98180_V()));
|
||||
world.addWorldAccess(new WorldManager(mcServer, world));
|
||||
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
|
||||
if (!mcServer.isSinglePlayer())
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package net.minecraftforge.common;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
//Preliminary, simple Fake Player class
|
||||
public class FakePlayer extends EntityPlayer
|
||||
{
|
||||
public FakePlayer(World world, String name)
|
||||
{
|
||||
super(world);
|
||||
this.username = name;
|
||||
}
|
||||
|
||||
public void sendChatToPlayer(String s){}
|
||||
public boolean canCommandSenderUseCommand(int i, String s){ return false; }
|
||||
public ChunkCoordinates getPlayerCoordinates()
|
||||
{
|
||||
return new ChunkCoordinates(0,0,0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package net.minecraftforge.common;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
//To be expanded for generic Mod fake players?
|
||||
public class FakePlayerFactory
|
||||
{
|
||||
private static FakePlayer MINECRAFT_PLAYER = null;
|
||||
|
||||
public static FakePlayer getMinecraft(World world)
|
||||
{
|
||||
if (MINECRAFT_PLAYER == null)
|
||||
{
|
||||
MINECRAFT_PLAYER = new FakePlayer(world, "[Minecraft]");
|
||||
}
|
||||
return MINECRAFT_PLAYER;
|
||||
}
|
||||
}
|
|
@ -775,7 +775,7 @@ public class ForgeChunkManager
|
|||
|
||||
static void loadConfiguration()
|
||||
{
|
||||
for (String mod : config.categories.keySet())
|
||||
for (String mod : config.getCategoryNames())
|
||||
{
|
||||
if (mod.equals("Forge") || mod.equals("defaults"))
|
||||
{
|
||||
|
@ -786,7 +786,10 @@ public class ForgeChunkManager
|
|||
ticketConstraints.put(mod, modTC.getInt(200));
|
||||
chunkConstraints.put(mod, modCPT.getInt(25));
|
||||
}
|
||||
config.save();
|
||||
if (config.hasChanged())
|
||||
{
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -953,7 +956,7 @@ public class ForgeChunkManager
|
|||
sampleTC.comment = "Maximum ticket count for the mod. Zero disables chunkloading capabilities.";
|
||||
sampleTC = config.get("Forge", "maximumChunksPerTicket", 25);
|
||||
sampleTC.comment = "Maximum chunks per ticket for the mod.";
|
||||
for (String mod : config.categories.keySet())
|
||||
for (String mod : config.getCategoryNames())
|
||||
{
|
||||
if (mod.equals("Forge") || mod.equals("defaults"))
|
||||
{
|
||||
|
@ -965,12 +968,12 @@ public class ForgeChunkManager
|
|||
}
|
||||
|
||||
|
||||
public static Map<String,Property> getConfigMapFor(Object mod)
|
||||
public static ConfigCategory getConfigFor(Object mod)
|
||||
{
|
||||
ModContainer container = getContainer(mod);
|
||||
if (container != null)
|
||||
{
|
||||
return config.getCategory(container.getModId()).getValues();
|
||||
return config.getCategory(container.getModId());
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -981,8 +984,8 @@ public class ForgeChunkManager
|
|||
ModContainer container = getContainer(mod);
|
||||
if (container != null)
|
||||
{
|
||||
Map<String, Property> props = config.getCategory(container.getModId()).getValues();
|
||||
props.put(propertyName, new Property(propertyName, value, type));
|
||||
ConfigCategory cat = config.getCategory(container.getModId());
|
||||
cat.put(propertyName, new Property(propertyName, value, type));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import static net.minecraftforge.common.ForgeVersion.*;
|
|||
public class ForgeDummyContainer extends DummyModContainer implements WorldAccessContainer
|
||||
{
|
||||
public static int clumpingThreshold = 64;
|
||||
public static boolean legacyFurnaceSides = false;
|
||||
|
||||
public ForgeDummyContainer()
|
||||
{
|
||||
|
@ -44,7 +45,22 @@ public class ForgeDummyContainer extends DummyModContainer implements WorldAcces
|
|||
meta.screenshots = new String[0];
|
||||
meta.logoFile = "/forge_logo.png";
|
||||
|
||||
Configuration config = new Configuration(new File(Loader.instance().getConfigDir(), "forge.cfg"));
|
||||
Configuration config = null;
|
||||
File cfgFile = new File(Loader.instance().getConfigDir(), "forge.cfg");
|
||||
try
|
||||
{
|
||||
config = new Configuration(cfgFile);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("Error loading forge.cfg, deleting file and resetting: ");
|
||||
e.printStackTrace();
|
||||
|
||||
if (cfgFile.exists())
|
||||
cfgFile.delete();
|
||||
|
||||
config = new Configuration(cfgFile);
|
||||
}
|
||||
if (!config.isChild)
|
||||
{
|
||||
config.load();
|
||||
|
@ -60,9 +76,17 @@ public class ForgeDummyContainer extends DummyModContainer implements WorldAcces
|
|||
if (clumpingThreshold > 1024 || clumpingThreshold < 64)
|
||||
{
|
||||
clumpingThreshold = 64;
|
||||
clumpingThresholdProperty.value = "64";
|
||||
clumpingThresholdProperty.set(64);
|
||||
}
|
||||
|
||||
Property furnaceOutput = config.get(Configuration.CATEGORY_GENERAL, "legacyFurnceOutput", false);
|
||||
furnaceOutput.comment = "Controls the sides of vanilla furnaces for Forge's ISidedInventroy, Vanilla defines the output as the bottom, but mods/Forge define it as the sides. Settings this to true will restore the old side relations.";
|
||||
legacyFurnaceSides = furnaceOutput.getBoolean(false);
|
||||
|
||||
if (config.hasChanged())
|
||||
{
|
||||
config.save();
|
||||
}
|
||||
config.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -63,7 +63,7 @@ public class ForgeHooks
|
|||
{
|
||||
return;
|
||||
}
|
||||
world.setBlockAndMetadataWithNotify(x, y, z, grass.block.blockID, grass.metadata);
|
||||
world.setBlockAndMetadataWithNotify(x, y, z, grass.block.blockID, grass.metadata, 3);
|
||||
}
|
||||
|
||||
public static ItemStack getGrassSeed(World world)
|
||||
|
@ -147,7 +147,7 @@ public class ForgeHooks
|
|||
}
|
||||
else
|
||||
{
|
||||
return player.getCurrentPlayerStrVsBlock(block, metadata) / hardness / 30F;
|
||||
return player.getCurrentPlayerStrVsBlock(block, false, metadata) / hardness / 30F;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,22 +215,6 @@ public class ForgeHooks
|
|||
MinecraftForge.removeBlockEffectiveness(Block.oreRedstoneGlowing, "pickaxe");
|
||||
}
|
||||
|
||||
public static String getTexture(String _default, Object obj)
|
||||
{
|
||||
if (obj instanceof Item)
|
||||
{
|
||||
return ((Item)obj).getTextureFile();
|
||||
}
|
||||
else if (obj instanceof Block)
|
||||
{
|
||||
return ((Block)obj).getTextureFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
return _default;
|
||||
}
|
||||
}
|
||||
|
||||
public static int getTotalArmorValue(EntityPlayer player)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
|
@ -19,14 +19,7 @@ public class ForgeInternalHandler
|
|||
{
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if (event.entity.getPersistentID() == null)
|
||||
{
|
||||
event.entity.generatePersistentID();
|
||||
}
|
||||
else
|
||||
{
|
||||
ForgeChunkManager.loadEntity(event.entity);
|
||||
}
|
||||
ForgeChunkManager.loadEntity(event.entity);
|
||||
}
|
||||
|
||||
Entity entity = event.entity;
|
||||
|
|
|
@ -8,11 +8,11 @@ package net.minecraftforge.common;
|
|||
public class ForgeVersion
|
||||
{
|
||||
//This number is incremented every time we remove deprecated code/major API changes, never reset
|
||||
public static final int majorVersion = 6;
|
||||
public static final int majorVersion = 7;
|
||||
//This number is incremented every minecraft release, never reset
|
||||
public static final int minorVersion = 6;
|
||||
public static final int minorVersion = 7;
|
||||
//This number is incremented every time a interface changes or new major feature is added, and reset every Minecraft version
|
||||
public static final int revisionVersion = 2;
|
||||
public static final int revisionVersion = 0;
|
||||
//This number is incremented every time Jenkins builds Forge, and never reset. Should always be 0 in the repo code.
|
||||
public static final int buildVersion = 0;
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.inventory.IInventory;
|
|||
/** Inventory ranges mapped by side. This class is implemented by TileEntities
|
||||
* that provide different inventory slot ranges to different sides.
|
||||
*/
|
||||
@Deprecated //A equivalent Interface is now in Minecraft Vanilla will be removed next major MC version
|
||||
public interface ISidedInventory extends IInventory
|
||||
{
|
||||
|
||||
|
@ -17,12 +18,14 @@ public interface ISidedInventory extends IInventory
|
|||
* Get the start of the side inventory.
|
||||
* @param side The global side to get the start of range.
|
||||
*/
|
||||
@Deprecated
|
||||
int getStartInventorySide(ForgeDirection side);
|
||||
|
||||
/**
|
||||
* Get the size of the side inventory.
|
||||
* @param side The global side.
|
||||
*/
|
||||
@Deprecated
|
||||
int getSizeInventorySide(ForgeDirection side);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,215 +0,0 @@
|
|||
package net.minecraftforge.common;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class MinecartRegistry
|
||||
{
|
||||
private static Map<MinecartKey, ItemStack> itemForMinecart = new HashMap<MinecartKey, ItemStack>();
|
||||
private static Map<ItemStack, MinecartKey> minecartForItem = new HashMap<ItemStack, MinecartKey>();
|
||||
/**
|
||||
* Registers a custom minecart and its corresponding item.
|
||||
* This should be the item used to place the minecart by the user,
|
||||
* not the item dropped by the cart.
|
||||
* @param cart The minecart.
|
||||
* @param item The item used to place the cart.
|
||||
*/
|
||||
public static void registerMinecart(Class<? extends EntityMinecart> cart, ItemStack item)
|
||||
{
|
||||
registerMinecart(cart, 0, item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a minecart and its corresponding item.
|
||||
* This should be the item used to place the minecart by the user,
|
||||
* not the item dropped by the cart.
|
||||
* @param minecart The minecart.
|
||||
* @param type The minecart type, used to differentiate carts that have the same class.
|
||||
* @param item The item used to place the cart.
|
||||
*/
|
||||
public static void registerMinecart(Class<? extends EntityMinecart> minecart, int type, ItemStack item)
|
||||
{
|
||||
MinecartKey key = new MinecartKey(minecart, type);
|
||||
itemForMinecart.put(key, item);
|
||||
minecartForItem.put(item, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a previously registered Minecart. Useful for replacing the vanilla minecarts.
|
||||
* @param minecart
|
||||
* @param type
|
||||
*/
|
||||
public static void removeMinecart(Class<? extends EntityMinecart> minecart, int type)
|
||||
{
|
||||
MinecartKey key = new MinecartKey(minecart, type);
|
||||
ItemStack item = itemForMinecart.remove(key);
|
||||
if (item != null)
|
||||
{
|
||||
minecartForItem.remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns an ItemStack that represents this cart.
|
||||
* The player should be able to use this item to place the minecart.
|
||||
* This is the item that was registered with the cart via the registerMinecart function,
|
||||
* but is not necessary the item the cart drops when destroyed.
|
||||
* @param minecart The cart class
|
||||
* @return An ItemStack that can be used to place the cart.
|
||||
*/
|
||||
public static ItemStack getItemForCart(Class<? extends EntityMinecart> minecart)
|
||||
{
|
||||
return getItemForCart(minecart, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns an ItemStack that represents this cart.
|
||||
* The player should be able to use this item to place the minecart.
|
||||
* This is the item that was registered with the cart via the registerMinecart function,
|
||||
* but is not necessary the item the cart drops when destroyed.
|
||||
* @param minecart The cart class
|
||||
* @param type The minecartType value
|
||||
* @return An ItemStack that can be used to place the cart.
|
||||
*/
|
||||
public static ItemStack getItemForCart(Class<? extends EntityMinecart> minecart, int type)
|
||||
{
|
||||
ItemStack item = itemForMinecart.get(new MinecartKey(minecart, type));
|
||||
if (item == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return item.copy();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns an ItemStack that represents this cart.
|
||||
* The player should be able to use this item to place the minecart.
|
||||
* This is the item that was registered with the cart via the registerMinecart function,
|
||||
* but is not necessary the item the cart drops when destroyed.
|
||||
* @param cart The cart entity
|
||||
* @return An ItemStack that can be used to place the cart.
|
||||
*/
|
||||
public static ItemStack getItemForCart(EntityMinecart cart)
|
||||
{
|
||||
return getItemForCart(cart.getClass(), cart.getMinecartType());
|
||||
}
|
||||
|
||||
/**
|
||||
* The function will return the cart class for a given item.
|
||||
* If the item was not registered via the registerMinecart function it will return null.
|
||||
* @param item The item to test.
|
||||
* @return Cart if mapping exists, null if not.
|
||||
*/
|
||||
public static Class<? extends EntityMinecart> getCartClassForItem(ItemStack item)
|
||||
{
|
||||
MinecartKey key = null;
|
||||
for (Map.Entry<ItemStack, MinecartKey> entry : minecartForItem.entrySet())
|
||||
{
|
||||
if (entry.getKey().isItemEqual(item))
|
||||
{
|
||||
key = entry.getValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (key != null)
|
||||
{
|
||||
return key.minecart;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The function will return the cart type for a given item.
|
||||
* Will return -1 if the mapping doesn't exist.
|
||||
* If the item was not registered via the registerMinecart function it will return null.
|
||||
* @param item The item to test.
|
||||
* @return the cart minecartType value.
|
||||
*/
|
||||
public static int getCartTypeForItem(ItemStack item)
|
||||
{
|
||||
MinecartKey key = null;
|
||||
for (Map.Entry<ItemStack, MinecartKey> entry : minecartForItem.entrySet())
|
||||
{
|
||||
if (entry.getKey().isItemEqual(item))
|
||||
{
|
||||
key = entry.getValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (key != null)
|
||||
{
|
||||
return key.type;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will return a set of all registered minecart items.
|
||||
* @return a copy of the set of all minecart items
|
||||
*/
|
||||
public static Set<ItemStack> getAllCartItems()
|
||||
{
|
||||
Set<ItemStack> ret = new HashSet<ItemStack>();
|
||||
for (ItemStack item : minecartForItem.keySet())
|
||||
{
|
||||
ret.add(item.copy());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
registerMinecart(EntityMinecart.class, 0, new ItemStack(Item.minecartEmpty));
|
||||
registerMinecart(EntityMinecart.class, 1, new ItemStack(Item.minecartCrate));
|
||||
registerMinecart(EntityMinecart.class, 2, new ItemStack(Item.minecartPowered));
|
||||
}
|
||||
|
||||
public static class MinecartKey
|
||||
{
|
||||
public final Class<? extends EntityMinecart> minecart;
|
||||
public final int type;
|
||||
|
||||
public MinecartKey(Class<? extends EntityMinecart> cls, int typtID)
|
||||
{
|
||||
minecart = cls;
|
||||
type = typtID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final MinecartKey other = (MinecartKey)obj;
|
||||
if (this.minecart != other.minecart && (this.minecart == null || !this.minecart.equals(other.minecart)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return (this.type == other.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 7;
|
||||
hash = 59 * hash + (this.minecart != null ? this.minecart.hashCode() : 0);
|
||||
hash = 59 * hash + this.type;
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,9 +7,13 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
|||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.ModContainer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -33,8 +37,6 @@ public class MinecraftForge
|
|||
public static final EventBus EVENT_BUS = new EventBus();
|
||||
public static final EventBus TERRAIN_GEN_BUS = new EventBus();
|
||||
public static final EventBus ORE_GEN_BUS = new EventBus();
|
||||
@Deprecated //Vanilla feature now
|
||||
public static boolean SPAWNER_ALLOW_ON_INVERTED = false;
|
||||
|
||||
private static final ForgeInternalHandler INTERNAL_HANDLER = new ForgeInternalHandler();
|
||||
|
||||
|
@ -183,10 +185,14 @@ public class MinecraftForge
|
|||
System.out.printf("MinecraftForge v%s Initialized\n", ForgeVersion.getVersion());
|
||||
FMLLog.info("MinecraftForge v%s Initialized", ForgeVersion.getVersion());
|
||||
|
||||
Block filler = new Block(0, Material.air);
|
||||
Block filler = new Block(0, Material.air)
|
||||
{
|
||||
@SideOnly(Side.CLIENT) public void func_94332_a(IconRegister register){}
|
||||
};
|
||||
Block.blocksList[0] = null;
|
||||
Block.opaqueCubeLookup[0] = false;
|
||||
Block.lightOpacity[0] = 0;
|
||||
filler.setUnlocalizedName("ForgeFiller");
|
||||
|
||||
for (int x = 256; x < 4096; x++)
|
||||
{
|
||||
|
@ -202,6 +208,9 @@ public class MinecraftForge
|
|||
|
||||
EVENT_BUS.register(INTERNAL_HANDLER);
|
||||
OreDictionary.getOreName(0);
|
||||
|
||||
//Force these classes to be defined, Should prevent derp error hiding.
|
||||
new CrashReport("ThisIsFake", new Exception("Not real"));
|
||||
}
|
||||
|
||||
public static String getBrandingVersion()
|
||||
|
|
|
@ -40,13 +40,14 @@ public class Property
|
|||
}
|
||||
|
||||
private String name;
|
||||
public String value;
|
||||
private String value;
|
||||
public String comment;
|
||||
public String[] valueList;
|
||||
private String[] values;
|
||||
|
||||
private final boolean wasRead;
|
||||
private final boolean isList;
|
||||
private final Type type;
|
||||
private boolean changed = false;
|
||||
|
||||
public Property()
|
||||
{
|
||||
|
@ -77,10 +78,20 @@ public class Property
|
|||
Property(String name, String[] values, Type type, boolean read)
|
||||
{
|
||||
setName(name);
|
||||
this.type = type;
|
||||
valueList = values;
|
||||
wasRead = read;
|
||||
isList = true;
|
||||
this.type = type;
|
||||
this.values = values;
|
||||
wasRead = read;
|
||||
isList = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value in this property as it's raw string.
|
||||
*
|
||||
* @return current value
|
||||
*/
|
||||
public String getString()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -197,6 +208,11 @@ public class Property
|
|||
}
|
||||
}
|
||||
|
||||
public String[] getStringList()
|
||||
{
|
||||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the integer value of all values that can
|
||||
* be parsed in the list.
|
||||
|
@ -207,7 +223,7 @@ public class Property
|
|||
{
|
||||
ArrayList<Integer> nums = new ArrayList<Integer>();
|
||||
|
||||
for (String value : valueList)
|
||||
for (String value : values)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -232,7 +248,7 @@ public class Property
|
|||
*/
|
||||
public boolean isIntList()
|
||||
{
|
||||
for (String value : valueList)
|
||||
for (String value : values)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -254,21 +270,21 @@ public class Property
|
|||
*/
|
||||
public boolean[] getBooleanList()
|
||||
{
|
||||
ArrayList<Boolean> values = new ArrayList<Boolean>();
|
||||
for (String value : valueList)
|
||||
ArrayList<Boolean> tmp = new ArrayList<Boolean>();
|
||||
for (String value : values)
|
||||
{
|
||||
try
|
||||
{
|
||||
values.add(Boolean.parseBoolean(value));
|
||||
tmp.add(Boolean.parseBoolean(value));
|
||||
}
|
||||
catch (NumberFormatException e){}
|
||||
}
|
||||
|
||||
boolean[] primitives = new boolean[values.size()];
|
||||
boolean[] primitives = new boolean[tmp.size()];
|
||||
|
||||
for (int i = 0; i < values.size(); i++)
|
||||
for (int i = 0; i < tmp.size(); i++)
|
||||
{
|
||||
primitives[i] = values.get(i);
|
||||
primitives[i] = tmp.get(i);
|
||||
}
|
||||
|
||||
return primitives;
|
||||
|
@ -280,7 +296,7 @@ public class Property
|
|||
*/
|
||||
public boolean isBooleanList()
|
||||
{
|
||||
for (String value : valueList)
|
||||
for (String value : values)
|
||||
{
|
||||
if (!"true".equalsIgnoreCase(value) && !"false".equalsIgnoreCase(value))
|
||||
{
|
||||
|
@ -299,21 +315,21 @@ public class Property
|
|||
*/
|
||||
public double[] getDoubleList()
|
||||
{
|
||||
ArrayList<Double> values = new ArrayList<Double>();
|
||||
for (String value : valueList)
|
||||
ArrayList<Double> tmp = new ArrayList<Double>();
|
||||
for (String value : values)
|
||||
{
|
||||
try
|
||||
{
|
||||
values.add(Double.parseDouble(value));
|
||||
tmp.add(Double.parseDouble(value));
|
||||
}
|
||||
catch (NumberFormatException e) {}
|
||||
}
|
||||
|
||||
double[] primitives = new double[values.size()];
|
||||
double[] primitives = new double[tmp.size()];
|
||||
|
||||
for (int i = 0; i < values.size(); i++)
|
||||
for (int i = 0; i < tmp.size(); i++)
|
||||
{
|
||||
primitives[i] = values.get(i);
|
||||
primitives[i] = tmp.get(i);
|
||||
}
|
||||
|
||||
return primitives;
|
||||
|
@ -325,7 +341,7 @@ public class Property
|
|||
*/
|
||||
public boolean isDoubleList()
|
||||
{
|
||||
for (String value : valueList)
|
||||
for (String value : values)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -371,4 +387,23 @@ public class Property
|
|||
{
|
||||
return isList;
|
||||
}
|
||||
|
||||
public boolean hasChanged(){ return changed; }
|
||||
void resetChangedState(){ changed = false; }
|
||||
|
||||
public void set(String value)
|
||||
{
|
||||
this.value = value;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
public void set(String[] values)
|
||||
{
|
||||
this.values = values;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
public void set(int value){ set(Integer.toString(value)); }
|
||||
public void set(boolean value){ set(Boolean.toString(value)); }
|
||||
public void set(double value){ set(Double.toString(value)); }
|
||||
}
|
||||
|
|
|
@ -1,16 +1,22 @@
|
|||
package net.minecraftforge.event;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.Event.Result;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSpecialSpawnEvent;
|
||||
import net.minecraftforge.event.entity.player.*;
|
||||
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ForgeEventFactory
|
||||
|
@ -49,14 +55,16 @@ public class ForgeEventFactory
|
|||
|
||||
public static boolean doSpecialSpawn(EntityLiving entity, World world, float x, float y, float z)
|
||||
{
|
||||
boolean result = MinecraftForge.EVENT_BUS.post(new LivingSpecialSpawnEvent(entity, world, x, y, z));
|
||||
LivingSpawnEvent.SpecialSpawn nEvent = new LivingSpawnEvent.SpecialSpawn(entity, world, x, y, z);
|
||||
return MinecraftForge.EVENT_BUS.post(new LivingSpawnEvent.SpecialSpawn(entity, world, x, y, z));
|
||||
}
|
||||
|
||||
if (result) //For the time being, copy the canceled state from the old legacy event
|
||||
{ // Remove when we remove LivingSpecialSpawnEvent.
|
||||
nEvent.setCanceled(true);
|
||||
public static List getPotentialSpawns(WorldServer world, EnumCreatureType type, int x, int y, int z, List oldList)
|
||||
{
|
||||
WorldEvent.PotentialSpawns event = new WorldEvent.PotentialSpawns(world, type, x, y, z, oldList);
|
||||
if (MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return MinecraftForge.EVENT_BUS.post(nEvent);
|
||||
return event.list;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
package net.minecraftforge.event.entity.living;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
|
||||
@Deprecated //Remove next MC Version
|
||||
@Cancelable
|
||||
public class LivingSpecialSpawnEvent extends LivingEvent
|
||||
{
|
||||
public final World world;
|
||||
public final float x;
|
||||
public final float y;
|
||||
public final float z;
|
||||
private boolean handeled = false;
|
||||
|
||||
public LivingSpecialSpawnEvent(EntityLiving entity, World world, float x, float y, float z)
|
||||
{
|
||||
super(entity);
|
||||
this.world = world;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,12 @@
|
|||
package net.minecraftforge.event.world;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
public class WorldEvent extends Event
|
||||
|
@ -26,4 +32,35 @@ public class WorldEvent extends Event
|
|||
{
|
||||
public Save(World world) { super(world); }
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by WorldServer to gather a list of all possible entities that can spawn at the specified location.
|
||||
* Canceling the event will result in a empty list, meaning no entity will be spawned.
|
||||
*/
|
||||
@Cancelable
|
||||
public static class PotentialSpawns extends WorldEvent
|
||||
{
|
||||
public final EnumCreatureType type;
|
||||
public final int x;
|
||||
public final int y;
|
||||
public final int z;
|
||||
public final List<SpawnListEntry> list;
|
||||
|
||||
public PotentialSpawns(World world, EnumCreatureType type, int x, int y, int z, List oldList)
|
||||
{
|
||||
super(world);
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.type = type;
|
||||
if (oldList != null)
|
||||
{
|
||||
this.list = (List<SpawnListEntry>)oldList;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.list = new ArrayList<SpawnListEntry>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package net.minecraftforge.liquids;
|
||||
|
||||
import static cpw.mods.fml.relauncher.Side.CLIENT;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
/**
|
||||
* ItemStack substitute for liquids
|
||||
|
@ -84,7 +88,7 @@ public class LiquidStack
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return isLiquidEqual(LiquidContainerRegistry.getLiquidForFilledItem(other));
|
||||
}
|
||||
|
||||
|
@ -108,4 +112,19 @@ public class LiquidStack
|
|||
liquidstack.readFromNBT(nbt);
|
||||
return liquidstack.itemID == 0 ? null : liquidstack;
|
||||
}
|
||||
|
||||
@SideOnly(CLIENT)
|
||||
private Icon renderingIcon;
|
||||
|
||||
@SideOnly(CLIENT)
|
||||
public Icon getRenderingIcon()
|
||||
{
|
||||
return renderingIcon;
|
||||
}
|
||||
|
||||
@SideOnly(CLIENT)
|
||||
public void setRenderingIcon(Icon icon)
|
||||
{
|
||||
this.renderingIcon = icon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class EventTransformer implements IClassTransformer
|
|||
}
|
||||
|
||||
@Override
|
||||
public byte[] transform(String name, byte[] bytes)
|
||||
public byte[] transform(String name, String transformedName, byte[] bytes)
|
||||
{
|
||||
if (bytes == null || name.equals("net.minecraftforge.event.Event") || name.startsWith("net.minecraft.") || name.indexOf('.') == -1)
|
||||
{
|
||||
|
@ -162,5 +162,4 @@ public class EventTransformer implements IClassTransformer
|
|||
classNode.methods.add(method);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Subproject commit 0419b9d9751ade4497343aefaf2ca43703eb479a
|
Binary file not shown.
15
forge.py
15
forge.py
|
@ -64,7 +64,7 @@ def zip_folder(path, key, zip):
|
|||
zip_folder(file_path, file_key, zip)
|
||||
else:
|
||||
if not file_key.replace(os.sep, '/') in zip.NameToInfo:
|
||||
print file_key
|
||||
print ' ' + file_key
|
||||
zip.write(file_path, file_key)
|
||||
|
||||
def zip_create(path, key, zip_name):
|
||||
|
@ -77,6 +77,7 @@ def zip_create(path, key, zip_name):
|
|||
|
||||
def apply_forge_patches(fml_dir, mcp_dir, forge_dir, src_dir, copy_files=True):
|
||||
sys.path.append(fml_dir)
|
||||
sys.path.append(os.path.join(fml_dir, 'install'))
|
||||
from fml import copytree, apply_patches
|
||||
|
||||
#patch files
|
||||
|
@ -100,6 +101,7 @@ def build_forge_dev(mcp_dir, forge_dir, fml_dir, build_num=0):
|
|||
shutil.rmtree(src_dir)
|
||||
|
||||
sys.path.append(fml_dir)
|
||||
sys.path.append(os.path.join(fml_dir, 'install'))
|
||||
from fml import copytree
|
||||
|
||||
print 'src_work -> src'
|
||||
|
@ -114,11 +116,18 @@ def build_forge_dev(mcp_dir, forge_dir, fml_dir, build_num=0):
|
|||
error_level = 0
|
||||
try:
|
||||
sys.path.append(mcp_dir)
|
||||
from runtime.recompile import recompile
|
||||
from runtime.commands import Commands, CLIENT, SERVER, CalledProcessError
|
||||
from runtime.mcp import recompile_side
|
||||
|
||||
os.chdir(mcp_dir)
|
||||
reset_logger()
|
||||
recompile(None, True, False)
|
||||
|
||||
commands = Commands(None, verify=True)
|
||||
try:
|
||||
recompile_side(commands, CLIENT)
|
||||
except CalledProcessError as e:
|
||||
error_level = 1
|
||||
pass
|
||||
reset_logger()
|
||||
os.chdir(forge_dir)
|
||||
except SystemExit, e:
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/Block.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/Block.java
|
||||
@@ -2,13 +2,17 @@
|
||||
@@ -1,15 +1,20 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
-import cpw.mods.fml.relauncher.Side;
|
||||
-import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import static net.minecraftforge.common.ForgeDirection.DOWN;
|
||||
+import static net.minecraftforge.common.ForgeDirection.UP;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
+
|
||||
import net.minecraft.block.material.Material;
|
||||
+import net.minecraft.client.particle.EffectRenderer;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -18,24 +23,28 @@
|
|||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -24,17 +28,27 @@
|
||||
import net.minecraft.item.ItemSlab;
|
||||
@@ -26,8 +31,10 @@
|
||||
import net.minecraft.item.ItemSnow;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
+import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntitySign;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
+import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
@@ -35,9 +42,20 @@
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraft.world.WorldProviderEnd;
|
||||
+
|
||||
+import net.minecraftforge.common.*;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
+import net.minecraftforge.common.EnumPlantType;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import net.minecraftforge.common.ForgeHooks;
|
||||
+import net.minecraftforge.common.IPlantable;
|
||||
+import cpw.mods.fml.relauncher.Side;
|
||||
+import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class Block
|
||||
{
|
||||
|
@ -46,7 +55,7 @@
|
|||
/**
|
||||
* used as foreach item, if item.tab = current tab, display it on the screen
|
||||
*/
|
||||
@@ -321,6 +335,7 @@
|
||||
@@ -332,6 +350,7 @@
|
||||
lightOpacity[par1] = this.isOpaqueCube() ? 255 : 0;
|
||||
canBlockGrass[par1] = !par2Material.getCanBlockGrass();
|
||||
}
|
||||
|
@ -54,7 +63,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -459,9 +474,10 @@
|
||||
@@ -454,9 +473,10 @@
|
||||
return this.needsRandomTick;
|
||||
}
|
||||
|
||||
|
@ -66,7 +75,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -484,7 +500,7 @@
|
||||
@@ -479,7 +499,7 @@
|
||||
*/
|
||||
public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
|
@ -75,7 +84,7 @@
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -494,7 +510,7 @@
|
||||
@@ -489,7 +509,7 @@
|
||||
*/
|
||||
public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
|
@ -84,7 +93,7 @@
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -639,7 +655,13 @@
|
||||
@@ -639,7 +659,13 @@
|
||||
/**
|
||||
* ejects contained items into the world, and notifies neighbours of an update, as appropriate
|
||||
*/
|
||||
|
@ -99,49 +108,48 @@
|
|||
|
||||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
@@ -663,8 +685,7 @@
|
||||
*/
|
||||
@@ -664,7 +690,7 @@
|
||||
public float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5)
|
||||
{
|
||||
- float var6 = this.getBlockHardness(par2World, par3, par4, par5);
|
||||
- return var6 < 0.0F ? 0.0F : (!par1EntityPlayer.canHarvestBlock(this) ? 1.0F / var6 / 100.0F : par1EntityPlayer.getCurrentPlayerStrVsBlock(this) / var6 / 30.0F);
|
||||
float f = this.getBlockHardness(par2World, par3, par4, par5);
|
||||
- return f < 0.0F ? 0.0F : (!par1EntityPlayer.canHarvestBlock(this) ? par1EntityPlayer.getCurrentPlayerStrVsBlock(this, false) / f / 100.0F : par1EntityPlayer.getCurrentPlayerStrVsBlock(this, true) / f / 30.0F);
|
||||
+ return ForgeHooks.blockStrength(this, par1EntityPlayer, par2World, par3, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -682,18 +703,13 @@
|
||||
@@ -682,18 +708,13 @@
|
||||
{
|
||||
if (!par1World.isRemote)
|
||||
{
|
||||
- int var8 = this.quantityDroppedWithBonus(par7, par1World.rand);
|
||||
- int j1 = this.quantityDroppedWithBonus(par7, par1World.rand);
|
||||
-
|
||||
- for (int var9 = 0; var9 < var8; ++var9)
|
||||
- for (int k1 = 0; k1 < j1; ++k1)
|
||||
+ ArrayList<ItemStack> items = getBlockDropped(par1World, par2, par3, par4, par5, par7);
|
||||
+
|
||||
+ for (ItemStack item : items)
|
||||
{
|
||||
if (par1World.rand.nextFloat() <= par6)
|
||||
{
|
||||
- int var10 = this.idDropped(par5, par1World.rand, par7);
|
||||
- int l1 = this.idDropped(par5, par1World.rand, par7);
|
||||
-
|
||||
- if (var10 > 0)
|
||||
- if (l1 > 0)
|
||||
- {
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var10, 1, this.damageDropped(par5)));
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(l1, 1, this.damageDropped(par5)));
|
||||
- }
|
||||
+ this.dropBlockAsItem_do(par1World, par2, par3, par4, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1081,7 +1097,7 @@
|
||||
@@ -1086,7 +1107,7 @@
|
||||
par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
|
||||
par2EntityPlayer.addExhaustion(0.025F);
|
||||
|
||||
- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
|
||||
+ if (this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
|
||||
{
|
||||
ItemStack var8 = this.createStackedBlock(par6);
|
||||
ItemStack itemstack = this.createStackedBlock(par6);
|
||||
|
||||
@@ -1097,12 +1113,13 @@
|
||||
@@ -1102,12 +1123,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,7 +164,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -1364,4 +1381,864 @@
|
||||
@@ -1414,4 +1436,871 @@
|
||||
canBlockGrass[0] = true;
|
||||
StatList.initBreakableStats();
|
||||
}
|
||||
|
@ -237,6 +245,10 @@
|
|||
+ boolean flipped = ((meta & 4) != 0);
|
||||
+ return ((meta & 3) + side.ordinal() == 5) || (side == UP && flipped);
|
||||
+ }
|
||||
+ else if (this instanceof BlockHopper && side == UP)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ return isBlockNormalCube(world, x, y, z);
|
||||
+ }
|
||||
+
|
||||
|
@ -319,7 +331,7 @@
|
|||
+ */
|
||||
+ public boolean removeBlockByPlayer(World world, EntityPlayer player, int x, int y, int z)
|
||||
+ {
|
||||
+ return world.setBlockWithNotify(x, y, z, 0);
|
||||
+ return world.func_94571_i(x, y, z);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
|
@ -422,6 +434,7 @@
|
|||
+ blockFlammability[id] = flammability;
|
||||
+ }
|
||||
+
|
||||
+ private boolean isTileProvider = this instanceof ITileEntityProvider;
|
||||
+ /**
|
||||
+ * Called throughout the code as a replacement for block instanceof BlockContainer
|
||||
+ * Moving this to the Block base class allows for mods that wish to extend vinella
|
||||
|
@ -434,22 +447,22 @@
|
|||
+ */
|
||||
+ public boolean hasTileEntity(int metadata)
|
||||
+ {
|
||||
+ return isBlockContainer;
|
||||
+ return isTileProvider;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called throughout the code as a replacement for BlockContainer.getBlockEntity
|
||||
+ * Called throughout the code as a replacement for ITileEntityProvider.createNewTileEntity
|
||||
+ * Return the same thing you would from that function.
|
||||
+ * This will fall back to BlockContainer.getBlockEntity if this block is a BlockContainer.
|
||||
+ * This will fall back to ITileEntityProvider.createNewTileEntity(World) if this block is a ITileEntityProvider
|
||||
+ *
|
||||
+ * @param metadata The Metadata of the current block
|
||||
+ * @return A instance of a class extending TileEntity
|
||||
+ */
|
||||
+ public TileEntity createTileEntity(World world, int metadata)
|
||||
+ {
|
||||
+ if (this instanceof BlockContainer)
|
||||
+ if (isTileProvider)
|
||||
+ {
|
||||
+ return ((BlockContainer)this).createNewTileEntity(world, metadata);
|
||||
+ return ((ITileEntityProvider)this).createNewTileEntity(world);
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
|
@ -688,9 +701,11 @@
|
|||
+ * @param x X Position
|
||||
+ * @param y Y Position
|
||||
+ * @param z Z Position
|
||||
+ * @param target The generic target block the gen is looking for, Standards define stone
|
||||
+ * for overworld generation, and neatherack for the nether.
|
||||
+ * @return True to allow this block to be replaced by a ore
|
||||
+ */
|
||||
+ public boolean isGenMineableReplaceable(World world, int x, int y, int z)
|
||||
+ public boolean isGenMineableReplaceable(World world, int x, int y, int z, int target)
|
||||
+ {
|
||||
+ return blockID == stone.blockID;
|
||||
+ }
|
||||
|
@ -927,12 +942,12 @@
|
|||
+ /**
|
||||
+ * Called when a plant grows on this block, only implemented for saplings using the WorldGen*Trees classes right now.
|
||||
+ * Modder may implement this for custom plants.
|
||||
+ * This does not use ForgeDirection, because large/huge trees can be located in non-representable direction,
|
||||
+ * This does not use ForgeDirection, because large/huge trees can be located in non-representable direction,
|
||||
+ * so the source location is specified.
|
||||
+ * Currently this just changes the block to dirt if it was grass.
|
||||
+ *
|
||||
+ *
|
||||
+ * Note: This happens DURING the generation, the generation may not be complete when this is called.
|
||||
+ *
|
||||
+ *
|
||||
+ * @param world Current world
|
||||
+ * @param x Soil X
|
||||
+ * @param y Soil Y
|
||||
|
@ -945,7 +960,7 @@
|
|||
+ {
|
||||
+ if (blockID == grass.blockID)
|
||||
+ {
|
||||
+ world.setBlock(x, y, z, dirt.blockID);
|
||||
+ world.setBlockAndMetadataWithNotify(x, y, z, dirt.blockID, 0, 2);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockBaseRailLogic.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockBaseRailLogic.java
|
||||
@@ -14,6 +14,8 @@
|
||||
private final boolean field_94512_f;
|
||||
private List field_94513_g;
|
||||
|
||||
+ private final boolean canMakeSlopes;
|
||||
+
|
||||
final BlockRailBase field_94518_a;
|
||||
|
||||
public BlockBaseRailLogic(BlockRailBase par1, World par2, int par3, int par4, int par5)
|
||||
@@ -25,17 +27,11 @@
|
||||
this.field_94514_d = par4;
|
||||
this.field_94515_e = par5;
|
||||
int l = par2.getBlockId(par3, par4, par5);
|
||||
- int i1 = par2.getBlockMetadata(par3, par4, par5);
|
||||
-
|
||||
- if (((BlockRailBase)Block.blocksList[l]).isPowered)
|
||||
- {
|
||||
- this.field_94512_f = true;
|
||||
- i1 &= -9;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.field_94512_f = false;
|
||||
- }
|
||||
+
|
||||
+ BlockRailBase target = (BlockRailBase)Block.blocksList[l];
|
||||
+ int i1 = target.getBasicRailMetadata(par2, null, par3, par4, par5);
|
||||
+ field_94512_f = !target.isFlexibleRail(par2, par3, par4, par5);
|
||||
+ canMakeSlopes = target.canMakeSlopes(par2, par3, par4, par5);
|
||||
|
||||
this.func_94504_a(i1);
|
||||
}
|
||||
@@ -227,7 +223,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (b0 == 0)
|
||||
+ if (b0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.isRailBlockAt(this.field_94516_b, this.field_94517_c, this.field_94514_d + 1, this.field_94515_e - 1))
|
||||
{
|
||||
@@ -240,7 +236,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (b0 == 1)
|
||||
+ if (b0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.isRailBlockAt(this.field_94516_b, this.field_94517_c + 1, this.field_94514_d + 1, this.field_94515_e))
|
||||
{
|
||||
@@ -385,7 +381,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (b0 == 0)
|
||||
+ if (b0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.isRailBlockAt(this.field_94516_b, this.field_94517_c, this.field_94514_d + 1, this.field_94515_e - 1))
|
||||
{
|
||||
@@ -398,7 +394,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (b0 == 1)
|
||||
+ if (b0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.isRailBlockAt(this.field_94516_b, this.field_94517_c + 1, this.field_94514_d + 1, this.field_94515_e))
|
||||
{
|
|
@ -1,16 +1,16 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockButton.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockButton.java
|
||||
@@ -11,6 +11,9 @@
|
||||
@@ -14,6 +14,9 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
+
|
||||
public class BlockButton extends Block
|
||||
public abstract class BlockButton extends Block
|
||||
{
|
||||
/** Whether this button is sensible to arrows, used by wooden buttons. */
|
||||
@@ -63,7 +66,11 @@
|
||||
@@ -66,7 +69,11 @@
|
||||
*/
|
||||
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
|
@ -23,7 +23,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -71,7 +78,10 @@
|
||||
@@ -74,7 +81,10 @@
|
||||
*/
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
|
@ -35,9 +35,9 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -83,19 +93,22 @@
|
||||
int var11 = var10 & 8;
|
||||
var10 &= 7;
|
||||
@@ -86,19 +96,22 @@
|
||||
int k1 = j1 & 8;
|
||||
j1 &= 7;
|
||||
|
||||
- if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||
+
|
||||
|
@ -45,24 +45,24 @@
|
|||
+
|
||||
+ if (dir == NORTH && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
var10 = 4;
|
||||
j1 = 4;
|
||||
}
|
||||
- else if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ else if (dir == SOUTH && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
var10 = 3;
|
||||
j1 = 3;
|
||||
}
|
||||
- else if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ else if (dir == WEST && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
var10 = 2;
|
||||
j1 = 2;
|
||||
}
|
||||
- else if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ else if (dir == EAST && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
var10 = 1;
|
||||
j1 = 1;
|
||||
}
|
||||
@@ -112,7 +125,11 @@
|
||||
@@ -115,7 +128,11 @@
|
||||
*/
|
||||
private int getOrientation(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
|
@ -75,30 +75,30 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -126,22 +143,22 @@
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7;
|
||||
boolean var7 = false;
|
||||
@@ -129,22 +146,22 @@
|
||||
int i1 = par1World.getBlockMetadata(par2, par3, par4) & 7;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && var6 == 1)
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && i1 == 1)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && i1 == 1)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && var6 == 2)
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && i1 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && i1 == 2)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && var6 == 3)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && i1 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && i1 == 3)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && var6 == 4)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && i1 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && i1 == 4)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockCactus.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockCactus.java
|
||||
@@ -10,7 +10,11 @@
|
||||
import net.minecraft.util.DamageSource;
|
||||
@@ -12,7 +12,11 @@
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockCactus extends Block
|
||||
|
@ -11,20 +11,20 @@
|
|||
+
|
||||
+public class BlockCactus extends Block implements IPlantable
|
||||
{
|
||||
protected BlockCactus(int par1, int par2)
|
||||
{
|
||||
@@ -149,7 +153,7 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
private Icon field_94380_a;
|
||||
@@ -158,7 +162,7 @@
|
||||
else
|
||||
{
|
||||
int var5 = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return var5 == Block.cactus.blockID || var5 == Block.sand.blockID;
|
||||
+ return blocksList[var5] != null && blocksList[var5].canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this);
|
||||
int l = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return l == Block.cactus.blockID || l == Block.sand.blockID;
|
||||
+ return blocksList[l] != null && blocksList[l].canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,4 +164,22 @@
|
||||
{
|
||||
par5Entity.attackEntityFrom(DamageSource.cactus, 1);
|
||||
@@ -177,4 +181,22 @@
|
||||
this.field_94380_a = par1IconRegister.func_94245_a("cactus_top");
|
||||
this.field_94379_b = par1IconRegister.func_94245_a("cactus_bottom");
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockChest.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockChest.java
|
||||
@@ -21,6 +21,8 @@
|
||||
@@ -23,6 +23,8 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -8,46 +8,46 @@
|
|||
+
|
||||
public class BlockChest extends BlockContainer
|
||||
{
|
||||
private Random random = new Random();
|
||||
@@ -427,7 +429,7 @@
|
||||
private final Random random = new Random();
|
||||
@@ -436,7 +438,7 @@
|
||||
{
|
||||
return true;
|
||||
return null;
|
||||
}
|
||||
- else if (par1World.isBlockNormalCube(par2, par3 + 1, par4))
|
||||
+ else if (par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN))
|
||||
{
|
||||
return true;
|
||||
return null;
|
||||
}
|
||||
@@ -435,19 +437,19 @@
|
||||
@@ -444,19 +446,19 @@
|
||||
{
|
||||
return true;
|
||||
return null;
|
||||
}
|
||||
- else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 - 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4)))
|
||||
- {
|
||||
- return true;
|
||||
- return null;
|
||||
- }
|
||||
- else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 + 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4)))
|
||||
- {
|
||||
- return true;
|
||||
- return null;
|
||||
- }
|
||||
- else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 - 1) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1)))
|
||||
- {
|
||||
- return true;
|
||||
- return null;
|
||||
- }
|
||||
- else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 + 1) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1)))
|
||||
+ else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 - 1, par3 + 1, par4, DOWN) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4)))
|
||||
+ {
|
||||
+ return true;
|
||||
+ return null;
|
||||
+ }
|
||||
+ else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 + 1, par3 + 1, par4, DOWN) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4)))
|
||||
+ {
|
||||
+ return true;
|
||||
+ return null;
|
||||
+ }
|
||||
+ else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 - 1, DOWN) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1)))
|
||||
+ {
|
||||
+ return true;
|
||||
+ return null;
|
||||
+ }
|
||||
+ else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 + 1, DOWN) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1)))
|
||||
{
|
||||
return true;
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
@@ -175,7 +177,14 @@
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
@@ -202,7 +204,14 @@
|
||||
*/
|
||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
|
||||
{
|
||||
- int var8 = func_72219_c(par5);
|
||||
- int j1 = func_72219_c(par5);
|
||||
+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
|
||||
+ }
|
||||
+
|
||||
|
@ -21,13 +21,13 @@
|
|||
+ public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> dropped = super.getBlockDropped(world, x, y, z, metadata, fortune);
|
||||
+ int var8 = func_72219_c(metadata);
|
||||
byte var9 = 1;
|
||||
+ int j1 = func_72219_c(metadata);
|
||||
byte b0 = 1;
|
||||
|
||||
if (var8 >= 2)
|
||||
@@ -185,8 +194,9 @@
|
||||
if (j1 >= 2)
|
||||
@@ -212,8 +221,9 @@
|
||||
|
||||
for (int var10 = 0; var10 < var9; ++var10)
|
||||
for (int k1 = 0; k1 < b0; ++k1)
|
||||
{
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.dyePowder, 1, 3));
|
||||
- }
|
||||
|
@ -37,9 +37,9 @@
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -206,4 +216,10 @@
|
||||
{
|
||||
return 3;
|
||||
@@ -244,4 +254,10 @@
|
||||
this.field_94469_b[i] = par1IconRegister.func_94245_a(field_94470_a[i]);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockContainer.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockContainer.java
|
||||
@@ -24,7 +24,7 @@
|
||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
super.onBlockAdded(par1World, par2, par3, par4);
|
||||
- par1World.setBlockTileEntity(par2, par3, par4, this.createNewTileEntity(par1World));
|
||||
+ par1World.setBlockTileEntity(par2, par3, par4, this.createTileEntity(par1World, par1World.getBlockMetadata(par2, par3, par4)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,6 +40,12 @@
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
public abstract TileEntity createNewTileEntity(World var1);
|
||||
+
|
||||
+
|
||||
+ public TileEntity createNewTileEntity(World world, int metadata)
|
||||
+ {
|
||||
+ return createNewTileEntity(world);
|
||||
+ }
|
||||
|
||||
/**
|
||||
* Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile
|
|
@ -1,35 +1,36 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockCrops.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockCrops.java
|
||||
@@ -2,11 +2,14 @@
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -10,6 +11,7 @@
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
public class BlockCrops extends BlockFlower
|
||||
{
|
||||
@@ -92,11 +95,11 @@
|
||||
int var19 = par1World.getBlockId(var17, par3 - 1, var18);
|
||||
float var20 = 0.0F;
|
||||
@@ -103,11 +105,11 @@
|
||||
int j3 = par1World.getBlockId(l2, par3 - 1, i3);
|
||||
float f1 = 0.0F;
|
||||
|
||||
- if (var19 == Block.tilledField.blockID)
|
||||
+ if (blocksList[var19] != null && blocksList[var19].canSustainPlant(par1World, var17, par3 - 1, var18, ForgeDirection.UP, this))
|
||||
- if (j3 == Block.tilledField.blockID)
|
||||
+ if (blocksList[j3] != null && blocksList[j3].canSustainPlant(par1World, l2, par3 - 1, i3, ForgeDirection.UP, this))
|
||||
{
|
||||
var20 = 1.0F;
|
||||
f1 = 1.0F;
|
||||
|
||||
- if (par1World.getBlockMetadata(var17, par3 - 1, var18) > 0)
|
||||
+ if (blocksList[var19].isFertile(par1World, var17, par3 - 1, var18))
|
||||
- if (par1World.getBlockMetadata(l2, par3 - 1, i3) > 0)
|
||||
+ if (blocksList[j3].isFertile(par1World, l2, par3 - 1, i3))
|
||||
{
|
||||
var20 = 3.0F;
|
||||
f1 = 3.0F;
|
||||
}
|
||||
@@ -162,22 +165,25 @@
|
||||
@@ -175,22 +177,25 @@
|
||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
|
||||
{
|
||||
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
|
||||
|
@ -48,9 +49,9 @@
|
|||
+ {
|
||||
+ for (int n = 0; n < 3 + fortune; n++)
|
||||
{
|
||||
- int var8 = 3 + par7;
|
||||
- int j1 = 3 + par7;
|
||||
-
|
||||
- for (int var9 = 0; var9 < var8; ++var9)
|
||||
- for (int k1 = 0; k1 < j1; ++k1)
|
||||
- {
|
||||
- if (par1World.rand.nextInt(15) <= par5)
|
||||
- {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockDoor.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockDoor.java
|
||||
@@ -268,7 +268,7 @@
|
||||
@@ -296,7 +296,7 @@
|
||||
{
|
||||
if (this.blockMaterial == Material.iron)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
@@ -8,6 +8,9 @@
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -10,6 +10,9 @@
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
+
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
|
@ -10,12 +10,12 @@
|
|||
|
||||
public class BlockFarmland extends Block
|
||||
{
|
||||
@@ -107,7 +110,8 @@
|
||||
@@ -115,7 +118,8 @@
|
||||
{
|
||||
int var8 = par1World.getBlockId(var6, par3 + 1, var7);
|
||||
int j1 = par1World.getBlockId(l, par3 + 1, i1);
|
||||
|
||||
- if (var8 == Block.crops.blockID || var8 == Block.melonStem.blockID || var8 == Block.pumpkinStem.blockID || var8 == Block.potato.blockID || var8 == Block.carrot.blockID)
|
||||
+ Block plant = blocksList[var8];
|
||||
- if (j1 == Block.crops.blockID || j1 == Block.melonStem.blockID || j1 == Block.pumpkinStem.blockID || j1 == Block.potato.blockID || j1 == Block.carrot.blockID)
|
||||
+ Block plant = blocksList[j1];
|
||||
+ if (plant instanceof IPlantable && canSustainPlant(par1World, par2, par3, par4, ForgeDirection.UP, (IPlantable)plant))
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockFire.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockFire.java
|
||||
@@ -9,6 +9,9 @@
|
||||
@@ -11,6 +11,9 @@
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProviderEnd;
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
|||
public class BlockFire extends Block
|
||||
{
|
||||
/** The chance this block will encourage nearby blocks to catch on fire */
|
||||
@@ -32,6 +35,8 @@
|
||||
@@ -36,6 +39,8 @@
|
||||
*/
|
||||
public void initializeBlock()
|
||||
{
|
||||
|
@ -19,7 +19,7 @@
|
|||
this.setBurnRate(Block.planks.blockID, 5, 20);
|
||||
this.setBurnRate(Block.woodDoubleSlab.blockID, 5, 20);
|
||||
this.setBurnRate(Block.woodSingleSlab.blockID, 5, 20);
|
||||
@@ -56,8 +61,7 @@
|
||||
@@ -60,8 +65,7 @@
|
||||
*/
|
||||
private void setBurnRate(int par1, int par2, int par3)
|
||||
{
|
||||
|
@ -29,72 +29,72 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -117,12 +121,8 @@
|
||||
@@ -121,12 +125,8 @@
|
||||
{
|
||||
if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick"))
|
||||
{
|
||||
- boolean var6 = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID;
|
||||
- boolean flag = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID;
|
||||
-
|
||||
- if (par1World.provider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID)
|
||||
- {
|
||||
- var6 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
+ Block base = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
|
||||
+ boolean var6 = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), UP));
|
||||
+ boolean flag = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), UP));
|
||||
|
||||
if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
|
||||
{
|
||||
@@ -151,7 +151,7 @@
|
||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||
@@ -155,7 +155,7 @@
|
||||
par1World.func_94571_i(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
- else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4) && var7 == 15 && par5Random.nextInt(4) == 0)
|
||||
+ else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4, UP) && var7 == 15 && par5Random.nextInt(4) == 0)
|
||||
- else if (!flag && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4) && l == 15 && par5Random.nextInt(4) == 0)
|
||||
+ else if (!flag && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4, UP) && l == 15 && par5Random.nextInt(4) == 0)
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||
par1World.func_94571_i(par2, par3, par4);
|
||||
}
|
||||
@@ -165,12 +165,12 @@
|
||||
var9 = -50;
|
||||
@@ -169,12 +169,12 @@
|
||||
b0 = -50;
|
||||
}
|
||||
|
||||
- this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7);
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7, WEST );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7, EAST );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7, UP );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7, DOWN );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7, SOUTH);
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7, NORTH);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + b0, par5Random, l);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + b0, par5Random, l);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + b0, par5Random, l);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + b0, par5Random, l);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + b0, par5Random, l);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + b0, par5Random, l);
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + b0, par5Random, l, WEST );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + b0, par5Random, l, EAST );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + b0, par5Random, l, UP );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + b0, par5Random, l, DOWN );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + b0, par5Random, l, SOUTH);
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + b0, par5Random, l, NORTH);
|
||||
|
||||
for (int var10 = par2 - 1; var10 <= par2 + 1; ++var10)
|
||||
for (int i1 = par2 - 1; i1 <= par2 + 1; ++i1)
|
||||
{
|
||||
@@ -224,9 +224,20 @@
|
||||
@@ -228,9 +228,20 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ @Deprecated
|
||||
private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7)
|
||||
{
|
||||
- int var8 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)];
|
||||
- int j1 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)];
|
||||
+ tryToCatchBlockOnFire(par1World, par2, par3, par4, par5, par6Random, par7, UP);
|
||||
+ }
|
||||
+
|
||||
+ private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7, ForgeDirection face)
|
||||
+ {
|
||||
+ int var8 = 0;
|
||||
+ int j1 = 0;
|
||||
+ Block block = Block.blocksList[par1World.getBlockId(par2, par3, par4)];
|
||||
+ if (block != null)
|
||||
+ {
|
||||
+ var8 = block.getFlammability(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), face);
|
||||
+ j1 = block.getFlammability(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), face);
|
||||
+ }
|
||||
|
||||
if (par6Random.nextInt(par5) < var8)
|
||||
if (par6Random.nextInt(par5) < j1)
|
||||
{
|
||||
@@ -260,7 +271,12 @@
|
||||
@@ -264,7 +275,12 @@
|
||||
*/
|
||||
private boolean canNeighborBurn(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
|
@ -108,26 +108,26 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -276,12 +292,12 @@
|
||||
@@ -280,12 +296,12 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5);
|
||||
- var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6);
|
||||
- var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6);
|
||||
- var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6);
|
||||
- var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6);
|
||||
- var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6);
|
||||
+ int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5, WEST);
|
||||
+ var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6, EAST);
|
||||
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6, UP);
|
||||
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6, DOWN);
|
||||
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6, SOUTH);
|
||||
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6, NORTH);
|
||||
return var6;
|
||||
- int l = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, b0);
|
||||
- l = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, l);
|
||||
- l = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, l);
|
||||
- l = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, l);
|
||||
- l = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, l);
|
||||
- l = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, l);
|
||||
+ int l = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, b0, WEST);
|
||||
+ l = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, l, EAST);
|
||||
+ l = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, l, UP);
|
||||
+ l = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, l, DOWN);
|
||||
+ l = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, l, SOUTH);
|
||||
+ l = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, l, NORTH);
|
||||
return l;
|
||||
}
|
||||
}
|
||||
@@ -296,21 +312,24 @@
|
||||
@@ -300,21 +316,24 @@
|
||||
|
||||
/**
|
||||
* Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z
|
||||
|
@ -151,15 +151,15 @@
|
|||
+ @Deprecated
|
||||
public int getChanceToEncourageFire(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
- int var6 = this.chanceToEncourageFire[par1World.getBlockId(par2, par3, par4)];
|
||||
- return var6 > par5 ? var6 : par5;
|
||||
- int i1 = this.chanceToEncourageFire[par1World.getBlockId(par2, par3, par4)];
|
||||
- return i1 > par5 ? i1 : par5;
|
||||
+ return getChanceToEncourageFire(par1World, par2, par3, par4, par5, UP);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -368,9 +387,9 @@
|
||||
float var8;
|
||||
float var9;
|
||||
@@ -372,9 +391,9 @@
|
||||
float f1;
|
||||
float f2;
|
||||
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4))
|
||||
- {
|
||||
|
@ -168,47 +168,47 @@
|
|||
+ {
|
||||
+ if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
for (var6 = 0; var6 < 2; ++var6)
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -381,7 +400,7 @@
|
||||
@@ -385,7 +404,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4))
|
||||
+ if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
for (var6 = 0; var6 < 2; ++var6)
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -392,7 +411,7 @@
|
||||
@@ -396,7 +415,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1))
|
||||
+ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
for (var6 = 0; var6 < 2; ++var6)
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -403,7 +422,7 @@
|
||||
@@ -407,7 +426,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1))
|
||||
+ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
for (var6 = 0; var6 < 2; ++var6)
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -414,7 +433,7 @@
|
||||
@@ -418,7 +437,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4))
|
||||
+ if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4, DOWN))
|
||||
{
|
||||
for (var6 = 0; var6 < 2; ++var6)
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -436,4 +455,46 @@
|
||||
}
|
||||
}
|
||||
@@ -462,4 +481,46 @@
|
||||
{
|
||||
return this.field_94439_c[0];
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
+
|
||||
+public class BlockFlower extends Block implements IPlantable
|
||||
{
|
||||
protected BlockFlower(int par1, int par2, Material par3Material)
|
||||
protected BlockFlower(int par1, Material par2Material)
|
||||
{
|
||||
@@ -28,7 +33,7 @@
|
||||
@@ -27,7 +32,7 @@
|
||||
*/
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
|
@ -23,7 +23,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +77,9 @@
|
||||
@@ -71,7 +76,9 @@
|
||||
*/
|
||||
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
|
@ -34,7 +34,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -108,4 +115,32 @@
|
||||
@@ -107,4 +114,32 @@
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockFluid.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockFluid.java
|
||||
@@ -54,7 +54,7 @@
|
||||
@@ -59,7 +59,7 @@
|
||||
{
|
||||
for (int var9 = -1; var9 <= 1; ++var9)
|
||||
for (int l1 = -1; l1 <= 1; ++l1)
|
||||
{
|
||||
- int var10 = par1IBlockAccess.getBiomeGenForCoords(par2 + var9, par4 + var8).waterColorMultiplier;
|
||||
+ int var10 = par1IBlockAccess.getBiomeGenForCoords(par2 + var9, par4 + var8).getWaterColorMultiplier();
|
||||
var5 += (var10 & 16711680) >> 16;
|
||||
var6 += (var10 & 65280) >> 8;
|
||||
var7 += var10 & 255;
|
||||
- int i2 = par1IBlockAccess.getBiomeGenForCoords(par2 + l1, par4 + k1).waterColorMultiplier;
|
||||
+ int i2 = par1IBlockAccess.getBiomeGenForCoords(par2 + l1, par4 + k1).getWaterColorMultiplier();
|
||||
l += (i2 & 16711680) >> 16;
|
||||
i1 += (i2 & 65280) >> 8;
|
||||
j1 += i2 & 255;
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockGrass.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockGrass.java
|
||||
@@ -100,7 +100,7 @@
|
||||
@@ -44,7 +44,7 @@
|
||||
{
|
||||
if (!par1World.isRemote)
|
||||
{
|
||||
- if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2)
|
||||
+ if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && par1World.getBlockLightOpacity(par2, par3 + 1, par4) > 2)
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, Block.dirt.blockID);
|
||||
par1World.func_94575_c(par2, par3, par4, Block.dirt.blockID);
|
||||
}
|
||||
@@ -113,7 +113,7 @@
|
||||
int var9 = par4 + par5Random.nextInt(3) - 1;
|
||||
int var10 = par1World.getBlockId(var7, var8 + 1, var9);
|
||||
@@ -57,7 +57,7 @@
|
||||
int k1 = par4 + par5Random.nextInt(3) - 1;
|
||||
int l1 = par1World.getBlockId(i1, j1 + 1, k1);
|
||||
|
||||
- if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2)
|
||||
+ if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && par1World.getBlockLightOpacity(var7, var8 + 1, var9) <= 2)
|
||||
- if (par1World.getBlockId(i1, j1, k1) == Block.dirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && Block.lightOpacity[l1] <= 2)
|
||||
+ if (par1World.getBlockId(i1, j1, k1) == Block.dirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && par1World.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
|
||||
{
|
||||
par1World.setBlockWithNotify(var7, var8, var9, Block.grass.blockID);
|
||||
par1World.func_94575_c(i1, j1, k1, Block.grass.blockID);
|
||||
}
|
||||
|
|
|
@ -24,57 +24,57 @@
|
|||
/**
|
||||
@@ -114,22 +120,22 @@
|
||||
{
|
||||
int var10 = par9;
|
||||
int j1 = par9;
|
||||
|
||||
- if ((par9 == 0 || par5 == 2) && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||
+ if ((var10 == 0 || par5 == 2) && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
+ if ((j1 == 0 || par5 == 2) && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
var10 = 2;
|
||||
j1 = 2;
|
||||
}
|
||||
|
||||
- if ((var10 == 0 || par5 == 3) && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ if ((var10 == 0 || par5 == 3) && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
- if ((j1 == 0 || par5 == 3) && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ if ((j1 == 0 || par5 == 3) && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
var10 = 3;
|
||||
j1 = 3;
|
||||
}
|
||||
|
||||
- if ((var10 == 0 || par5 == 4) && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ if ((var10 == 0 || par5 == 4) && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
- if ((j1 == 0 || par5 == 4) && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ if ((j1 == 0 || par5 == 4) && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
var10 = 4;
|
||||
j1 = 4;
|
||||
}
|
||||
|
||||
- if ((var10 == 0 || par5 == 5) && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ if ((var10 == 0 || par5 == 5) && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
- if ((j1 == 0 || par5 == 5) && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ if ((j1 == 0 || par5 == 5) && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
var10 = 5;
|
||||
j1 = 5;
|
||||
}
|
||||
@@ -146,22 +152,22 @@
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean var7 = false;
|
||||
int i1 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean flag = false;
|
||||
|
||||
- if (var6 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||
+ if (var6 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
- if (i1 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||
+ if (i1 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (var6 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ if (var6 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
- if (i1 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ if (i1 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (var6 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ if (var6 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
- if (i1 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ if (i1 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (var6 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ if (var6 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
- if (i1 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ if (i1 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
@@ -182,4 +188,10 @@
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -14,7 +16,9 @@
|
||||
@@ -16,7 +18,9 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -18,38 +18,38 @@
|
|||
+
|
||||
+public class BlockLeaves extends BlockLeavesBase implements IShearable
|
||||
{
|
||||
/**
|
||||
* The base index in terrain.png corresponding to the fancy version of the leaf texture. This is stored so we can
|
||||
public static final String[] LEAF_TYPES = new String[] {"oak", "spruce", "birch", "jungle"};
|
||||
public static final String[][] field_94396_b = new String[][] {{"leaves", "leaves_spruce", "leaves", "leaves_jungle"}, {"leaves_opaque", "leaves_spruce_opaque", "leaves_opaque", "leaves_jungle_opaque"}};
|
||||
@@ -107,10 +111,9 @@
|
||||
{
|
||||
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
||||
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
|
||||
|
||||
- if (var12 == Block.leaves.blockID)
|
||||
+ if (Block.blocksList[var12] != null)
|
||||
- if (j2 == Block.leaves.blockID)
|
||||
+ if (Block.blocksList[j2] != null)
|
||||
{
|
||||
- int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
||||
- par1World.setBlockMetadata(par2 + var9, par3 + var10, par4 + var11, var13 | 8);
|
||||
+ Block.blocksList[var12].beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11);
|
||||
- int k2 = par1World.getBlockMetadata(par2 + k1, par3 + l1, par4 + i2);
|
||||
- par1World.setBlockMetadataWithNotify(par2 + k1, par3 + l1, par4 + i2, k2 | 8, 4);
|
||||
+ Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,11 +159,13 @@
|
||||
{
|
||||
var15 = par1World.getBlockId(par2 + var12, par3 + var13, par4 + var14);
|
||||
k2 = par1World.getBlockId(par2 + l1, par3 + i2, par4 + j2);
|
||||
|
||||
- if (var15 == Block.wood.blockID)
|
||||
+ Block block = Block.blocksList[var15];
|
||||
- if (k2 == Block.wood.blockID)
|
||||
+ Block block = Block.blocksList[k2];
|
||||
+
|
||||
+ if (block != null && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14))
|
||||
+ if (block != null && block.canSustainLeaves(par1World, par2 + l1, par3 + i2, par4 + j2))
|
||||
{
|
||||
this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0;
|
||||
this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0;
|
||||
}
|
||||
- else if (var15 == Block.leaves.blockID)
|
||||
+ else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14))
|
||||
- else if (k2 == Block.leaves.blockID)
|
||||
+ else if (block != null && block.isLeaves(par1World, par2 + l1, par3 + i2, par4 + j2))
|
||||
{
|
||||
this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2;
|
||||
this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
|
||||
}
|
||||
@@ -303,15 +308,7 @@
|
||||
@@ -325,15 +330,7 @@
|
||||
*/
|
||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
|
@ -66,9 +66,9 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -371,4 +368,30 @@
|
||||
{
|
||||
return new ItemStack(this.blockID, 1, par1 & 3);
|
||||
@@ -409,4 +406,30 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
|
@ -88,7 +88,7 @@
|
|||
+ @Override
|
||||
+ public void beginLeavesDecay(World world, int x, int y, int z)
|
||||
+ {
|
||||
+ world.setBlockMetadata(x, y, z, world.getBlockMetadata(x, y, z) | 8);
|
||||
+ world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 4);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockLever.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockLever.java
|
||||
@@ -7,6 +7,9 @@
|
||||
@@ -10,6 +10,9 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
|||
+
|
||||
public class BlockLever extends Block
|
||||
{
|
||||
protected BlockLever(int par1, int par2)
|
||||
@@ -54,7 +57,13 @@
|
||||
protected BlockLever(int par1)
|
||||
@@ -57,7 +60,13 @@
|
||||
*/
|
||||
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
|
@ -25,7 +25,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -62,7 +71,12 @@
|
||||
@@ -65,7 +74,12 @@
|
||||
*/
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
|
@ -39,121 +39,121 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -74,32 +88,32 @@
|
||||
int var10 = par9 & 7;
|
||||
var10 = -1;
|
||||
@@ -77,32 +91,32 @@
|
||||
int k1 = par9 & 7;
|
||||
byte b0 = -1;
|
||||
|
||||
- if (par5 == 0 && par1World.isBlockNormalCube(par2, par3 + 1, par4))
|
||||
+ if (par5 == 0 && par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN))
|
||||
{
|
||||
var10 = par1World.rand.nextBoolean() ? 0 : 7;
|
||||
b0 = 0;
|
||||
}
|
||||
|
||||
- if (par5 == 1 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4))
|
||||
+ if (par5 == 1 && par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP))
|
||||
{
|
||||
var10 = 5 + par1World.rand.nextInt(2);
|
||||
b0 = 5;
|
||||
}
|
||||
|
||||
- if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||
+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
var10 = 4;
|
||||
b0 = 4;
|
||||
}
|
||||
|
||||
- if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
var10 = 3;
|
||||
b0 = 3;
|
||||
}
|
||||
|
||||
- if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
var10 = 2;
|
||||
b0 = 2;
|
||||
}
|
||||
|
||||
- if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
var10 = 1;
|
||||
b0 = 1;
|
||||
}
|
||||
@@ -142,42 +156,42 @@
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7;
|
||||
boolean var7 = false;
|
||||
@@ -178,42 +192,42 @@
|
||||
int i1 = par1World.getBlockMetadata(par2, par3, par4) & 7;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1)
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && i1 == 1)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2)
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && i1 == 2)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && i1 == 3)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && i1 == 4)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && var6 == 5)
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 5)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && var6 == 6)
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 6)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && var6 == 0)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 0)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && var6 == 7)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && var6 == 1)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 7)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && i1 == 1)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && var6 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && i1 == 2)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && var6 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && i1 == 3)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && var6 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && i1 == 4)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && var6 == 5)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 5)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && var6 == 6)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 6)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && var6 == 0)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 0)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && var6 == 7)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 7)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockLog.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockLog.java
|
||||
@@ -63,14 +63,9 @@
|
||||
@@ -69,14 +69,9 @@
|
||||
{
|
||||
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
||||
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
|
||||
|
||||
- if (var12 == Block.leaves.blockID)
|
||||
+ if (Block.blocksList[var12] != null)
|
||||
- if (j2 == Block.leaves.blockID)
|
||||
+ if (Block.blocksList[j2] != null)
|
||||
{
|
||||
- int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
||||
- int k2 = par1World.getBlockMetadata(par2 + k1, par3 + l1, par4 + i2);
|
||||
-
|
||||
- if ((var13 & 8) == 0)
|
||||
- if ((k2 & 8) == 0)
|
||||
- {
|
||||
- par1World.setBlockMetadata(par2 + var9, par3 + var10, par4 + var11, var13 | 8);
|
||||
- par1World.setBlockMetadataWithNotify(par2 + k1, par3 + l1, par4 + i2, k2 | 8, 4);
|
||||
- }
|
||||
+ Block.blocksList[var12].beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11);
|
||||
+ Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,4 +146,16 @@
|
||||
{
|
||||
return new ItemStack(this.blockID, 1, limitToValidMetadata(par1));
|
||||
@@ -171,4 +166,16 @@
|
||||
this.field_94390_c[i] = par1IconRegister.func_94245_a(field_94389_b[i]);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
@@ -3,6 +3,8 @@
|
||||
import java.util.Random;
|
||||
@@ -6,6 +6,8 @@
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenBigMushroom;
|
||||
+
|
||||
|
@ -9,13 +9,13 @@
|
|||
|
||||
public class BlockMushroom extends BlockFlower
|
||||
{
|
||||
@@ -96,7 +98,9 @@
|
||||
@@ -102,7 +104,9 @@
|
||||
if (par3 >= 0 && par3 < 256)
|
||||
{
|
||||
int var5 = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return var5 == Block.mycelium.blockID || par1World.getFullBlockLightValue(par2, par3, par4) < 13 && this.canThisPlantGrowOnThisBlockID(var5);
|
||||
+ Block soil = Block.blocksList[var5];
|
||||
+ return (var5 == Block.mycelium.blockID || par1World.getFullBlockLightValue(par2, par3, par4) < 13) &&
|
||||
int l = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return l == Block.mycelium.blockID || par1World.getFullBlockLightValue(par2, par3, par4) < 13 && this.canThisPlantGrowOnThisBlockID(l);
|
||||
+ Block soil = Block.blocksList[l];
|
||||
+ return (l == Block.mycelium.blockID || par1World.getFullBlockLightValue(par2, par3, par4) < 13) &&
|
||||
+ (soil != null && soil.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
@@ -55,7 +55,7 @@
|
||||
@@ -41,7 +41,7 @@
|
||||
{
|
||||
if (!par1World.isRemote)
|
||||
{
|
||||
- if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2)
|
||||
+ if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && par1World.getBlockLightOpacity(par2, par3 + 1, par4) > 2)
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, Block.dirt.blockID);
|
||||
par1World.func_94575_c(par2, par3, par4, Block.dirt.blockID);
|
||||
}
|
||||
@@ -68,7 +68,7 @@
|
||||
int var9 = par4 + par5Random.nextInt(3) - 1;
|
||||
int var10 = par1World.getBlockId(var7, var8 + 1, var9);
|
||||
@@ -54,7 +54,7 @@
|
||||
int k1 = par4 + par5Random.nextInt(3) - 1;
|
||||
int l1 = par1World.getBlockId(i1, j1 + 1, k1);
|
||||
|
||||
- if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2)
|
||||
+ if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && par1World.getBlockLightOpacity(var7, var8 + 1, var9) <= 2)
|
||||
- if (par1World.getBlockId(i1, j1, k1) == Block.dirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && Block.lightOpacity[l1] <= 2)
|
||||
+ if (par1World.getBlockId(i1, j1, k1) == Block.dirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && par1World.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
|
||||
{
|
||||
par1World.setBlockWithNotify(var7, var8, var9, this.blockID);
|
||||
par1World.func_94575_c(i1, j1, k1, this.blockID);
|
||||
}
|
||||
|
|
|
@ -1,21 +1,23 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockNetherStalk.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockNetherStalk.java
|
||||
@@ -2,11 +2,14 @@
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -9,6 +11,7 @@
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
public class BlockNetherStalk extends BlockFlower
|
||||
{
|
||||
@@ -33,7 +36,8 @@
|
||||
@@ -39,7 +42,8 @@
|
||||
*/
|
||||
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
|
@ -25,25 +27,25 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -73,25 +77,7 @@
|
||||
@@ -81,25 +85,7 @@
|
||||
*/
|
||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
|
||||
{
|
||||
- if (!par1World.isRemote)
|
||||
- {
|
||||
- int var8 = 1;
|
||||
- int j1 = 1;
|
||||
-
|
||||
- if (par5 >= 3)
|
||||
- {
|
||||
- var8 = 2 + par1World.rand.nextInt(3);
|
||||
- j1 = 2 + par1World.rand.nextInt(3);
|
||||
-
|
||||
- if (par7 > 0)
|
||||
- {
|
||||
- var8 += par1World.rand.nextInt(par7 + 1);
|
||||
- j1 += par1World.rand.nextInt(par7 + 1);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- for (int var9 = 0; var9 < var8; ++var9)
|
||||
- for (int k1 = 0; k1 < j1; ++k1)
|
||||
- {
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.netherStalkSeeds));
|
||||
- }
|
||||
|
@ -52,9 +54,9 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -119,4 +105,23 @@
|
||||
{
|
||||
return Item.netherStalkSeeds.itemID;
|
||||
@@ -138,4 +124,23 @@
|
||||
this.field_94372_b[i] = par1IconRegister.func_94245_a(field_94373_a[i]);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
@@ -380,7 +380,7 @@
|
||||
@@ -426,7 +426,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
- return !(Block.blocksList[par0] instanceof BlockContainer);
|
||||
- return !(Block.blocksList[par0] instanceof ITileEntityProvider);
|
||||
+ return !par1World.blockHasTileEntity(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@
|
||||
@@ -444,7 +444,7 @@
|
||||
{
|
||||
if (var8 < 13)
|
||||
if (l1 < 13)
|
||||
{
|
||||
- if (var6 <= 0 || var6 >= 255)
|
||||
+ if (var6 <= 0 || var6 >= par0World.getHeight() - 1)
|
||||
- if (j1 <= 0 || j1 >= 255)
|
||||
+ if (j1 <= 0 || j1 >= par0World.getHeight() - 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -448,7 +448,7 @@
|
||||
@@ -494,7 +494,7 @@
|
||||
|
||||
if (var9 < 13)
|
||||
if (l1 < 13)
|
||||
{
|
||||
- if (var7 <= 0 || var7 >= 255)
|
||||
+ if (var7 <= 0 || var7 >= par1World.getHeight() - 1)
|
||||
- if (j1 <= 0 || j1 >= 255)
|
||||
+ if (j1 <= 0 || j1 >= par1World.getHeight() - 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockRail.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockRail.java
|
||||
@@ -3,12 +3,16 @@
|
||||
--- ../src_base/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
@@ -3,6 +3,7 @@
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -8,34 +8,16 @@
|
|||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
+
|
||||
public class BlockRail extends Block
|
||||
{
|
||||
/** Power related rails have this field at true. */
|
||||
@@ -21,7 +25,7 @@
|
||||
public static final boolean isRailBlockAt(World par0World, int par1, int par2, int par3)
|
||||
{
|
||||
int var4 = par0World.getBlockId(par1, par2, par3);
|
||||
- return var4 == Block.rail.blockID || var4 == Block.railPowered.blockID || var4 == Block.railDetector.blockID;
|
||||
+ return isRailBlock(var4);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,7 +33,7 @@
|
||||
@@ -28,7 +29,7 @@
|
||||
*/
|
||||
public static final boolean isRailBlock(int par0)
|
||||
{
|
||||
- return par0 == Block.rail.blockID || par0 == Block.railPowered.blockID || par0 == Block.railDetector.blockID;
|
||||
+ return Block.blocksList[par0] instanceof BlockRail;
|
||||
- return par0 == Block.rail.blockID || par0 == Block.railPowered.blockID || par0 == Block.railDetector.blockID || par0 == Block.field_94337_cv.blockID;
|
||||
+ return Block.blocksList[par0] instanceof BlockRailBase;
|
||||
}
|
||||
|
||||
protected BlockRail(int par1, int par2, boolean par3)
|
||||
@@ -126,7 +130,7 @@
|
||||
protected BlockRailBase(int par1, boolean par2)
|
||||
@@ -105,7 +106,7 @@
|
||||
*/
|
||||
public int getRenderType()
|
||||
{
|
||||
|
@ -44,63 +26,12 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -142,7 +146,7 @@
|
||||
*/
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
- return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||
+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP);
|
||||
@@ -242,4 +243,107 @@
|
||||
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, par5);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -179,27 +183,27 @@
|
||||
|
||||
boolean var8 = false;
|
||||
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4))
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP))
|
||||
{
|
||||
var8 = true;
|
||||
}
|
||||
|
||||
- if (var7 == 2 && !par1World.doesBlockHaveSolidTopSurface(par2 + 1, par3, par4))
|
||||
+ if (var7 == 2 && !par1World.isBlockSolidOnSide(par2 + 1, par3, par4, UP))
|
||||
{
|
||||
var8 = true;
|
||||
}
|
||||
|
||||
- if (var7 == 3 && !par1World.doesBlockHaveSolidTopSurface(par2 - 1, par3, par4))
|
||||
+ if (var7 == 3 && !par1World.isBlockSolidOnSide(par2 - 1, par3, par4, UP))
|
||||
{
|
||||
var8 = true;
|
||||
}
|
||||
|
||||
- if (var7 == 4 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 - 1))
|
||||
+ if (var7 == 4 && !par1World.isBlockSolidOnSide(par2, par3, par4 - 1, UP))
|
||||
{
|
||||
var8 = true;
|
||||
}
|
||||
|
||||
- if (var7 == 5 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 + 1))
|
||||
+ if (var7 == 5 && !par1World.isBlockSolidOnSide(par2, par3, par4 + 1, UP))
|
||||
{
|
||||
var8 = true;
|
||||
}
|
||||
@@ -400,9 +404,135 @@
|
||||
|
||||
/**
|
||||
* Return true if the blocks passed is a power related rail.
|
||||
- */
|
||||
+ * @deprecated
|
||||
+ * This function is no longer called by Minecraft
|
||||
+ */
|
||||
+ @Deprecated
|
||||
static boolean isPoweredBlockRail(BlockRail par0BlockRail)
|
||||
{
|
||||
return par0BlockRail.isPowered;
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+
|
||||
+ /**
|
||||
+ * Return true if the rail can make corners.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
|
@ -129,7 +60,7 @@
|
|||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return the rails metadata (without the power bit if the rail uses one).
|
||||
+ * Return the rail's metadata (without the power bit if the rail uses one).
|
||||
+ * Can be used to make the cart think the rail something other than it is,
|
||||
+ * for example when making diamond junctions or switches.
|
||||
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
||||
|
@ -146,10 +77,6 @@
|
|||
+ * 0x8: EastSouth corner (connecting West and North)
|
||||
+ * 0x9: WestSouth corner (connecting East and North)
|
||||
+ *
|
||||
+ * All directions are Notch defined.
|
||||
+ * In MC Beta 1.8.3 the Sun rises in the North.
|
||||
+ * In MC 1.0.0 the Sun rises in the East.
|
||||
+ *
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
||||
+ * @param y The rail X coordinate.
|
||||
|
@ -192,23 +119,7 @@
|
|||
+ */
|
||||
+ public void onMinecartPass(World world, EntityMinecart cart, int y, int x, int z)
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return true if this rail uses the 4th bit as a power bit.
|
||||
+ * Avoid using this function when getBasicRailMetadata() can be used instead.
|
||||
+ * The only reason to use this function is if you wish to change the rails metadata.
|
||||
+ * @param world The world.
|
||||
+ * @param x The rail X coordinate.
|
||||
+ * @param y The rail Y coordinate.
|
||||
+ * @param z The rail Z coordinate.
|
||||
+ * @return True if the 4th bit is a power bit.
|
||||
+ */
|
||||
+ public boolean hasPowerBit(World world, int x, int y, int z)
|
||||
+ {
|
||||
+ return isPowered;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Forge: Moved render type to a field and a setter.
|
|
@ -1,11 +1,11 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
@@ -565,7 +565,7 @@
|
||||
@@ -473,7 +473,7 @@
|
||||
}
|
||||
else if (var5 != Block.redstoneRepeaterIdle.blockID && var5 != Block.redstoneRepeaterActive.blockID)
|
||||
else if (!Block.redstoneRepeaterIdle.func_94487_f(i1))
|
||||
{
|
||||
- return Block.blocksList[var5].canProvidePower() && par4 != -1;
|
||||
+ return (Block.blocksList[var5] != null && Block.blocksList[var5].canConnectRedstone(par0IBlockAccess, par1, par2, par3, par4));
|
||||
- return Block.blocksList[i1].canProvidePower() && par4 != -1;
|
||||
+ return (Block.blocksList[i1] != null && Block.blocksList[i1].canConnectRedstone(par0IBlockAccess, par1, par2, par3, par4));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -11,20 +11,20 @@
|
|||
+
|
||||
+public class BlockReed extends Block implements IPlantable
|
||||
{
|
||||
protected BlockReed(int par1, int par2)
|
||||
protected BlockReed(int par1)
|
||||
{
|
||||
@@ -55,8 +59,8 @@
|
||||
@@ -54,8 +58,8 @@
|
||||
*/
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
- int var5 = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return var5 == this.blockID ? true : (var5 != Block.grass.blockID && var5 != Block.dirt.blockID && var5 != Block.sand.blockID ? false : (par1World.getBlockMaterial(par2 - 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2 + 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2, par3 - 1, par4 - 1) == Material.water ? true : par1World.getBlockMaterial(par2, par3 - 1, par4 + 1) == Material.water))));
|
||||
- int l = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return l == this.blockID ? true : (l != Block.grass.blockID && l != Block.dirt.blockID && l != Block.sand.blockID ? false : (par1World.getBlockMaterial(par2 - 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2 + 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2, par3 - 1, par4 - 1) == Material.water ? true : par1World.getBlockMaterial(par2, par3 - 1, par4 + 1) == Material.water))));
|
||||
+ Block block = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
|
||||
+ return (block != null && block.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,4 +143,22 @@
|
||||
@@ -138,4 +142,22 @@
|
||||
{
|
||||
return Item.reed.itemID;
|
||||
}
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockSapling.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockSapling.java
|
||||
@@ -13,6 +13,8 @@
|
||||
import net.minecraft.world.gen.feature.WorldGenTaiga2;
|
||||
@@ -16,6 +16,8 @@
|
||||
import net.minecraft.world.gen.feature.WorldGenTrees;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
+
|
||||
+import net.minecraftforge.event.terraingen.TerrainGen;
|
||||
|
||||
+import net.minecraftforge.event.terraingen.TerrainGen;
|
||||
+
|
||||
public class BlockSapling extends BlockFlower
|
||||
{
|
||||
@@ -65,6 +67,8 @@
|
||||
public static final String[] WOOD_TYPES = new String[] {"oak", "spruce", "birch", "jungle"};
|
||||
@@ -77,6 +79,8 @@
|
||||
*/
|
||||
public void growTree(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||
{
|
||||
+ if (!TerrainGen.saplingGrowTree(par1World, par5Random, par2, par3, par4)) return;
|
||||
+
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4) & 3;
|
||||
Object var7 = null;
|
||||
int var8 = 0;
|
||||
int l = par1World.getBlockMetadata(par2, par3, par4) & 3;
|
||||
Object object = null;
|
||||
int i1 = 0;
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
@@ -133,11 +135,6 @@
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
@@ -135,11 +137,6 @@
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,8 +21,8 @@
|
|||
* Called when the block is attempted to be harvested
|
||||
*/
|
||||
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer)
|
||||
@@ -148,6 +145,8 @@
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, par5);
|
||||
@@ -150,6 +147,8 @@
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 4);
|
||||
}
|
||||
|
||||
+ dropBlockAsItem(par1World, par2, par3, par4, par5, 0);
|
||||
|
@ -30,28 +30,13 @@
|
|||
super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer);
|
||||
}
|
||||
|
||||
@@ -156,24 +155,30 @@
|
||||
@@ -158,24 +157,30 @@
|
||||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
- if (!par1World.isRemote)
|
||||
- {
|
||||
- if ((par6 & 8) == 0)
|
||||
- {
|
||||
- ItemStack var7 = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(par1World, par2, par3, par4));
|
||||
- TileEntitySkull var8 = (TileEntitySkull)par1World.getBlockTileEntity(par2, par3, par4);
|
||||
-
|
||||
- if (var8.getSkullType() == 3 && var8.getExtraType() != null && var8.getExtraType().length() > 0)
|
||||
- {
|
||||
- var7.setTagCompound(new NBTTagCompound());
|
||||
- var7.getTagCompound().setString("SkullOwner", var8.getExtraType());
|
||||
- }
|
||||
-
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, var7);
|
||||
- }
|
||||
-
|
||||
- super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
- }
|
||||
+ super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
+ }
|
||||
+
|
||||
|
@ -61,19 +46,32 @@
|
|||
+ ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
+ if ((metadata & 8) == 0)
|
||||
+ {
|
||||
+ ItemStack var7 = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(world, x, y, z));
|
||||
+ TileEntitySkull var8 = (TileEntitySkull)world.getBlockTileEntity(x, y, z);
|
||||
+ ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(world, x, y, z));
|
||||
+ TileEntitySkull tileentityskull = (TileEntitySkull)world.getBlockTileEntity(x, y, z);
|
||||
+
|
||||
+ if (var8 == null)
|
||||
+ {
|
||||
+ if (tileentityskull == null)
|
||||
{
|
||||
- ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(par1World, par2, par3, par4));
|
||||
- TileEntitySkull tileentityskull = (TileEntitySkull)par1World.getBlockTileEntity(par2, par3, par4);
|
||||
-
|
||||
- if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0)
|
||||
- {
|
||||
- itemstack.setTagCompound(new NBTTagCompound());
|
||||
- itemstack.getTagCompound().setString("SkullOwner", tileentityskull.getExtraType());
|
||||
- }
|
||||
-
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, itemstack);
|
||||
+ return drops;
|
||||
+ }
|
||||
+ if (var8.getSkullType() == 3 && var8.getExtraType() != null && var8.getExtraType().length() > 0)
|
||||
}
|
||||
-
|
||||
- super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
- }
|
||||
+ if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0)
|
||||
+ {
|
||||
+ var7.setTagCompound(new NBTTagCompound());
|
||||
+ var7.getTagCompound().setString("SkullOwner", var8.getExtraType());
|
||||
+ itemstack.setTagCompound(new NBTTagCompound());
|
||||
+ itemstack.getTagCompound().setString("SkullOwner", tileentityskull.getExtraType());
|
||||
+ }
|
||||
+ drops.add(var7);
|
||||
+ drops.add(itemstack);
|
||||
+ }
|
||||
+ return drops;
|
||||
}
|
||||
|
|
|
@ -1,36 +1,42 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockSnow.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockSnow.java
|
||||
@@ -67,7 +67,8 @@
|
||||
@@ -88,8 +88,12 @@
|
||||
*/
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
int var5 = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return var5 != 0 && (var5 == Block.leaves.blockID || Block.blocksList[var5].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false;
|
||||
+ Block block = Block.blocksList[var5];
|
||||
+ return block != null && (block.isLeaves(par1World, par2, par3 - 1, par4) || Block.blocksList[var5].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false;
|
||||
- int l = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return l == 0 ? false : (l == this.blockID && (par1World.getBlockMetadata(par2, par3 - 1, par4) & 7) == 7 ? true : (l != Block.leaves.blockID && !Block.blocksList[l].isOpaqueCube() ? false : par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement()));
|
||||
+ int l = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
+ Block block = Block.blocksList[l];
|
||||
+ if (block == null) return false;
|
||||
+ if (block == this && (par1World.getBlockMetadata(par2, par3 - 1, par4) & 7) == 7) return true;
|
||||
+ if (block.isLeaves(par1World, par2, par3 - 1, par4) && Block.blocksList[l].isOpaqueCube()) return false;
|
||||
+ return par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +87,6 @@
|
||||
@@ -108,7 +112,6 @@
|
||||
{
|
||||
if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
|
||||
{
|
||||
- this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||
par1World.func_94571_i(par2, par3, par4);
|
||||
return false;
|
||||
}
|
||||
@@ -102,10 +102,8 @@
|
||||
@@ -124,11 +127,8 @@
|
||||
*/
|
||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
- int var7 = Item.snowball.itemID;
|
||||
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(var7, 1, 0));
|
||||
- int i1 = Item.snowball.itemID;
|
||||
- int j1 = par6 & 7;
|
||||
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(i1, j1 + 1, 0));
|
||||
+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||
par1World.setBlockWithNotify(par3, par4, par5, 0);
|
||||
par1World.func_94571_i(par3, par4, par5);
|
||||
- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,7 +119,7 @@
|
||||
@@ -144,7 +144,7 @@
|
||||
*/
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
|
@ -39,11 +45,22 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -131,7 +129,6 @@
|
||||
@@ -154,7 +154,6 @@
|
||||
{
|
||||
if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11)
|
||||
{
|
||||
- this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||
par1World.func_94571_i(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
@@ -169,4 +168,10 @@
|
||||
{
|
||||
return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public int quantityDropped(int meta, int fortune, Random random)
|
||||
+ {
|
||||
+ return (meta & 7) + 1;
|
||||
+ }
|
||||
}
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
+
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -9,6 +11,8 @@
|
||||
@@ -12,6 +14,8 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -18,38 +18,38 @@
|
|||
public class BlockStem extends BlockFlower
|
||||
{
|
||||
/** Defines if it is a Melon or a Pumpkin that the stem is producing. */
|
||||
@@ -101,7 +105,8 @@
|
||||
@@ -106,7 +110,8 @@
|
||||
|
||||
int var11 = par1World.getBlockId(var9, par3 - 1, var10);
|
||||
int l1 = par1World.getBlockId(j1, par3 - 1, k1);
|
||||
|
||||
- if (par1World.getBlockId(var9, par3, var10) == 0 && (var11 == Block.tilledField.blockID || var11 == Block.dirt.blockID || var11 == Block.grass.blockID))
|
||||
+ boolean isSoil = (blocksList[var11] != null && blocksList[var11].canSustainPlant(par1World, var9, par3 - 1, var10, ForgeDirection.UP, this));
|
||||
+ if (par1World.getBlockId(var9, par3, var10) == 0 && (isSoil || var11 == Block.dirt.blockID || var11 == Block.grass.blockID))
|
||||
- if (par1World.getBlockId(j1, par3, k1) == 0 && (l1 == Block.tilledField.blockID || l1 == Block.dirt.blockID || l1 == Block.grass.blockID))
|
||||
+ boolean isSoil = (blocksList[l1] != null && blocksList[l1].canSustainPlant(par1World, j1, par3 - 1, k1, ForgeDirection.UP, this));
|
||||
+ if (par1World.getBlockId(j1, par3, k1) == 0 && (isSoil || l1 == Block.dirt.blockID || l1 == Block.grass.blockID))
|
||||
{
|
||||
par1World.setBlockWithNotify(var9, par3, var10, this.fruitType.blockID);
|
||||
par1World.func_94575_c(j1, par3, k1, this.fruitType.blockID);
|
||||
}
|
||||
@@ -137,11 +142,11 @@
|
||||
int var19 = par1World.getBlockId(var17, par3 - 1, var18);
|
||||
float var20 = 0.0F;
|
||||
@@ -149,11 +154,11 @@
|
||||
int j3 = par1World.getBlockId(l2, par3 - 1, i3);
|
||||
float f1 = 0.0F;
|
||||
|
||||
- if (var19 == Block.tilledField.blockID)
|
||||
+ if (blocksList[var19] != null && blocksList[var19].canSustainPlant(par1World, var17, par3 - 1, var18, ForgeDirection.UP, this))
|
||||
- if (j3 == Block.tilledField.blockID)
|
||||
+ if (blocksList[j3] != null && blocksList[j3].canSustainPlant(par1World, l2, par3 - 1, i3, ForgeDirection.UP, this))
|
||||
{
|
||||
var20 = 1.0F;
|
||||
f1 = 1.0F;
|
||||
|
||||
- if (par1World.getBlockMetadata(var17, par3 - 1, var18) > 0)
|
||||
+ if (blocksList[var19].isFertile(par1World, var17, par3 - 1, var18))
|
||||
- if (par1World.getBlockMetadata(l2, par3 - 1, i3) > 0)
|
||||
+ if (blocksList[j3].isFertile(par1World, l2, par3 - 1, i3))
|
||||
{
|
||||
var20 = 3.0F;
|
||||
f1 = 3.0F;
|
||||
}
|
||||
@@ -241,29 +246,22 @@
|
||||
@@ -245,29 +250,22 @@
|
||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
|
||||
{
|
||||
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
|
||||
-
|
||||
- if (!par1World.isRemote)
|
||||
- {
|
||||
- Item var8 = null;
|
||||
- Item item = null;
|
||||
-
|
||||
- if (this.fruitType == Block.pumpkin)
|
||||
+ }
|
||||
|
@ -63,20 +63,20 @@
|
|||
+ {
|
||||
+ if (world.rand.nextInt(15) <= metadata)
|
||||
{
|
||||
- var8 = Item.pumpkinSeeds;
|
||||
- item = Item.pumpkinSeeds;
|
||||
+ ret.add(new ItemStack(fruitType == pumpkin ? Item.pumpkinSeeds : Item.melonSeeds));
|
||||
}
|
||||
-
|
||||
- if (this.fruitType == Block.melon)
|
||||
- {
|
||||
- var8 = Item.melonSeeds;
|
||||
- item = Item.melonSeeds;
|
||||
- }
|
||||
-
|
||||
- for (int var9 = 0; var9 < 3; ++var9)
|
||||
- for (int j1 = 0; j1 < 3; ++j1)
|
||||
- {
|
||||
- if (par1World.rand.nextInt(15) <= par5)
|
||||
- {
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var8));
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(item));
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -15,7 +17,10 @@
|
||||
@@ -17,7 +19,10 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -19,9 +19,9 @@
|
|||
+
|
||||
+public class BlockTallGrass extends BlockFlower implements IShearable
|
||||
{
|
||||
protected BlockTallGrass(int par1, int par2)
|
||||
{
|
||||
@@ -37,7 +42,7 @@
|
||||
private static final String[] field_94367_a = new String[] {"deadbush", "tallgrass", "fern"};
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -50,7 +55,7 @@
|
||||
*/
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -54,15 +59,7 @@
|
||||
@@ -67,15 +72,7 @@
|
||||
*/
|
||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
|
@ -47,8 +47,8 @@
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -115,4 +112,35 @@
|
||||
par3List.add(new ItemStack(par1, 1, var4));
|
||||
@@ -139,4 +136,35 @@
|
||||
this.field_94366_b[i] = par1IconRegister.func_94245_a(field_94367_a[i]);
|
||||
}
|
||||
}
|
||||
+
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
+
|
||||
public class BlockTorch extends Block
|
||||
{
|
||||
protected BlockTorch(int par1, int par2)
|
||||
protected BlockTorch(int par1)
|
||||
@@ -65,7 +68,7 @@
|
||||
else
|
||||
{
|
||||
int var5 = par1World.getBlockId(par2, par3, par4);
|
||||
- return var5 == Block.fence.blockID || var5 == Block.netherFence.blockID || var5 == Block.glass.blockID || var5 == Block.cobblestoneWall.blockID;
|
||||
+ return (Block.blocksList[var5] != null && Block.blocksList[var5].canPlaceTorchOnTop(par1World, par2, par3, par4));
|
||||
int l = par1World.getBlockId(par2, par3, par4);
|
||||
- return l == Block.fence.blockID || l == Block.netherFence.blockID || l == Block.glass.blockID || l == Block.cobblestoneWall.blockID;
|
||||
+ return (Block.blocksList[l] != null && Block.blocksList[l].canPlaceTorchOnTop(par1World, par2, par3, par4));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,31 +33,31 @@
|
|||
|
||||
/**
|
||||
@@ -89,22 +96,22 @@
|
||||
var10 = 5;
|
||||
j1 = 5;
|
||||
}
|
||||
|
||||
- if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
|
||||
+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true))
|
||||
{
|
||||
var10 = 4;
|
||||
j1 = 4;
|
||||
}
|
||||
|
||||
- if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
|
||||
+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true))
|
||||
{
|
||||
var10 = 3;
|
||||
j1 = 3;
|
||||
}
|
||||
|
||||
- if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
|
||||
+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true))
|
||||
{
|
||||
var10 = 2;
|
||||
j1 = 2;
|
||||
}
|
||||
|
||||
- if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
|
||||
+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true))
|
||||
{
|
||||
var10 = 1;
|
||||
j1 = 1;
|
||||
}
|
||||
@@ -132,19 +139,19 @@
|
||||
{
|
||||
|
@ -66,59 +66,59 @@
|
|||
- if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
|
||||
+ if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true))
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 1);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2);
|
||||
}
|
||||
- else if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
|
||||
+ else if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true))
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2);
|
||||
}
|
||||
- else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
|
||||
+ else if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true))
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);
|
||||
}
|
||||
- else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
|
||||
+ else if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true))
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2);
|
||||
}
|
||||
@@ -168,22 +175,22 @@
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean var7 = false;
|
||||
@@ -173,22 +180,22 @@
|
||||
int i1 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean flag = false;
|
||||
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && var6 == 1)
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && i1 == 1)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && var6 == 2)
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && i1 == 2)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && var6 == 3)
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && i1 == 3)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && var6 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) && var6 == 1)
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && i1 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) && i1 == 1)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) && var6 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) && i1 == 2)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) && var6 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) && i1 == 3)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) && var6 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) && i1 == 4)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
|
|
@ -14,16 +14,16 @@
|
|||
protected BlockTrapDoor(int par1, Material par2Material)
|
||||
{
|
||||
super(par1, par2Material);
|
||||
@@ -201,7 +206,7 @@
|
||||
--var7;
|
||||
@@ -194,7 +199,7 @@
|
||||
--j1;
|
||||
}
|
||||
|
||||
- if (!isValidSupportBlock(par1World.getBlockId(var7, par3, var8)))
|
||||
+ if (!(isValidSupportBlock(par1World.getBlockId(var7, par3, var8)) || par1World.isBlockSolidOnSide(var7, par3, var8, ForgeDirection.getOrientation((var6 & 3) + 2))))
|
||||
- if (!isValidSupportBlock(par1World.getBlockId(j1, par3, k1)))
|
||||
+ if (!(isValidSupportBlock(par1World.getBlockId(j1, par3, k1)) || par1World.isBlockSolidOnSide(j1, par3, k1, ForgeDirection.getOrientation((i1 & 3) + 2))))
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0);
|
||||
@@ -266,6 +271,10 @@
|
||||
par1World.func_94571_i(par2, par3, par4);
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, i1, 0);
|
||||
@@ -259,6 +264,10 @@
|
||||
*/
|
||||
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
|
@ -34,7 +34,7 @@
|
|||
if (par5 == 0)
|
||||
{
|
||||
return false;
|
||||
@@ -296,7 +305,7 @@
|
||||
@@ -289,7 +298,7 @@
|
||||
--par2;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
@@ -311,6 +320,10 @@
|
||||
@@ -304,6 +313,10 @@
|
||||
*/
|
||||
private static boolean isValidSupportBlock(int par0)
|
||||
{
|
||||
|
|
|
@ -37,64 +37,64 @@
|
|||
/**
|
||||
@@ -82,22 +92,22 @@
|
||||
{
|
||||
byte var10 = 0;
|
||||
byte b0 = 0;
|
||||
|
||||
- if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
|
||||
+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, WEST, true))
|
||||
{
|
||||
var10 = 2;
|
||||
b0 = 2;
|
||||
}
|
||||
|
||||
- if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
|
||||
+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, EAST, true))
|
||||
{
|
||||
var10 = 0;
|
||||
b0 = 0;
|
||||
}
|
||||
|
||||
- if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
|
||||
+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, NORTH, true))
|
||||
{
|
||||
var10 = 1;
|
||||
b0 = 1;
|
||||
}
|
||||
|
||||
- if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
|
||||
+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, SOUTH, true))
|
||||
{
|
||||
var10 = 3;
|
||||
b0 = 3;
|
||||
}
|
||||
@@ -127,22 +137,22 @@
|
||||
int var7 = var6 & 3;
|
||||
boolean var8 = false;
|
||||
int j1 = i1 & 3;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var7 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, SOUTH) && var7 == 3)
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && j1 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, SOUTH) && j1 == 3)
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var7 == 1)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, NORTH) && var7 == 1)
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && j1 == 1)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, NORTH) && j1 == 1)
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var7 == 0)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, EAST) && var7 == 0)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && j1 == 0)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, EAST) && j1 == 0)
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var7 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, WEST) && var7 == 2)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && j1 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, WEST) && j1 == 2)
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
@@ -163,7 +173,7 @@
|
||||
boolean var12 = (par6 & 8) == 8;
|
||||
boolean var13 = par5 == Block.tripWireSource.blockID;
|
||||
boolean var14 = false;
|
||||
- boolean var15 = !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||
+ boolean var15 = !par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP);
|
||||
int var16 = Direction.offsetX[var10];
|
||||
int var17 = Direction.offsetZ[var10];
|
||||
int var18 = 0;
|
||||
boolean flag2 = (par6 & 8) == 8;
|
||||
boolean flag3 = par5 == Block.tripWireSource.blockID;
|
||||
boolean flag4 = false;
|
||||
- boolean flag5 = !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||
+ boolean flag5 = !par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP);
|
||||
int i2 = Direction.offsetX[l1];
|
||||
int j2 = Direction.offsetZ[l1];
|
||||
int k2 = 0;
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
- {
|
||||
- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||
- }
|
||||
- }
|
||||
+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||
+ }
|
||||
+
|
||||
|
@ -55,5 +54,5 @@
|
|||
+ public boolean isLadder(World world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/RailLogic.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/RailLogic.java
|
||||
@@ -20,6 +20,7 @@
|
||||
private List connectedTracks;
|
||||
|
||||
final BlockRail rail;
|
||||
+ private final boolean canMakeSlopes;
|
||||
|
||||
public RailLogic(BlockRail par1BlockRail, World par2World, int par3, int par4, int par5)
|
||||
{
|
||||
@@ -30,18 +31,11 @@
|
||||
this.trackY = par4;
|
||||
this.trackZ = par5;
|
||||
int var6 = par2World.getBlockId(par3, par4, par5);
|
||||
- int var7 = par2World.getBlockMetadata(par3, par4, par5);
|
||||
-
|
||||
- if (BlockRail.isPoweredBlockRail((BlockRail)Block.blocksList[var6]))
|
||||
- {
|
||||
- this.isPoweredRail = true;
|
||||
- var7 &= -9;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.isPoweredRail = false;
|
||||
- }
|
||||
-
|
||||
+
|
||||
+ BlockRail target = (BlockRail)Block.blocksList[var6];
|
||||
+ int var7 = target.getBasicRailMetadata(par2World, null, par3, par4, par5);
|
||||
+ isPoweredRail = !target.isFlexibleRail(par2World, par3, par4, par5);
|
||||
+ canMakeSlopes = target.canMakeSlopes(par2World, par3, par4, par5);
|
||||
this.setConnections(var7);
|
||||
}
|
||||
|
||||
@@ -260,7 +254,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (var6 == 0)
|
||||
+ if (var6 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX, this.trackY + 1, this.trackZ - 1))
|
||||
{
|
||||
@@ -273,7 +267,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (var6 == 1)
|
||||
+ if (var6 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX + 1, this.trackY + 1, this.trackZ))
|
||||
{
|
||||
@@ -424,7 +418,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (var7 == 0)
|
||||
+ if (var7 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX, this.trackY + 1, this.trackZ - 1))
|
||||
{
|
||||
@@ -437,7 +431,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (var7 == 1)
|
||||
+ if (var7 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX + 1, this.trackY + 1, this.trackZ))
|
||||
{
|
|
@ -1,61 +1,46 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/Minecraft.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/Minecraft.java
|
||||
@@ -128,6 +128,12 @@
|
||||
@@ -123,6 +123,10 @@
|
||||
|
||||
import com.google.common.collect.MapDifference;
|
||||
|
||||
+import net.minecraftforge.common.ForgeHooks;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
+import net.minecraftforge.event.ForgeEventFactory;
|
||||
+import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
+import net.minecraftforge.event.world.WorldEvent;
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract class Minecraft implements Runnable, IPlayerUsage
|
||||
{
|
||||
@@ -1253,7 +1259,7 @@
|
||||
@@ -1237,7 +1241,7 @@
|
||||
|
||||
if (this.thePlayer.canCurrentToolHarvestBlock(var3, var4, var5))
|
||||
if (this.thePlayer.canCurrentToolHarvestBlock(j, k, l))
|
||||
{
|
||||
- this.effectRenderer.addBlockHitEffects(var3, var4, var5, this.objectMouseOver.sideHit);
|
||||
+ this.effectRenderer.addBlockHitEffects(var3, var4, var5, this.objectMouseOver);
|
||||
- this.effectRenderer.addBlockHitEffects(j, k, l, this.objectMouseOver.sideHit);
|
||||
+ this.effectRenderer.addBlockHitEffects(j, k, l, this.objectMouseOver);
|
||||
this.thePlayer.swingItem();
|
||||
}
|
||||
}
|
||||
@@ -1319,7 +1325,8 @@
|
||||
@@ -1303,7 +1307,8 @@
|
||||
{
|
||||
int var8 = var3 != null ? var3.stackSize : 0;
|
||||
int j1 = itemstack != null ? itemstack.stackSize : 0;
|
||||
|
||||
- if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, var3, var4, var5, var6, var7, this.objectMouseOver.hitVec))
|
||||
+ boolean result = !ForgeEventFactory.onPlayerInteract(thePlayer, Action.RIGHT_CLICK_BLOCK, var4, var5, var6, var7).isCanceled();
|
||||
+ if (result && this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, var3, var4, var5, var6, var7, this.objectMouseOver.hitVec))
|
||||
- if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, j, k, l, i1, this.objectMouseOver.hitVec))
|
||||
+ boolean result = !ForgeEventFactory.onPlayerInteract(thePlayer, Action.RIGHT_CLICK_BLOCK, j, k, l, i1).isCanceled();
|
||||
+ if (result && this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, j, k, l, i1, this.objectMouseOver.hitVec))
|
||||
{
|
||||
var2 = false;
|
||||
flag = false;
|
||||
this.thePlayer.swingItem();
|
||||
@@ -1345,7 +1352,8 @@
|
||||
@@ -1329,7 +1334,8 @@
|
||||
{
|
||||
ItemStack var9 = this.thePlayer.inventory.getCurrentItem();
|
||||
ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem();
|
||||
|
||||
- if (var9 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, var9))
|
||||
- if (itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
|
||||
+ boolean result = !ForgeEventFactory.onPlayerInteract(thePlayer, Action.RIGHT_CLICK_AIR, 0, 0, 0, -1).isCanceled();
|
||||
+ if (result && var9 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, var9))
|
||||
+ if (result && itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
|
||||
{
|
||||
this.entityRenderer.itemRenderer.resetEquippedProgress2();
|
||||
}
|
||||
@@ -2026,6 +2034,12 @@
|
||||
|
||||
if (par1WorldClient == null)
|
||||
{
|
||||
+
|
||||
+ if (theWorld != null)
|
||||
+ {
|
||||
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(theWorld));
|
||||
+ }
|
||||
+
|
||||
NetClientHandler var3 = this.getSendQueue();
|
||||
|
||||
if (var3 != null)
|
||||
@@ -2041,6 +2055,18 @@
|
||||
@@ -2026,6 +2032,18 @@
|
||||
if (this.theIntegratedServer != null)
|
||||
{
|
||||
this.theIntegratedServer.initiateShutdown();
|
||||
|
@ -74,103 +59,111 @@
|
|||
}
|
||||
|
||||
this.theIntegratedServer = null;
|
||||
@@ -2350,95 +2376,12 @@
|
||||
@@ -2353,103 +2371,12 @@
|
||||
if (this.objectMouseOver != null)
|
||||
{
|
||||
boolean var1 = this.thePlayer.capabilities.isCreativeMode;
|
||||
- int var3 = 0;
|
||||
- boolean var4 = false;
|
||||
- int var2;
|
||||
int var5;
|
||||
boolean flag = this.thePlayer.capabilities.isCreativeMode;
|
||||
- int i = 0;
|
||||
- boolean flag1 = false;
|
||||
- int j;
|
||||
int k;
|
||||
|
||||
- if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE)
|
||||
- {
|
||||
- var5 = this.objectMouseOver.blockX;
|
||||
- int var6 = this.objectMouseOver.blockY;
|
||||
- int var7 = this.objectMouseOver.blockZ;
|
||||
- Block var8 = Block.blocksList[this.theWorld.getBlockId(var5, var6, var7)];
|
||||
- k = this.objectMouseOver.blockX;
|
||||
- int l = this.objectMouseOver.blockY;
|
||||
- int i1 = this.objectMouseOver.blockZ;
|
||||
- Block block = Block.blocksList[this.theWorld.getBlockId(k, l, i1)];
|
||||
-
|
||||
- if (var8 == null)
|
||||
- if (block == null)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- var2 = var8.idPicked(this.theWorld, var5, var6, var7);
|
||||
- j = block.idPicked(this.theWorld, k, l, i1);
|
||||
-
|
||||
- if (var2 == 0)
|
||||
- if (j == 0)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- var4 = Item.itemsList[var2].getHasSubtypes();
|
||||
- int var9 = var2 < 256 && !Block.blocksList[var8.blockID].func_82505_u_() ? var2 : var8.blockID;
|
||||
- var3 = Block.blocksList[var9].getDamageValue(this.theWorld, var5, var6, var7);
|
||||
- flag1 = Item.itemsList[j].getHasSubtypes();
|
||||
- int j1 = j < 256 && !Block.blocksList[block.blockID].func_82505_u_() ? j : block.blockID;
|
||||
- i = Block.blocksList[j1].getDamageValue(this.theWorld, k, l, i1);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1)
|
||||
- if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (this.objectMouseOver.entityHit instanceof EntityPainting)
|
||||
- {
|
||||
- var2 = Item.painting.itemID;
|
||||
- j = Item.painting.itemID;
|
||||
- }
|
||||
- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame)
|
||||
- {
|
||||
- EntityItemFrame var10 = (EntityItemFrame)this.objectMouseOver.entityHit;
|
||||
- EntityItemFrame entityitemframe = (EntityItemFrame)this.objectMouseOver.entityHit;
|
||||
-
|
||||
- if (var10.getDisplayedItem() == null)
|
||||
- if (entityitemframe.getDisplayedItem() == null)
|
||||
- {
|
||||
- var2 = Item.itemFrame.itemID;
|
||||
- j = Item.itemFrame.itemID;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- var2 = var10.getDisplayedItem().itemID;
|
||||
- var3 = var10.getDisplayedItem().getItemDamage();
|
||||
- var4 = true;
|
||||
- j = entityitemframe.getDisplayedItem().itemID;
|
||||
- i = entityitemframe.getDisplayedItem().getItemDamage();
|
||||
- flag1 = true;
|
||||
- }
|
||||
- }
|
||||
- else if (this.objectMouseOver.entityHit instanceof EntityMinecart)
|
||||
- {
|
||||
- EntityMinecart var11 = (EntityMinecart)this.objectMouseOver.entityHit;
|
||||
- EntityMinecart entityminecart = (EntityMinecart)this.objectMouseOver.entityHit;
|
||||
-
|
||||
- if (var11.minecartType == 2)
|
||||
- if (entityminecart.func_94087_l() == 2)
|
||||
- {
|
||||
- var2 = Item.minecartPowered.itemID;
|
||||
- j = Item.minecartPowered.itemID;
|
||||
- }
|
||||
- else if (var11.minecartType == 1)
|
||||
- else if (entityminecart.func_94087_l() == 1)
|
||||
- {
|
||||
- var2 = Item.minecartCrate.itemID;
|
||||
- j = Item.minecartCrate.itemID;
|
||||
- }
|
||||
- else if (entityminecart.func_94087_l() == 3)
|
||||
- {
|
||||
- j = Item.field_94582_cb.itemID;
|
||||
- }
|
||||
- else if (entityminecart.func_94087_l() == 5)
|
||||
- {
|
||||
- j = Item.field_96600_cc.itemID;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- var2 = Item.minecartEmpty.itemID;
|
||||
- j = Item.minecartEmpty.itemID;
|
||||
- }
|
||||
- }
|
||||
- else if (this.objectMouseOver.entityHit instanceof EntityBoat)
|
||||
- {
|
||||
- var2 = Item.boat.itemID;
|
||||
- j = Item.boat.itemID;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- var2 = Item.monsterPlacer.itemID;
|
||||
- var3 = EntityList.getEntityID(this.objectMouseOver.entityHit);
|
||||
- var4 = true;
|
||||
- j = Item.monsterPlacer.itemID;
|
||||
- i = EntityList.getEntityID(this.objectMouseOver.entityHit);
|
||||
- flag1 = true;
|
||||
-
|
||||
- if (var3 <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(var3)))
|
||||
- if (i <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(i)))
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- this.thePlayer.inventory.setCurrentItem(var2, var3, var4, var1);
|
||||
- this.thePlayer.inventory.setCurrentItem(j, i, flag1, flag);
|
||||
+ if (!ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld))
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
if (var1)
|
||||
if (flag)
|
||||
{
|
||||
|
|
|
@ -39,67 +39,67 @@
|
|||
+ ModCompatibilityClient.audioModAddCodecs();
|
||||
+ MinecraftForge.EVENT_BUS.post(new SoundSetupEvent(this));
|
||||
sndSystem = new SoundSystem();
|
||||
this.options.soundVolume = var1;
|
||||
this.options.musicVolume = var2;
|
||||
this.options.soundVolume = f;
|
||||
this.options.musicVolume = f1;
|
||||
@@ -177,10 +187,12 @@
|
||||
}
|
||||
|
||||
SoundPoolEntry var1 = this.soundPoolMusic.getRandomSound();
|
||||
+ var1 = ModCompatibilityClient.audioModPickBackgroundMusic(this, var1);
|
||||
+ var1 = SoundEvent.getResult(new PlayBackgroundMusicEvent(this, var1));
|
||||
SoundPoolEntry soundpoolentry = this.soundPoolMusic.getRandomSound();
|
||||
+ soundpoolentry = ModCompatibilityClient.audioModPickBackgroundMusic(this, soundpoolentry);
|
||||
+ soundpoolentry = SoundEvent.getResult(new PlayBackgroundMusicEvent(this, soundpoolentry));
|
||||
|
||||
if (var1 != null)
|
||||
if (soundpoolentry != null)
|
||||
{
|
||||
- this.ticksBeforeMusic = this.rand.nextInt(12000) + 12000;
|
||||
+ this.ticksBeforeMusic = this.rand.nextInt(MUSIC_INTERVAL) + MUSIC_INTERVAL;
|
||||
sndSystem.backgroundMusic("BgMusic", var1.soundUrl, var1.soundName, false);
|
||||
sndSystem.backgroundMusic("BgMusic", soundpoolentry.soundUrl, soundpoolentry.soundName, false);
|
||||
sndSystem.setVolume("BgMusic", this.options.musicVolume);
|
||||
sndSystem.play("BgMusic");
|
||||
@@ -247,6 +259,7 @@
|
||||
if (par1Str != null)
|
||||
{
|
||||
SoundPoolEntry var6 = this.soundPoolStreaming.getRandomSoundFromSoundPool(par1Str);
|
||||
+ var6 = SoundEvent.getResult(new PlayStreamingEvent(this, var6, par1Str, par2, par3, par4));
|
||||
SoundPoolEntry soundpoolentry = this.soundPoolStreaming.getRandomSoundFromSoundPool(par1Str);
|
||||
+ soundpoolentry = SoundEvent.getResult(new PlayStreamingEvent(this, soundpoolentry, par1Str, par2, par3, par4));
|
||||
|
||||
if (var6 != null)
|
||||
if (soundpoolentry != null)
|
||||
{
|
||||
@@ -258,6 +271,7 @@
|
||||
float var7 = 16.0F;
|
||||
sndSystem.newStreamingSource(true, var5, var6.soundUrl, var6.soundName, false, par2, par3, par4, 2, var7 * 4.0F);
|
||||
sndSystem.setVolume(var5, 0.5F * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayStreamingSourceEvent(this, var5, par2, par3, par4));
|
||||
sndSystem.play(var5);
|
||||
float f3 = 16.0F;
|
||||
sndSystem.newStreamingSource(true, s1, soundpoolentry.soundUrl, soundpoolentry.soundName, false, par2, par3, par4, 2, f3 * 4.0F);
|
||||
sndSystem.setVolume(s1, 0.5F * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayStreamingSourceEvent(this, s1, par2, par3, par4));
|
||||
sndSystem.play(s1);
|
||||
}
|
||||
}
|
||||
@@ -437,6 +451,7 @@
|
||||
if (loaded && this.options.soundVolume != 0.0F)
|
||||
{
|
||||
SoundPoolEntry var7 = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str);
|
||||
+ var7 = SoundEvent.getResult(new PlaySoundEvent(this, var7, par1Str, par2, par3, par4, par5, par6));
|
||||
SoundPoolEntry soundpoolentry = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str);
|
||||
+ soundpoolentry = SoundEvent.getResult(new PlaySoundEvent(this, soundpoolentry, par1Str, par2, par3, par4, par5, par6));
|
||||
|
||||
if (var7 != null && par5 > 0.0F)
|
||||
if (soundpoolentry != null && par5 > 0.0F)
|
||||
{
|
||||
@@ -458,6 +473,7 @@
|
||||
}
|
||||
|
||||
sndSystem.setVolume(var8, par5 * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlaySoundSourceEvent(this, var8, par2, par3, par4));
|
||||
sndSystem.play(var8);
|
||||
sndSystem.setVolume(s1, par5 * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlaySoundSourceEvent(this, s1, par2, par3, par4));
|
||||
sndSystem.play(s1);
|
||||
}
|
||||
}
|
||||
@@ -472,6 +488,7 @@
|
||||
if (loaded && this.options.soundVolume != 0.0F)
|
||||
{
|
||||
SoundPoolEntry var4 = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str);
|
||||
+ var4 = SoundEvent.getResult(new PlaySoundEffectEvent(this, var4, par1Str, par2, par3));
|
||||
SoundPoolEntry soundpoolentry = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str);
|
||||
+ soundpoolentry = SoundEvent.getResult(new PlaySoundEffectEvent(this, soundpoolentry, par1Str, par2, par3));
|
||||
|
||||
if (var4 != null)
|
||||
if (soundpoolentry != null)
|
||||
{
|
||||
@@ -487,6 +504,7 @@
|
||||
par2 *= 0.25F;
|
||||
sndSystem.setPitch(var5, par3);
|
||||
sndSystem.setVolume(var5, par2 * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlaySoundEffectSourceEvent(this, var5));
|
||||
sndSystem.play(var5);
|
||||
sndSystem.setPitch(s1, par3);
|
||||
sndSystem.setVolume(s1, par2 * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlaySoundEffectSourceEvent(this, s1));
|
||||
sndSystem.play(s1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,20 +34,20 @@
|
|||
+ {
|
||||
try
|
||||
{
|
||||
String var3 = par1Str;
|
||||
String s1 = par1Str;
|
||||
@@ -56,13 +77,13 @@
|
||||
this.nameToSoundPoolEntriesMapping.put(par1Str, new ArrayList());
|
||||
}
|
||||
|
||||
- SoundPoolEntry var4 = new SoundPoolEntry(var3, par2File.toURI().toURL());
|
||||
+ SoundPoolEntry var4 = new SoundPoolEntry(var3, url);
|
||||
((List)this.nameToSoundPoolEntriesMapping.get(par1Str)).add(var4);
|
||||
this.allSoundPoolEntries.add(var4);
|
||||
- SoundPoolEntry soundpoolentry = new SoundPoolEntry(s1, par2File.toURI().toURL());
|
||||
+ SoundPoolEntry soundpoolentry = new SoundPoolEntry(s1, url);
|
||||
((List)this.nameToSoundPoolEntriesMapping.get(par1Str)).add(soundpoolentry);
|
||||
this.allSoundPoolEntries.add(soundpoolentry);
|
||||
++this.numberOfSoundPoolEntries;
|
||||
return var4;
|
||||
return soundpoolentry;
|
||||
}
|
||||
- catch (MalformedURLException var5)
|
||||
+ catch (Exception var5)
|
||||
- catch (MalformedURLException malformedurlexception)
|
||||
+ catch (Exception malformedurlexception)
|
||||
{
|
||||
var5.printStackTrace();
|
||||
throw new RuntimeException(var5);
|
||||
malformedurlexception.printStackTrace();
|
||||
throw new RuntimeException(malformedurlexception);
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/gui/GuiControls.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/gui/GuiControls.java
|
||||
@@ -5,6 +5,8 @@
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
@@ -6,6 +6,8 @@
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StringTranslate;
|
||||
+
|
||||
+import net.minecraftforge.client.GuiControlsScrollPanel;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiControls extends GuiScreen
|
||||
@@ -23,6 +25,8 @@
|
||||
@@ -24,6 +26,8 @@
|
||||
/** The ID of the button that has been pressed. */
|
||||
private int buttonId = -1;
|
||||
|
||||
|
@ -18,34 +18,36 @@
|
|||
public GuiControls(GuiScreen par1GuiScreen, GameSettings par2GameSettings)
|
||||
{
|
||||
this.parentScreen = par1GuiScreen;
|
||||
@@ -39,15 +43,12 @@
|
||||
@@ -40,15 +44,10 @@
|
||||
*/
|
||||
public void initGui()
|
||||
{
|
||||
+ scrollPane = new GuiControlsScrollPanel(this, options, mc);
|
||||
StringTranslate var1 = StringTranslate.getInstance();
|
||||
int var2 = this.func_73907_g();
|
||||
|
||||
- for (int var3 = 0; var3 < this.options.keyBindings.length; ++var3)
|
||||
StringTranslate stringtranslate = StringTranslate.getInstance();
|
||||
- int i = this.func_73907_g();
|
||||
-
|
||||
- for (int j = 0; j < this.options.keyBindings.length; ++j)
|
||||
- {
|
||||
- this.controlList.add(new GuiSmallButton(var3, var2 + var3 % 2 * 160, this.height / 6 + 24 * (var3 >> 1), 70, 20, this.options.getOptionDisplayString(var3)));
|
||||
- this.buttonList.add(new GuiSmallButton(j, i + j % 2 * 160, this.height / 6 + 24 * (j >> 1), 70, 20, this.options.getOptionDisplayString(j)));
|
||||
- }
|
||||
-
|
||||
- this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, var1.translateKey("gui.done")));
|
||||
+ this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height - 28, var1.translateKey("gui.done")));
|
||||
+ scrollPane.registerScrollButtons(controlList, 7, 8);
|
||||
this.screenTitle = var1.translateKey("controls.title");
|
||||
- this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, stringtranslate.translateKey("gui.done")));
|
||||
+ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height - 28, stringtranslate.translateKey("gui.done")));
|
||||
+ scrollPane.registerScrollButtons(buttonList, 7, 8);
|
||||
this.screenTitle = stringtranslate.translateKey("controls.title");
|
||||
}
|
||||
|
||||
@@ -56,19 +57,9 @@
|
||||
@@ -56,20 +55,10 @@
|
||||
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
|
||||
*/
|
||||
protected void actionPerformed(GuiButton par1GuiButton)
|
||||
{
|
||||
- for (int var2 = 0; var2 < this.options.keyBindings.length; ++var2)
|
||||
- {
|
||||
- for (int i = 0; i < this.options.keyBindings.length; ++i)
|
||||
- {
|
||||
- ((GuiButton)this.controlList.get(var2)).displayString = this.options.getOptionDisplayString(var2);
|
||||
- ((GuiButton)this.buttonList.get(i)).displayString = this.options.getOptionDisplayString(i);
|
||||
- }
|
||||
-
|
||||
+ {
|
||||
if (par1GuiButton.id == 200)
|
||||
{
|
||||
this.mc.displayGuiScreen(this.parentScreen);
|
||||
|
@ -57,14 +59,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
@@ -77,17 +68,7 @@
|
||||
@@ -78,17 +67,7 @@
|
||||
*/
|
||||
protected void mouseClicked(int par1, int par2, int par3)
|
||||
{
|
||||
- if (this.buttonId >= 0)
|
||||
- {
|
||||
- this.options.setKeyBinding(this.buttonId, -100 + par3);
|
||||
- ((GuiButton)this.controlList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);
|
||||
- ((GuiButton)this.buttonList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);
|
||||
- this.buttonId = -1;
|
||||
- KeyBinding.resetKeyBindingArrayAndHash();
|
||||
- }
|
||||
|
@ -76,14 +78,14 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -95,14 +76,7 @@
|
||||
@@ -96,14 +75,7 @@
|
||||
*/
|
||||
protected void keyTyped(char par1, int par2)
|
||||
{
|
||||
- if (this.buttonId >= 0)
|
||||
- {
|
||||
- this.options.setKeyBinding(this.buttonId, par2);
|
||||
- ((GuiButton)this.controlList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);
|
||||
- ((GuiButton)this.buttonList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);
|
||||
- this.buttonId = -1;
|
||||
- KeyBinding.resetKeyBindingArrayAndHash();
|
||||
- }
|
||||
|
@ -92,53 +94,22 @@
|
|||
{
|
||||
super.keyTyped(par1, par2);
|
||||
}
|
||||
@@ -114,47 +88,8 @@
|
||||
@@ -115,6 +87,7 @@
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
- this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);
|
||||
- int var4 = this.func_73907_g();
|
||||
- int var5 = 0;
|
||||
-
|
||||
- while (var5 < this.options.keyBindings.length)
|
||||
- {
|
||||
- boolean var6 = false;
|
||||
- int var7 = 0;
|
||||
-
|
||||
- while (true)
|
||||
- {
|
||||
- if (var7 < this.options.keyBindings.length)
|
||||
- {
|
||||
- if (var7 == var5 || this.options.keyBindings[var5].keyCode != this.options.keyBindings[var7].keyCode)
|
||||
- {
|
||||
- ++var7;
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- var6 = true;
|
||||
- }
|
||||
-
|
||||
- if (this.buttonId == var5)
|
||||
- {
|
||||
- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7f> \u00a7e??? \u00a7f<";
|
||||
- }
|
||||
- else if (var6)
|
||||
- {
|
||||
- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7c" + this.options.getOptionDisplayString(var5);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- ((GuiButton)this.controlList.get(var5)).displayString = this.options.getOptionDisplayString(var5);
|
||||
- }
|
||||
-
|
||||
- this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1);
|
||||
- ++var5;
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
+ /* Forge Start: Moved all rendering to GuiControlsScrollPanel
|
||||
this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);
|
||||
int k = this.func_73907_g();
|
||||
int l = 0;
|
||||
@@ -155,6 +128,10 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
+ */
|
||||
+ scrollPane.drawScreen(par1, par2, par3);
|
||||
+ drawCenteredString(fontRenderer, screenTitle, width / 2, 4, 0xffffff);
|
||||
+ //Forge End
|
||||
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
@@ -375,7 +375,7 @@
|
||||
@@ -377,7 +377,7 @@
|
||||
}
|
||||
else if (par1GuiButton.id == 8)
|
||||
{
|
||||
- this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.field_82290_a));
|
||||
- this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.generatorOptionsToUse));
|
||||
+ WorldType.worldTypes[this.worldTypeId].onCustomizeButton(this.mc, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -393,7 +393,7 @@
|
||||
@@ -395,7 +395,8 @@
|
||||
this.buttonBonusItems.drawButton = this.moreOptions;
|
||||
this.buttonWorldType.drawButton = this.moreOptions;
|
||||
this.buttonAllowCommands.drawButton = this.moreOptions;
|
||||
- this.buttonCustomize.drawButton = this.moreOptions && WorldType.worldTypes[this.worldTypeId] == WorldType.FLAT;
|
||||
+ this.buttonCustomize.drawButton = this.moreOptions && (WorldType.worldTypes[this.worldTypeId].isCustomizable());
|
||||
StringTranslate var2;
|
||||
+
|
||||
StringTranslate stringtranslate;
|
||||
|
||||
if (this.moreOptions)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/gui/GuiIngame.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/gui/GuiIngame.java
|
||||
@@ -26,6 +26,8 @@
|
||||
@@ -34,6 +34,8 @@
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
|
@ -9,12 +9,12 @@
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class GuiIngame extends Gui
|
||||
{
|
||||
@@ -159,7 +161,7 @@
|
||||
@@ -170,7 +172,7 @@
|
||||
|
||||
var47 = var7 - 39;
|
||||
var22 = var47 - 10;
|
||||
- var23 = this.mc.thePlayer.getTotalArmorValue();
|
||||
+ var23 = ForgeHooks.getTotalArmorValue(mc.thePlayer);
|
||||
var24 = -1;
|
||||
k3 = l - 39;
|
||||
l2 = k3 - 10;
|
||||
- k2 = this.mc.thePlayer.getTotalArmorValue();
|
||||
+ k2 = ForgeHooks.getTotalArmorValue(mc.thePlayer);
|
||||
i3 = -1;
|
||||
|
||||
if (this.mc.thePlayer.isPotionActive(Potion.regeneration))
|
||||
|
|
|
@ -12,20 +12,20 @@
|
|||
@@ -332,16 +334,7 @@
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
Tessellator var18 = Tessellator.instance;
|
||||
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/background.png"));
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
- this.mc.renderEngine.func_98187_b("/gui/background.png");
|
||||
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
- float var17 = 32.0F;
|
||||
- var18.startDrawingQuads();
|
||||
- var18.setColorOpaque_I(2105376);
|
||||
- var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17));
|
||||
- var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17));
|
||||
- var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17));
|
||||
- var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17));
|
||||
- var18.draw();
|
||||
+ drawContainerBackground(var18);
|
||||
var9 = this.width / 2 - 92 - 16;
|
||||
var10 = this.top + 4 - (int)this.amountScrolled;
|
||||
- float f1 = 32.0F;
|
||||
- tessellator.startDrawingQuads();
|
||||
- tessellator.setColorOpaque_I(2105376);
|
||||
- tessellator.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1));
|
||||
- tessellator.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1));
|
||||
- tessellator.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1));
|
||||
- tessellator.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1));
|
||||
- tessellator.draw();
|
||||
+ drawContainerBackground(tessellator);
|
||||
j1 = this.width / 2 - 92 - 16;
|
||||
k1 = this.top + 4 - (int)this.amountScrolled;
|
||||
|
||||
@@ -470,10 +463,10 @@
|
||||
/**
|
||||
|
@ -34,20 +34,20 @@
|
|||
- private void overlayBackground(int par1, int par2, int par3, int par4)
|
||||
+ protected void overlayBackground(int par1, int par2, int par3, int par4)
|
||||
{
|
||||
Tessellator var5 = Tessellator.instance;
|
||||
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/background.png"));
|
||||
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(BACKGROUND_IMAGE));
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
- this.mc.renderEngine.func_98187_b("/gui/background.png");
|
||||
+ this.mc.renderEngine.func_98187_b(BACKGROUND_IMAGE);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
float var6 = 32.0F;
|
||||
var5.startDrawingQuads();
|
||||
float f = 32.0F;
|
||||
tessellator.startDrawingQuads();
|
||||
@@ -485,4 +478,18 @@
|
||||
var5.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / var6));
|
||||
var5.draw();
|
||||
tessellator.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / f));
|
||||
tessellator.draw();
|
||||
}
|
||||
+
|
||||
+ protected void drawContainerBackground(Tessellator tess)
|
||||
+ {
|
||||
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(BACKGROUND_IMAGE));
|
||||
+ this.mc.renderEngine.func_98187_b(BACKGROUND_IMAGE);
|
||||
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
+ float height = 32.0F;
|
||||
+ tess.startDrawingQuads();
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -19,6 +22,8 @@
|
||||
@@ -20,6 +23,8 @@
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
|
@ -19,21 +19,21 @@
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class GuiAchievements extends GuiScreen
|
||||
{
|
||||
@@ -55,6 +60,10 @@
|
||||
/** Whether the Mouse Button is down or not */
|
||||
@@ -57,6 +62,10 @@
|
||||
private int isMouseButtonDown = 0;
|
||||
private StatFileWriter statFileWriter;
|
||||
+
|
||||
|
||||
+ private int currentPage = -1;
|
||||
+ private GuiSmallButton button;
|
||||
+ private LinkedList<Achievement> minecraftAchievements = new LinkedList<Achievement>();
|
||||
|
||||
+
|
||||
public GuiAchievements(StatFileWriter par1StatFileWriter)
|
||||
{
|
||||
@@ -63,6 +72,14 @@
|
||||
short var3 = 141;
|
||||
this.field_74117_m = this.guiMapX = this.field_74124_q = (double)(AchievementList.openInventory.displayColumn * 24 - var2 / 2 - 12);
|
||||
this.field_74115_n = this.guiMapY = this.field_74123_r = (double)(AchievementList.openInventory.displayRow * 24 - var3 / 2);
|
||||
this.statFileWriter = par1StatFileWriter;
|
||||
@@ -64,6 +73,14 @@
|
||||
short short2 = 141;
|
||||
this.field_74117_m = this.guiMapX = this.field_74124_q = (double)(AchievementList.openInventory.displayColumn * 24 - short1 / 2 - 12);
|
||||
this.field_74115_n = this.guiMapY = this.field_74123_r = (double)(AchievementList.openInventory.displayRow * 24 - short2 / 2);
|
||||
+ minecraftAchievements.clear();
|
||||
+ for (Object achievement : AchievementList.achievementList)
|
||||
+ {
|
||||
|
@ -45,15 +45,15 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -72,6 +89,7 @@
|
||||
@@ -73,6 +90,7 @@
|
||||
{
|
||||
this.controlList.clear();
|
||||
this.controlList.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, StatCollector.translateToLocal("gui.done")));
|
||||
+ this.controlList.add(button = new GuiSmallButton(2, (width - achievementsPaneWidth) / 2 + 24, height / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage)));
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, StatCollector.translateToLocal("gui.done")));
|
||||
+ this.buttonList.add(button = new GuiSmallButton(2, (width - achievementsPaneWidth) / 2 + 24, height / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,6 +101,16 @@
|
||||
@@ -84,6 +102,16 @@
|
||||
{
|
||||
this.mc.displayGuiScreen((GuiScreen)null);
|
||||
this.mc.setIngameFocus();
|
||||
|
@ -70,34 +70,34 @@
|
|||
}
|
||||
|
||||
super.actionPerformed(par1GuiButton);
|
||||
@@ -307,11 +335,12 @@
|
||||
int var27;
|
||||
int var30;
|
||||
@@ -306,11 +334,12 @@
|
||||
int i4;
|
||||
int j4;
|
||||
|
||||
- for (var22 = 0; var22 < AchievementList.achievementList.size(); ++var22)
|
||||
- for (i3 = 0; i3 < AchievementList.achievementList.size(); ++i3)
|
||||
- {
|
||||
- Achievement var33 = (Achievement)AchievementList.achievementList.get(var22);
|
||||
- Achievement achievement = (Achievement)AchievementList.achievementList.get(i3);
|
||||
-
|
||||
- if (var33.parentAchievement != null)
|
||||
- if (achievement.parentAchievement != null)
|
||||
+ List<Achievement> achievementList = (currentPage == -1 ? minecraftAchievements : AchievementPage.getAchievementPage(currentPage).getAchievements());
|
||||
+ for (var22 = 0; var22 < achievementList.size(); ++var22)
|
||||
+ for (i3 = 0; i3 < achievementList.size(); ++i3)
|
||||
+ {
|
||||
+ Achievement var33 = achievementList.get(var22);
|
||||
+ Achievement achievement = achievementList.get(i3);
|
||||
+
|
||||
+ if (var33.parentAchievement != null && achievementList.contains(var33.parentAchievement))
|
||||
+ if (achievement.parentAchievement != null && achievementList.contains(achievement.parentAchievement))
|
||||
{
|
||||
var24 = var33.displayColumn * 24 - var4 + 11 + var10;
|
||||
var25 = var33.displayRow * 24 - var5 + 11 + var11;
|
||||
@@ -345,9 +374,9 @@
|
||||
int var42;
|
||||
int var41;
|
||||
k3 = achievement.displayColumn * 24 - k + 11 + k1;
|
||||
j3 = achievement.displayRow * 24 - l + 11 + l1;
|
||||
@@ -344,9 +373,9 @@
|
||||
int l4;
|
||||
int i5;
|
||||
|
||||
- for (var24 = 0; var24 < AchievementList.achievementList.size(); ++var24)
|
||||
- for (k3 = 0; k3 < AchievementList.achievementList.size(); ++k3)
|
||||
- {
|
||||
- Achievement var35 = (Achievement)AchievementList.achievementList.get(var24);
|
||||
+ for (var24 = 0; var24 < achievementList.size(); ++var24)
|
||||
- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(k3);
|
||||
+ for (k3 = 0; k3 < achievementList.size(); ++k3)
|
||||
+ {
|
||||
+ Achievement var35 = achievementList.get(var24);
|
||||
var26 = var35.displayColumn * 24 - var4;
|
||||
var27 = var35.displayRow * 24 - var5;
|
||||
+ Achievement achievement2 = (Achievement)achievementList.get(k3);
|
||||
j4 = achievement2.displayColumn * 24 - k;
|
||||
l3 = achievement2.displayRow * 24 - l;
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
||||
@@ -333,7 +333,7 @@
|
||||
if (var6 >= 0)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
- this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture("/gui/items.png"));
|
||||
+ this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(par1Slot.getBackgroundIconTexture()));
|
||||
this.drawTexturedModalRect(var2, var3, var6 % 16 * 16, var6 / 16 * 16, 16, 16);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
var5 = true;
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
|
||||
@@ -55,6 +55,8 @@
|
||||
@@ -56,6 +56,8 @@
|
||||
private Slot field_74235_v = null;
|
||||
private boolean field_74234_w = false;
|
||||
private CreativeCrafting field_82324_x;
|
||||
|
@ -9,48 +9,39 @@
|
|||
|
||||
public GuiContainerCreative(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
@@ -137,7 +139,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- if (var7 != null && var8 != null && var7.isItemEqual(var8))
|
||||
+ if (var7 != null && var8 != null && var7.isItemEqual(var8) && ItemStack.areItemStackTagsEqual(var7, var8))
|
||||
{
|
||||
if (par3 == 0)
|
||||
{
|
||||
@@ -229,6 +231,13 @@
|
||||
this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[var1]);
|
||||
@@ -274,6 +276,13 @@
|
||||
this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]);
|
||||
this.field_82324_x = new CreativeCrafting(this.mc);
|
||||
this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x);
|
||||
+ int tabCount = CreativeTabs.creativeTabArray.length;
|
||||
+ if (tabCount > 12)
|
||||
+ {
|
||||
+ controlList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<"));
|
||||
+ controlList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">"));
|
||||
+ buttonList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<"));
|
||||
+ buttonList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">"));
|
||||
+ maxPages = ((tabCount - 12) / 10) + 1;
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -363,7 +372,7 @@
|
||||
@@ -408,7 +417,7 @@
|
||||
{
|
||||
CreativeTabs var3 = CreativeTabs.creativeTabArray[selectedTabIndex];
|
||||
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex];
|
||||
|
||||
- if (var3.drawInForegroundOfTab())
|
||||
+ if (var3 != null && var3.drawInForegroundOfTab())
|
||||
- if (creativetabs.drawInForegroundOfTab())
|
||||
+ if (creativetabs != null && creativetabs.drawInForegroundOfTab())
|
||||
{
|
||||
this.fontRenderer.drawString(var3.getTranslatedTabLabel(), 8, 6, 4210752);
|
||||
this.fontRenderer.drawString(creativetabs.getTranslatedTabLabel(), 8, 6, 4210752);
|
||||
}
|
||||
@@ -385,7 +394,7 @@
|
||||
@@ -457,7 +466,7 @@
|
||||
{
|
||||
CreativeTabs var9 = var6[var8];
|
||||
CreativeTabs creativetabs = acreativetabs[k1];
|
||||
|
||||
- if (this.func_74232_a(var9, var4, var5))
|
||||
+ if (var9 != null && func_74232_a(var9, var4, var5))
|
||||
- if (this.func_74232_a(creativetabs, l, i1))
|
||||
+ if (creativetabs != null && func_74232_a(creativetabs, l, i1))
|
||||
{
|
||||
this.setCurrentCreativeTab(var9);
|
||||
this.setCurrentCreativeTab(creativetabs);
|
||||
return;
|
||||
@@ -401,11 +410,17 @@
|
||||
@@ -473,11 +482,17 @@
|
||||
*/
|
||||
private boolean needsScrollBars()
|
||||
{
|
||||
|
@ -65,28 +56,28 @@
|
|||
+ return;
|
||||
+ }
|
||||
+
|
||||
int var2 = selectedTabIndex;
|
||||
int i = selectedTabIndex;
|
||||
selectedTabIndex = par1CreativeTabs.getTabIndex();
|
||||
ContainerCreative var3 = (ContainerCreative)this.inventorySlots;
|
||||
@@ -575,21 +590,42 @@
|
||||
ContainerCreative containercreative = (ContainerCreative)this.inventorySlots;
|
||||
@@ -648,21 +663,42 @@
|
||||
|
||||
super.drawScreen(par1, par2, par3);
|
||||
CreativeTabs[] var11 = CreativeTabs.creativeTabArray;
|
||||
- int var12 = var11.length;
|
||||
CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray;
|
||||
- int i2 = acreativetabs.length;
|
||||
-
|
||||
- for (int var13 = 0; var13 < var12; ++var13)
|
||||
- for (int j2 = 0; j2 < i2; ++j2)
|
||||
+ int start = tabPage * 10;
|
||||
+ int var12 = Math.min(var11.length, ((tabPage + 1) * 10) + 2);
|
||||
+ int i2 = Math.min(acreativetabs.length, ((tabPage + 1) * 10) + 2);
|
||||
+ if (tabPage != 0) start += 2;
|
||||
+ boolean rendered = false;
|
||||
+
|
||||
+ for (int var13 = start; var13 < var12; ++var13)
|
||||
+ for (int j2 = start; j2 < i2; ++j2)
|
||||
{
|
||||
CreativeTabs var14 = var11[var13];
|
||||
CreativeTabs creativetabs = acreativetabs[j2];
|
||||
|
||||
- if (this.renderCreativeInventoryHoveringText(var14, par1, par2))
|
||||
- if (this.renderCreativeInventoryHoveringText(creativetabs, par1, par2))
|
||||
- {
|
||||
+ if (var14 != null && renderCreativeInventoryHoveringText(var14, par1, par2))
|
||||
+ if (creativetabs != null && renderCreativeInventoryHoveringText(creativetabs, par1, par2))
|
||||
+ {
|
||||
+ rendered = true;
|
||||
break;
|
||||
|
@ -116,57 +107,57 @@
|
|||
}
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -610,14 +646,32 @@
|
||||
int var8 = var7.length;
|
||||
int var9;
|
||||
@@ -681,14 +717,32 @@
|
||||
int k = acreativetabs.length;
|
||||
int l;
|
||||
|
||||
- for (var9 = 0; var9 < var8; ++var9)
|
||||
- for (l = 0; l < k; ++l)
|
||||
+ int start = tabPage * 10;
|
||||
+ var8 = Math.min(var7.length, ((tabPage + 1) * 10 + 2));
|
||||
+ k = Math.min(acreativetabs.length, ((tabPage + 1) * 10 + 2));
|
||||
+ if (tabPage != 0) start += 2;
|
||||
+
|
||||
+ for (var9 = start; var9 < var8; ++var9)
|
||||
+ for (l = start; l < k; ++l)
|
||||
{
|
||||
CreativeTabs var10 = var7[var9];
|
||||
this.mc.renderEngine.bindTexture(var4);
|
||||
CreativeTabs creativetabs1 = acreativetabs[l];
|
||||
this.mc.renderEngine.func_98187_b("/gui/allitems.png");
|
||||
|
||||
- if (var10.getTabIndex() != selectedTabIndex)
|
||||
+ if (var10 != null && var10.getTabIndex() != selectedTabIndex)
|
||||
- if (creativetabs1.getTabIndex() != selectedTabIndex)
|
||||
+ if (creativetabs1 != null && creativetabs1.getTabIndex() != selectedTabIndex)
|
||||
{
|
||||
this.renderCreativeTab(var10);
|
||||
this.renderCreativeTab(creativetabs1);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (tabPage != 0)
|
||||
+ {
|
||||
+ if (var5 != CreativeTabs.tabAllSearch)
|
||||
+ if (creativetabs != CreativeTabs.tabAllSearch)
|
||||
+ {
|
||||
+ mc.renderEngine.bindTexture(var4);
|
||||
+ mc.renderEngine.func_98187_b("/gui/allitems.png");
|
||||
+ renderCreativeTab(CreativeTabs.tabAllSearch);
|
||||
+ }
|
||||
+ if (var5 != CreativeTabs.tabInventory)
|
||||
+ if (creativetabs != CreativeTabs.tabInventory)
|
||||
+ {
|
||||
+ mc.renderEngine.bindTexture(var4);
|
||||
+ mc.renderEngine.func_98187_b("/gui/allitems.png");
|
||||
+ renderCreativeTab(CreativeTabs.tabInventory);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -635,6 +689,14 @@
|
||||
this.drawTexturedModalRect(var11, var8 + (int)((float)(var9 - var8 - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
|
||||
@@ -706,6 +760,14 @@
|
||||
this.drawTexturedModalRect(i1, k + (int)((float)(l - k - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
|
||||
}
|
||||
|
||||
+ if (var5 == null || var5.getTabPage() != tabPage)
|
||||
+ if (creativetabs == null || creativetabs.getTabPage() != tabPage)
|
||||
+ {
|
||||
+ if (var5 != CreativeTabs.tabAllSearch && var5 != CreativeTabs.tabInventory)
|
||||
+ if (creativetabs != CreativeTabs.tabAllSearch && creativetabs != CreativeTabs.tabInventory)
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
this.renderCreativeTab(var5);
|
||||
this.renderCreativeTab(creativetabs);
|
||||
|
||||
if (var5 == CreativeTabs.tabInventory)
|
||||
@@ -645,6 +707,15 @@
|
||||
if (creativetabs == CreativeTabs.tabInventory)
|
||||
@@ -716,6 +778,15 @@
|
||||
|
||||
protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3)
|
||||
{
|
||||
|
@ -179,19 +170,19 @@
|
|||
+ }
|
||||
+ }
|
||||
+
|
||||
int var4 = par1CreativeTabs.getTabColumn();
|
||||
int var5 = 28 * var4;
|
||||
byte var6 = 0;
|
||||
@@ -759,7 +830,7 @@
|
||||
var8 += 8 + (var3 ? 1 : -1);
|
||||
int k = par1CreativeTabs.getTabColumn();
|
||||
int l = 28 * k;
|
||||
byte b0 = 0;
|
||||
@@ -830,7 +901,7 @@
|
||||
i1 += 8 + (flag1 ? 1 : -1);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
- ItemStack var10 = new ItemStack(par1CreativeTabs.getTabIconItem());
|
||||
+ ItemStack var10 = par1CreativeTabs.getIconItemStack();
|
||||
itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
|
||||
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
|
||||
- ItemStack itemstack = new ItemStack(par1CreativeTabs.getTabIconItem());
|
||||
+ ItemStack itemstack = par1CreativeTabs.getIconItemStack();
|
||||
itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.renderEngine, itemstack, l, i1);
|
||||
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, itemstack, l, i1);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
@@ -781,6 +852,15 @@
|
||||
@@ -852,6 +923,15 @@
|
||||
{
|
||||
this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter));
|
||||
}
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
+ @SideOnly(Side.CLIENT)
|
||||
public void render(Tessellator par1Tessellator, float par2)
|
||||
{
|
||||
for (int var3 = 0; var3 < this.quadList.length; ++var3)
|
||||
for (int i = 0; i < this.quadList.length; ++i)
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
public class ChunkProviderClient implements IChunkProvider
|
||||
@@ -75,6 +77,7 @@
|
||||
{
|
||||
Chunk var3 = new Chunk(this.worldObj, par1, par2);
|
||||
this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(par1, par2), var3);
|
||||
+ MinecraftForge.EVENT_BUS.post(new ChunkEvent.Load(var3));
|
||||
var3.isChunkLoaded = true;
|
||||
return var3;
|
||||
Chunk chunk = new Chunk(this.worldObj, par1, par2);
|
||||
this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(par1, par2), chunk);
|
||||
+ MinecraftForge.EVENT_BUS.post(new ChunkEvent.Load(chunk));
|
||||
chunk.isChunkLoaded = true;
|
||||
return chunk;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java
|
||||
@@ -160,6 +160,11 @@
|
||||
@@ -176,6 +176,11 @@
|
||||
import net.minecraft.world.storage.MapStorage;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class NetClientHandler extends NetHandler
|
||||
{
|
||||
@@ -744,7 +749,7 @@
|
||||
@@ -762,7 +767,7 @@
|
||||
|
||||
public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect)
|
||||
{
|
||||
|
@ -20,8 +20,8 @@
|
|||
+ this.netManager.networkShutdown("disconnect.kicked", par1Packet255KickDisconnect.reason);
|
||||
this.disconnected = true;
|
||||
this.mc.loadWorld((WorldClient)null);
|
||||
this.mc.displayGuiScreen(new GuiDisconnected("disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason}));
|
||||
@@ -810,7 +815,11 @@
|
||||
|
||||
@@ -844,7 +849,11 @@
|
||||
public void handleChat(Packet3Chat par1Packet3Chat)
|
||||
{
|
||||
par1Packet3Chat = FMLNetworkHandler.handleChatMessage(this, par1Packet3Chat);
|
||||
|
@ -34,13 +34,13 @@
|
|||
}
|
||||
|
||||
public void handleAnimation(Packet18Animation par1Packet18Animation)
|
||||
@@ -1192,6 +1201,10 @@
|
||||
@@ -1278,6 +1287,10 @@
|
||||
{
|
||||
var2.readFromNBT(par1Packet132TileEntityData.customParam1);
|
||||
tileentity.readFromNBT(par1Packet132TileEntityData.customParam1);
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ var2.onDataPacket(netManager, par1Packet132TileEntityData);
|
||||
+ tileentity.onDataPacket(netManager, par1Packet132TileEntityData);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class PlayerControllerMP
|
||||
{
|
||||
@@ -121,6 +125,12 @@
|
||||
@@ -124,6 +128,12 @@
|
||||
*/
|
||||
public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4)
|
||||
{
|
||||
|
@ -24,42 +24,34 @@
|
|||
if (this.currentGameType.isAdventure() && !this.mc.thePlayer.canCurrentToolHarvestBlock(par1, par2, par3))
|
||||
{
|
||||
return false;
|
||||
@@ -138,7 +148,7 @@
|
||||
@@ -141,7 +151,7 @@
|
||||
{
|
||||
var5.playAuxSFX(2001, par1, par2, par3, var6.blockID + (var5.getBlockMetadata(par1, par2, par3) << 12));
|
||||
int var7 = var5.getBlockMetadata(par1, par2, par3);
|
||||
- boolean var8 = var5.setBlockWithNotify(par1, par2, par3, 0);
|
||||
+ boolean var8 = var6.removeBlockByPlayer(var5, mc.thePlayer, par1, par2, par3);
|
||||
worldclient.playAuxSFX(2001, par1, par2, par3, block.blockID + (worldclient.getBlockMetadata(par1, par2, par3) << 12));
|
||||
int i1 = worldclient.getBlockMetadata(par1, par2, par3);
|
||||
- boolean flag = worldclient.func_94571_i(par1, par2, par3);
|
||||
+ boolean flag = block.removeBlockByPlayer(worldclient, mc.thePlayer, par1, par2, par3);
|
||||
|
||||
if (var8)
|
||||
if (flag)
|
||||
{
|
||||
@@ -334,6 +344,12 @@
|
||||
float var11 = (float)par8Vec3.zCoord - (float)par6;
|
||||
boolean var12 = false;
|
||||
int var13;
|
||||
@@ -342,6 +352,12 @@
|
||||
float f2 = (float)par8Vec3.zCoord - (float)par6;
|
||||
boolean flag = false;
|
||||
int i1;
|
||||
+ if (par3ItemStack != null &&
|
||||
+ par3ItemStack.getItem() != null &&
|
||||
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11))
|
||||
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2))
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
|
||||
if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null)
|
||||
{
|
||||
@@ -344,6 +360,7 @@
|
||||
var12 = true;
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
if (!var12 && par3ItemStack != null && par3ItemStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
@@ -376,7 +393,15 @@
|
||||
@@ -384,7 +400,15 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11);
|
||||
+ if (!par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11))
|
||||
- return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2);
|
||||
+ if (!par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2))
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
|
@ -71,15 +63,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
@@ -398,9 +423,10 @@
|
||||
@@ -406,9 +430,10 @@
|
||||
{
|
||||
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = var5;
|
||||
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = itemstack1;
|
||||
|
||||
- if (var5.stackSize == 0)
|
||||
+ if (var5.stackSize <= 0)
|
||||
- if (itemstack1.stackSize == 0)
|
||||
+ if (itemstack1.stackSize <= 0)
|
||||
{
|
||||
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null;
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(par1EntityPlayer, var5));
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(par1EntityPlayer, itemstack1));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/multiplayer/WorldClient.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/multiplayer/WorldClient.java
|
||||
@@ -27,6 +27,9 @@
|
||||
@@ -29,6 +29,9 @@
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.storage.SaveHandlerMP;
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class WorldClient extends World
|
||||
{
|
||||
@@ -57,8 +60,11 @@
|
||||
super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings, par5Profiler);
|
||||
@@ -59,8 +62,11 @@
|
||||
super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings, par5Profiler, par6ILogAgent);
|
||||
this.sendQueue = par1NetClientHandler;
|
||||
this.difficultySetting = par4;
|
||||
+ this.mapStorage = par1NetClientHandler.mapStorage;
|
||||
|
@ -23,7 +23,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -289,6 +295,12 @@
|
||||
@@ -291,6 +297,12 @@
|
||||
*/
|
||||
protected void updateWeather()
|
||||
{
|
||||
|
|
|
@ -1,196 +1,63 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/particle/EffectRenderer.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/particle/EffectRenderer.java
|
||||
@@ -3,16 +3,25 @@
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
+import java.util.Iterator;
|
||||
import java.util.List;
|
||||
+import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.RenderEngine;
|
||||
@@ -11,6 +11,7 @@
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
+import net.minecraft.item.Item;
|
||||
import net.minecraft.util.MathHelper;
|
||||
+import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
+
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+import net.minecraftforge.common.ForgeHooks;
|
||||
+import com.google.common.collect.ArrayListMultimap;
|
||||
+import com.google.common.collect.Multimap;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class EffectRenderer
|
||||
@@ -25,6 +34,8 @@
|
||||
/** RNG. */
|
||||
private Random rand = new Random();
|
||||
|
||||
+ private Multimap<String, EntityFX> effectList = ArrayListMultimap.create();
|
||||
+
|
||||
public EffectRenderer(World par1World, RenderEngine par2RenderEngine)
|
||||
{
|
||||
if (par1World != null)
|
||||
@@ -59,12 +70,27 @@
|
||||
for (int var2 = 0; var2 < this.fxLayers[var1].size(); ++var2)
|
||||
@@ -59,9 +60,13 @@
|
||||
for (int j = 0; j < this.fxLayers[i].size(); ++j)
|
||||
{
|
||||
EntityFX var3 = (EntityFX)this.fxLayers[var1].get(var2);
|
||||
- var3.onUpdate();
|
||||
EntityFX entityfx = (EntityFX)this.fxLayers[i].get(j);
|
||||
- entityfx.onUpdate();
|
||||
-
|
||||
- if (var3.isDead)
|
||||
- if (entityfx.isDead)
|
||||
+
|
||||
+ if (var3 != null)
|
||||
+ if (entityfx != null)
|
||||
+ {
|
||||
+ var3.onUpdate();
|
||||
+ entityfx.onUpdate();
|
||||
+ }
|
||||
+
|
||||
+ if (var3 == null || var3.isDead)
|
||||
+ if (entityfx == null || entityfx.isDead)
|
||||
{
|
||||
this.fxLayers[var1].remove(var2--);
|
||||
this.fxLayers[i].remove(j--);
|
||||
}
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ Iterator<Entry<String, EntityFX>> itr = effectList.entries().iterator();
|
||||
+ while (itr.hasNext())
|
||||
+ {
|
||||
+ EntityFX fx = itr.next().getValue();
|
||||
+ fx.onUpdate();
|
||||
+ if (fx.isDead)
|
||||
+ {
|
||||
+ itr.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,6 +141,7 @@
|
||||
for (int var11 = 0; var11 < this.fxLayers[var8].size(); ++var11)
|
||||
@@ -111,6 +116,7 @@
|
||||
for (int j = 0; j < this.fxLayers[i].size(); ++j)
|
||||
{
|
||||
EntityFX var12 = (EntityFX)this.fxLayers[var8].get(var11);
|
||||
+ if (var12 == null) continue;
|
||||
var10.setBrightness(var12.getBrightnessForRender(par2));
|
||||
var12.renderParticle(var10, par2, var3, var7, var4, var5, var6);
|
||||
EntityFX entityfx = (EntityFX)this.fxLayers[i].get(j);
|
||||
+ if (entityfx == null) continue;
|
||||
tessellator.setBrightness(entityfx.getBrightnessForRender(par2));
|
||||
entityfx.renderParticle(tessellator, par2, f1, f5, f2, f3, f4);
|
||||
}
|
||||
@@ -123,6 +150,27 @@
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
}
|
||||
+ }
|
||||
+
|
||||
+ for (String key : effectList.keySet())
|
||||
+ {
|
||||
+ ForgeHooksClient.bindTexture(key, 0);
|
||||
+ for (EntityFX entry : effectList.get(key))
|
||||
+ {
|
||||
+ if (entry == null) continue;
|
||||
+ Tessellator tessallator = Tessellator.instance;
|
||||
+ //GL11.glBindTexture(GL11.GL_TEXTURE_2D, renderer.getTexture(key));
|
||||
+ tessallator.startDrawingQuads();
|
||||
+
|
||||
+ if (entry.getFXLayer() != 3)
|
||||
+ {
|
||||
+ tessallator.setBrightness(entry.getBrightnessForRender(par2));
|
||||
+ entry.renderParticle(tessallator, par2, var3, var7, var4, var5, var6);
|
||||
+ }
|
||||
+
|
||||
+ tessallator.draw();
|
||||
+ }
|
||||
+ ForgeHooksClient.unbindTexture();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,6 +190,7 @@
|
||||
for (int var11 = 0; var11 < this.fxLayers[var9].size(); ++var11)
|
||||
@@ -139,6 +145,7 @@
|
||||
for (int i = 0; i < this.fxLayers[b0].size(); ++i)
|
||||
{
|
||||
EntityFX var12 = (EntityFX)this.fxLayers[var9].get(var11);
|
||||
+ if (var12 == null) continue;
|
||||
var10.setBrightness(var12.getBrightnessForRender(par2));
|
||||
var12.renderParticle(var10, par2, var4, var8, var5, var6, var7);
|
||||
EntityFX entityfx = (EntityFX)this.fxLayers[b0].get(i);
|
||||
+ if (entityfx == null) continue;
|
||||
tessellator.setBrightness(entityfx.getBrightnessForRender(par2));
|
||||
entityfx.renderParticle(tessellator, par2, f1, f5, f2, f3, f4);
|
||||
}
|
||||
@@ -156,13 +205,15 @@
|
||||
{
|
||||
this.fxLayers[var2].clear();
|
||||
}
|
||||
+
|
||||
+ effectList.clear();
|
||||
}
|
||||
@@ -157,9 +164,9 @@
|
||||
|
||||
public void addBlockDestroyEffects(int par1, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
- if (par4 != 0)
|
||||
- {
|
||||
- Block var6 = Block.blocksList[par4];
|
||||
+ Block var6 = Block.blocksList[par4];
|
||||
+ if (var6 != null && !var6.addBlockDestroyEffects(worldObj, par1, par2, par3, par5, this))
|
||||
- Block block = Block.blocksList[par4];
|
||||
+ Block block = Block.blocksList[par4];
|
||||
+ if (block != null && !block.addBlockDestroyEffects(worldObj, par1, par2, par3, par5, this))
|
||||
+ {
|
||||
byte var7 = 4;
|
||||
byte b0 = 4;
|
||||
|
||||
for (int var8 = 0; var8 < var7; ++var8)
|
||||
@@ -175,7 +226,7 @@
|
||||
double var13 = (double)par2 + ((double)var9 + 0.5D) / (double)var7;
|
||||
double var15 = (double)par3 + ((double)var10 + 0.5D) / (double)var7;
|
||||
int var17 = this.rand.nextInt(6);
|
||||
- this.addEffect((new EntityDiggingFX(this.worldObj, var11, var13, var15, var11 - (double)par1 - 0.5D, var13 - (double)par2 - 0.5D, var15 - (double)par3 - 0.5D, var6, var17, par5)).func_70596_a(par1, par2, par3));
|
||||
+ this.addEffect((new EntityDiggingFX(this.worldObj, var11, var13, var15, var11 - (double)par1 - 0.5D, var13 - (double)par2 - 0.5D, var15 - (double)par3 - 0.5D, var6, var17, par5)).func_70596_a(par1, par2, par3), var6);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,12 +278,60 @@
|
||||
var8 = (double)par1 + var6.getBlockBoundsMaxX() + (double)var7;
|
||||
}
|
||||
|
||||
- this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, par4, this.worldObj.getBlockMetadata(par1, par2, par3))).func_70596_a(par1, par2, par3).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
|
||||
+ this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, par4, this.worldObj.getBlockMetadata(par1, par2, par3))).func_70596_a(par1, par2, par3).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F), var6);
|
||||
}
|
||||
}
|
||||
|
||||
public String getStatistics()
|
||||
for (int j1 = 0; j1 < b0; ++j1)
|
||||
@@ -232,4 +239,13 @@
|
||||
{
|
||||
- return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size());
|
||||
+ int size = 0;
|
||||
+ for (List x : fxLayers)
|
||||
+ {
|
||||
+ size += x.size();
|
||||
+ }
|
||||
+ size += effectList.size();
|
||||
+ return Integer.toString(size);
|
||||
+ }
|
||||
+
|
||||
+ public void addEffect(EntityFX effect, Object obj)
|
||||
+ {
|
||||
+ if (obj == null || !(obj instanceof Block || obj instanceof Item))
|
||||
+ {
|
||||
+ addEffect(effect);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (obj instanceof Item && ((Item)obj).isDefaultTexture)
|
||||
+ {
|
||||
+ addEffect(effect);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (obj instanceof Block && ((Block)obj).isDefaultTexture)
|
||||
+ {
|
||||
+ addEffect(effect);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ String texture = "/terrain.png";
|
||||
+ if (effect.getFXLayer() == 0)
|
||||
+ {
|
||||
+ texture = "/particles.png";
|
||||
+ }
|
||||
+ else if (effect.getFXLayer() == 2)
|
||||
+ {
|
||||
+ texture = "/gui/items.png";
|
||||
+ }
|
||||
+ texture = ForgeHooks.getTexture(texture, obj);
|
||||
+ effectList.put(texture, effect);
|
||||
+ }
|
||||
return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size());
|
||||
}
|
||||
+
|
||||
+ public void addBlockHitEffects(int x, int y, int z, MovingObjectPosition target)
|
||||
+ {
|
||||
|
@ -199,5 +66,5 @@
|
|||
+ {
|
||||
+ addBlockHitEffects(x, y, z, target.sideHit);
|
||||
+ }
|
||||
}
|
||||
+ }
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/particle/EntityDiggingFX.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/particle/EntityDiggingFX.java
|
||||
@@ -10,20 +10,22 @@
|
||||
@@ -11,20 +11,22 @@
|
||||
public class EntityDiggingFX extends EntityFX
|
||||
{
|
||||
private Block blockInstance;
|
||||
+ private int side;
|
||||
|
||||
public EntityDiggingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Block par14Block, int par15, int par16)
|
||||
public EntityDiggingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Block par14Block, int par15, int par16, RenderEngine par17RenderEngine)
|
||||
{
|
||||
super(par1World, par2, par4, par6, par8, par10, par12);
|
||||
this.blockInstance = par14Block;
|
||||
- this.setParticleTextureIndex(par14Block.getBlockTextureFromSideAndMetadata(0, par16));
|
||||
+ this.setParticleTextureIndex(par14Block.getBlockTextureFromSideAndMetadata(par15, par16));
|
||||
- this.func_94052_a(par17RenderEngine, par14Block.getBlockTextureFromSideAndMetadata(0, par16));
|
||||
+ this.func_94052_a(par17RenderEngine, par14Block.getBlockTextureFromSideAndMetadata(par15, par16));
|
||||
this.particleGravity = par14Block.blockParticleGravity;
|
||||
this.particleRed = this.particleGreen = this.particleBlue = 0.6F;
|
||||
this.particleScale /= 2.0F;
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
+++ ../src_work/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java
|
||||
@@ -30,11 +30,11 @@
|
||||
{
|
||||
this.field_92039_az = par15NBTTagCompound.getTagList("Explosions");
|
||||
this.fireworkExplosions = par15NBTTagCompound.getTagList("Explosions");
|
||||
|
||||
- if (this.field_92039_az.tagCount() == 0)
|
||||
+ if (this.field_92039_az != null && this.field_92039_az.tagCount() == 0)
|
||||
- if (this.fireworkExplosions.tagCount() == 0)
|
||||
+ if (this.fireworkExplosions != null && this.fireworkExplosions.tagCount() == 0)
|
||||
{
|
||||
this.field_92039_az = null;
|
||||
this.fireworkExplosions = null;
|
||||
}
|
||||
- else
|
||||
+ else if (this.field_92039_az != null)
|
||||
+ else if (this.fireworkExplosions != null)
|
||||
{
|
||||
this.particleMaxAge = this.field_92039_az.tagCount() * 2 - 1;
|
||||
this.particleMaxAge = this.fireworkExplosions.tagCount() * 2 - 1;
|
||||
|
||||
|
|
|
@ -12,16 +12,16 @@
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class EntityRenderer
|
||||
{
|
||||
@@ -333,8 +338,15 @@
|
||||
@@ -339,8 +344,15 @@
|
||||
*/
|
||||
private void updateFovModifierHand()
|
||||
{
|
||||
- EntityPlayerSP var1 = (EntityPlayerSP)this.mc.renderViewEntity;
|
||||
- this.fovMultiplierTemp = var1.getFOVMultiplier();
|
||||
- EntityPlayerSP entityplayersp = (EntityPlayerSP)this.mc.renderViewEntity;
|
||||
- this.fovMultiplierTemp = entityplayersp.getFOVMultiplier();
|
||||
+ if (mc.renderViewEntity instanceof EntityPlayerSP)
|
||||
+ {
|
||||
+ EntityPlayerSP var1 = (EntityPlayerSP)this.mc.renderViewEntity;
|
||||
+ this.fovMultiplierTemp = var1.getFOVMultiplier();
|
||||
+ EntityPlayerSP entityplayersp = (EntityPlayerSP)this.mc.renderViewEntity;
|
||||
+ this.fovMultiplierTemp = entityplayersp.getFOVMultiplier();
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
|
@ -29,81 +29,81 @@
|
|||
+ }
|
||||
this.fovModifierHandPrev = this.fovModifierHand;
|
||||
this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F;
|
||||
}
|
||||
@@ -350,7 +362,7 @@
|
||||
|
||||
@@ -366,7 +378,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- EntityPlayer var3 = (EntityPlayer)this.mc.renderViewEntity;
|
||||
+ EntityLiving var3 = (EntityLiving)this.mc.renderViewEntity;
|
||||
float var4 = 70.0F;
|
||||
- EntityPlayer entityplayer = (EntityPlayer)this.mc.renderViewEntity;
|
||||
+ EntityLiving entityplayer = (EntityLiving)this.mc.renderViewEntity;
|
||||
float f1 = 70.0F;
|
||||
|
||||
if (par2)
|
||||
@@ -437,15 +449,7 @@
|
||||
@@ -453,15 +465,7 @@
|
||||
|
||||
if (!this.mc.gameSettings.debugCamEnable)
|
||||
{
|
||||
- int var10 = this.mc.theWorld.getBlockId(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ));
|
||||
- int i = this.mc.theWorld.getBlockId(MathHelper.floor_double(entityliving.posX), MathHelper.floor_double(entityliving.posY), MathHelper.floor_double(entityliving.posZ));
|
||||
-
|
||||
- if (var10 == Block.bed.blockID)
|
||||
- if (i == Block.bed.blockID)
|
||||
- {
|
||||
- int var11 = this.mc.theWorld.getBlockMetadata(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ));
|
||||
- int var12 = var11 & 3;
|
||||
- GL11.glRotatef((float)(var12 * 90), 0.0F, 1.0F, 0.0F);
|
||||
- int j = this.mc.theWorld.getBlockMetadata(MathHelper.floor_double(entityliving.posX), MathHelper.floor_double(entityliving.posY), MathHelper.floor_double(entityliving.posZ));
|
||||
- int k = j & 3;
|
||||
- GL11.glRotatef((float)(k * 90), 0.0F, 1.0F, 0.0F);
|
||||
- }
|
||||
-
|
||||
+ ForgeHooksClient.orientBedCamera(mc, var2);
|
||||
GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * par1 + 180.0F, 0.0F, -1.0F, 0.0F);
|
||||
GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * par1, -1.0F, 0.0F, 0.0F);
|
||||
+ ForgeHooksClient.orientBedCamera(mc, entityliving);
|
||||
GL11.glRotatef(entityliving.prevRotationYaw + (entityliving.rotationYaw - entityliving.prevRotationYaw) * par1 + 180.0F, 0.0F, -1.0F, 0.0F);
|
||||
GL11.glRotatef(entityliving.prevRotationPitch + (entityliving.rotationPitch - entityliving.prevRotationPitch) * par1, -1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
@@ -1124,7 +1128,9 @@
|
||||
@@ -1142,7 +1146,9 @@
|
||||
{
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
this.mc.mcProfiler.endStartSection("entities");
|
||||
+ ForgeHooksClient.setRenderPass(0);
|
||||
var5.renderEntities(var4.getPosition(par1), var14, par1);
|
||||
renderglobal.renderEntities(entityliving.getPosition(par1), frustrum, par1);
|
||||
+ ForgeHooksClient.setRenderPass(-1);
|
||||
this.enableLightmap((double)par1);
|
||||
this.mc.mcProfiler.endStartSection("litParticles");
|
||||
var6.renderLitParticles(var4, par1);
|
||||
@@ -1139,8 +1145,11 @@
|
||||
var17 = (EntityPlayer)var4;
|
||||
effectrenderer.renderLitParticles(entityliving, par1);
|
||||
@@ -1157,8 +1163,11 @@
|
||||
entityplayer = (EntityPlayer)entityliving;
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
this.mc.mcProfiler.endStartSection("outline");
|
||||
- var5.drawBlockBreaking(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
- var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ if (!ForgeHooksClient.onDrawBlockHighlight(var5, var17, mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1))
|
||||
- renderglobal.drawBlockBreaking(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
- renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1))
|
||||
+ {
|
||||
+ var5.drawBlockBreaking(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ renderglobal.drawBlockBreaking(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ }
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
}
|
||||
@@ -1194,6 +1203,13 @@
|
||||
this.mc.mcProfiler.endStartSection("water");
|
||||
var5.sortAndRender(var4, 1, (double)par1);
|
||||
@@ -1213,6 +1222,13 @@
|
||||
renderglobal.sortAndRender(entityliving, 1, (double)par1);
|
||||
}
|
||||
+
|
||||
|
||||
+ RenderHelper.enableStandardItemLighting();
|
||||
+ this.mc.mcProfiler.endStartSection("entities");
|
||||
+ ForgeHooksClient.setRenderPass(1);
|
||||
+ var5.renderEntities(var4.getPosition(par1), var14, par1);
|
||||
+ renderglobal.renderEntities(entityliving.getPosition(par1), frustrum, par1);
|
||||
+ ForgeHooksClient.setRenderPass(-1);
|
||||
+ RenderHelper.disableStandardItemLighting();
|
||||
|
||||
+
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
@@ -1204,15 +1220,18 @@
|
||||
var17 = (EntityPlayer)var4;
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
@@ -1222,15 +1238,18 @@
|
||||
entityplayer = (EntityPlayer)entityliving;
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
this.mc.mcProfiler.endStartSection("outline");
|
||||
- var5.drawBlockBreaking(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
- var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ if (!ForgeHooksClient.onDrawBlockHighlight(var5, var17, mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1))
|
||||
- renderglobal.drawBlockBreaking(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
- renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1))
|
||||
+ {
|
||||
+ var5.drawBlockBreaking(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ renderglobal.drawBlockBreaking(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ }
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
|
@ -111,18 +111,18 @@
|
|||
this.mc.mcProfiler.endStartSection("destroyProgress");
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
- var5.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer)var4, par1);
|
||||
+ var5.drawBlockDamageTexture(Tessellator.instance, var4, par1);
|
||||
- renderglobal.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer)entityliving, par1);
|
||||
+ renderglobal.drawBlockDamageTexture(Tessellator.instance, entityliving, par1);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
this.mc.mcProfiler.endStartSection("weather");
|
||||
this.renderRainSnow(par1);
|
||||
@@ -1222,6 +1241,9 @@
|
||||
{
|
||||
this.renderCloudsCheck(var5, par1);
|
||||
@@ -1248,6 +1267,9 @@
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
this.renderHand(par1, j);
|
||||
}
|
||||
+
|
||||
+ this.mc.mcProfiler.endStartSection("FRenderLast");
|
||||
+ ForgeHooksClient.dispatchRenderLast(var5, par1);
|
||||
|
||||
this.mc.mcProfiler.endStartSection("hand");
|
||||
+ ForgeHooksClient.dispatchRenderLast(renderglobal, par1);
|
||||
|
||||
if (!this.mc.gameSettings.anaglyph)
|
||||
{
|
||||
|
|
|
@ -1,118 +1,104 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/renderer/ItemRenderer.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/renderer/ItemRenderer.java
|
||||
@@ -15,11 +15,19 @@
|
||||
@@ -14,6 +14,8 @@
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
+import net.minecraft.item.ItemBlock;
|
||||
+import net.minecraft.item.ItemMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.storage.MapData;
|
||||
@@ -21,6 +23,12 @@
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
+
|
||||
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+import net.minecraftforge.client.IItemRenderer;
|
||||
+import net.minecraftforge.client.MinecraftForgeClient;
|
||||
+import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*;
|
||||
+import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*;
|
||||
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ItemRenderer
|
||||
@@ -54,27 +62,21 @@
|
||||
{
|
||||
@@ -53,8 +61,21 @@
|
||||
public void renderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
- Block var4 = null;
|
||||
- if (par2ItemStack.itemID < Block.blocksList.length)
|
||||
- {
|
||||
- var4 = Block.blocksList[par2ItemStack.itemID];
|
||||
- }
|
||||
-
|
||||
- if (var4 != null && RenderBlocks.renderItemIn3d(var4.getRenderType()))
|
||||
- {
|
||||
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
|
||||
- this.renderBlocksInstance.renderBlockAsItem(var4, par2ItemStack.getItemDamage(), 1.0F);
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, EQUIPPED);
|
||||
- if (par2ItemStack.func_94608_d() == 0 && Block.blocksList[par2ItemStack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
|
||||
+
|
||||
+ Block block = null;
|
||||
+ if (par2ItemStack.getItem() instanceof ItemBlock && par2ItemStack.itemID < Block.blocksList.length)
|
||||
+ {
|
||||
+ block = Block.blocksList[par2ItemStack.itemID];
|
||||
+ }
|
||||
+
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, EQUIPPED);
|
||||
+
|
||||
+ if (customRenderer != null)
|
||||
+ {
|
||||
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile()));
|
||||
+ this.mc.renderEngine.func_98187_b(par2ItemStack.func_94608_d() == 0 ? "/terrain.png" : "/gui/items.png");
|
||||
+ ForgeHooksClient.renderEquippedItem(customRenderer, renderBlocksInstance, par1EntityLiving, par2ItemStack);
|
||||
+ }
|
||||
+ else if (par2ItemStack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
|
||||
+ {
|
||||
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile()));
|
||||
+ this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
|
||||
}
|
||||
else
|
||||
+ else if (block != null && par2ItemStack.func_94608_d() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
|
||||
{
|
||||
- if (var4 != null)
|
||||
- {
|
||||
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/items.png"));
|
||||
- }
|
||||
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile()));
|
||||
this.mc.renderEngine.func_98187_b("/terrain.png");
|
||||
this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
|
||||
@@ -272,7 +293,7 @@
|
||||
Render render;
|
||||
RenderPlayer renderplayer;
|
||||
|
||||
Tessellator var5 = Tessellator.instance;
|
||||
int var6 = par1EntityLiving.getItemIcon(par2ItemStack, par3);
|
||||
@@ -279,8 +281,9 @@
|
||||
Render var24;
|
||||
RenderPlayer var26;
|
||||
|
||||
- if (var17 != null && var17.itemID == Item.map.itemID)
|
||||
- {
|
||||
+ if (var17 != null && var17.getItem() instanceof ItemMap)
|
||||
+ {
|
||||
+ IItemRenderer custom = MinecraftForgeClient.getItemRenderer(var17, FIRST_PERSON_MAP);
|
||||
- if (itemstack != null && itemstack.itemID == Item.map.itemID)
|
||||
+ if (itemstack != null && itemstack.getItem() instanceof ItemMap)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
var7 = 0.8F;
|
||||
var20 = var3.getSwingProgress(par1);
|
||||
@@ -346,11 +349,17 @@
|
||||
var28.addVertexWithUV((double)(128 + var27), (double)(0 - var27), 0.0D, 1.0D, 0.0D);
|
||||
var28.addVertexWithUV((double)(0 - var27), (double)(0 - var27), 0.0D, 0.0D, 0.0D);
|
||||
var28.draw();
|
||||
- MapData var16 = Item.map.getMapData(var17, this.mc.theWorld);
|
||||
f4 = 0.8F;
|
||||
@@ -340,11 +361,20 @@
|
||||
tessellator.addVertexWithUV((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D);
|
||||
tessellator.addVertexWithUV((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
- MapData mapdata = Item.map.getMapData(itemstack, this.mc.theWorld);
|
||||
-
|
||||
- if (var16 != null)
|
||||
- if (mapdata != null)
|
||||
- {
|
||||
- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var16);
|
||||
+ MapData var16 = ((ItemMap)var17.getItem()).getMapData(var17, this.mc.theWorld);
|
||||
- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, mapdata);
|
||||
+
|
||||
+ IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP);
|
||||
+ MapData mapdata = ((ItemMap)itemstack.getItem()).getMapData(itemstack, this.mc.theWorld);
|
||||
+
|
||||
+ if (custom == null)
|
||||
+ {
|
||||
+ if (var16 != null)
|
||||
+ if (mapdata != null)
|
||||
+ {
|
||||
+ this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var16);
|
||||
+ this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, mapdata);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ custom.renderItem(FIRST_PERSON_MAP, var17, mc.thePlayer, mc.renderEngine, var16);
|
||||
+ custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.renderEngine, mapdata);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
@@ -453,12 +462,15 @@
|
||||
if (var17.getItem().requiresMultipleRenderPasses())
|
||||
@@ -447,12 +477,15 @@
|
||||
if (itemstack.getItem().requiresMultipleRenderPasses())
|
||||
{
|
||||
this.renderItem(var3, var17, 0);
|
||||
- int var25 = Item.itemsList[var17.itemID].getColorFromItemStack(var17, 1);
|
||||
- var13 = (float)(var25 >> 16 & 255) / 255.0F;
|
||||
- var14 = (float)(var25 >> 8 & 255) / 255.0F;
|
||||
- var15 = (float)(var25 & 255) / 255.0F;
|
||||
- GL11.glColor4f(var6 * var13, var6 * var14, var6 * var15, 1.0F);
|
||||
- this.renderItem(var3, var17, 1);
|
||||
+ for (int x = 1; x < var17.getItem().getRenderPasses(var17.getItemDamage()); x++)
|
||||
this.renderItem(entityclientplayermp, itemstack, 0);
|
||||
- int i1 = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 1);
|
||||
- f10 = (float)(i1 >> 16 & 255) / 255.0F;
|
||||
- f11 = (float)(i1 >> 8 & 255) / 255.0F;
|
||||
- f12 = (float)(i1 & 255) / 255.0F;
|
||||
- GL11.glColor4f(f3 * f10, f3 * f11, f3 * f12, 1.0F);
|
||||
- this.renderItem(entityclientplayermp, itemstack, 1);
|
||||
+ for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++)
|
||||
+ {
|
||||
+ int var25 = Item.itemsList[var17.itemID].getColorFromItemStack(var17, x);
|
||||
+ var13 = (float)(var25 >> 16 & 255) / 255.0F;
|
||||
+ var14 = (float)(var25 >> 8 & 255) / 255.0F;
|
||||
+ var15 = (float)(var25 & 255) / 255.0F;
|
||||
+ GL11.glColor4f(var6 * var13, var6 * var14, var6 * var15, 1.0F);
|
||||
+ this.renderItem(var3, var17, x);
|
||||
+ int i1 = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, x);
|
||||
+ f10 = (float)(i1 >> 16 & 255) / 255.0F;
|
||||
+ f11 = (float)(i1 >> 8 & 255) / 255.0F;
|
||||
+ f12 = (float)(i1 & 255) / 255.0F;
|
||||
+ GL11.glColor4f(f3 * f10, f3 * f11, f3 * f12, 1.0F);
|
||||
+ this.renderItem(entityclientplayermp, itemstack, x);
|
||||
+ }
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1,165 +1,93 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/renderer/RenderBlocks.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/renderer/RenderBlocks.java
|
||||
@@ -37,6 +37,8 @@
|
||||
import net.minecraft.world.World;
|
||||
@@ -44,6 +44,8 @@
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
+
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderBlocks
|
||||
@@ -620,9 +622,8 @@
|
||||
{
|
||||
@@ -608,9 +610,8 @@
|
||||
public boolean renderBlockBed(Block par1Block, int par2, int par3, int par4)
|
||||
{
|
||||
Tessellator var5 = Tessellator.instance;
|
||||
- int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4);
|
||||
- int var7 = BlockBed.getDirection(var6);
|
||||
- boolean var8 = BlockBed.isBlockHeadOfBed(var6);
|
||||
+ int var7 = par1Block.getBedDirection(blockAccess, par2, par3, par4);
|
||||
+ boolean var8 = par1Block.isBedFoot(blockAccess, par2, par3, par4);
|
||||
float var9 = 0.5F;
|
||||
float var10 = 1.0F;
|
||||
float var11 = 0.8F;
|
||||
@@ -631,6 +632,7 @@
|
||||
var5.setBrightness(var25);
|
||||
var5.setColorOpaque_F(var9, var9, var9);
|
||||
int var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 0);
|
||||
+ if (overrideBlockTexture >= 0) var27 = overrideBlockTexture; //BugFix Proper breaking texture on underside
|
||||
int var28 = (var27 & 15) << 4;
|
||||
int var29 = var27 & 240;
|
||||
double var30 = (double)((float)var28 / 256.0F);
|
||||
@@ -649,6 +651,7 @@
|
||||
var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4));
|
||||
var5.setColorOpaque_F(var10, var10, var10);
|
||||
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 1);
|
||||
+ if (overrideBlockTexture >= 0) var27 = overrideBlockTexture; //BugFix Proper breaking texture on top
|
||||
var28 = (var27 & 15) << 4;
|
||||
var29 = var27 & 240;
|
||||
var30 = (double)((float)var28 / 256.0F);
|
||||
@@ -2387,7 +2390,7 @@
|
||||
double var28;
|
||||
double var30;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
- int l = this.blockAccess.getBlockMetadata(par2, par3, par4);
|
||||
- int i1 = BlockBed.getDirection(l);
|
||||
- boolean flag = BlockBed.isBlockHeadOfBed(l);
|
||||
+ int i1 = par1Block.getBedDirection(blockAccess, par2, par3, par4);
|
||||
+ boolean flag = par1Block.isBedFoot(blockAccess, par2, par3, par4);
|
||||
float f = 0.5F;
|
||||
float f1 = 1.0F;
|
||||
float f2 = 0.8F;
|
||||
@@ -619,6 +620,7 @@
|
||||
tessellator.setBrightness(j1);
|
||||
tessellator.setColorOpaque_F(f, f, f);
|
||||
Icon icon = this.func_94170_a(par1Block, this.blockAccess, par2, par3, par4, 0);
|
||||
+ if (func_94167_b()) icon = overrideBlockTexture; //BugFix Proper breaking texture on underside
|
||||
double d0 = (double)icon.func_94209_e();
|
||||
double d1 = (double)icon.func_94212_f();
|
||||
double d2 = (double)icon.func_94206_g();
|
||||
@@ -635,6 +637,7 @@
|
||||
tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4));
|
||||
tessellator.setColorOpaque_F(f1, f1, f1);
|
||||
icon = this.func_94170_a(par1Block, this.blockAccess, par2, par3, par4, 1);
|
||||
+ if (func_94167_b()) icon = overrideBlockTexture; //BugFix Proper breaking texture on underside
|
||||
d0 = (double)icon.func_94209_e();
|
||||
d1 = (double)icon.func_94212_f();
|
||||
d2 = (double)icon.func_94206_g();
|
||||
@@ -2426,7 +2429,7 @@
|
||||
double d9;
|
||||
double d10;
|
||||
|
||||
- if (!this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4))
|
||||
+ if (!this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4, UP))
|
||||
{
|
||||
float var36 = 0.2F;
|
||||
float var19 = 0.0625F;
|
||||
@@ -2407,7 +2410,7 @@
|
||||
var9 = var20;
|
||||
float f1 = 0.2F;
|
||||
float f2 = 0.0625F;
|
||||
@@ -2446,7 +2449,7 @@
|
||||
d0 = d5;
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4))
|
||||
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
|
||||
var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var11, var15);
|
||||
@@ -2419,7 +2422,7 @@
|
||||
var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
|
||||
tessellator.addVertexWithUV((double)((float)par2 + f1), (double)((float)par3 + f + f2), (double)(par4 + 1), d2, d1);
|
||||
tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + f2), (double)(par4 + 1), d2, d3);
|
||||
@@ -2458,7 +2461,7 @@
|
||||
tessellator.addVertexWithUV((double)((float)par2 + f1), (double)((float)par3 + f + f2), (double)(par4 + 1), d2, d1);
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4))
|
||||
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
|
||||
var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15);
|
||||
@@ -2431,7 +2434,7 @@
|
||||
var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
|
||||
tessellator.addVertexWithUV((double)((float)(par2 + 1) - f1), (double)((float)par3 + f + f2), (double)(par4 + 0), d0, d1);
|
||||
tessellator.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + f2), (double)(par4 + 0), d0, d3);
|
||||
@@ -2470,7 +2473,7 @@
|
||||
tessellator.addVertexWithUV((double)((float)(par2 + 1) - f1), (double)((float)par3 + f + f2), (double)(par4 + 0), d0, d1);
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1))
|
||||
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13);
|
||||
var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var11, var15);
|
||||
@@ -2443,7 +2446,7 @@
|
||||
var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13);
|
||||
tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + f + f2), (double)((float)par4 + f1), d2, d1);
|
||||
tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + f2), (double)(par4 + 0), d2, d3);
|
||||
@@ -2482,7 +2485,7 @@
|
||||
tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + f + f2), (double)((float)par4 + f1), d2, d1);
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1))
|
||||
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13);
|
||||
var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15);
|
||||
@@ -2455,7 +2458,7 @@
|
||||
var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13);
|
||||
tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + f + f2), (double)((float)(par4 + 1) - f1), d0, d1);
|
||||
tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + f2), (double)(par4 + 1 - 0), d0, d3);
|
||||
@@ -2494,7 +2497,7 @@
|
||||
tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + f + f2), (double)((float)(par4 + 1) - f1), d0, d1);
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4))
|
||||
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4, DOWN))
|
||||
{
|
||||
var20 = (double)par2 + 0.5D + 0.5D;
|
||||
var22 = (double)par2 + 0.5D - 0.5D;
|
||||
@@ -4654,7 +4657,7 @@
|
||||
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
|
||||
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||
|
||||
- if (fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
this.colorRedTopLeft *= par5;
|
||||
this.colorRedBottomLeft *= par5;
|
||||
@@ -4777,7 +4780,7 @@
|
||||
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
|
||||
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3));
|
||||
|
||||
- if (fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
this.colorRedTopLeft *= par5;
|
||||
this.colorRedBottomLeft *= par5;
|
||||
@@ -4900,7 +4903,7 @@
|
||||
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
|
||||
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||
|
||||
- if (fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
this.colorRedTopLeft *= par5;
|
||||
this.colorRedBottomLeft *= par5;
|
||||
@@ -5023,7 +5026,7 @@
|
||||
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
|
||||
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||
|
||||
- if (fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
this.colorRedTopLeft *= par5;
|
||||
this.colorRedBottomLeft *= par5;
|
||||
@@ -5135,7 +5138,7 @@
|
||||
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
|
||||
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
|
||||
|
||||
- if (fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
|
||||
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||
@@ -5151,7 +5154,7 @@
|
||||
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
|
||||
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
|
||||
|
||||
- if (fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
|
||||
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||
@@ -5167,7 +5170,7 @@
|
||||
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
|
||||
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
|
||||
|
||||
- if (fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7);
|
||||
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||
@@ -5183,7 +5186,7 @@
|
||||
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
|
||||
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
|
||||
|
||||
- if (fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7);
|
||||
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||
d5 = (double)par2 + 0.5D + 0.5D;
|
||||
d6 = (double)par2 + 0.5D - 0.5D;
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/renderer/RenderEngine.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/renderer/RenderEngine.java
|
||||
@@ -29,6 +29,8 @@
|
||||
import net.minecraft.util.IntHashMap;
|
||||
@@ -28,6 +28,8 @@
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderEngine
|
||||
{
|
||||
@@ -172,6 +174,7 @@
|
||||
@@ -186,6 +188,7 @@
|
||||
|
||||
try
|
||||
{
|
||||
+ ForgeHooksClient.onTextureLoadPre(par1Str);
|
||||
this.singleIntBuffer.clear();
|
||||
GLAllocation.generateTextureNames(this.singleIntBuffer);
|
||||
int var3 = this.singleIntBuffer.get(0);
|
||||
@@ -217,6 +220,7 @@
|
||||
try
|
||||
{
|
||||
+ ForgeHooksClient.onTextureLoadPre(par1Str);
|
||||
int i = GLAllocation.generateTextureNames();
|
||||
boolean flag = par1Str.startsWith("%blur%");
|
||||
|
||||
@@ -215,6 +218,7 @@
|
||||
}
|
||||
|
||||
this.textureMap.put(s1, Integer.valueOf(i));
|
||||
+ ForgeHooksClient.onTextureLoad(par1Str, texturePack.getSelectedTexturePack());
|
||||
return i;
|
||||
}
|
||||
|
||||
this.textureMap.put(par1Str, Integer.valueOf(var3));
|
||||
+ ForgeHooksClient.onTextureLoad(par1Str, var6);
|
||||
return var3;
|
||||
}
|
||||
catch (Exception var5)
|
||||
catch (Exception exception)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/renderer/RenderGlobal.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/renderer/RenderGlobal.java
|
||||
@@ -62,6 +62,9 @@
|
||||
@@ -65,6 +65,9 @@
|
||||
import org.lwjgl.opengl.ARBOcclusionQuery;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
@ -10,110 +10,89 @@
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class RenderGlobal implements IWorldAccess
|
||||
{
|
||||
@@ -439,62 +442,72 @@
|
||||
@@ -443,35 +446,47 @@
|
||||
*/
|
||||
public void renderEntities(Vec3 par1Vec3, ICamera par2ICamera, float par3)
|
||||
{
|
||||
+ int pass = MinecraftForgeClient.getRenderPass();
|
||||
if (this.renderEntitiesStartupCounter > 0)
|
||||
{
|
||||
+ if(pass > 0)
|
||||
+ if (pass > 0)
|
||||
+ {
|
||||
+ return;
|
||||
+
|
||||
+ }
|
||||
--this.renderEntitiesStartupCounter;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.theWorld.theProfiler.startSection("prepare");
|
||||
- TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, par3);
|
||||
- RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.gameSettings, par3);
|
||||
- RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.field_96291_i, this.mc.gameSettings, par3);
|
||||
- this.countEntitiesTotal = 0;
|
||||
- this.countEntitiesRendered = 0;
|
||||
- this.countEntitiesHidden = 0;
|
||||
- EntityLiving var4 = this.mc.renderViewEntity;
|
||||
- RenderManager.renderPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
|
||||
- RenderManager.renderPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
|
||||
- RenderManager.renderPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
|
||||
- TileEntityRenderer.staticPlayerX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
|
||||
- TileEntityRenderer.staticPlayerY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
|
||||
- TileEntityRenderer.staticPlayerZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
|
||||
+ List var5 = this.theWorld.getLoadedEntityList();
|
||||
+ if(pass == 0)
|
||||
- EntityLiving entityliving = this.mc.renderViewEntity;
|
||||
- RenderManager.renderPosX = entityliving.lastTickPosX + (entityliving.posX - entityliving.lastTickPosX) * (double)par3;
|
||||
- RenderManager.renderPosY = entityliving.lastTickPosY + (entityliving.posY - entityliving.lastTickPosY) * (double)par3;
|
||||
- RenderManager.renderPosZ = entityliving.lastTickPosZ + (entityliving.posZ - entityliving.lastTickPosZ) * (double)par3;
|
||||
- TileEntityRenderer.staticPlayerX = entityliving.lastTickPosX + (entityliving.posX - entityliving.lastTickPosX) * (double)par3;
|
||||
- TileEntityRenderer.staticPlayerY = entityliving.lastTickPosY + (entityliving.posY - entityliving.lastTickPosY) * (double)par3;
|
||||
- TileEntityRenderer.staticPlayerZ = entityliving.lastTickPosZ + (entityliving.posZ - entityliving.lastTickPosZ) * (double)par3;
|
||||
+ if (pass == 0)
|
||||
+ {
|
||||
+ TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, par3);
|
||||
+ RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.gameSettings, par3);
|
||||
+ RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.field_96291_i, this.mc.gameSettings, par3);
|
||||
+ this.countEntitiesTotal = 0;
|
||||
+ this.countEntitiesRendered = 0;
|
||||
+ this.countEntitiesHidden = 0;
|
||||
+ EntityLiving var4 = this.mc.renderViewEntity;
|
||||
+ RenderManager.renderPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
|
||||
+ RenderManager.renderPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
|
||||
+ RenderManager.renderPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
|
||||
+ TileEntityRenderer.staticPlayerX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
|
||||
+ TileEntityRenderer.staticPlayerY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
|
||||
+ TileEntityRenderer.staticPlayerZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
|
||||
+ this.countEntitiesTotal = var5.size();
|
||||
+ EntityLiving entityliving = this.mc.renderViewEntity;
|
||||
+ RenderManager.renderPosX = entityliving.lastTickPosX + (entityliving.posX - entityliving.lastTickPosX) * (double)par3;
|
||||
+ RenderManager.renderPosY = entityliving.lastTickPosY + (entityliving.posY - entityliving.lastTickPosY) * (double)par3;
|
||||
+ RenderManager.renderPosZ = entityliving.lastTickPosZ + (entityliving.posZ - entityliving.lastTickPosZ) * (double)par3;
|
||||
+ TileEntityRenderer.staticPlayerX = entityliving.lastTickPosX + (entityliving.posX - entityliving.lastTickPosX) * (double)par3;
|
||||
+ TileEntityRenderer.staticPlayerY = entityliving.lastTickPosY + (entityliving.posY - entityliving.lastTickPosY) * (double)par3;
|
||||
+ TileEntityRenderer.staticPlayerZ = entityliving.lastTickPosZ + (entityliving.posZ - entityliving.lastTickPosZ) * (double)par3;
|
||||
+ }
|
||||
this.mc.entityRenderer.enableLightmap((double)par3);
|
||||
this.theWorld.theProfiler.endStartSection("global");
|
||||
- List var5 = this.theWorld.getLoadedEntityList();
|
||||
- this.countEntitiesTotal = var5.size();
|
||||
int var6;
|
||||
Entity var7;
|
||||
|
||||
for (var6 = 0; var6 < this.theWorld.weatherEffects.size(); ++var6)
|
||||
{
|
||||
var7 = (Entity)this.theWorld.weatherEffects.get(var6);
|
||||
- ++this.countEntitiesRendered;
|
||||
-
|
||||
- if (var7.isInRangeToRenderVec3D(par1Vec3))
|
||||
- {
|
||||
- RenderManager.instance.renderEntity(var7, par3);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- this.theWorld.theProfiler.endStartSection("entities");
|
||||
-
|
||||
- for (var6 = 0; var6 < var5.size(); ++var6)
|
||||
- {
|
||||
- var7 = (Entity)var5.get(var6);
|
||||
-
|
||||
- if (var7.isInRangeToRenderVec3D(par1Vec3) && (var7.ignoreFrustumCheck || par2ICamera.isBoundingBoxInFrustum(var7.boundingBox) || var7.riddenByEntity == this.mc.thePlayer) && (var7 != this.mc.renderViewEntity || this.mc.gameSettings.thirdPersonView != 0 || this.mc.renderViewEntity.isPlayerSleeping()) && this.theWorld.blockExists(MathHelper.floor_double(var7.posX), 0, MathHelper.floor_double(var7.posZ)))
|
||||
+
|
||||
+ if (var7.shouldRenderInPass(pass) && var7.isInRangeToRenderVec3D(par1Vec3))
|
||||
{
|
||||
++this.countEntitiesRendered;
|
||||
RenderManager.instance.renderEntity(var7, par3);
|
||||
}
|
||||
}
|
||||
|
||||
+ this.theWorld.theProfiler.endStartSection("entities");
|
||||
+
|
||||
+ for (var6 = 0; var6 < var5.size(); ++var6)
|
||||
List list = this.theWorld.getLoadedEntityList();
|
||||
- this.countEntitiesTotal = list.size();
|
||||
+ if (pass == 0)
|
||||
+ {
|
||||
+ var7 = (Entity)var5.get(var6);
|
||||
+
|
||||
+ if (var7.shouldRenderInPass(pass) && var7.isInRangeToRenderVec3D(par1Vec3) && (var7.ignoreFrustumCheck || par2ICamera.isBoundingBoxInFrustum(var7.boundingBox) || var7.riddenByEntity == this.mc.thePlayer) && (var7 != this.mc.renderViewEntity || this.mc.gameSettings.thirdPersonView != 0 || this.mc.renderViewEntity.isPlayerSleeping()) && this.theWorld.blockExists(MathHelper.floor_double(var7.posX), 0, MathHelper.floor_double(var7.posZ)))
|
||||
+ {
|
||||
+ ++this.countEntitiesRendered;
|
||||
+ RenderManager.instance.renderEntity(var7, par3);
|
||||
+ }
|
||||
+ this.countEntitiesTotal = list.size();
|
||||
+ }
|
||||
+
|
||||
this.theWorld.theProfiler.endStartSection("tileentities");
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
int i;
|
||||
Entity entity;
|
||||
|
||||
+ TileEntity te;
|
||||
for (var6 = 0; var6 < this.tileEntities.size(); ++var6)
|
||||
for (i = 0; i < this.theWorld.weatherEffects.size(); ++i)
|
||||
{
|
||||
- TileEntityRenderer.instance.renderTileEntity((TileEntity)this.tileEntities.get(var6), par3);
|
||||
+ te = (TileEntity)this.tileEntities.get(var6);
|
||||
+ if(par2ICamera.isBoundingBoxInFrustum(te.getRenderBoundingBox()) && te.shouldRenderInPass(pass))
|
||||
+ TileEntityRenderer.instance.renderTileEntity(te, par3);
|
||||
entity = (Entity)this.theWorld.weatherEffects.get(i);
|
||||
+ if (!entity.shouldRenderInPass(pass)) continue;
|
||||
++this.countEntitiesRendered;
|
||||
|
||||
if (entity.isInRangeToRenderVec3D(par1Vec3))
|
||||
@@ -485,6 +500,7 @@
|
||||
for (i = 0; i < list.size(); ++i)
|
||||
{
|
||||
entity = (Entity)list.get(i);
|
||||
+ if (!entity.shouldRenderInPass(pass)) continue;
|
||||
|
||||
if (entity.isInRangeToRenderVec3D(par1Vec3) && (entity.ignoreFrustumCheck || par2ICamera.isBoundingBoxInFrustum(entity.boundingBox) || entity.riddenByEntity == this.mc.thePlayer) && (entity != this.mc.renderViewEntity || this.mc.gameSettings.thirdPersonView != 0 || this.mc.renderViewEntity.isPlayerSleeping()) && this.theWorld.blockExists(MathHelper.floor_double(entity.posX), 0, MathHelper.floor_double(entity.posZ)))
|
||||
{
|
||||
@@ -498,7 +514,11 @@
|
||||
|
||||
for (i = 0; i < this.tileEntities.size(); ++i)
|
||||
{
|
||||
- TileEntityRenderer.instance.renderTileEntity((TileEntity)this.tileEntities.get(i), par3);
|
||||
+ TileEntity tile = (TileEntity)tileEntities.get(i);
|
||||
+ if (tile.shouldRenderInPass(pass) && par2ICamera.isBoundingBoxInFrustum(tile.getRenderBoundingBox()))
|
||||
+ {
|
||||
+ TileEntityRenderer.instance.renderTileEntity(tile, par3);
|
||||
+ }
|
||||
}
|
||||
|
||||
this.mc.entityRenderer.disableLightmap((double)par3);
|
||||
@@ -929,6 +942,12 @@
|
||||
@@ -933,6 +953,12 @@
|
||||
*/
|
||||
public void renderSky(float par1)
|
||||
{
|
||||
|
@ -126,7 +105,7 @@
|
|||
if (this.mc.theWorld.provider.dimensionId == 1)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
@@ -1167,6 +1186,13 @@
|
||||
@@ -1171,6 +1197,13 @@
|
||||
|
||||
public void renderClouds(float par1)
|
||||
{
|
||||
|
@ -140,7 +119,7 @@
|
|||
if (this.mc.theWorld.provider.isSurfaceWorld())
|
||||
{
|
||||
if (this.mc.gameSettings.fancyGraphics)
|
||||
@@ -1596,6 +1622,11 @@
|
||||
@@ -1599,6 +1632,11 @@
|
||||
}
|
||||
|
||||
public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3)
|
||||
|
@ -150,51 +129,5 @@
|
|||
+
|
||||
+ public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityLiving par2EntityPlayer, float par3)
|
||||
{
|
||||
double var4 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3;
|
||||
double var6 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3;
|
||||
@@ -1873,6 +1904,7 @@
|
||||
double var17 = this.mc.renderViewEntity.posY - par4;
|
||||
double var19 = this.mc.renderViewEntity.posZ - par6;
|
||||
EntityFX var21 = null;
|
||||
+ Object effectObject = null;
|
||||
|
||||
if (par1Str.equals("hugeexplosion"))
|
||||
{
|
||||
@@ -2009,6 +2041,7 @@
|
||||
else if (par1Str.equals("snowballpoof"))
|
||||
{
|
||||
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.snowball);
|
||||
+ effectObject = Item.snowball;
|
||||
}
|
||||
else if (par1Str.equals("dripWater"))
|
||||
{
|
||||
@@ -2025,6 +2058,7 @@
|
||||
else if (par1Str.equals("slime"))
|
||||
{
|
||||
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.slimeBall);
|
||||
+ effectObject = Item.slimeBall;
|
||||
}
|
||||
else if (par1Str.equals("heart"))
|
||||
{
|
||||
@@ -2046,6 +2080,7 @@
|
||||
{
|
||||
int var27 = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1));
|
||||
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[var27]);
|
||||
+ effectObject = Item.itemsList[var27];
|
||||
}
|
||||
else if (par1Str.startsWith("tilecrack_"))
|
||||
{
|
||||
@@ -2053,11 +2088,12 @@
|
||||
int var25 = Integer.parseInt(var28[1]);
|
||||
int var26 = Integer.parseInt(var28[2]);
|
||||
var21 = (new EntityDiggingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Block.blocksList[var25], 0, var26)).applyRenderColor(var26);
|
||||
+ effectObject = Block.blocksList[var25];
|
||||
}
|
||||
|
||||
if (var21 != null)
|
||||
{
|
||||
- this.mc.effectRenderer.addEffect((EntityFX)var21);
|
||||
+ this.mc.effectRenderer.addEffect((EntityFX)var21, effectObject);
|
||||
}
|
||||
|
||||
return (EntityFX)var21;
|
||||
double d0 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3;
|
||||
double d1 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3;
|
||||
|
|
|
@ -152,7 +152,7 @@
|
|||
+ rawBuffer = null;
|
||||
}
|
||||
|
||||
int var1 = this.rawBufferIndex * 4;
|
||||
int i = this.rawBufferIndex * 4;
|
||||
@@ -442,6 +470,19 @@
|
||||
*/
|
||||
public void addVertex(double par1, double par3, double par5)
|
||||
|
|
|
@ -19,51 +19,49 @@
|
|||
public int posY;
|
||||
@@ -192,15 +194,16 @@
|
||||
GL11.glTranslatef(-8.0F, -8.0F, -8.0F);
|
||||
GL11.glScalef(var19, var19, var19);
|
||||
GL11.glScalef(f, f, f);
|
||||
GL11.glTranslatef(8.0F, 8.0F, 8.0F);
|
||||
- tessellator.startDrawingQuads();
|
||||
- tessellator.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ));
|
||||
+ ForgeHooksClient.beforeRenderPass(var11);
|
||||
+ //ForgeHooksClient.beforeRenderPass(l1); Noop fo now, TODO: Event if anyone needs
|
||||
+ Tessellator.instance.startDrawingQuads();
|
||||
+ Tessellator.instance.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ));
|
||||
}
|
||||
|
||||
Block var23 = Block.blocksList[var18];
|
||||
Block block = Block.blocksList[l2];
|
||||
|
||||
if (var23 != null)
|
||||
if (block != null)
|
||||
{
|
||||
- if (var11 == 0 && var23.hasTileEntity())
|
||||
+ if (var11 == 0 && var23.hasTileEntity(var9.getBlockMetadata(var17, var15, var16)))
|
||||
- if (l1 == 0 && block.hasTileEntity())
|
||||
+ if (l1 == 0 && block.hasTileEntity(chunkcache.getBlockMetadata(k2, i2, j2)))
|
||||
{
|
||||
TileEntity var20 = var9.getBlockTileEntity(var17, var15, var16);
|
||||
TileEntity tileentity = chunkcache.getBlockTileEntity(k2, i2, j2);
|
||||
|
||||
@@ -212,14 +215,17 @@
|
||||
@@ -212,14 +215,15 @@
|
||||
|
||||
int var24 = var23.getRenderBlockPass();
|
||||
int i3 = block.getRenderBlockPass();
|
||||
|
||||
- if (var24 != var11)
|
||||
+ if (var24 > var11)
|
||||
- if (i3 != l1)
|
||||
+ if (i3 > l1)
|
||||
{
|
||||
var12 = true;
|
||||
flag = true;
|
||||
}
|
||||
- else if (var24 == var11)
|
||||
+ if (!var23.canRenderInPass(var11))
|
||||
- else if (i3 == l1)
|
||||
+ if (!block.canRenderInPass(l1))
|
||||
{
|
||||
- var13 |= var10.renderBlockByRenderType(var23, var17, var15, var16);
|
||||
- flag1 |= renderblocks.renderBlockByRenderType(block, k2, i2, j2);
|
||||
+ continue;
|
||||
}
|
||||
+ ForgeHooksClient.beforeBlockRender(var23, var10);
|
||||
+ var13 |= var10.renderBlockByRenderType(var23, var17, var15, var16);
|
||||
+ ForgeHooksClient.afterBlockRender(var23, var10);
|
||||
+ flag1 |= renderblocks.renderBlockByRenderType(block, k2, i2, j2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,10 +234,11 @@
|
||||
@@ -228,10 +232,11 @@
|
||||
|
||||
if (var14)
|
||||
if (flag2)
|
||||
{
|
||||
- this.bytesDrawn += tessellator.draw();
|
||||
+ ForgeHooksClient.afterRenderPass(var11);
|
||||
+ //ForgeHooksClient.afterRenderPass(l1); Noop fo now, TODO: Event if anyone needs
|
||||
+ this.bytesDrawn += Tessellator.instance.draw();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEndList();
|
||||
|
|
|
@ -17,50 +17,50 @@
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class RenderBiped extends RenderLiving
|
||||
@@ -59,7 +65,7 @@
|
||||
if (var5 instanceof ItemArmor)
|
||||
if (item instanceof ItemArmor)
|
||||
{
|
||||
ItemArmor var6 = (ItemArmor)var5;
|
||||
- this.loadTexture("/armor/" + bipedArmorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(var4, "/armor/" + bipedArmorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png"));
|
||||
ModelBiped var7 = par2 == 2 ? this.field_82425_h : this.field_82423_g;
|
||||
var7.bipedHead.showModel = par2 == 0;
|
||||
var7.bipedHeadwear.showModel = par2 == 0;
|
||||
ItemArmor itemarmor = (ItemArmor)item;
|
||||
- this.loadTexture("/armor/" + bipedArmorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(itemstack, "/armor/" + bipedArmorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png"));
|
||||
ModelBiped modelbiped = par2 == 2 ? this.field_82425_h : this.field_82423_g;
|
||||
modelbiped.bipedHead.showModel = par2 == 0;
|
||||
modelbiped.bipedHeadwear.showModel = par2 == 0;
|
||||
@@ -174,9 +180,12 @@
|
||||
GL11.glPushMatrix();
|
||||
this.modelBipedMain.bipedHead.postRender(0.0625F);
|
||||
|
||||
- if (var5.getItem().itemID < 256)
|
||||
- if (itemstack1.getItem().itemID < 256)
|
||||
- {
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[var5.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var5, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var5, BLOCK_3D));
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D));
|
||||
+
|
||||
+ if (var5.getItem() instanceof ItemBlock)
|
||||
+ if (itemstack1.getItem() instanceof ItemBlock)
|
||||
+ {
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var5.itemID].getRenderType()))
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType()))
|
||||
{
|
||||
var6 = 0.625F;
|
||||
f2 = 0.625F;
|
||||
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
|
||||
@@ -218,7 +227,10 @@
|
||||
this.modelBipedMain.bipedRightArm.postRender(0.0625F);
|
||||
GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
|
||||
|
||||
- if (var4.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var4, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var4, BLOCK_3D));
|
||||
- if (itemstack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
|
||||
+
|
||||
+ if (var4.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())))
|
||||
+ if (itemstack.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())))
|
||||
{
|
||||
var6 = 0.5F;
|
||||
f2 = 0.5F;
|
||||
GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
|
||||
@@ -265,7 +277,10 @@
|
||||
|
||||
if (var4.getItem().requiresMultipleRenderPasses())
|
||||
if (itemstack.getItem().requiresMultipleRenderPasses())
|
||||
{
|
||||
- this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, 1);
|
||||
+ for (int x = 1; x < var4.getItem().getRenderPasses(var4.getItemDamage()); x++)
|
||||
- this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, 1);
|
||||
+ for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++)
|
||||
+ {
|
||||
+ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, x);
|
||||
+ this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, x);
|
||||
+ }
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderItem.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderItem.java
|
||||
@@ -13,11 +13,14 @@
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.Item;
|
||||
+import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -19,6 +19,8 @@
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
|
@ -15,209 +9,149 @@
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class RenderItem extends Render
|
||||
{
|
||||
@@ -48,39 +51,22 @@
|
||||
if (var10.getItem() != null)
|
||||
@@ -49,29 +51,9 @@
|
||||
if (itemstack.getItem() != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
- float var11 = MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F;
|
||||
+ float var11 = shouldBob() ? MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F;
|
||||
float var12 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI);
|
||||
- byte var13 = 1;
|
||||
- float f2 = MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F;
|
||||
+ float f2 = shouldBob() ? MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F;
|
||||
float f3 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI);
|
||||
- byte b0 = 1;
|
||||
-
|
||||
- if (par1EntityItem.getEntityItem().stackSize > 1)
|
||||
- {
|
||||
- var13 = 2;
|
||||
- b0 = 2;
|
||||
- }
|
||||
-
|
||||
- if (par1EntityItem.getEntityItem().stackSize > 5)
|
||||
- {
|
||||
- var13 = 3;
|
||||
- b0 = 3;
|
||||
- }
|
||||
-
|
||||
- if (par1EntityItem.getEntityItem().stackSize > 20)
|
||||
- {
|
||||
- var13 = 4;
|
||||
- b0 = 4;
|
||||
- }
|
||||
-
|
||||
- if (par1EntityItem.getEntityItem().stackSize > 40)
|
||||
- {
|
||||
- var13 = 5;
|
||||
- b0 = 5;
|
||||
- }
|
||||
+ byte var13 = getMiniBlockCountForItemStack(var10);
|
||||
+ byte b0 = getMiniBlockCount(itemstack);
|
||||
|
||||
GL11.glTranslatef((float)par2, (float)par4 + var11, (float)par6);
|
||||
GL11.glTranslatef((float)par2, (float)par4 + f2, (float)par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
- Block var14 = Block.blocksList[var10.itemID];
|
||||
int var16;
|
||||
float var19;
|
||||
float var20;
|
||||
float var24;
|
||||
@@ -80,9 +62,18 @@
|
||||
float f5;
|
||||
float f6;
|
||||
|
||||
- if (var14 != null && RenderBlocks.renderItemIn3d(var14.getRenderType()))
|
||||
+ if (ForgeHooksClient.renderEntityItem(par1EntityItem, var10, var11, var12, random, renderManager.renderEngine, renderBlocks))
|
||||
- if (itemstack.func_94608_d() == 0 && Block.blocksList[itemstack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
- {
|
||||
- Block block = Block.blocksList[itemstack.itemID];
|
||||
+ Block block = null;
|
||||
+ if (itemstack.itemID < Block.blocksList.length)
|
||||
+ {
|
||||
+ block = Block.blocksList[itemstack.itemID];
|
||||
+ }
|
||||
+
|
||||
+ if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, renderBlocks))
|
||||
+ {
|
||||
+ ;
|
||||
+ }
|
||||
+ else if (var10.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType()))
|
||||
{
|
||||
GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F);
|
||||
+ else if (itemstack.func_94608_d() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
+ {
|
||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
@@ -91,9 +77,9 @@
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
if (field_82407_g)
|
||||
@@ -138,10 +129,10 @@
|
||||
|
||||
- this.loadTexture("/terrain.png");
|
||||
+ this.loadTexture(Block.blocksList[var10.itemID].getTextureFile());
|
||||
float var22 = 0.25F;
|
||||
- var16 = var14.getRenderType();
|
||||
+ var16 = Block.blocksList[var10.itemID].getRenderType();
|
||||
this.loadTexture("/gui/items.png");
|
||||
|
||||
if (var16 == 1 || var16 == 19 || var16 == 12 || var16 == 2)
|
||||
{
|
||||
@@ -115,7 +101,7 @@
|
||||
}
|
||||
|
||||
var24 = 1.0F;
|
||||
- this.itemRenderBlocks.renderBlockAsItem(var14, var10.getItemDamage(), var24);
|
||||
+ this.itemRenderBlocks.renderBlockAsItem(Block.blocksList[var10.itemID], var10.getItemDamage(), var24);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -136,12 +122,12 @@
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
- this.loadTexture("/gui/items.png");
|
||||
-
|
||||
- for (var15 = 0; var15 <= 1; ++var15)
|
||||
- {
|
||||
+
|
||||
+ for (var15 = 0; var15 < var10.getItem().getRenderPasses(var10.getItemDamage()); ++var15)
|
||||
+ {
|
||||
+ this.loadTexture(Item.itemsList[var10.itemID].getTextureFile());
|
||||
- for (int k = 0; k <= 1; ++k)
|
||||
+ for (int k = 0; k <= itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k)
|
||||
{
|
||||
this.random.setSeed(187L);
|
||||
- var16 = var10.getItem().getIconFromDamageForRenderPass(var10.getItemDamage(), var15);
|
||||
+ var16 = var10.getItem().getIconIndex(var10, var15);
|
||||
var17 = 1.0F;
|
||||
- Icon icon = itemstack.getItem().getIconFromDamageForRenderPass(itemstack.getItemDamage(), k);
|
||||
+ Icon icon = itemstack.getItem().getIcon(itemstack, k);
|
||||
f8 = 1.0F;
|
||||
|
||||
if (this.field_77024_a)
|
||||
@@ -173,14 +159,7 @@
|
||||
|
||||
var15 = var10.getIconIndex();
|
||||
|
||||
- if (var14 != null)
|
||||
- {
|
||||
- this.loadTexture("/terrain.png");
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.loadTexture("/gui/items.png");
|
||||
- }
|
||||
+ this.loadTexture(var10.getItem().getTextureFile());
|
||||
|
||||
if (this.field_77024_a)
|
||||
{
|
||||
@@ -232,39 +211,27 @@
|
||||
var17 = 0.021875F;
|
||||
ItemStack var18 = par1EntityItem.getEntityItem();
|
||||
int var19 = var18.stackSize;
|
||||
- byte var24;
|
||||
@@ -241,32 +232,26 @@
|
||||
f11 = 0.021875F;
|
||||
ItemStack itemstack = par1EntityItem.getEntityItem();
|
||||
int j = itemstack.stackSize;
|
||||
- byte b0;
|
||||
-
|
||||
- if (var19 < 2)
|
||||
- if (j < 2)
|
||||
- {
|
||||
- var24 = 1;
|
||||
- b0 = 1;
|
||||
- }
|
||||
- else if (var19 < 16)
|
||||
- else if (j < 16)
|
||||
- {
|
||||
- var24 = 2;
|
||||
- b0 = 2;
|
||||
- }
|
||||
- else if (var19 < 32)
|
||||
- else if (j < 32)
|
||||
- {
|
||||
- var24 = 3;
|
||||
- b0 = 3;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- var24 = 4;
|
||||
- b0 = 4;
|
||||
- }
|
||||
+ byte var24 = getMiniItemCountForItemStack(var18);
|
||||
+
|
||||
+ byte b0 = getMiniItemCount(itemstack);
|
||||
|
||||
GL11.glTranslatef(-var14, -var15, -((var16 + var17) * (float)var24 / 2.0F));
|
||||
GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float)b0 / 2.0F));
|
||||
|
||||
for (int var20 = 0; var20 < var24; ++var20)
|
||||
for (int k = 0; k < b0; ++k)
|
||||
{
|
||||
- GL11.glTranslatef(0.0F, 0.0F, var16 + var17);
|
||||
- GL11.glTranslatef(0.0F, 0.0F, f12 + f11);
|
||||
-
|
||||
- if (Block.blocksList[var18.itemID] != null)
|
||||
- {
|
||||
- this.loadTexture("/terrain.png");
|
||||
- if (itemstack.func_94608_d() == 0 && Block.blocksList[itemstack.itemID] != null)
|
||||
+ // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
|
||||
+ if (var20 > 0 && shouldSpreadItems())
|
||||
+ if (k > 0 && shouldSpreadItems())
|
||||
+ {
|
||||
+ float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
+ float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
+ float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
+ GL11.glTranslatef(x, y, var16 + var17);
|
||||
}
|
||||
else
|
||||
{
|
||||
- this.loadTexture("/gui/items.png");
|
||||
- }
|
||||
+ GL11.glTranslatef(0f, 0f, var16 + var17);
|
||||
+ GL11.glTranslatef(x, y, f12 + f11);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ GL11.glTranslatef(0f, 0f, f12 + f11);
|
||||
+ }
|
||||
+
|
||||
+ this.loadTexture(Item.itemsList[var18.itemID].getTextureFile());
|
||||
+ if (itemstack.func_94608_d() == 0 && itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null)
|
||||
{
|
||||
this.loadTexture("/terrain.png");
|
||||
}
|
||||
@@ -356,10 +341,11 @@
|
||||
float f1;
|
||||
float f2;
|
||||
|
||||
GL11.glColor4f(par5, par6, par7, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(var8, var10, var11, var9, var12, var16);
|
||||
@@ -348,10 +315,10 @@
|
||||
float var13;
|
||||
float var16;
|
||||
|
||||
- if (var6 < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var6].getRenderType()))
|
||||
- {
|
||||
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png"));
|
||||
+ if (par3ItemStack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[par3ItemStack.itemID].getRenderType()))
|
||||
+ {
|
||||
Block var15 = Block.blocksList[var6];
|
||||
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(var15.getTextureFile()));
|
||||
- if (par3ItemStack.func_94608_d() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType()))
|
||||
+ Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null);
|
||||
+
|
||||
+ if (par3ItemStack.func_94608_d() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType()))
|
||||
{
|
||||
par2RenderEngine.func_98187_b("/terrain.png");
|
||||
- Block block = Block.blocksList[k];
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel);
|
||||
GL11.glScalef(10.0F, 10.0F, 10.0F);
|
||||
@@ -382,11 +349,11 @@
|
||||
if (Item.itemsList[var6].requiresMultipleRenderPasses())
|
||||
{
|
||||
@@ -392,9 +378,9 @@
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png"));
|
||||
-
|
||||
- for (var9 = 0; var9 <= 1; ++var9)
|
||||
par2RenderEngine.func_98187_b("/gui/items.png");
|
||||
|
||||
- for (j1 = 0; j1 <= 1; ++j1)
|
||||
- {
|
||||
- var10 = Item.itemsList[var6].getIconFromDamageForRenderPass(var7, var9);
|
||||
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Item.itemsList[var6].getTextureFile()));
|
||||
+
|
||||
+ for (var9 = 0; var9 < Item.itemsList[var6].getRenderPasses(var7); ++var9)
|
||||
- Icon icon1 = Item.itemsList[k].getIconFromDamageForRenderPass(l, j1);
|
||||
+ for (j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1)
|
||||
+ {
|
||||
+ var10 = Item.itemsList[var6].getIconIndex(par3ItemStack, var9);
|
||||
int var11 = Item.itemsList[var6].getColorFromItemStack(par3ItemStack, var9);
|
||||
var12 = (float)(var11 >> 16 & 255) / 255.0F;
|
||||
var13 = (float)(var11 >> 8 & 255) / 255.0F;
|
||||
@@ -406,14 +373,7 @@
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
- if (var6 < 256)
|
||||
- {
|
||||
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png"));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png"));
|
||||
- }
|
||||
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(par3ItemStack.getItem().getTextureFile()));
|
||||
|
||||
var9 = Item.itemsList[var6].getColorFromItemStack(par3ItemStack, 0);
|
||||
float var17 = (float)(var9 >> 16 & 255) / 255.0F;
|
||||
@@ -440,7 +400,10 @@
|
||||
+ Icon icon1 = Item.itemsList[k].getIcon(par3ItemStack, j1);
|
||||
int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1);
|
||||
f = (float)(k1 >> 16 & 255) / 255.0F;
|
||||
f1 = (float)(k1 >> 8 & 255) / 255.0F;
|
||||
@@ -453,7 +439,10 @@
|
||||
{
|
||||
if (par3ItemStack != null)
|
||||
{
|
||||
|
@ -227,14 +161,13 @@
|
|||
+ this.renderItemIntoGUI(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5);
|
||||
+ }
|
||||
|
||||
if (par3ItemStack != null && par3ItemStack.hasEffect())
|
||||
if (par3ItemStack.hasEffect())
|
||||
{
|
||||
@@ -578,4 +541,77 @@
|
||||
@@ -590,4 +579,47 @@
|
||||
{
|
||||
this.doRenderItem((EntityItem)par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
+
|
||||
+ /* ==== Forge start ===== */
|
||||
+ /**
|
||||
+ * Items should spread out when rendered in 3d?
|
||||
+ * @return
|
||||
|
@ -253,29 +186,14 @@
|
|||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ public byte getMiniBlockCountForItemStack(ItemStack stack)
|
||||
+ public byte getMiniBlockCount(ItemStack stack)
|
||||
+ {
|
||||
+ byte var13 = 1;
|
||||
+ if (stack.stackSize > 1)
|
||||
+ {
|
||||
+ var13 = 2;
|
||||
+ }
|
||||
+
|
||||
+ if (stack.stackSize > 5)
|
||||
+ {
|
||||
+ var13 = 3;
|
||||
+ }
|
||||
+
|
||||
+ if (stack.stackSize > 20)
|
||||
+ {
|
||||
+ var13 = 4;
|
||||
+ }
|
||||
+
|
||||
+ if (stack.stackSize > 40)
|
||||
+ {
|
||||
+ var13 = 5;
|
||||
+ }
|
||||
+ return var13;
|
||||
+ byte ret = 1;
|
||||
+ if (stack.stackSize > 1 ) ret = 2;
|
||||
+ if (stack.stackSize > 5 ) ret = 3;
|
||||
+ if (stack.stackSize > 20) ret = 4;
|
||||
+ if (stack.stackSize > 40) ret = 5;
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
|
@ -284,26 +202,12 @@
|
|||
+ * @param stack
|
||||
+ * @return
|
||||
+ */
|
||||
+ public byte getMiniItemCountForItemStack(ItemStack stack)
|
||||
+ public byte getMiniItemCount(ItemStack stack)
|
||||
+ {
|
||||
+ byte var24;
|
||||
+ int var19 = stack.stackSize;
|
||||
+ if (var19 < 2)
|
||||
+ {
|
||||
+ var24 = 1;
|
||||
+ }
|
||||
+ else if (var19 < 16)
|
||||
+ {
|
||||
+ var24 = 2;
|
||||
+ }
|
||||
+ else if (var19 < 32)
|
||||
+ {
|
||||
+ var24 = 3;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ var24 = 4;
|
||||
+ }
|
||||
+ return var24;
|
||||
+ byte ret = 1;
|
||||
+ if (stack.stackSize > 1) ret = 2;
|
||||
+ if (stack.stackSize > 15) ret = 3;
|
||||
+ if (stack.stackSize > 31) ret = 4;
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
|
||||
@@ -213,12 +213,14 @@
|
||||
@@ -221,12 +221,14 @@
|
||||
|
||||
if (par4EntityLiving.isPlayerSleeping())
|
||||
{
|
||||
- int var7 = par1World.getBlockId(MathHelper.floor_double(par4EntityLiving.posX), MathHelper.floor_double(par4EntityLiving.posY), MathHelper.floor_double(par4EntityLiving.posZ));
|
||||
- int i = par1World.getBlockId(MathHelper.floor_double(par4EntityLiving.posX), MathHelper.floor_double(par4EntityLiving.posY), MathHelper.floor_double(par4EntityLiving.posZ));
|
||||
-
|
||||
- if (var7 == Block.bed.blockID)
|
||||
- if (i == Block.bed.blockID)
|
||||
+ int x = MathHelper.floor_double(par4EntityLiving.posX);
|
||||
+ int y = MathHelper.floor_double(par4EntityLiving.posY);
|
||||
+ int z = MathHelper.floor_double(par4EntityLiving.posZ);
|
||||
|
@ -14,9 +14,9 @@
|
|||
+
|
||||
+ if (block != null && block.isBed(par1World, x, y, z, par4EntityLiving))
|
||||
{
|
||||
- int var8 = par1World.getBlockMetadata(MathHelper.floor_double(par4EntityLiving.posX), MathHelper.floor_double(par4EntityLiving.posY), MathHelper.floor_double(par4EntityLiving.posZ));
|
||||
- int var9 = var8 & 3;
|
||||
+ int var9 = block.getBedDirection(par1World, x, y, z);;
|
||||
this.playerViewY = (float)(var9 * 90 + 180);
|
||||
- int j = par1World.getBlockMetadata(MathHelper.floor_double(par4EntityLiving.posX), MathHelper.floor_double(par4EntityLiving.posY), MathHelper.floor_double(par4EntityLiving.posZ));
|
||||
- int k = j & 3;
|
||||
+ int k = block.getBedDirection(par1World, x, y, z);;
|
||||
this.playerViewY = (float)(k * 90 + 180);
|
||||
this.playerViewX = 0.0F;
|
||||
}
|
||||
|
|
|
@ -1,24 +1,20 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java
|
||||
@@ -16,10 +16,17 @@
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.EnumArmorMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
+import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -19,7 +19,13 @@
|
||||
import net.minecraft.scoreboard.ScoreObjective;
|
||||
import net.minecraft.scoreboard.Scoreboard;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
+
|
||||
+import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*;
|
||||
+import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*;
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+import net.minecraftforge.client.IItemRenderer;
|
||||
+import net.minecraftforge.client.MinecraftForgeClient;
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
+import net.minecraft.item.ItemBlock;
|
||||
+import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED;
|
||||
+import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderPlayer extends RenderLiving
|
||||
@@ -28,6 +35,8 @@
|
||||
@@ -28,6 +34,8 @@
|
||||
private ModelBiped modelArmorChestplate;
|
||||
private ModelBiped modelArmor;
|
||||
public static String[] armorFilenamePrefix = new String[] {"cloth", "chain", "iron", "diamond", "gold"};
|
||||
|
@ -27,67 +23,58 @@
|
|||
|
||||
public RenderPlayer()
|
||||
{
|
||||
@@ -51,7 +60,7 @@
|
||||
if (var5 instanceof ItemArmor)
|
||||
@@ -56,7 +64,7 @@
|
||||
if (item instanceof ItemArmor)
|
||||
{
|
||||
ItemArmor var6 = (ItemArmor)var5;
|
||||
- this.loadTexture("/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(var4, "/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png"));
|
||||
ModelBiped var7 = par2 == 2 ? this.modelArmor : this.modelArmorChestplate;
|
||||
var7.bipedHead.showModel = par2 == 0;
|
||||
var7.bipedHeadwear.showModel = par2 == 0;
|
||||
@@ -120,7 +129,7 @@
|
||||
if (var5 instanceof ItemArmor)
|
||||
ItemArmor itemarmor = (ItemArmor)item;
|
||||
- this.loadTexture("/armor/" + armorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(itemstack, "/armor/" + armorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png"));
|
||||
ModelBiped modelbiped = par2 == 2 ? this.modelArmor : this.modelArmorChestplate;
|
||||
modelbiped.bipedHead.showModel = par2 == 0;
|
||||
modelbiped.bipedHeadwear.showModel = par2 == 0;
|
||||
@@ -125,7 +133,7 @@
|
||||
if (item instanceof ItemArmor)
|
||||
{
|
||||
ItemArmor var6 = (ItemArmor)var5;
|
||||
- this.loadTexture("/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + "_b.png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(var4, "/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + "_b.png"));
|
||||
float var7 = 1.0F;
|
||||
GL11.glColor3f(var7, var7, var7);
|
||||
ItemArmor itemarmor = (ItemArmor)item;
|
||||
- this.loadTexture("/armor/" + armorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + "_b.png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(itemstack, "/armor/" + armorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + "_b.png"));
|
||||
float f1 = 1.0F;
|
||||
GL11.glColor3f(f1, f1, f1);
|
||||
}
|
||||
@@ -172,7 +181,7 @@
|
||||
float var8 = 1.6F;
|
||||
float var9 = 0.016666668F * var8;
|
||||
double var10 = par1EntityPlayer.getDistanceSqToEntity(this.renderManager.livingPlayer);
|
||||
- float var12 = par1EntityPlayer.isSneaking() ? 32.0F : 64.0F;
|
||||
+ float var12 = par1EntityPlayer.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;
|
||||
|
||||
if (var10 < (double)(var12 * var12))
|
||||
{
|
||||
@@ -239,9 +248,12 @@
|
||||
@@ -184,9 +192,12 @@
|
||||
this.modelBipedMain.bipedHead.postRender(0.0625F);
|
||||
float var5;
|
||||
float f2;
|
||||
|
||||
- if (var4.getItem().itemID < 256)
|
||||
- if (itemstack.getItem().itemID < 256)
|
||||
- {
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType()))
|
||||
+ if (var4 != null && var4.getItem() instanceof ItemBlock)
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
+ if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
|
||||
+ {
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var4, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var4, BLOCK_3D));
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
|
||||
+
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType()))
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
var5 = 0.625F;
|
||||
f2 = 0.625F;
|
||||
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
|
||||
@@ -359,7 +371,10 @@
|
||||
var23 = var21.getItemUseAction();
|
||||
@@ -304,7 +315,10 @@
|
||||
enumaction = itemstack1.getItemUseAction();
|
||||
}
|
||||
|
||||
- if (var21.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var21.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var21, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var21, BLOCK_3D));
|
||||
- if (itemstack1.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D));
|
||||
+
|
||||
+ if (var21.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var21.itemID].getRenderType())))
|
||||
+ if (itemstack1.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType())))
|
||||
{
|
||||
var7 = 0.5F;
|
||||
f3 = 0.5F;
|
||||
GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
|
||||
@@ -416,7 +431,7 @@
|
||||
@@ -361,7 +375,7 @@
|
||||
|
||||
if (var21.getItem().requiresMultipleRenderPasses())
|
||||
if (itemstack1.getItem().requiresMultipleRenderPasses())
|
||||
{
|
||||
- for (var27 = 0; var27 <= 1; ++var27)
|
||||
+ for (var27 = 0; var27 < var21.getItem().getRenderPasses(var21.getItemDamage()); ++var27)
|
||||
- for (j = 0; j <= 1; ++j)
|
||||
+ for (j = 0; j < itemstack1.getItem().getRenderPasses(itemstack1.getItemDamage()); ++j)
|
||||
{
|
||||
int var26 = var21.getItem().getColorFromItemStack(var21, var27);
|
||||
var28 = (float)(var26 >> 16 & 255) / 255.0F;
|
||||
int k = itemstack1.getItem().getColorFromItemStack(itemstack1, j);
|
||||
f12 = (float)(k >> 16 & 255) / 255.0F;
|
||||
|
|
|
@ -17,19 +17,19 @@
|
|||
public class RenderSnowMan extends RenderLiving
|
||||
@@ -31,12 +37,15 @@
|
||||
super.renderEquippedItems(par1EntitySnowman, par2);
|
||||
ItemStack var3 = new ItemStack(Block.pumpkin, 1);
|
||||
ItemStack itemstack = new ItemStack(Block.pumpkin, 1);
|
||||
|
||||
- if (var3 != null && var3.getItem().itemID < 256)
|
||||
+ if (var3 != null && var3.getItem() instanceof ItemBlock)
|
||||
- if (itemstack != null && itemstack.getItem().itemID < 256)
|
||||
+ if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
this.snowmanModel.head.postRender(0.0625F);
|
||||
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var3, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var3, BLOCK_3D));
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
|
||||
+
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType()))
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
float var4 = 0.625F;
|
||||
float f1 = 0.625F;
|
||||
GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/renderer/texture/TextureManager.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/renderer/texture/TextureManager.java
|
||||
@@ -66,17 +66,42 @@
|
||||
|
||||
public List func_94266_e(String par1Str)
|
||||
{
|
||||
+ return createNewTexture(par1Str, par1Str, null);
|
||||
+ }
|
||||
+
|
||||
+ public List createNewTexture(String textureName, String textureFile, TextureStitched stitched)
|
||||
+ {
|
||||
+ String par1Str = textureFile;
|
||||
ArrayList arraylist = new ArrayList();
|
||||
ITexturePack itexturepack = Minecraft.getMinecraft().texturePackList.getSelectedTexturePack();
|
||||
|
||||
try
|
||||
{
|
||||
- BufferedImage bufferedimage = ImageIO.read(itexturepack.getResourceAsStream("/" + par1Str));
|
||||
- int i = bufferedimage.getHeight();
|
||||
- int j = bufferedimage.getWidth();
|
||||
- String s1 = this.func_98146_d(par1Str);
|
||||
+ BufferedImage bufferedimage = null;
|
||||
+ int i = 0;
|
||||
+ int j = 0;
|
||||
+ FileNotFoundException fnfe = null;
|
||||
+ try
|
||||
+ {
|
||||
+ bufferedimage = ImageIO.read(itexturepack.getResourceAsStream("/" + textureFile));
|
||||
+ i = bufferedimage.getHeight();
|
||||
+ j = bufferedimage.getWidth();
|
||||
+ }
|
||||
+ catch (FileNotFoundException e)
|
||||
+ {
|
||||
+ fnfe = e;
|
||||
+ }
|
||||
+ String s1 = textureName;
|
||||
|
||||
- if (this.func_98147_a(par1Str, itexturepack))
|
||||
+ if (stitched != null && stitched.loadTexture(this, itexturepack, textureName, textureFile, bufferedimage, arraylist))
|
||||
+ {
|
||||
+ ;
|
||||
+ }
|
||||
+ else if (fnfe != null)
|
||||
+ {
|
||||
+ throw fnfe;
|
||||
+ }
|
||||
+ else if (this.func_98147_a(par1Str, itexturepack))
|
||||
{
|
||||
int k = j;
|
||||
int l = j;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue