Updated Forge to s13w09c

This commit is contained in:
LexManos 2013-03-02 03:08:27 -08:00
parent ed55969932
commit 9bd8f2697c
63 changed files with 688 additions and 880 deletions

View File

@ -35,172 +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 String getArmorTexture(ItemStack armor, String _default)
{
@ -231,7 +69,7 @@ public class ForgeHooksClient
if (item.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[item.itemID].getRenderType())))
{
engine.bindTexture(engine.getTexture("/terrain.png"));
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);
@ -263,7 +101,7 @@ public class ForgeHooksClient
}
else
{
engine.bindTexture(engine.getTexture("/gui/items.png"));
engine.func_98187_b("/gui/items.png");
GL11.glScalef(0.5F, 0.5F, 0.5F);
customRenderer.renderItem(ENTITY, item, renderBlocks, entity);
}
@ -278,7 +116,7 @@ public class ForgeHooksClient
return false;
}
engine.bindTexture(engine.getTexture("/gui/items.png"));
engine.func_98187_b("/gui/items.png");
if (customRenderer.shouldUseRenderHelper(INVENTORY, item, INVENTORY_BLOCK))
{
GL11.glPushMatrix();
@ -405,9 +243,4 @@ public class ForgeHooksClient
}
}
}
public static void setRenderPass(int pass)
{
renderPass = pass;
}
}

View File

@ -91,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);

View File

@ -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,14 +27,6 @@ public class MinecraftForgeClient
ForgeHooksClient.engine().getTexture(texture);
}
/**
* Get the current render pass.
*/
public static int getRenderPass()
{
return ForgeHooksClient.renderPass;
}
private static IItemRenderer[] customItemRenderers = new IItemRenderer[Item.itemsList.length];
/**

View File

@ -1,82 +1,84 @@
#Main Forge Access Transformer configuration file
# Tessellator
public-f bfc.a #FD:Tessellator/field_78398_a #instance
public bfc.u #FD:Tessellator/field_78409_u #drawMode
public bfc.v #FD:Tessellator/field_78408_v #xOffset
public bfc.w #FD:Tessellator/field_78407_w #yOffset
public bfc.x #FD:Tessellator/field_78417_x #zOffset
public bfc.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 wf.<init>(ILvw;)V #MD:ItemPickaxe/<init>(ILnet/minecraft/src/EnumToolMaterial;) #constructor
public+f wf.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 vt.<init>(ILvw;)V #MD:ItemAxe/<init>(ILnet/minecraft/src/EnumToolMaterial;) #constructor
public+f vt.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 wq.<init>(ILvw;)V #MD:ItemSpade/<init>(ILnet/minecraft/src/EnumToolMaterial;) #constructor
public+f wq.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 vc.a #FD:ItemTool/field_77864_a #efficiencyOnProperMaterial
public vc.d #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 rg.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
# RenderGlobal
public bex.h #FD:RenderGlobal/field_72769_h #theWorld
public bex.i #FD:RenderGlobal/field_72770_i #renderEngine
public bex.q #FD:RenderGlobal/field_72777_q #mc
public bex.r #FD:RenderGlobal/field_72776_r #globalRenderBlocks
public bex.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 biz.a #FD:SoundManager/field_77381_a #sndSystem
public biz.b #FD:SoundManager/field_77379_b #soundPoolSounds
public biz.c #FD:SoundManager/field_77380_c #soundPoolStreaming
public biz.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 qv.* #FD:EntityMinecart/* # All private -> protected
protected rc.* #FD:EntityMinecart/* # All private -> protected
# -- MISSING MAPPING public py.h()Z #MD:EntityMinecart/func_70490_h #isMinecartPowered
# Block
public aoj.<init>(ILahp;)V #MD:Block/<init>(ILnet/minecraft/src/Material;) #Constructor
public aoj.<init>(IILahp;)V #MD:Block/<init>(IILnet/minecraft/src/Material;) #Constructor
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 aoj.a(Laon;)Laoj; #MD:Block/func_71884_a #setStepSound
public aoj.b(F)Laoj; #MD:Block/func_71894_b #setResistance
public aoj.c(F)Laoj; #MD:Block/func_71848_c #setHardness
public aoj.k(I)Laoj; #MD:Block/func_71868_h #setLightOpacity
public aoj.a(F)Laoj; #MD:Block/func_71900_a #setLightValue
public aoj.r()Laoj; #MD:Block/func_71875_q #setBlockUnbreakable
public aoj.b(Z)Laoj; #MD:Block/func_71907_b #setTickRandomly
public aoj.a(FFFFFF)V #MD:Block/func_71905_a #setBlockBounds
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 jh.g #FD:NetServerHandler/field_72572_g #playerInAirTime
public jh.f #FD:NetServerHandler/field_72572_g #playerInAirTime
# TileEntity
public apy.k #FD:TileEntity/field_70331_k #worldObj
public aqj.k #FD:TileEntity/field_70331_k #worldObj
# BlockLeavesBase
public aor.d #FD:BlockLeavesBase/field_72131_c #graphicsLevel
public apc.d #FD:BlockLeavesBase/field_72131_c #graphicsLevel
# Item
public vv.<init>(I)V #MD:Item/<init>(I) #Constructor
public vv.e(I)Lvv; #MD:Item/func_77656_e #setMaxDamage
public we.<init>(I)V #MD:Item/<init>(I) #Constructor
public we.e(I)Lwe; #MD:Item/func_77656_e #setMaxDamage
public-f up.h(Lur;)I #MD:Item/func_94580_h #getIconIndex
# -- MISSING MAPPING# RailLogic
# -- MISSING MAPPING# -- MISSING MAPPING# RailLogic
# -- MISSING MAPPING public als #CL:RailLogic
# -- MISSING MAPPING public als.a(Lals;)I #MD:RailLogic/func_73650_a #getNAdjacentTiles
# EntityPlayer
public sb.a(Lqu;)V #MD:EntityPlayer/func_71012_a #joinEntityItemWithWorld
public sb.h()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 bcu.a(Lqu;)V #MD:EntityClientPlayerMP/func_71012_a #joinEntityItemWithWorld
public bdp.a(Lrb;)V #MD:EntityClientPlayerMP/func_71012_a #joinEntityItemWithWorld
# World Gen Chests Related
public lj.* #FD:WeightedRandomChestContent/* #all
public lp.* #FD:WeightedRandomChestContent/* #all
public iz.S #FD:WorldServer/field_73069_S #bonusChestContent
public adw.a #FD:StructureMineshaftPieces/field_78818_a #mineshaftChestContents
public afa.i #FD:ComponentScatteredFeatureDesertPyramid/field_74941_i #itemsToGenerateInTemple
public afb.l #FD:ComponentScatteredFeatureJunglePyramid/field_74943_l #junglePyramidsChestContents
public afb.m #FD:ComponentScatteredFeatureJunglePyramid/field_74944_m #junglePyramidsDispenserContents
public afl.a #FD:ComponentStrongholdChestCorridor/field_75003_a #strongholdChestContents
public afp.b #FD:ComponentStrongholdLibrary/field_75007_b #strongholdLibraryChestContents
public afu.c #FD:ComponentStrongholdRoomCrossing/field_75014_c #strongholdCorridorChestContents
public agv.a #FD:ComponentVillageHouse2/field_74918_a #villageBlacksmithChestContents
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 abt.d #FD:AnvilChunkLoader/field_75825_d
public acd.d #FD:AnvilChunkLoader/field_75825_d
# ChunkProviderServer.currentChunkLoader
public iy.e #FD:ChunkProviderServer/field_73247_e
# PlayerManager
@ -84,43 +86,43 @@ public iw.a(IIZ)Lix; #MD:PlayerManager/func_72690_a #getOrCreateChunkWatcher
# PlayerInstance
public ix #CL:PlayerInstance
# World
public-f zk.A #FD:World/field_72982_D #villageCollectionObj
public zk.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 na.bd #FD:EntityLiving/field_70728_aV #experienceValue
public ng.be #FD:EntityLiving/field_70728_aV #experienceValue
# GuiFlatPresets
public awt.a(Ljava/lang/String;ILaaf;Ljava/util/List;[Lads;)V #MD:GuiFlatPresets/func_82294_a
public awt.a(Ljava/lang/String;ILaaf;[Lads;)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 aaf.*() #MD:BiomeGenBase/* #Everything protected->public
public aap.*() #MD:BiomeGenBase/* #Everything protected->public
# MapGenVillage
public-f agj.e #FD:MapGenVillage/field_75055_e #villageSpawnBiomes
public-f agt.e #FD:MapGenVillage/field_75055_e #villageSpawnBiomes
# ShapedRecipes
public+f xy.d #FD:ShapedRecipes/field_77574_d #recipeItems
public+f xy.b #FD:ShapedRecipes/field_77576_b #recipeWidth
public+f xy.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 xz.b #FD:ShapelessRecipes/field_77579_b #recipeItems
public yi.b #FD:ShapelessRecipes/field_77579_b #recipeItems
# GuiContainer
protected axs.a(Ltw;)V #MD:GuiContainer/func_74192_a #drawSlotInventory
protected ayf.a(Luf;)V #MD:GuiContainer/func_74192_a #drawSlotInventory
# BlockButton
protected akr.n(Lzk;III)V #MD:BlockButton/func_82535_o #checkActivation
protected-f akr.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 aaj.* #FD:BiomeDecorator/* # All private -> protected
public aat.* #FD:BiomeDecorator/* # All private -> protected
# CreativeTabs
public-f up.a #FD:CreativeTabs/field_78032_a # creativeTabArray non-final
public-f uy.a #FD:CreativeTabs/field_78032_a # creativeTabArray non-final
# Packet
public eg.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 ajd.b()Ljava/io/File; #MD:SaveHandler/func_75765_b
public ajn.b()Ljava/io/File; #MD:SaveHandler/func_75765_b
# World stuff
public zk.b(Lmj;)V #MD:World/func_72847_b #releaseEntitySkin
public zk.m #FD:World/field_73003_n #prevRainingStrength
public zk.n #FD:World/field_73004_o #rainingStrength
public zk.p #FD:World/field_73017_q #thunderingStrength
public zk.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 bcr.b(Lmj;)V #MD:WorldClient/func_72847_b #releaseEntitySkin
public bdm.b(Lmp;)V #MD:WorldClient/func_72847_b #releaseEntitySkin
#WorldServer
public iz.b(Lmj;)V #MD:WorldServer/func_72847_b #releaseEntitySkin
public iz.b(Lmp;)V #MD:WorldServer/func_72847_b #releaseEntitySkin

View File

@ -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())

View File

@ -147,7 +147,7 @@ public class ForgeHooks
}
else
{
return player.getCurrentPlayerStrVsBlock(block, metadata) / hardness / 30F;
return player.getCurrentPlayerStrVsBlock(block, false, metadata) / hardness / 30F;
}
}

View File

@ -191,7 +191,7 @@ public class MinecraftForge
Block.blocksList[0] = null;
Block.opaqueCubeLookup[0] = false;
Block.lightOpacity[0] = 0;
filler.setBlockName("ForgeFiller");
filler.setUnlocalizedName("ForgeFiller");
for (int x = 256; x < 4096; x++)
{

View File

@ -55,7 +55,7 @@
/**
* used as foreach item, if item.tab = current tab, display it on the screen
*/
@@ -330,6 +348,7 @@
@@ -332,6 +350,7 @@
lightOpacity[par1] = this.isOpaqueCube() ? 255 : 0;
canBlockGrass[par1] = !par2Material.getCanBlockGrass();
}
@ -63,7 +63,7 @@
}
/**
@@ -452,9 +471,10 @@
@@ -454,9 +473,10 @@
return this.needsRandomTick;
}
@ -75,7 +75,7 @@
}
/**
@@ -477,7 +497,7 @@
@@ -479,7 +499,7 @@
*/
public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
@ -84,7 +84,7 @@
}
@SideOnly(Side.CLIENT)
@@ -487,7 +507,7 @@
@@ -489,7 +509,7 @@
*/
public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
@ -93,7 +93,7 @@
}
@SideOnly(Side.CLIENT)
@@ -636,7 +656,13 @@
@@ -639,7 +659,13 @@
/**
* ejects contained items into the world, and notifies neighbours of an update, as appropriate
*/
@ -108,17 +108,16 @@
/**
* Returns the quantity of items to drop on block destruction.
@@ -660,8 +686,7 @@
*/
@@ -664,7 +690,7 @@
public float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5)
{
- float f = this.getBlockHardness(par2World, par3, par4, par5);
- return f < 0.0F ? 0.0F : (!par1EntityPlayer.canHarvestBlock(this) ? 1.0F / f / 100.0F : par1EntityPlayer.getCurrentPlayerStrVsBlock(this) / f / 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);
}
/**
@@ -679,18 +704,13 @@
@@ -682,18 +708,13 @@
{
if (!par1World.isRemote)
{
@ -141,7 +140,7 @@
}
}
}
@@ -1083,7 +1103,7 @@
@@ -1086,7 +1107,7 @@
par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
par2EntityPlayer.addExhaustion(0.025F);
@ -150,7 +149,7 @@
{
ItemStack itemstack = this.createStackedBlock(par6);
@@ -1099,12 +1119,13 @@
@@ -1102,12 +1123,13 @@
}
}
@ -165,7 +164,7 @@
}
/**
@@ -1406,4 +1427,871 @@
@@ -1414,4 +1436,871 @@
canBlockGrass[0] = true;
StatList.initBreakableStats();
}

View File

@ -49,7 +49,7 @@
{
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,7 +66,7 @@
}
/**
@@ -387,4 +384,30 @@
@@ -409,4 +406,30 @@
}
}
}

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/block/BlockPistonBase.java
+++ ../src_work/minecraft/net/minecraft/block/BlockPistonBase.java
@@ -413,7 +413,7 @@
@@ -435,7 +435,7 @@
return false;
}
@ -9,7 +9,7 @@
}
}
@@ -431,7 +431,7 @@
@@ -453,7 +453,7 @@
{
if (l1 < 13)
{
@ -18,7 +18,7 @@
{
return false;
}
@@ -481,7 +481,7 @@
@@ -503,7 +503,7 @@
if (l1 < 13)
{

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/block/BlockRedstoneWire.java
+++ ../src_work/minecraft/net/minecraft/block/BlockRedstoneWire.java
@@ -522,7 +522,7 @@
@@ -473,7 +473,7 @@
}
else if (!Block.redstoneRepeaterIdle.func_94487_f(i1))
{

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/client/Minecraft.java
+++ ../src_work/minecraft/net/minecraft/client/Minecraft.java
@@ -122,6 +122,10 @@
@@ -123,6 +123,10 @@
import com.google.common.collect.MapDifference;
@ -11,7 +11,7 @@
@SideOnly(Side.CLIENT)
public abstract class Minecraft implements Runnable, IPlayerUsage
{
@@ -1240,7 +1244,7 @@
@@ -1237,7 +1241,7 @@
if (this.thePlayer.canCurrentToolHarvestBlock(j, k, l))
{
@ -20,7 +20,7 @@
this.thePlayer.swingItem();
}
}
@@ -1306,7 +1310,8 @@
@@ -1303,7 +1307,8 @@
{
int j1 = itemstack != null ? itemstack.stackSize : 0;
@ -30,7 +30,7 @@
{
flag = false;
this.thePlayer.swingItem();
@@ -1332,7 +1337,8 @@
@@ -1329,7 +1334,8 @@
{
ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem();
@ -40,7 +40,7 @@
{
this.entityRenderer.itemRenderer.resetEquippedProgress2();
}
@@ -2029,6 +2035,18 @@
@@ -2026,6 +2032,18 @@
if (this.theIntegratedServer != null)
{
this.theIntegratedServer.initiateShutdown();
@ -59,7 +59,7 @@
}
this.theIntegratedServer = null;
@@ -2340,103 +2358,12 @@
@@ -2353,103 +2371,12 @@
if (this.objectMouseOver != null)
{
boolean flag = this.thePlayer.capabilities.isCreativeMode;

View File

@ -18,34 +18,36 @@
public GuiControls(GuiScreen par1GuiScreen, GameSettings par2GameSettings)
{
this.parentScreen = par1GuiScreen;
@@ -40,15 +44,12 @@
@@ -40,15 +44,10 @@
*/
public void initGui()
{
+ scrollPane = new GuiControlsScrollPanel(this, options, mc);
StringTranslate stringtranslate = StringTranslate.getInstance();
int i = this.func_73907_g();
- int i = this.func_73907_g();
-
- for (int j = 0; j < this.options.keyBindings.length; ++j)
- {
- this.controlList.add(new GuiSmallButton(j, i + j % 2 * 160, this.height / 6 + 24 * (j >> 1), 70, 20, this.options.getOptionDisplayString(j)));
- 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, stringtranslate.translateKey("gui.done")));
+ this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height - 28, stringtranslate.translateKey("gui.done")));
+ scrollPane.registerScrollButtons(controlList, 7, 8);
- 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");
}
@@ -57,19 +58,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 i = 0; i < this.options.keyBindings.length; ++i)
- {
- ((GuiButton)this.controlList.get(i)).displayString = this.options.getOptionDisplayString(i);
- ((GuiButton)this.buttonList.get(i)).displayString = this.options.getOptionDisplayString(i);
- }
-
+ {
if (par1GuiButton.id == 200)
{
this.mc.displayGuiScreen(this.parentScreen);
@ -57,14 +59,14 @@
}
}
@@ -78,17 +69,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 @@
}
/**
@@ -96,14 +77,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);
}
@@ -115,47 +89,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 k = this.func_73907_g();
- int l = 0;
-
- while (l < this.options.keyBindings.length)
- {
- boolean flag = false;
- int i1 = 0;
-
- while (true)
- {
- if (i1 < this.options.keyBindings.length)
- {
- if (i1 == l || this.options.keyBindings[l].keyCode != this.options.keyBindings[i1].keyCode)
- {
- ++i1;
- continue;
- }
-
- flag = true;
- }
-
- if (this.buttonId == l)
- {
- ((GuiButton)this.controlList.get(l)).displayString = "" + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<";
- }
- else if (flag)
- {
- ((GuiButton)this.controlList.get(l)).displayString = EnumChatFormatting.RED + this.options.getOptionDisplayString(l);
- }
- else
- {
- ((GuiButton)this.controlList.get(l)).displayString = this.options.getOptionDisplayString(l);
- }
-
- this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(l), k + l % 2 * 160 + 70 + 6, this.height / 6 + 24 * (l >> 1) + 7, -1);
- ++l;
- 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);
}
}

View File

@ -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 stringtranslate;
if (this.moreOptions)

View File

@ -13,7 +13,7 @@
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
Tessellator tessellator = Tessellator.instance;
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/background.png"));
- this.mc.renderEngine.func_98187_b("/gui/background.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- float f1 = 32.0F;
- tessellator.startDrawingQuads();
@ -35,8 +35,8 @@
+ protected void overlayBackground(int par1, int par2, int par3, int par4)
{
Tessellator tessellator = 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));
- 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 f = 32.0F;
tessellator.startDrawingQuads();
@ -47,7 +47,7 @@
+
+ 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();

View File

@ -19,17 +19,17 @@
@SideOnly(Side.CLIENT)
public class GuiAchievements extends GuiScreen
{
@@ -56,6 +61,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)
{
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);
@ -47,9 +47,9 @@
/**
@@ -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)));
}
/**
@ -70,34 +70,34 @@
}
super.actionPerformed(par1GuiButton);
@@ -308,11 +336,12 @@
int k4;
int l4;
@@ -306,11 +334,12 @@
int i4;
int j4;
- for (k3 = 0; k3 < AchievementList.achievementList.size(); ++k3)
- for (i3 = 0; i3 < AchievementList.achievementList.size(); ++i3)
- {
- Achievement achievement = (Achievement)AchievementList.achievementList.get(k3);
- Achievement achievement = (Achievement)AchievementList.achievementList.get(i3);
-
- if (achievement.parentAchievement != null)
+ List<Achievement> achievementList = (currentPage == -1 ? minecraftAchievements : AchievementPage.getAchievementPage(currentPage).getAchievements());
+ for (k3 = 0; k3 < achievementList.size(); ++k3)
+ for (i3 = 0; i3 < achievementList.size(); ++i3)
+ {
+ Achievement achievement = achievementList.get(k3);
+ Achievement achievement = achievementList.get(i3);
+
+ if (achievement.parentAchievement != null && achievementList.contains(achievement.parentAchievement))
{
i4 = achievement.displayColumn * 24 - k + 11 + i2;
l3 = achievement.displayRow * 24 - l + 11 + j2;
@@ -346,9 +375,9 @@
int j5;
int k5;
k3 = achievement.displayColumn * 24 - k + 11 + k1;
j3 = achievement.displayRow * 24 - l + 11 + l1;
@@ -344,9 +373,9 @@
int l4;
int i5;
- for (i4 = 0; i4 < AchievementList.achievementList.size(); ++i4)
- for (k3 = 0; k3 < AchievementList.achievementList.size(); ++k3)
- {
- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(i4);
+ for (i4 = 0; i4 < achievementList.size(); ++i4)
- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(k3);
+ for (k3 = 0; k3 < achievementList.size(); ++k3)
+ {
+ Achievement achievement2 = (Achievement)achievementList.get(i4);
l4 = achievement2.displayColumn * 24 - k;
j4 = achievement2.displayRow * 24 - l;
+ Achievement achievement2 = (Achievement)achievementList.get(k3);
j4 = achievement2.displayColumn * 24 - k;
l3 = achievement2.displayRow * 24 - l;

View File

@ -9,21 +9,21 @@
public GuiContainerCreative(EntityPlayer par1EntityPlayer)
{
@@ -266,6 +268,13 @@
@@ -273,6 +275,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
{
@@ -400,7 +409,7 @@
@@ -407,7 +416,7 @@
{
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex];
@ -32,7 +32,7 @@
{
this.fontRenderer.drawString(creativetabs.getTranslatedTabLabel(), 8, 6, 4210752);
}
@@ -449,7 +458,7 @@
@@ -456,7 +465,7 @@
{
CreativeTabs creativetabs = acreativetabs[k1];
@ -41,7 +41,7 @@
{
this.setCurrentCreativeTab(creativetabs);
return;
@@ -465,11 +474,17 @@
@@ -472,11 +481,17 @@
*/
private boolean needsScrollBars()
{
@ -59,7 +59,7 @@
int i = selectedTabIndex;
selectedTabIndex = par1CreativeTabs.getTabIndex();
ContainerCreative containercreative = (ContainerCreative)this.inventorySlots;
@@ -640,21 +655,42 @@
@@ -647,21 +662,42 @@
super.drawScreen(par1, par2, par3);
CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray;
@ -107,19 +107,19 @@
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -675,14 +711,32 @@
int i1 = acreativetabs.length;
int j1;
@@ -680,14 +716,32 @@
int k = acreativetabs.length;
int l;
- for (j1 = 0; j1 < i1; ++j1)
- for (l = 0; l < k; ++l)
+ int start = tabPage * 10;
+ i1 = Math.min(acreativetabs.length, ((tabPage + 1) * 10 + 2));
+ k = Math.min(acreativetabs.length, ((tabPage + 1) * 10 + 2));
+ if (tabPage != 0) start += 2;
+
+ for (j1 = start; j1 < i1; ++j1)
+ for (l = start; l < k; ++l)
{
CreativeTabs creativetabs1 = acreativetabs[j1];
this.mc.renderEngine.bindTexture(k);
CreativeTabs creativetabs1 = acreativetabs[l];
this.mc.renderEngine.func_98187_b("/gui/allitems.png");
- if (creativetabs1.getTabIndex() != selectedTabIndex)
+ if (creativetabs1 != null && creativetabs1.getTabIndex() != selectedTabIndex)
@ -132,18 +132,18 @@
+ {
+ if (creativetabs != CreativeTabs.tabAllSearch)
+ {
+ mc.renderEngine.bindTexture(k);
+ mc.renderEngine.func_98187_b("/gui/allitems.png");
+ renderCreativeTab(CreativeTabs.tabAllSearch);
+ }
+ if (creativetabs != CreativeTabs.tabInventory)
+ {
+ mc.renderEngine.bindTexture(k);
+ mc.renderEngine.func_98187_b("/gui/allitems.png");
+ renderCreativeTab(CreativeTabs.tabInventory);
}
}
@@ -700,6 +754,14 @@
this.drawTexturedModalRect(k1, i1 + (int)((float)(j1 - i1 - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
@@ -705,6 +759,14 @@
this.drawTexturedModalRect(i1, k + (int)((float)(l - k - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
}
+ if (creativetabs == null || creativetabs.getTabPage() != tabPage)
@ -157,7 +157,7 @@
this.renderCreativeTab(creativetabs);
if (creativetabs == CreativeTabs.tabInventory)
@@ -710,6 +772,15 @@
@@ -715,6 +777,15 @@
protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3)
{
@ -173,7 +173,7 @@
int k = par1CreativeTabs.getTabColumn();
int l = 28 * k;
byte b0 = 0;
@@ -824,7 +895,7 @@
@@ -829,7 +900,7 @@
i1 += 8 + (flag1 ? 1 : -1);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
@ -182,7 +182,7 @@
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);
@@ -846,6 +917,15 @@
@@ -851,6 +922,15 @@
{
this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter));
}

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java
+++ ../src_work/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java
@@ -172,6 +172,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
{
@@ -748,7 +753,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}));
@@ -814,7 +819,11 @@
@@ -844,7 +849,11 @@
public void handleChat(Packet3Chat par1Packet3Chat)
{
par1Packet3Chat = FMLNetworkHandler.handleChatMessage(this, par1Packet3Chat);
@ -34,7 +34,7 @@
}
public void handleAnimation(Packet18Animation par1Packet18Animation)
@@ -1248,6 +1257,10 @@
@@ -1278,6 +1287,10 @@
{
tileentity.readFromNBT(par1Packet132TileEntityData.customParam1);
}

View File

@ -11,7 +11,7 @@
@SideOnly(Side.CLIENT)
public class PlayerControllerMP
{
@@ -118,6 +122,12 @@
@@ -124,6 +128,12 @@
*/
public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4)
{
@ -24,7 +24,7 @@
if (this.currentGameType.isAdventure() && !this.mc.thePlayer.canCurrentToolHarvestBlock(par1, par2, par3))
{
return false;
@@ -135,7 +145,7 @@
@@ -141,7 +151,7 @@
{
worldclient.playAuxSFX(2001, par1, par2, par3, block.blockID + (worldclient.getBlockMetadata(par1, par2, par3) << 12));
int i1 = worldclient.getBlockMetadata(par1, par2, par3);
@ -33,7 +33,7 @@
if (flag)
{
@@ -336,6 +346,12 @@
@@ -342,6 +352,12 @@
float f2 = (float)par8Vec3.zCoord - (float)par6;
boolean flag = false;
int i1;
@ -46,7 +46,7 @@
if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null)
{
@@ -378,7 +394,15 @@
@@ -384,7 +400,15 @@
}
else
{
@ -63,7 +63,7 @@
}
}
@@ -400,9 +424,10 @@
@@ -406,9 +430,10 @@
{
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = itemstack1;

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/client/multiplayer/WorldClient.java
+++ ../src_work/minecraft/net/minecraft/client/multiplayer/WorldClient.java
@@ -28,6 +28,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
{
@@ -58,8 +61,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 @@
}
/**
@@ -290,6 +296,12 @@
@@ -291,6 +297,12 @@
*/
protected void updateWeather()
{

View File

@ -25,15 +25,15 @@
{
this.fxLayers[i].remove(j--);
}
@@ -115,6 +120,7 @@
for (int k = 0; k < this.fxLayers[i].size(); ++k)
@@ -111,6 +116,7 @@
for (int j = 0; j < this.fxLayers[i].size(); ++j)
{
EntityFX entityfx = (EntityFX)this.fxLayers[i].get(k);
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);
}
@@ -142,6 +148,7 @@
@@ -139,6 +145,7 @@
for (int i = 0; i < this.fxLayers[b0].size(); ++i)
{
EntityFX entityfx = (EntityFX)this.fxLayers[b0].get(i);
@ -41,7 +41,7 @@
tessellator.setBrightness(entityfx.getBrightnessForRender(par2));
entityfx.renderParticle(tessellator, par2, f1, f5, f2, f3, f4);
}
@@ -160,9 +167,9 @@
@@ -157,9 +164,9 @@
public void addBlockDestroyEffects(int par1, int par2, int par3, int par4, int par5)
{
@ -54,7 +54,7 @@
byte b0 = 4;
for (int j1 = 0; j1 < b0; ++j1)
@@ -235,4 +242,13 @@
@@ -232,4 +239,13 @@
{
return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size());
}

View File

@ -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;

View File

@ -29,8 +29,8 @@
+ }
this.fovModifierHandPrev = this.fovModifierHand;
this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F;
}
@@ -356,7 +368,7 @@
@@ -361,7 +373,7 @@
}
else
{
@ -39,7 +39,7 @@
float f1 = 70.0F;
if (par2)
@@ -443,15 +455,7 @@
@@ -448,15 +460,7 @@
if (!this.mc.gameSettings.debugCamEnable)
{
@ -56,7 +56,7 @@
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);
}
@@ -1145,8 +1149,11 @@
@@ -1146,8 +1150,11 @@
entityplayer = (EntityPlayer)entityliving;
GL11.glDisable(GL11.GL_ALPHA_TEST);
this.mc.mcProfiler.endStartSection("outline");
@ -70,7 +70,7 @@
GL11.glEnable(GL11.GL_ALPHA_TEST);
}
}
@@ -1210,15 +1217,18 @@
@@ -1211,15 +1218,18 @@
entityplayer = (EntityPlayer)entityliving;
GL11.glDisable(GL11.GL_ALPHA_TEST);
this.mc.mcProfiler.endStartSection("outline");
@ -92,13 +92,13 @@
GL11.glDisable(GL11.GL_BLEND);
this.mc.mcProfiler.endStartSection("weather");
this.renderRainSnow(par1);
@@ -1228,6 +1238,9 @@
{
this.renderCloudsCheck(renderglobal, par1);
@@ -1232,6 +1242,9 @@
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
this.renderHand(par1, j);
}
+
+ this.mc.mcProfiler.endStartSection("FRenderLast");
+ ForgeHooksClient.dispatchRenderLast(renderglobal, par1);
this.mc.mcProfiler.endStartSection("hand");
if (!this.mc.gameSettings.anaglyph)
{

View File

@ -39,12 +39,12 @@
+
+ if (customRenderer != null)
+ {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture((par2ItemStack.func_94608_d() == 0 ? "/terrain.png" : "/gui/items.png")));
+ this.mc.renderEngine.func_98187_b(par2ItemStack.func_94608_d() == 0 ? "/terrain.png" : "/gui/items.png");
+ ForgeHooksClient.renderEquippedItem(customRenderer, renderBlocksInstance, par1EntityLiving, par2ItemStack);
+ }
+ else if (block != null && par2ItemStack.func_94608_d() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
{
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
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;
@ -55,7 +55,7 @@
{
GL11.glPushMatrix();
f4 = 0.8F;
@@ -339,11 +360,20 @@
@@ -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();
@ -81,7 +81,7 @@
}
GL11.glPopMatrix();
@@ -446,12 +476,15 @@
@@ -447,12 +477,15 @@
if (itemstack.getItem().requiresMultipleRenderPasses())
{
this.renderItem(entityclientplayermp, itemstack, 0);

View File

@ -9,7 +9,7 @@
@SideOnly(Side.CLIENT)
public class RenderBlocks
{
@@ -604,9 +606,8 @@
@@ -608,9 +610,8 @@
public boolean renderBlockBed(Block par1Block, int par2, int par3, int par4)
{
Tessellator tessellator = Tessellator.instance;
@ -21,7 +21,7 @@
float f = 0.5F;
float f1 = 1.0F;
float f2 = 0.8F;
@@ -615,6 +616,7 @@
@@ -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);
@ -29,7 +29,7 @@
double d0 = (double)icon.func_94209_e();
double d1 = (double)icon.func_94212_f();
double d2 = (double)icon.func_94206_g();
@@ -631,6 +633,7 @@
@@ -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);
@ -37,7 +37,7 @@
d0 = (double)icon.func_94209_e();
d1 = (double)icon.func_94212_f();
d2 = (double)icon.func_94206_g();
@@ -2421,7 +2424,7 @@
@@ -2426,7 +2429,7 @@
double d9;
double d10;
@ -46,7 +46,7 @@
{
float f1 = 0.2F;
float f2 = 0.0625F;
@@ -2441,7 +2444,7 @@
@@ -2446,7 +2449,7 @@
d0 = d5;
}
@ -55,7 +55,7 @@
{
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);
@@ -2453,7 +2456,7 @@
@@ -2458,7 +2461,7 @@
tessellator.addVertexWithUV((double)((float)par2 + f1), (double)((float)par3 + f + f2), (double)(par4 + 1), d2, d1);
}
@ -64,7 +64,7 @@
{
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);
@@ -2465,7 +2468,7 @@
@@ -2470,7 +2473,7 @@
tessellator.addVertexWithUV((double)((float)(par2 + 1) - f1), (double)((float)par3 + f + f2), (double)(par4 + 0), d0, d1);
}
@ -73,7 +73,7 @@
{
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);
@@ -2477,7 +2480,7 @@
@@ -2482,7 +2485,7 @@
tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + f + f2), (double)((float)par4 + f1), d2, d1);
}
@ -82,7 +82,7 @@
{
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);
@@ -2489,7 +2492,7 @@
@@ -2494,7 +2497,7 @@
tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + f + f2), (double)((float)(par4 + 1) - f1), d0, d1);
}

View File

@ -1,27 +1,27 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/RenderEngine.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/RenderEngine.java
@@ -28,6 +28,8 @@
import net.minecraft.util.IntHashMap;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
+import net.minecraftforge.client.ForgeHooksClient;
+
@SideOnly(Side.CLIENT)
public class RenderEngine
{
@@ -202,6 +204,7 @@
@@ -186,6 +188,7 @@
try
{
+ ForgeHooksClient.onTextureLoadPre(par1Str);
this.singleIntBuffer.clear();
GLAllocation.generateTextureNames(this.singleIntBuffer);
int i = this.singleIntBuffer.get(0);
@@ -247,6 +250,7 @@
int i = GLAllocation.generateTextureNames();
boolean flag = par1Str.startsWith("%blur%");
@@ -215,6 +218,7 @@
}
this.textureMap.put(par1Str, Integer.valueOf(i));
+ ForgeHooksClient.onTextureLoad(par1Str, itexturepack);
this.textureMap.put(s1, Integer.valueOf(i));
+ ForgeHooksClient.onTextureLoad(par1Str, texturePack.getSelectedTexturePack());
return i;
}
catch (Exception exception)

View File

@ -9,15 +9,7 @@
@SideOnly(Side.CLIENT)
public class RenderGlobal implements IWorldAccess
{
@@ -677,7 +679,6 @@
this.sortedWorldRenderers[i1].isVisible = true;
}
-
this.theWorld.theProfiler.endStartSection("render");
k = b0 + this.renderSortedRenderers(b1, l, par2, par3);
@@ -934,6 +935,12 @@
@@ -933,6 +935,12 @@
*/
public void renderSky(float par1)
{
@ -30,7 +22,7 @@
if (this.mc.theWorld.provider.dimensionId == 1)
{
GL11.glDisable(GL11.GL_FOG);
@@ -1172,6 +1179,13 @@
@@ -1171,6 +1179,13 @@
public void renderClouds(float par1)
{
@ -44,7 +36,7 @@
if (this.mc.theWorld.provider.isSurfaceWorld())
{
if (this.mc.gameSettings.fancyGraphics)
@@ -1601,6 +1615,11 @@
@@ -1599,6 +1614,11 @@
}
public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3)

View File

@ -23,7 +23,7 @@
GL11.glTranslatef(8.0F, 8.0F, 8.0F);
- tessellator.startDrawingQuads();
- tessellator.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ));
+ ForgeHooksClient.beforeRenderPass(l1);
+ //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));
}
@ -61,7 +61,7 @@
if (flag2)
{
- this.bytesDrawn += tessellator.draw();
+ ForgeHooksClient.afterRenderPass(l1);
+ //ForgeHooksClient.afterRenderPass(l1); Noop fo now, TODO: Event if anyone needs
+ this.bytesDrawn += Tessellator.instance.draw();
GL11.glPopMatrix();
GL11.glEndList();

View File

@ -76,7 +76,7 @@
f8 = 1.0F;
if (this.field_77024_a)
@@ -238,32 +229,26 @@
@@ -241,32 +232,26 @@
f11 = 0.021875F;
ItemStack itemstack = par1EntityItem.getEntityItem();
int j = itemstack.stackSize;
@ -124,25 +124,23 @@
{
this.loadTexture("/terrain.png");
}
@@ -352,11 +337,12 @@
float f;
@@ -356,10 +341,11 @@
float f1;
float f2;
-
- 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.bindTexture(par2RenderEngine.getTexture("/terrain.png"));
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);
@@ -389,9 +375,9 @@
@@ -392,9 +378,9 @@
GL11.glDisable(GL11.GL_LIGHTING);
par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png"));
par2RenderEngine.func_98187_b("/gui/items.png");
- for (j1 = 0; j1 <= 1; ++j1)
- {
@ -153,7 +151,7 @@
int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1);
f = (float)(k1 >> 16 & 255) / 255.0F;
f1 = (float)(k1 >> 8 & 255) / 255.0F;
@@ -450,7 +436,10 @@
@@ -453,7 +439,10 @@
{
if (par3ItemStack != null)
{
@ -165,7 +163,7 @@
if (par3ItemStack.hasEffect())
{
@@ -587,4 +576,47 @@
@@ -590,4 +579,47 @@
{
this.doRenderItem((EntityItem)par1Entity, par2, par4, par6, par8, par9);
}

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
@@ -218,12 +218,14 @@
@@ -221,12 +221,14 @@
if (par4EntityLiving.isPlayerSleeping())
{

View File

@ -23,7 +23,7 @@
public RenderPlayer()
{
@@ -51,7 +59,7 @@
@@ -56,7 +64,7 @@
if (item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
@ -32,7 +32,7 @@
ModelBiped modelbiped = par2 == 2 ? this.modelArmor : this.modelArmorChestplate;
modelbiped.bipedHead.showModel = par2 == 0;
modelbiped.bipedHeadwear.showModel = par2 == 0;
@@ -120,7 +128,7 @@
@@ -125,7 +133,7 @@
if (item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
@ -41,7 +41,7 @@
float f1 = 1.0F;
GL11.glColor3f(f1, f1, f1);
}
@@ -179,9 +187,12 @@
@@ -184,9 +192,12 @@
this.modelBipedMain.bipedHead.postRender(0.0625F);
float f2;
@ -57,7 +57,7 @@
{
f2 = 0.625F;
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
@@ -299,7 +310,10 @@
@@ -304,7 +315,10 @@
enumaction = itemstack1.getItemUseAction();
}
@ -69,7 +69,7 @@
{
f3 = 0.5F;
GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
@@ -356,7 +370,7 @@
@@ -361,7 +375,7 @@
if (itemstack1.getItem().requiresMultipleRenderPasses())
{

View File

@ -7,7 +7,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Calendar;
@@ -50,7 +51,15 @@
@@ -52,7 +53,15 @@
if (block instanceof BlockChest && i == 0)
{

View File

@ -30,7 +30,7 @@
import net.minecraft.util.ReportedException;
import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
@@ -224,6 +231,11 @@
@@ -225,6 +232,11 @@
private boolean invulnerable;
private UUID field_96093_i;
public EnumEntitySize myEntitySize;
@ -42,7 +42,7 @@
public Entity(World par1World)
{
@@ -546,7 +558,7 @@
@@ -547,7 +559,7 @@
if (!this.worldObj.isRemote)
{
this.setFlag(0, this.fire > 0);
@ -51,7 +51,7 @@
}
this.firstUpdate = false;
@@ -1510,6 +1522,10 @@
@@ -1527,6 +1539,10 @@
par1NBTTagCompound.setInteger("PortalCooldown", this.timeUntilPortal);
par1NBTTagCompound.setLong("UUIDMost", this.field_96093_i.getMostSignificantBits());
par1NBTTagCompound.setLong("UUIDLeast", this.field_96093_i.getLeastSignificantBits());
@ -60,9 +60,9 @@
+ par1NBTTagCompound.setCompoundTag("ForgeData", customEntityData);
+ }
this.writeEntityToNBT(par1NBTTagCompound);
}
catch (Throwable throwable)
@@ -1570,6 +1586,15 @@
if (this.ridingEntity != null)
@@ -1597,6 +1613,15 @@
this.setPosition(this.posX, this.posY, this.posZ);
this.setRotation(this.rotationYaw, this.rotationPitch);
@ -78,7 +78,7 @@
this.readEntityFromNBT(par1NBTTagCompound);
}
catch (Throwable throwable)
@@ -1664,7 +1689,14 @@
@@ -1691,7 +1716,14 @@
{
EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack);
entityitem.delayBeforeCanPickup = 10;
@ -94,7 +94,7 @@
return entityitem;
}
@@ -2026,7 +2058,7 @@
@@ -2046,7 +2078,7 @@
*/
public boolean isRiding()
{
@ -103,7 +103,7 @@
}
/**
@@ -2364,7 +2396,7 @@
@@ -2390,7 +2422,7 @@
public float func_82146_a(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block)
{
@ -112,7 +112,7 @@
}
public boolean func_96091_a(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7)
@@ -2419,4 +2451,84 @@
@@ -2445,4 +2477,84 @@
{
return this.getEntityName();
}

View File

@ -160,9 +160,9 @@
/**
* Remove the speified potion effect from this entity.
*/
@@ -3044,4 +3091,42 @@
@@ -3054,4 +3101,42 @@
{
this.equipmentDropChances[par1] = par2;
this.canPickUpLoot = par1;
}
+
+ /***

View File

@ -27,7 +27,7 @@
@@ -49,6 +59,7 @@
{
this(par1World, par2, par4, par6);
this.func_92058_a(par8ItemStack);
this.setEntityItemStack(par8ItemStack);
+ this.lifespan = (par8ItemStack.getItem() == null ? 6000 : par8ItemStack.getItem().getEntityLifespan(par8ItemStack, par1World));
}
@ -63,7 +63,7 @@
{
this.setDead();
}
@@ -263,6 +296,7 @@
@@ -270,6 +303,7 @@
{
par1NBTTagCompound.setShort("Health", (short)((byte)this.health));
par1NBTTagCompound.setShort("Age", (short)this.age);
@ -71,9 +71,9 @@
if (this.getEntityItem() != null)
{
@@ -280,10 +314,17 @@
@@ -287,10 +321,17 @@
NBTTagCompound nbttagcompound1 = par1NBTTagCompound.getCompoundTag("Item");
this.func_92058_a(ItemStack.loadItemStackFromNBT(nbttagcompound1));
this.setEntityItemStack(ItemStack.loadItemStackFromNBT(nbttagcompound1));
- if (this.getEntityItem() == null)
+ ItemStack item = getDataWatcher().getWatchableObjectItemStack(10);
@ -90,7 +90,7 @@
}
/**
@@ -293,10 +334,22 @@
@@ -300,10 +341,22 @@
{
if (!this.worldObj.isRemote)
{

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/entity/item/EntityMinecart.java
+++ ../src_work/minecraft/net/minecraft/entity/item/EntityMinecart.java
@@ -25,6 +25,10 @@
@@ -21,6 +21,10 @@
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
@ -11,7 +11,7 @@
public abstract class EntityMinecart extends Entity
{
@@ -49,6 +53,20 @@
@@ -45,6 +49,20 @@
@SideOnly(Side.CLIENT)
protected double velocityZ;
@ -32,7 +32,7 @@
public EntityMinecart(World par1World)
{
super(par1World);
@@ -102,6 +120,10 @@
@@ -99,6 +117,10 @@
*/
public AxisAlignedBB getCollisionBox(Entity par1Entity)
{
@ -43,7 +43,7 @@
return par1Entity.canBePushed() ? par1Entity.boundingBox : null;
}
@@ -110,6 +132,10 @@
@@ -107,6 +129,10 @@
*/
public AxisAlignedBB getBoundingBox()
{
@ -54,7 +54,7 @@
return null;
}
@@ -118,7 +144,7 @@
@@ -115,7 +141,7 @@
*/
public boolean canBePushed()
{
@ -63,7 +63,7 @@
}
public EntityMinecart(World par1World, double par2, double par4, double par6)
@@ -350,10 +376,13 @@
@@ -347,10 +373,13 @@
double d5 = 0.0078125D;
int l = this.worldObj.getBlockId(j, i, k);
@ -81,7 +81,7 @@
if (l == Block.field_94337_cv.blockID)
{
@@ -362,7 +391,7 @@
@@ -359,7 +388,7 @@
}
else
{
@ -90,7 +90,7 @@
}
this.doBlockCollisions();
@@ -389,7 +418,18 @@
@@ -386,7 +415,18 @@
}
this.setRotation(this.rotationYaw, this.rotationPitch);
@ -110,7 +110,7 @@
if (list != null && !list.isEmpty())
{
@@ -413,6 +453,8 @@
@@ -410,6 +450,8 @@
this.riddenByEntity = null;
}
@ -119,7 +119,7 @@
}
}
@@ -438,6 +480,17 @@
@@ -435,6 +477,17 @@
if (this.motionZ > par1)
{
this.motionZ = par1;
@ -137,7 +137,7 @@
}
if (this.onGround)
@@ -447,13 +500,13 @@
@@ -444,13 +497,13 @@
this.motionZ *= 0.5D;
}
@ -155,7 +155,7 @@
}
}
@@ -467,7 +520,7 @@
@@ -464,7 +517,7 @@
if (par8 == Block.railPowered.blockID)
{
@ -164,7 +164,7 @@
flag1 = !flag;
}
@@ -532,7 +585,7 @@
@@ -535,7 +588,7 @@
}
}
@ -173,7 +173,7 @@
{
d7 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
@@ -580,36 +633,8 @@
@@ -583,36 +636,8 @@
this.posX = d8 + d2 * d7;
this.posZ = d9 + d3 * d7;
this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ);
@ -212,7 +212,7 @@
if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - par1 == aint[0][0] && MathHelper.floor_double(this.posZ) - par3 == aint[0][2])
{
@@ -647,7 +672,12 @@
@@ -650,7 +675,12 @@
this.motionZ = d6 * (double)(k1 - par3);
}
@ -226,7 +226,7 @@
{
double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
@@ -718,12 +748,7 @@
@@ -721,12 +751,7 @@
}
else
{
@ -240,7 +240,7 @@
par3 = (double)j;
@@ -769,13 +794,8 @@
@@ -772,13 +797,8 @@
if (BlockRailBase.isRailBlock(l))
{
@ -255,7 +255,7 @@
if (i1 >= 2 && i1 <= 5)
{
@@ -881,11 +901,17 @@
@@ -884,11 +904,17 @@
*/
public void applyEntityCollision(Entity par1Entity)
{
@ -274,7 +274,7 @@
{
par1Entity.mountEntity(this);
}
@@ -931,7 +957,7 @@
@@ -934,7 +960,7 @@
double d7 = par1Entity.motionX + this.motionX;
double d8 = par1Entity.motionZ + this.motionZ;
@ -283,7 +283,7 @@
{
this.motionX *= 0.20000000298023224D;
this.motionZ *= 0.20000000298023224D;
@@ -939,7 +965,7 @@
@@ -942,7 +968,7 @@
par1Entity.motionX *= 0.949999988079071D;
par1Entity.motionZ *= 0.949999988079071D;
}
@ -292,7 +292,7 @@
{
par1Entity.motionX *= 0.20000000298023224D;
par1Entity.motionZ *= 0.20000000298023224D;
@@ -1142,4 +1168,211 @@
@@ -1145,4 +1171,211 @@
{
return this.field_94102_c;
}

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/entity/EntityMinecartContainer.java
+++ ../src_work/minecraft/net/minecraft/entity/EntityMinecartContainer.java
@@ -10,6 +10,8 @@
--- ../src_base/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java
+++ ../src_work/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java
@@ -8,6 +8,8 @@
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@ -9,7 +9,7 @@
public abstract class EntityMinecartContainer extends EntityMinecart implements IInventory
{
@@ -277,6 +279,10 @@
@@ -275,6 +277,10 @@
*/
public boolean interact(EntityPlayer par1EntityPlayer)
{

View File

@ -1,7 +1,7 @@
--- ../src_base/minecraft/net/minecraft/entity/EntityMinecartEmpty.java
+++ ../src_work/minecraft/net/minecraft/entity/EntityMinecartEmpty.java
@@ -3,6 +3,8 @@
import net.minecraft.entity.item.EntityMinecart;
--- ../src_base/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java
+++ ../src_work/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java
@@ -2,6 +2,8 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
+import net.minecraftforge.common.MinecraftForge;
@ -9,7 +9,7 @@
public class EntityMinecartEmpty extends EntityMinecart
{
@@ -21,6 +23,10 @@
@@ -20,6 +22,10 @@
*/
public boolean interact(EntityPlayer par1EntityPlayer)
{

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/entity/EntityMinecartFurnace.java
+++ ../src_work/minecraft/net/minecraft/entity/EntityMinecartFurnace.java
@@ -9,6 +9,8 @@
--- ../src_base/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java
+++ ../src_work/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java
@@ -8,6 +8,8 @@
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
@ -9,7 +9,7 @@
public class EntityMinecartFurnace extends EntityMinecart
{
@@ -127,6 +129,10 @@
@@ -126,6 +128,10 @@
*/
public boolean interact(EntityPlayer par1EntityPlayer)
{

View File

@ -0,0 +1,22 @@
--- ../src_base/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java
+++ ../src_work/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java
@@ -9,6 +9,8 @@
import net.minecraft.tileentity.TileEntityHopper;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.minecart.MinecartInteractEvent;
public class EntityMinecartHopper extends EntityMinecartContainer implements Hopper
{
@@ -53,6 +55,10 @@
*/
public boolean interact(EntityPlayer par1EntityPlayer)
{
+ if(MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, par1EntityPlayer)))
+ {
+ return true;
+ }
if (!this.worldObj.isRemote)
{
par1EntityPlayer.func_96125_a(this);

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/entity/player/EntityPlayer.java
+++ ../src_work/minecraft/net/minecraft/entity/player/EntityPlayer.java
@@ -64,8 +64,21 @@
@@ -66,8 +66,21 @@
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
@ -30,7 +30,7 @@
if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0)
{
this.updateItemUse(itemstack, 5);
@@ -506,11 +520,11 @@
@@ -528,11 +542,11 @@
this.cameraYaw = 0.0F;
this.addMountedMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2);
@ -44,7 +44,7 @@
}
}
@@ -639,6 +653,9 @@
@@ -661,6 +675,9 @@
this.setPosition(this.posX, this.posY, this.posZ);
this.motionY = 0.10000000149011612D;
@ -54,7 +54,7 @@
if (this.username.equals("Notch"))
{
this.dropPlayerItemWithRandomChoice(new ItemStack(Item.appleRed, 1), true);
@@ -647,6 +664,20 @@
@@ -669,6 +686,20 @@
if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory"))
{
this.inventory.dropAllItems();
@ -75,7 +75,7 @@
}
if (par1DamageSource != null)
@@ -697,7 +728,20 @@
@@ -719,7 +750,20 @@
*/
public EntityItem dropOneItem(boolean par1)
{
@ -97,7 +97,7 @@
}
/**
@@ -706,7 +750,7 @@
@@ -728,7 +772,7 @@
*/
public EntityItem dropPlayerItem(ItemStack par1ItemStack)
{
@ -106,19 +106,16 @@
}
/**
@@ -758,23 +802,39 @@
@@ -780,15 +824,28 @@
*/
public void joinEntityItemWithWorld(EntityItem par1EntityItem)
{
- this.worldObj.spawnEntityInWorld(par1EntityItem);
+ if (captureDrops)
+ {
+ capturedDrops.add(par1EntityItem);
+ return;
+ }
+ else
+ {
+ this.worldObj.spawnEntityInWorld(par1EntityItem);
+ }
this.worldObj.spawnEntityInWorld(par1EntityItem);
}
/**
@ -127,31 +124,31 @@
+ * Deprecated in favor of the more sensitive version
+ */
+ @Deprecated
public float getCurrentPlayerStrVsBlock(Block par1Block)
public float getCurrentPlayerStrVsBlock(Block par1Block, boolean par2)
{
- float f = this.inventory.getStrVsBlock(par1Block);
+ return getCurrentPlayerStrVsBlock(par1Block, 0);
+ return getCurrentPlayerStrVsBlock(par1Block, par2, 0);
+ }
+
+ public float getCurrentPlayerStrVsBlock(Block par1Block, int meta)
+ public float getCurrentPlayerStrVsBlock(Block par1Block, boolean par2, int meta)
+ {
+ ItemStack stack = inventory.getCurrentItem();
+ float f = (stack == null ? 1.0F : stack.getItem().getStrVsBlock(stack, par1Block, meta));
int i = EnchantmentHelper.getEfficiencyModifier(this);
ItemStack itemstack = this.inventory.getCurrentItem();
if (i > 0 && itemstack != null)
if (f > 1.0F)
{
float f1 = (float)(i * i + 1);
-
- if (!itemstack.canHarvestBlock(par1Block) && f <= 1.0F)
+ boolean canHarvest = ForgeHooks.canToolHarvestBlock(par1Block, meta, itemstack);
+
+ if (!canHarvest && f <= 1.0F)
@@ -799,7 +856,9 @@
{
f += f1 * 0.08F;
}
@@ -804,7 +864,8 @@
float f1 = (float)(i * i + 1);
- if (!itemstack.canHarvestBlock(par1Block) && f <= 1.0F)
+ boolean canHarvest = ForgeHooks.canToolHarvestBlock(par1Block, meta, itemstack);
+
+ if (!canHarvest && f <= 1.0F)
{
f += f1 * 0.08F;
}
@@ -830,7 +889,8 @@
f /= 5.0F;
}
@ -161,7 +158,7 @@
}
/**
@@ -812,7 +873,7 @@
@@ -838,7 +898,7 @@
*/
public boolean canHarvestBlock(Block par1Block)
{
@ -170,7 +167,7 @@
}
/**
@@ -1070,12 +1131,22 @@
@@ -1096,12 +1156,22 @@
{
if (!this.isEntityInvulnerable())
{
@ -194,7 +191,7 @@
par2 = this.applyPotionDamageCalculations(par1DamageSource, par2);
this.addExhaustion(par1DamageSource.getHungerDamage());
int j = this.getHealth();
@@ -1118,6 +1189,10 @@
@@ -1144,6 +1214,10 @@
public boolean interactWith(Entity par1Entity)
{
@ -205,7 +202,7 @@
if (par1Entity.interact(this))
{
return true;
@@ -1161,7 +1236,9 @@
@@ -1187,7 +1261,9 @@
*/
public void destroyCurrentEquippedItem()
{
@ -215,7 +212,7 @@
}
/**
@@ -1178,6 +1255,15 @@
@@ -1204,6 +1280,15 @@
*/
public void attackTargetEntityWithCurrentItem(Entity par1Entity)
{
@ -231,7 +228,7 @@
if (par1Entity.canAttackWithItem())
{
if (!par1Entity.func_85031_j(this))
@@ -1341,6 +1427,12 @@
@@ -1378,6 +1463,12 @@
*/
public EnumStatus sleepInBedAt(int par1, int par2, int par3)
{
@ -244,7 +241,7 @@
if (!this.worldObj.isRemote)
{
if (this.isPlayerSleeping() || !this.isEntityAlive())
@@ -1380,6 +1472,11 @@
@@ -1417,6 +1508,11 @@
{
int l = this.worldObj.getBlockMetadata(par1, par2, par3);
int i1 = BlockBed.getDirection(l);
@ -256,7 +253,7 @@
float f = 0.5F;
float f1 = 0.5F;
@@ -1450,10 +1547,12 @@
@@ -1487,10 +1583,12 @@
ChunkCoordinates chunkcoordinates = this.playerLocation;
ChunkCoordinates chunkcoordinates1 = this.playerLocation;
@ -273,7 +270,7 @@
if (chunkcoordinates1 == null)
{
@@ -1490,7 +1589,9 @@
@@ -1527,7 +1625,9 @@
*/
private boolean isInBed()
{
@ -284,7 +281,7 @@
}
/**
@@ -1505,9 +1606,12 @@
@@ -1542,9 +1642,12 @@
ichunkprovider.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
ichunkprovider.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
@ -300,7 +297,7 @@
return chunkcoordinates1;
}
else
@@ -1529,10 +1633,13 @@
@@ -1566,10 +1669,13 @@
{
if (this.playerLocation != null)
{
@ -318,7 +315,7 @@
{
case 0:
return 90.0F;
@@ -1839,7 +1946,7 @@
@@ -1876,7 +1982,7 @@
{
if (par1ItemStack.getItem().requiresMultipleRenderPasses())
{
@ -327,7 +324,7 @@
}
if (this.itemInUse != null && par1ItemStack.itemID == Item.bow.itemID)
@@ -1861,6 +1968,7 @@
@@ -1898,6 +2004,7 @@
return Item.bow.func_94599_c(0);
}
}
@ -335,7 +332,7 @@
}
return icon;
@@ -2092,6 +2200,14 @@
@@ -2137,6 +2244,14 @@
}
this.theInventoryEnderChest = par1EntityPlayer.theInventoryEnderChest;
@ -350,7 +347,7 @@
}
/**
@@ -2163,7 +2279,14 @@
@@ -2208,7 +2323,14 @@
*/
public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack)
{
@ -365,4 +362,4 @@
+ }
}
/**
@SideOnly(Side.CLIENT)

View File

@ -1,17 +1,10 @@
--- ../src_base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java
+++ ../src_work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java
@@ -15,6 +15,7 @@
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityMinecartHopper;
import net.minecraft.entity.IMerchant;
+import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerBeacon;
@@ -87,6 +88,11 @@
@@ -87,6 +87,12 @@
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraftforge.common.ForgeHooks;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.player.PlayerDropsEvent;

View File

@ -18,7 +18,7 @@
public class Item
{
@@ -242,13 +245,16 @@
@@ -238,13 +241,16 @@
/** Icon index in the icons table. */
protected Icon iconIndex;
@ -36,7 +36,7 @@
}
itemsList[256 + par1] = this;
@@ -630,6 +636,10 @@
@@ -636,6 +642,10 @@
float f7 = f4 * f5;
float f8 = f3 * f5;
double d3 = 5.0D;
@ -47,7 +47,7 @@
Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3);
return par1World.rayTraceBlocks_do_do(vec3, vec31, par3, !par3);
}
@@ -710,4 +720,324 @@
@@ -716,4 +726,324 @@
{
StatList.initStats();
}

View File

@ -37,7 +37,7 @@
{
if (par5 == 0)
{
@@ -220,4 +216,28 @@
@@ -227,4 +223,28 @@
this.field_94588_b = par1IconRegister.func_94245_a(s);
}
}

View File

@ -13,7 +13,7 @@
public class ItemDye extends Item
{
/** List of dye color names */
@@ -137,7 +143,27 @@
@@ -141,7 +147,27 @@
public static boolean func_96604_a(ItemStack par0ItemStack, World par1World, int par2, int par3, int par4)
{
@ -41,7 +41,7 @@
if (l == Block.sapling.blockID)
{
@@ -240,16 +266,9 @@
@@ -244,16 +270,9 @@
par1World.setBlockAndMetadataWithNotify(j1, k1, l1, Block.tallGrass.blockID, 1, 3);
}
}

View File

@ -34,15 +34,15 @@
if (this.isCreative())
{
if (!this.theWorld.extinguishFire((EntityPlayer)null, par1, par2, par3, par4))
@@ -154,15 +172,32 @@
@@ -154,15 +172,33 @@
}
else
{
- this.theWorld.extinguishFire(this.thisPlayerMP, par1, par2, par3, par4);
- this.theWorld.extinguishFire((EntityPlayer)null, par1, par2, par3, par4);
this.initialDamage = this.curblockDamage;
float f = 1.0F;
int i1 = this.theWorld.getBlockId(par1, par2, par3);
-
- if (i1 > 0)
- {
- Block.blocksList[i1].onBlockClicked(this.theWorld, par1, par2, par3, this.thisPlayerMP);
@ -73,7 +73,7 @@
}
if (i1 > 0 && f >= 1.0F)
@@ -236,7 +271,7 @@
@@ -236,7 +272,7 @@
block.onBlockHarvested(this.theWorld, par1, par2, par3, l, this.thisPlayerMP);
}
@ -82,7 +82,7 @@
if (block != null && flag)
{
@@ -257,19 +292,30 @@
@@ -257,19 +293,30 @@
}
else
{
@ -115,7 +115,7 @@
if (itemstack != null)
{
@@ -281,6 +327,7 @@
@@ -281,6 +328,7 @@
}
}
@ -123,7 +123,7 @@
if (flag && flag1)
{
Block.blocksList[l].harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, i1);
@@ -321,6 +368,7 @@
@@ -321,6 +369,7 @@
if (itemstack1.stackSize == 0)
{
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null;
@ -131,7 +131,7 @@
}
if (!par1EntityPlayer.isUsingItem())
@@ -338,35 +386,56 @@
@@ -338,35 +387,56 @@
*/
public boolean activateBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
@ -215,7 +215,7 @@
}
/**
@@ -376,4 +445,13 @@
@@ -376,4 +446,13 @@
{
this.theWorld = par1WorldServer;
}

View File

@ -1,7 +1,7 @@
--- ../src_base/minecraft/net/minecraft/network/NetServerHandler.java
+++ ../src_work/minecraft/net/minecraft/network/NetServerHandler.java
@@ -63,6 +63,13 @@
import net.minecraft.util.IntHashMap;
@@ -65,6 +65,13 @@
import net.minecraft.util.ReportedException;
import net.minecraft.world.WorldServer;
+import net.minecraftforge.common.MinecraftForge;
@ -13,8 +13,8 @@
+
public class NetServerHandler extends NetHandler
{
/** The logging system. */
@@ -239,6 +246,11 @@
/** The underlying network manager for this server handler. */
@@ -233,6 +240,11 @@
if (this.playerEntity.ridingEntity != null)
{
this.playerEntity.ridingEntity.updateRiderPosition();
@ -26,7 +26,7 @@
}
this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity);
@@ -311,9 +323,9 @@
@@ -305,9 +317,9 @@
d4 = d1 - this.playerEntity.posX;
double d6 = d2 - this.playerEntity.posY;
double d7 = d3 - this.playerEntity.posZ;
@ -39,7 +39,7 @@
double d11 = d8 * d8 + d9 * d9 + d10 * d10;
if (d11 > 100.0D && (!this.mcServer.isSinglePlayer() || !this.mcServer.getServerOwner().equals(this.playerEntity.username)))
@@ -329,6 +341,11 @@
@@ -323,6 +335,11 @@
if (this.playerEntity.onGround && !par1Packet10Flying.onGround && d6 > 0.0D)
{
this.playerEntity.addExhaustion(0.2F);
@ -51,8 +51,8 @@
}
this.playerEntity.moveEntity(d4, d6, d7);
@@ -353,10 +370,15 @@
logger.warning(this.playerEntity.username + " moved wrongly!");
@@ -347,10 +364,15 @@
this.mcServer.func_98033_al().func_98236_b(this.playerEntity.username + " moved wrongly!");
}
+ if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving
@ -68,7 +68,7 @@
{
this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f2, f3);
return;
@@ -364,7 +386,7 @@
@@ -358,7 +380,7 @@
AxisAlignedBB axisalignedbb = this.playerEntity.boundingBox.copy().expand((double)f4, (double)f4, (double)f4).addCoord(0.0D, -0.55D, 0.0D);
@ -77,7 +77,7 @@
{
if (d12 >= -0.03125D)
{
@@ -383,6 +405,11 @@
@@ -377,6 +399,11 @@
this.ticksForFloatKick = 0;
}
@ -89,7 +89,7 @@
this.playerEntity.onGround = par1Packet10Flying.onGround;
this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity);
this.playerEntity.updateFlyingState(this.playerEntity.posY - d0, par1Packet10Flying.onGround);
@@ -449,7 +476,10 @@
@@ -443,7 +470,10 @@
double d2 = this.playerEntity.posZ - ((double)k + 0.5D);
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
@ -101,7 +101,7 @@
{
return;
}
@@ -509,7 +539,11 @@
@@ -503,7 +533,11 @@
return;
}
@ -114,7 +114,7 @@
}
else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit()))
{
@@ -518,7 +552,9 @@
@@ -512,7 +546,9 @@
}
else
{
@ -125,21 +125,22 @@
{
this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, par1Packet15Place.getXOffset(), par1Packet15Place.getYOffset(), par1Packet15Place.getZOffset());
}
@@ -686,7 +722,12 @@
@@ -691,7 +727,14 @@
return;
}
- s = "<" + this.playerEntity.func_96090_ax() + "> " + s;
+ ServerChatEvent event = new ServerChatEvent(this.playerEntity, s, "<" + this.playerEntity.func_96090_ax() + "> " + s);
+ String old = s;
s = "<" + this.playerEntity.func_96090_ax() + "> " + s;
+ ServerChatEvent event = new ServerChatEvent(this.playerEntity, old, s);
+ if (MinecraftForge.EVENT_BUS.post(event))
+ {
+ return;
+ }
+ s = event.line;
logger.info(s);
this.mcServer.func_98033_al().func_98233_a(s);
this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet3Chat(s, false));
}
@@ -817,7 +858,7 @@
@@ -822,7 +865,7 @@
return;
}
@ -148,7 +149,7 @@
}
}
}
@@ -1215,7 +1256,6 @@
@@ -1220,7 +1263,6 @@
}
}
}

View File

@ -16,7 +16,7 @@
- if (par4 >= 64)
+ if (par4 >= ForgeDummyContainer.clumpingThreshold)
{
- System.out.println("ChunkTilesUpdatePacket compress " + par4);
- this.field_98193_m.func_98233_a("ChunkTilesUpdatePacket compress " + par4);
-
if (field_73449_e.length < l)
{

View File

@ -8,7 +8,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
@@ -55,6 +56,10 @@
@@ -56,6 +57,10 @@
import net.minecraft.world.storage.ISaveHandler;
import net.minecraft.world.storage.WorldInfo;
@ -18,8 +18,8 @@
+
public abstract class MinecraftServer implements ICommandSender, Runnable, IPlayerUsage
{
/** The logging system. */
@@ -135,7 +140,8 @@
/** Instance of Minecraft Server. */
@@ -133,7 +138,8 @@
public final long[] tickTimeArray = new long[100];
/** Stats are [dimension][tick%100] system.nanoTime is stored. */
@ -29,7 +29,7 @@
private KeyPair serverKeyPair;
/** Username of the server owner (for integrated servers) */
@@ -211,8 +217,6 @@
@@ -209,8 +215,6 @@
{
this.convertMapIfNeeded(par1Str);
this.setUserMessage("menu.loadingLevel");
@ -38,7 +38,7 @@
ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true);
WorldInfo worldinfo = isavehandler.loadWorldInfo();
WorldSettings worldsettings;
@@ -232,46 +236,23 @@
@@ -230,46 +234,23 @@
worldsettings.enableBonusChest();
}
@ -60,23 +60,23 @@
- {
- if (this.isDemo())
- {
- this.worldServers[j] = new DemoWorldServer(this, isavehandler, par2Str, b0, this.theProfiler);
- this.worldServers[j] = new DemoWorldServer(this, isavehandler, par2Str, b0, this.theProfiler, this.func_98033_al());
- }
- else
- {
- this.worldServers[j] = new WorldServer(this, isavehandler, par2Str, b0, worldsettings, this.theProfiler);
- this.worldServers[j] = new WorldServer(this, isavehandler, par2Str, b0, worldsettings, this.theProfiler, this.func_98033_al());
- }
- }
- else
- {
- this.worldServers[j] = new WorldServerMulti(this, isavehandler, par2Str, b0, worldsettings, this.worldServers[0], this.theProfiler);
- this.worldServers[j] = new WorldServerMulti(this, isavehandler, par2Str, b0, worldsettings, this.worldServers[0], this.theProfiler, this.func_98033_al());
- }
-
- this.worldServers[j].addWorldAccess(new WorldManager(this, this.worldServers[j]));
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler) : new WorldServer(this, isavehandler, par2Str, 0, worldsettings, theProfiler));
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler, func_98033_al()) : new WorldServer(this, isavehandler, par2Str, 0, worldsettings, theProfiler, func_98033_al()));
+ for (int dim : DimensionManager.getStaticDimensionIDs())
+ {
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, worldsettings, overWorld, theProfiler));
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, worldsettings, overWorld, theProfiler, func_98033_al()));
+ world.addWorldAccess(new WorldManager(this, world));
if (!this.isSinglePlayer())
@ -96,7 +96,7 @@
this.setDifficultyForAllWorlds(this.getDifficulty());
this.initialWorldChunkLoad();
}
@@ -400,7 +381,14 @@
@@ -398,7 +379,14 @@
for (int i = 0; i < this.worldServers.length; ++i)
{
WorldServer worldserver = this.worldServers[i];
@ -111,7 +111,7 @@
}
if (this.usageSnooper != null && this.usageSnooper.isSnooperRunning())
@@ -624,13 +612,15 @@
@@ -622,13 +610,15 @@
this.theProfiler.startSection("levels");
int i;
@ -132,7 +132,7 @@
this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName());
this.theProfiler.startSection("pools");
worldserver.getWorldVec3Pool().clear();
@@ -677,9 +667,11 @@
@@ -675,9 +665,11 @@
this.theProfiler.endSection();
}
@ -147,7 +147,7 @@
this.theProfiler.endStartSection("connection");
this.getNetworkThread().networkTick();
this.theProfiler.endStartSection("players");
@@ -733,7 +725,13 @@
@@ -731,7 +723,13 @@
*/
public WorldServer worldServerForDimension(int par1)
{
@ -162,7 +162,7 @@
}
@SideOnly(Side.SERVER)
@@ -1107,6 +1105,7 @@
@@ -1102,6 +1100,7 @@
if (worldserver != null)
{

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/server/integrated/IntegratedServer.java
+++ ../src_work/minecraft/net/minecraft/server/integrated/IntegratedServer.java
@@ -21,6 +21,10 @@
@@ -23,6 +23,10 @@
import net.minecraft.world.demo.DemoWorldServer;
import net.minecraft.world.storage.ISaveHandler;
@ -11,7 +11,7 @@
@SideOnly(Side.CLIENT)
public class IntegratedServer extends MinecraftServer
{
@@ -60,44 +64,22 @@
@@ -63,44 +67,23 @@
protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str)
{
this.convertMapIfNeeded(par1Str);
@ -24,11 +24,12 @@
- byte b0 = 0;
-
- if (j == 1)
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler) : new WorldServer(this, isavehandler, par2Str, 0, theWorldSettings, theProfiler));
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler, func_98033_al()) : new WorldServer(this, isavehandler, par2Str, 0, theWorldSettings, theProfiler, func_98033_al()));
+ for (int dim : DimensionManager.getStaticDimensionIDs())
+ {
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, theWorldSettings, overWorld, theProfiler));
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, theWorldSettings, overWorld, theProfiler, func_98033_al()));
+ world.addWorldAccess(new WorldManager(this, world));
+
+ if (!this.isSinglePlayer())
{
- b0 = -1;
@ -44,16 +45,16 @@
- {
- if (this.isDemo())
- {
- this.worldServers[j] = new DemoWorldServer(this, isavehandler, par2Str, b0, this.theProfiler);
- this.worldServers[j] = new DemoWorldServer(this, isavehandler, par2Str, b0, this.theProfiler, this.func_98033_al());
- }
- else
- {
- this.worldServers[j] = new WorldServer(this, isavehandler, par2Str, b0, this.theWorldSettings, this.theProfiler);
- this.worldServers[j] = new WorldServer(this, isavehandler, par2Str, b0, this.theWorldSettings, this.theProfiler, this.func_98033_al());
- }
- }
- else
- {
- this.worldServers[j] = new WorldServerMulti(this, isavehandler, par2Str, b0, this.theWorldSettings, this.worldServers[0], this.theProfiler);
- this.worldServers[j] = new WorldServerMulti(this, isavehandler, par2Str, b0, this.theWorldSettings, this.worldServers[0], this.theProfiler, this.func_98033_al());
- }
-
- this.worldServers[j].addWorldAccess(new WorldManager(this, this.worldServers[j]));

View File

@ -8,7 +8,7 @@
import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.packet.Packet;
@@ -9,11 +10,14 @@
@@ -9,10 +10,13 @@
import net.minecraft.network.packet.Packet53BlockChange;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.ChunkCoordIntPair;
@ -18,57 +18,56 @@
public class PlayerInstance
{
/** the list of all players in this instance (chunk) */
- private final List players;
+ public final List players;
- private final List playersInChunk;
+ public final List playersInChunk;
/** note: this is final */
private final ChunkCoordIntPair chunkLocation;
@@ -64,6 +68,8 @@
this.players.remove(par1EntityPlayerMP);
@@ -56,6 +60,8 @@
this.playersInChunk.remove(par1EntityPlayerMP);
par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation);
+ MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.UnWatch(chunkLocation, par1EntityPlayerMP));
+
if (this.players.isEmpty())
if (this.playersInChunk.isEmpty())
{
long i = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32;
@@ -91,7 +97,7 @@
@@ -80,7 +86,7 @@
this.field_73260_f |= 1 << (par2 >> 4);
- if (this.numBlocksToUpdate < 64)
+ //if (this.numBlocksToUpdate < 64) //Forge; Cache everything, so always run
- if (this.numberOfTilesToUpdate < 64)
+ //if (this.numberOfTilesToUpdate < 64) //Forge; Cache everything, so always run
{
short short1 = (short)(par1 << 12 | par3 << 8 | par2);
@@ -103,6 +109,10 @@
@@ -92,6 +98,10 @@
}
}
+ if (this.numBlocksToUpdate == blocksToUpdate.length)
+ if (numberOfTilesToUpdate == locationOfBlockChange.length)
+ {
+ this.blocksToUpdate = Arrays.copyOf(this.blocksToUpdate, blocksToUpdate.length << 1);
+ locationOfBlockChange = Arrays.copyOf(locationOfBlockChange, locationOfBlockChange.length << 1);
+ }
this.blocksToUpdate[this.numBlocksToUpdate++] = short1;
this.locationOfBlockChange[this.numberOfTilesToUpdate++] = short1;
}
}
@@ -147,12 +157,13 @@
@@ -133,12 +143,13 @@
{
int l;
- if (this.numBlocksToUpdate == 64)
+ if (this.numBlocksToUpdate >= ForgeDummyContainer.clumpingThreshold)
- if (this.numberOfTilesToUpdate == 64)
+ if (this.numberOfTilesToUpdate >= ForgeDummyContainer.clumpingThreshold)
{
i = this.chunkLocation.chunkXPos * 16;
j = this.chunkLocation.chunkZPos * 16;
this.sendPacketToPlayersInInstance(new Packet51MapChunk(PlayerManager.getWorldServer(this.myManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.field_73260_f));
this.sendToAllPlayersWatchingChunk(new Packet51MapChunk(PlayerManager.getWorldServer(this.myManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.field_73260_f));
+ /* Forge: Grabings ALL tile entities is costly on a modded server, only send needed ones
for (k = 0; k < 16; ++k)
{
if ((this.field_73260_f & 1 << k) != 0)
@@ -166,11 +177,14 @@
@@ -152,11 +163,14 @@
}
}
}
@ -76,11 +75,11 @@
}
else
{
this.sendPacketToPlayersInInstance(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.blocksToUpdate, this.numBlocksToUpdate, PlayerManager.getWorldServer(this.myManager)));
this.sendToAllPlayersWatchingChunk(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.locationOfBlockChange, this.numberOfTilesToUpdate, PlayerManager.getWorldServer(this.myManager)));
-
+ }
+
+ { //Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small
for (i = 0; i < this.numBlocksToUpdate; ++i)
for (i = 0; i < this.numberOfTilesToUpdate; ++i)
{
j = this.chunkLocation.chunkXPos * 16 + (this.blocksToUpdate[i] >> 12 & 15);
j = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[i] >> 12 & 15);

View File

@ -15,7 +15,7 @@
public abstract class ServerConfigurationManager
{
@@ -364,6 +368,16 @@
@@ -386,6 +390,16 @@
*/
public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3)
{
@ -29,10 +29,10 @@
+ par2 = world.provider.getRespawnDimension(par1EntityPlayerMP);
+ }
+
par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removeAllTrackingPlayers(par1EntityPlayerMP);
par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(par1EntityPlayerMP);
par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removeEntityFromAllTrackingPlayers(par1EntityPlayerMP);
par1EntityPlayerMP.getServerForPlayer().getPlayerManager().removePlayer(par1EntityPlayerMP);
@@ -386,6 +400,7 @@
@@ -408,6 +422,7 @@
EntityPlayerMP entityplayermp1 = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension), par1EntityPlayerMP.username, (ItemInWorldManager)object);
entityplayermp1.playerNetServerHandler = par1EntityPlayerMP.playerNetServerHandler;
entityplayermp1.clonePlayer(par1EntityPlayerMP, par3);
@ -40,11 +40,11 @@
entityplayermp1.entityId = par1EntityPlayerMP.entityId;
WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
this.func_72381_a(entityplayermp1, par1EntityPlayerMP, worldserver);
@@ -433,6 +448,11 @@
*/
@@ -452,6 +467,11 @@
public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
{
+ transferPlayerToDimension(par1EntityPlayerMP, par2, mcServer.worldServerForDimension(par2).func_85176_s());
+ transferPlayerToDimension(par1EntityPlayerMP, par2, mcServer.worldServerForDimension(par2).getDefaultTeleporter());
+ }
+
+ public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2, Teleporter teleporter)
@ -52,7 +52,7 @@
int j = par1EntityPlayerMP.dimension;
WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
par1EntityPlayerMP.dimension = par2;
@@ -440,7 +460,7 @@
@@ -459,7 +479,7 @@
par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, worldserver1.getWorldInfo().getTerrainType(), worldserver1.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType()));
worldserver.removePlayerEntityDangerously(par1EntityPlayerMP);
par1EntityPlayerMP.isDead = false;
@ -61,14 +61,14 @@
this.func_72375_a(par1EntityPlayerMP, worldserver);
par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1);
@@ -462,38 +482,23 @@
@@ -481,38 +501,23 @@
*/
public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer)
{
- double d0 = par1Entity.posX;
- double d1 = par1Entity.posZ;
- double d2 = 8.0D;
+ transferEntityToWorld(par1Entity, par2, par3WorldServer, par4WorldServer, par4WorldServer.func_85176_s());
+ transferEntityToWorld(par1Entity, par2, par3WorldServer, par4WorldServer, par4WorldServer.getDefaultTeleporter());
+ }
+
+ public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer, Teleporter teleporter)
@ -111,11 +111,11 @@
{
ChunkCoordinates chunkcoordinates;
@@ -530,7 +535,7 @@
@@ -549,7 +554,7 @@
par4WorldServer.spawnEntityInWorld(par1Entity);
par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch);
par4WorldServer.updateEntityWithOptionalForce(par1Entity, false);
- par4WorldServer.func_85176_s().placeInPortal(par1Entity, d3, d4, d5, f);
- par4WorldServer.getDefaultTeleporter().placeInPortal(par1Entity, d3, d4, d5, f);
+ teleporter.placeInPortal(par1Entity, d3, d4, d5, f);
}

View File

@ -1,17 +1,18 @@
--- ../src_base/minecraft/net/minecraft/tileentity/TileEntity.java
+++ ../src_work/minecraft/net/minecraft/tileentity/TileEntity.java
@@ -10,7 +10,10 @@
@@ -10,8 +10,11 @@
import net.minecraft.block.Block;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;
+import net.minecraft.network.packet.Packet132TileEntityData;
import net.minecraft.server.MinecraftServer;
+import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
public class TileEntity
@@ -304,4 +307,93 @@
@@ -308,4 +311,93 @@
addMapping(TileEntityHopper.class, "Hopper");
addMapping(TileEntityComparator.class, "Comparator");
}
@ -88,11 +89,11 @@
+ Block type = getBlockType();
+ if (type == Block.enchantmentTable)
+ {
+ bb = AxisAlignedBB.getAABBPool().addOrModifyAABBInPool(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1);
+ bb = AxisAlignedBB.getAABBPool().getAABB(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1);
+ }
+ else if (type == Block.chest)
+ {
+ bb = AxisAlignedBB.getAABBPool().addOrModifyAABBInPool(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 1, zCoord + 2);
+ bb = AxisAlignedBB.getAABBPool().getAABB(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 2, zCoord + 2);
+ }
+ else if (type != null && type != Block.beacon)
+ {

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java
+++ ../src_work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java
@@ -117,8 +117,9 @@
@@ -120,8 +120,9 @@
for (int l = this.zCoord - i; l <= this.zCoord + i; ++l)
{
int i1 = this.worldObj.getBlockId(k, j, l);

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/world/World.java
+++ ../src_work/minecraft/net/minecraft/world/World.java
@@ -50,8 +50,30 @@
@@ -51,8 +51,30 @@
import net.minecraft.world.storage.MapStorage;
import net.minecraft.world.storage.WorldInfo;
@ -31,24 +31,25 @@
/**
* boolean; if true updates scheduled by scheduleBlockUpdate happen immediately
*/
@@ -166,6 +188,11 @@
* Gets the biome for a given set of x/z coordinates
@@ -163,6 +185,11 @@
*/
public BiomeGenBase getBiomeGenForCoords(int par1, int par2)
+ {
{
+ return provider.getBiomeGenForCoords(par1, par2);
+ }
+
+ public BiomeGenBase getBiomeGenForCoordsBody(int par1, int par2)
{
+ {
if (this.blockExists(par1, 0, par2))
{
@@ -196,7 +223,13 @@
Chunk chunk = this.getChunkFromBlockCoords(par1, par2);
@@ -191,8 +218,14 @@
this.theProfiler = par5Profiler;
this.worldInfo = new WorldInfo(par4WorldSettings, par2Str);
this.provider = par3WorldProvider;
- this.mapStorage = new MapStorage(par1ISaveHandler);
+ perWorldStorage = new MapStorage((ISaveHandler)null);
this.field_98181_L = par6ILogAgent;
+ }
+
+ // Broken up so that the WorldClient gets the chance to set the mapstorage object before the dimension initializes
@ -58,7 +59,7 @@
VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages");
if (villagecollection == null)
@@ -210,7 +243,7 @@
@@ -206,7 +239,7 @@
this.villageCollectionObj.func_82566_a(this);
}
@ -67,16 +68,16 @@
this.chunkProvider = this.createChunkProvider();
this.calculateInitialSkylight();
this.calculateInitialWeather();
@@ -224,7 +257,7 @@
@@ -219,7 +252,7 @@
this.isRemote = false;
this.saveHandler = par1ISaveHandler;
this.theProfiler = par5Profiler;
- this.mapStorage = new MapStorage(par1ISaveHandler);
+ this.mapStorage = getMapStorage(par1ISaveHandler);
this.field_98181_L = par6ILogAgent;
this.worldInfo = par1ISaveHandler.loadWorldInfo();
if (par4WorldProvider != null)
@@ -277,12 +310,20 @@
@@ -273,12 +306,20 @@
this.worldInfo.setServerInitialized(true);
}
@ -99,7 +100,7 @@
}
else
{
@@ -292,6 +333,19 @@
@@ -288,6 +329,19 @@
this.calculateInitialSkylight();
this.calculateInitialWeather();
@ -119,7 +120,7 @@
}
/**
@@ -380,7 +434,8 @@
@@ -371,7 +425,8 @@
*/
public boolean isAirBlock(int par1, int par2, int par3)
{
@ -129,7 +130,7 @@
}
/**
@@ -389,7 +444,8 @@
@@ -380,7 +435,8 @@
public boolean blockHasTileEntity(int par1, int par2, int par3)
{
int l = this.getBlockId(par1, par2, par3);
@ -139,7 +140,7 @@
}
/**
@@ -1141,7 +1197,7 @@
@@ -1132,7 +1188,7 @@
*/
public boolean isDaytime()
{
@ -148,7 +149,7 @@
}
/**
@@ -1173,7 +1229,7 @@
@@ -1164,7 +1220,7 @@
int l1 = this.getBlockMetadata(l, i1, j1);
Block block = Block.blocksList[k1];
@ -157,7 +158,7 @@
{
MovingObjectPosition movingobjectposition = block.collisionRayTrace(this, l, i1, j1, par1Vec3, par2Vec3);
@@ -1373,6 +1429,12 @@
@@ -1364,6 +1420,12 @@
*/
public void playSoundAtEntity(Entity par1Entity, String par2Str, float par3, float par4)
{
@ -170,7 +171,7 @@
if (par1Entity != null && par2Str != null)
{
for (int i = 0; i < this.worldAccesses.size(); ++i)
@@ -1387,6 +1449,12 @@
@@ -1378,6 +1440,12 @@
*/
public void playSoundToNearExcept(EntityPlayer par1EntityPlayer, String par2Str, float par3, float par4)
{
@ -183,7 +184,7 @@
if (par1EntityPlayer != null && par2Str != null)
{
for (int i = 0; i < this.worldAccesses.size(); ++i)
@@ -1473,6 +1541,11 @@
@@ -1464,6 +1532,11 @@
EntityPlayer entityplayer = (EntityPlayer)par1Entity;
this.playerEntities.add(entityplayer);
this.updateAllPlayersSleepingFlag();
@ -195,7 +196,7 @@
}
this.getChunkFromChunkCoords(i, j).addEntity(par1Entity);
@@ -1719,6 +1792,12 @@
@@ -1710,6 +1783,12 @@
* Calculates the color for the skybox
*/
public Vec3 getSkyColor(Entity par1Entity, float par2)
@ -208,9 +209,9 @@
{
float f1 = this.getCelestialAngle(par2);
float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
@@ -1812,6 +1891,12 @@
@@ -1803,6 +1882,12 @@
@SideOnly(Side.CLIENT)
public Vec3 drawClouds(float par1)
public Vec3 getCloudColour(float par1)
{
+ return provider.drawClouds(par1);
+ }
@ -221,7 +222,7 @@
float f1 = this.getCelestialAngle(par1);
float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
@@ -1890,7 +1975,7 @@
@@ -1881,7 +1966,7 @@
{
int l = chunk.getBlockID(par1, k, par2);
@ -230,7 +231,7 @@
{
return k + 1;
}
@@ -1905,6 +1990,12 @@
@@ -1896,6 +1981,12 @@
* How bright are stars in the sky
*/
public float getStarBrightness(float par1)
@ -243,7 +244,7 @@
{
float f1 = this.getCelestialAngle(par1);
float f2 = 1.0F - (MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.25F);
@@ -2040,16 +2131,8 @@
@@ -2031,16 +2122,8 @@
if (entity.isDead)
{
@ -262,7 +263,7 @@
}
this.theProfiler.endSection();
@@ -2088,7 +2171,7 @@
@@ -2079,7 +2162,7 @@
if (chunk != null)
{
@ -271,7 +272,7 @@
}
}
}
@@ -2097,6 +2180,10 @@
@@ -2088,6 +2171,10 @@
if (!this.entityRemoval.isEmpty())
{
@ -282,7 +283,7 @@
this.loadedTileEntityList.removeAll(this.entityRemoval);
this.entityRemoval.clear();
}
@@ -2117,18 +2204,18 @@
@@ -2108,18 +2195,18 @@
{
this.loadedTileEntityList.add(tileentity1);
}
@ -305,7 +306,7 @@
}
}
@@ -2141,13 +2228,13 @@
@@ -2132,13 +2219,13 @@
public void addTileEntity(Collection par1Collection)
{
@ -326,7 +327,7 @@
}
}
@@ -2167,9 +2254,17 @@
@@ -2158,9 +2245,17 @@
{
int i = MathHelper.floor_double(par1Entity.posX);
int j = MathHelper.floor_double(par1Entity.posZ);
@ -347,7 +348,7 @@
{
par1Entity.lastTickPosX = par1Entity.posX;
par1Entity.lastTickPosY = par1Entity.posY;
@@ -2402,6 +2497,14 @@
@@ -2393,6 +2488,14 @@
{
return true;
}
@ -362,7 +363,7 @@
}
}
}
@@ -2707,25 +2810,21 @@
@@ -2698,25 +2801,21 @@
*/
public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity)
{
@ -403,7 +404,7 @@
}
}
@@ -2734,27 +2833,10 @@
@@ -2725,27 +2824,10 @@
*/
public void removeBlockTileEntity(int par1, int par2, int par3)
{
@ -435,7 +436,7 @@
}
}
@@ -2780,7 +2862,8 @@
@@ -2771,7 +2853,8 @@
*/
public boolean isBlockNormalCube(int par1, int par2, int par3)
{
@ -445,7 +446,7 @@
}
public boolean func_85174_u(int par1, int par2, int par3)
@@ -2803,8 +2886,7 @@
@@ -2794,8 +2877,7 @@
*/
public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3)
{
@ -455,7 +456,7 @@
}
/**
@@ -2820,7 +2902,7 @@
@@ -2811,7 +2893,7 @@
if (chunk != null && !chunk.isEmpty())
{
Block block = Block.blocksList[this.getBlockId(par1, par2, par3)];
@ -464,7 +465,7 @@
}
else
{
@@ -2851,8 +2933,7 @@
@@ -2842,8 +2924,7 @@
*/
public void setAllowedSpawnTypes(boolean par1, boolean par2)
{
@ -474,7 +475,7 @@
}
/**
@@ -2868,6 +2949,11 @@
@@ -2859,6 +2940,11 @@
*/
private void calculateInitialWeather()
{
@ -486,7 +487,7 @@
if (this.worldInfo.isRaining())
{
this.rainingStrength = 1.0F;
@@ -2883,6 +2969,11 @@
@@ -2874,6 +2960,11 @@
* Updates all weather states.
*/
protected void updateWeather()
@ -498,9 +499,9 @@
{
if (!this.provider.hasNoSky)
{
@@ -2983,12 +3074,14 @@
*/
public void commandToggleDownfall()
@@ -2971,12 +3062,14 @@
public void toggleRain()
{
- this.worldInfo.setRainTime(1);
+ provider.toggleRain();
@ -514,7 +515,7 @@
this.theProfiler.startSection("buildList");
int i;
EntityPlayer entityplayer;
@@ -3095,6 +3188,11 @@
@@ -3083,6 +3176,11 @@
*/
public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4)
{
@ -526,49 +527,50 @@
BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3);
float f = biomegenbase.getFloatTemperature();
@@ -3152,6 +3250,11 @@
* Tests whether or not snow can be placed at a given location
@@ -3141,6 +3239,11 @@
*/
public boolean canSnowAt(int par1, int par2, int par3)
+ {
{
+ return provider.canSnowAt(par1, par2, par3);
+ }
+
+ public boolean canSnowAtBody(int par1, int par2, int par3)
{
+ {
BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3);
float f = biomegenbase.getFloatTemperature();
@@ -3245,7 +3348,7 @@
private int computeBlockLightValue(int par1, int par2, int par3, int par4, int par5, int par6)
{
- int k1 = Block.lightValue[par5];
+ int k1 = (par5 == 0 || Block.blocksList[par5] == null ? 0 : Block.blocksList[par5].getLightValue(this, par2, par3, par4));
int l1 = this.getSavedLightValue(EnumSkyBlock.Block, par2 - 1, par3, par4) - par6;
int i2 = this.getSavedLightValue(EnumSkyBlock.Block, par2 + 1, par3, par4) - par6;
int j2 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3 - 1, par4) - par6;
@@ -3380,7 +3483,7 @@
int k4 = i2 + (i4 / 2 + 1) % 3 / 2 * l3;
int l4 = j2 + (i4 / 2 + 2) % 3 / 2 * l3;
l2 = this.getSavedLightValue(par1EnumSkyBlock, j4, k4, l4);
- int i5 = Block.lightOpacity[this.getBlockId(j4, k4, l4)];
+ int i5 = this.getBlockLightOpacity(j4, k4, l4);
@@ -3184,10 +3287,12 @@
else
{
int l = this.getBlockId(par1, par2, par3);
- int i1 = par4EnumSkyBlock == EnumSkyBlock.Sky ? 0 : Block.lightValue[l];
- int j1 = Block.lightOpacity[l];
-
- if (j1 >= 15 && Block.lightValue[l] > 0)
+ Block block = Block.blocksList[l];
+ int blockLight = (block == null ? 0 : block.getLightValue(this, par1, par2, par3));
+ int i1 = par4EnumSkyBlock == EnumSkyBlock.Sky ? 0 : blockLight;
+ int j1 = (block == null ? 0 : block.getLightOpacity(this, par1, par2, par3));
+
+ if (j1 >= 15 && blockLight > 0)
{
j1 = 1;
}
@@ -3283,7 +3388,9 @@
int j4 = i2 + Facing.offsetsXForSide[i4];
int k4 = j2 + Facing.offsetsYForSide[i4];
int l4 = k2 + Facing.offsetsZForSide[i4];
- int i5 = Math.max(1, Block.lightOpacity[this.getBlockId(j4, k4, l4)]);
+ Block block = Block.blocksList[getBlockId(j4, k4, l4)];
+ int blockOpacity = (block == null ? 0 : block.getLightOpacity(this, j4, k4, l4));
+ int i5 = Math.max(1, blockOpacity);
i3 = this.getSavedLightValue(par1EnumSkyBlock, j4, k4, l4);
if (i5 == 0)
{
@@ -3411,7 +3514,7 @@
j2 = (k1 >> 12 & 63) - 32 + par4;
k2 = this.getSavedLightValue(par1EnumSkyBlock, l1, i2, j2);
l2 = this.getBlockId(l1, i2, j2);
- i3 = Block.lightOpacity[l2];
+ i3 = this.getBlockLightOpacity(l1, i2, j2);
if (i3 == 0)
{
@@ -3518,10 +3621,10 @@
if (i3 == l2 - i5 && i1 < this.lightUpdateBlockList.length)
@@ -3386,10 +3493,10 @@
public List func_94576_a(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{
this.entitiesWithinAABBExcludingEntity.clear();
ArrayList arraylist = new ArrayList();
- int i = MathHelper.floor_double((par2AxisAlignedBB.minX - 2.0D) / 16.0D);
- int j = MathHelper.floor_double((par2AxisAlignedBB.maxX + 2.0D) / 16.0D);
- int k = MathHelper.floor_double((par2AxisAlignedBB.minZ - 2.0D) / 16.0D);
@ -580,7 +582,7 @@
for (int i1 = i; i1 <= j; ++i1)
{
@@ -3547,10 +3650,10 @@
@@ -3415,10 +3522,10 @@
public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{
@ -595,7 +597,7 @@
ArrayList arraylist = new ArrayList();
for (int i1 = i; i1 <= j; ++i1)
@@ -3643,11 +3746,14 @@
@@ -3511,11 +3618,14 @@
*/
public void addLoadedEntities(List par1List)
{
@ -613,7 +615,7 @@
}
}
@@ -3681,6 +3787,11 @@
@@ -3549,6 +3659,11 @@
else
{
if (block != null && (block == Block.waterMoving || block == Block.waterStill || block == Block.lavaMoving || block == Block.lavaStill || block == Block.fire || block.blockMaterial.isReplaceable()))
@ -625,7 +627,7 @@
{
block = null;
}
@@ -3969,7 +4080,7 @@
@@ -3837,7 +3952,7 @@
*/
public long getSeed()
{
@ -634,7 +636,7 @@
}
public long getTotalWorldTime()
@@ -3979,7 +4090,7 @@
@@ -3847,7 +3962,7 @@
public long getWorldTime()
{
@ -643,7 +645,7 @@
}
/**
@@ -3987,7 +4098,7 @@
@@ -3855,7 +3970,7 @@
*/
public void setWorldTime(long par1)
{
@ -652,7 +654,7 @@
}
/**
@@ -3995,13 +4106,13 @@
@@ -3863,13 +3978,13 @@
*/
public ChunkCoordinates getSpawnPoint()
{
@ -668,7 +670,7 @@
}
@SideOnly(Side.CLIENT)
@@ -4025,7 +4136,10 @@
@@ -3893,7 +4008,10 @@
if (!this.loadedEntityList.contains(par1Entity))
{
@ -680,7 +682,7 @@
}
}
@@ -4033,6 +4147,11 @@
@@ -3901,6 +4019,11 @@
* Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here.
*/
public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4)
@ -692,7 +694,7 @@
{
return true;
}
@@ -4153,8 +4272,7 @@
@@ -4021,8 +4144,7 @@
*/
public boolean isBlockHighHumidity(int par1, int par2, int par3)
{
@ -702,7 +704,7 @@
}
/**
@@ -4229,7 +4347,7 @@
@@ -4097,7 +4219,7 @@
*/
public int getHeight()
{
@ -711,7 +713,7 @@
}
/**
@@ -4237,7 +4355,7 @@
@@ -4105,7 +4227,7 @@
*/
public int getActualHeight()
{
@ -720,7 +722,7 @@
}
public IUpdatePlayerListBox func_82735_a(EntityMinecart par1EntityMinecart)
@@ -4280,7 +4398,7 @@
@@ -4148,7 +4270,7 @@
*/
public double getHorizon()
{
@ -729,11 +731,10 @@
}
/**
@@ -4378,4 +4496,75 @@
}
}
@@ -4251,4 +4373,98 @@
{
return this.field_98181_L;
}
-}
+
+ /**
+ * Adds a single TileEntity to the world.
@ -805,4 +806,27 @@
+ {
+ return ForgeChunkManager.getPersistentChunksFor(this);
+ }
+}
+
+ /**
+ * Readded as it was removed, very useful helper function
+ *
+ * @param x X position
+ * @param y Y Position
+ * @param z Z Position
+ * @return The blocks light opacity
+ */
+ public int getBlockLightOpacity(int x, int y, int z)
+ {
+ if (x < -30000000 || z < -30000000 || x >= 30000000 || z >= 30000000)
+ {
+ return 0;
+ }
+
+ if (y < 0 || y >= 256)
+ {
+ return 0;
+ }
+
+ return getChunkFromChunkCoords(x >> 4, z >> 4).getBlockLightOpacity(x & 15, y, z & 15);
+ }
}

View File

@ -9,7 +9,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
@@ -46,11 +48,18 @@
@@ -47,11 +49,18 @@
import net.minecraft.world.biome.WorldChunkManager;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
@ -28,7 +28,7 @@
public class WorldServer extends World
{
@@ -87,6 +96,10 @@
@@ -88,6 +97,10 @@
/** An IntHashMap of entity IDs (integers) to their Entity objects. */
private IntHashMap entityIdMap;
@ -36,10 +36,10 @@
+ protected Set<ChunkCoordIntPair> doneChunks = new HashSet<ChunkCoordIntPair>();
+ public List<Teleporter> customTeleporters = new ArrayList<Teleporter>();
+
public WorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler)
public WorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler, ILogAgent par7ILogAgent)
{
super(par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4), par6Profiler);
@@ -121,6 +134,7 @@
super(par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4), par6Profiler, par7ILogAgent);
@@ -122,6 +135,7 @@
scoreboardsavedata.func_96499_a(this.field_96442_D);
((ServerScoreboard)this.field_96442_D).func_96547_a(scoreboardsavedata);
@ -125,7 +125,7 @@
if (this.scheduledUpdatesAreImmediate && par4 > 0)
{
@@ -492,7 +520,7 @@
@@ -493,7 +521,7 @@
*/
public void updateEntities()
{
@ -134,7 +134,7 @@
{
if (this.updateEntityTick++ >= 1200)
{
@@ -558,7 +586,8 @@
@@ -559,7 +587,8 @@
{
nextticklistentry = (NextTickListEntry)iterator.next();
iterator.remove();
@ -144,7 +144,7 @@
if (this.checkChunksExist(nextticklistentry.xCoord - b0, nextticklistentry.yCoord - b0, nextticklistentry.zCoord - b0, nextticklistentry.xCoord + b0, nextticklistentry.yCoord + b0, nextticklistentry.zCoord + b0))
{
@@ -679,16 +708,28 @@
@@ -698,16 +727,28 @@
{
ArrayList arraylist = new ArrayList();
@ -183,7 +183,7 @@
return arraylist;
}
@@ -696,6 +737,11 @@
@@ -715,6 +756,11 @@
* Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here.
*/
public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4)
@ -195,7 +195,7 @@
{
return !this.mcServer.func_96290_a(this, par2, par3, par4, par1EntityPlayer);
}
@@ -780,7 +826,7 @@
@@ -799,7 +845,7 @@
*/
protected void createBonusChest()
{
@ -204,7 +204,7 @@
for (int i = 0; i < 10; ++i)
{
@@ -823,6 +869,7 @@
@@ -842,6 +888,7 @@
}
this.chunkProvider.saveChunks(par1, par2IProgressUpdate);
@ -212,15 +212,15 @@
}
}
@@ -834,6 +881,7 @@
@@ -853,6 +900,7 @@
this.checkSessionLock();
this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getTagsFromLastWrite());
this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData());
this.mapStorage.saveAllData();
+ this.perWorldStorage.saveAllData();
}
/**
@@ -1056,4 +1104,9 @@
@@ -1066,4 +1114,9 @@
{
return this.field_85177_Q;
}

View File

@ -10,7 +10,7 @@
import net.minecraft.world.*;
import net.minecraft.world.gen.*;
import net.minecraft.world.biome.*;
@@ -224,4 +227,36 @@
@@ -224,4 +227,37 @@
* Called when 'Create New World' button is pressed before starting game
*/
public void onGUICreateWorldPress() { }
@ -31,10 +31,11 @@
+ * @param guiCreateWorld the createworld GUI
+ */
+ @SideOnly(Side.CLIENT)
+ public void onCustomizeButton(Minecraft instance, GuiCreateWorld guiCreateWorld) {
+ public void onCustomizeButton(Minecraft instance, GuiCreateWorld guiCreateWorld)
+ {
+ if (this == FLAT)
+ {
+ instance.displayGuiScreen(new GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.field_82290_a));
+ instance.displayGuiScreen(new GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.generatorOptionsToUse));
+ }
+ }
+

View File

@ -11,7 +11,7 @@
public class Chunk
{
/**
@@ -139,7 +143,9 @@
@@ -144,7 +148,9 @@
{
for (int j1 = 0; j1 < k; ++j1)
{
@ -22,7 +22,7 @@
if (b0 != 0)
{
@@ -158,6 +164,90 @@
@@ -163,6 +169,90 @@
}
/**
@ -113,7 +113,7 @@
* Checks whether the chunk is at the X/Z location specified
*/
public boolean isAtLocation(int par1, int par2)
@@ -221,7 +311,7 @@
@@ -226,7 +316,7 @@
{
int i1 = this.getBlockID(j, l - 1, k);
@ -122,7 +122,7 @@
{
--l;
continue;
@@ -527,7 +617,10 @@
@@ -532,7 +622,10 @@
public int getBlockLightOpacity(int par1, int par2, int par3)
{
@ -134,7 +134,7 @@
}
/**
@@ -535,7 +628,7 @@
@@ -540,7 +633,7 @@
*/
public int getBlockID(int par1, int par2, int par3)
{
@ -143,7 +143,7 @@
{
return 0;
}
@@ -551,7 +644,7 @@
@@ -556,7 +649,7 @@
*/
public int getBlockMetadata(int par1, int par2, int par3)
{
@ -152,7 +152,7 @@
{
return 0;
}
@@ -584,6 +677,11 @@
@@ -589,6 +682,11 @@
}
else
{
@ -164,7 +164,7 @@
ExtendedBlockStorage extendedblockstorage = this.storageArrays[par2 >> 4];
boolean flag = false;
@@ -614,9 +712,13 @@
@@ -619,9 +717,13 @@
{
Block.blocksList[l1].breakBlock(this.worldObj, j2, par2, k2, l1, i2);
}
@ -181,7 +181,7 @@
}
}
@@ -634,7 +736,7 @@
@@ -639,7 +741,7 @@
}
else
{
@ -190,7 +190,7 @@
{
if (par2 >= k1)
{
@@ -658,29 +760,21 @@
@@ -663,29 +765,21 @@
Block.blocksList[par4].onBlockAdded(this.worldObj, j2, par2, k2);
}
@ -223,7 +223,7 @@
}
}
@@ -695,7 +789,7 @@
@@ -700,7 +794,7 @@
*/
public boolean setBlockMetadata(int par1, int par2, int par3, int par4)
{
@ -232,7 +232,7 @@
if (extendedblockstorage == null)
{
@@ -715,7 +809,7 @@
@@ -720,7 +814,7 @@
extendedblockstorage.setExtBlockMetadata(par1, par2 & 15, par3, par4);
int j1 = extendedblockstorage.getExtBlockID(par1, par2 & 15, par3);
@ -241,7 +241,7 @@
{
TileEntity tileentity = this.getChunkBlockTileEntity(par1, par2, par3);
@@ -736,7 +830,7 @@
@@ -741,7 +835,7 @@
*/
public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4)
{
@ -250,7 +250,7 @@
return extendedblockstorage == null ? (this.canBlockSeeTheSky(par2, par3, par4) ? par1EnumSkyBlock.defaultLightValue : 0) : (par1EnumSkyBlock == EnumSkyBlock.Sky ? (this.worldObj.provider.hasNoSky ? 0 : extendedblockstorage.getExtSkylightValue(par2, par3 & 15, par4)) : (par1EnumSkyBlock == EnumSkyBlock.Block ? extendedblockstorage.getExtBlocklightValue(par2, par3 & 15, par4) : par1EnumSkyBlock.defaultLightValue));
}
@@ -746,6 +840,11 @@
@@ -751,6 +845,11 @@
*/
public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5)
{
@ -262,7 +262,7 @@
ExtendedBlockStorage extendedblockstorage = this.storageArrays[par3 >> 4];
if (extendedblockstorage == null)
@@ -774,7 +873,7 @@
@@ -779,7 +878,7 @@
*/
public int getBlockLightValue(int par1, int par2, int par3, int par4)
{
@ -271,7 +271,7 @@
if (extendedblockstorage == null)
{
@@ -827,7 +926,7 @@
@@ -832,7 +931,7 @@
{
k = this.entityLists.length - 1;
}
@ -280,7 +280,7 @@
par1Entity.addedToChunk = true;
par1Entity.chunkCoordX = this.xPosition;
par1Entity.chunkCoordY = k;
@@ -877,33 +976,32 @@
@@ -882,33 +981,32 @@
ChunkPosition chunkposition = new ChunkPosition(par1, par2, par3);
TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(chunkposition);
@ -325,7 +325,7 @@
}
/**
@@ -918,7 +1016,7 @@
@@ -923,7 +1021,7 @@
if (this.isChunkLoaded)
{
@ -334,7 +334,7 @@
}
}
@@ -933,8 +1031,14 @@
@@ -938,8 +1036,14 @@
par4TileEntity.yCoord = par2;
par4TileEntity.zCoord = this.zPosition * 16 + par3;
@ -351,7 +351,7 @@
par4TileEntity.validate();
this.chunkTileEntityMap.put(chunkposition, par4TileEntity);
}
@@ -970,6 +1074,7 @@
@@ -975,6 +1079,7 @@
{
this.worldObj.addLoadedEntities(this.entityLists[i]);
}
@ -359,7 +359,7 @@
}
/**
@@ -990,6 +1095,7 @@
@@ -995,6 +1100,7 @@
{
this.worldObj.unloadEntities(this.entityLists[i]);
}
@ -367,7 +367,7 @@
}
/**
@@ -1006,8 +1112,8 @@
@@ -1011,8 +1117,8 @@
*/
public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector)
{
@ -378,7 +378,7 @@
if (i < 0)
{
@@ -1054,8 +1160,8 @@
@@ -1061,8 +1167,8 @@
*/
public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector)
{
@ -389,7 +389,7 @@
if (i < 0)
{
@@ -1238,6 +1344,15 @@
@@ -1245,6 +1351,15 @@
*/
public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4)
{
@ -405,7 +405,7 @@
int k = 0;
boolean flag1 = !this.worldObj.provider.hasNoSky;
int l;
@@ -1338,12 +1453,26 @@
@@ -1345,12 +1460,26 @@
}
this.generateHeightMap();
@ -436,7 +436,7 @@
}
}
@@ -1452,4 +1581,18 @@
@@ -1459,4 +1588,18 @@
}
}
}

View File

@ -10,7 +10,7 @@
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.crash.CrashReport;
@@ -74,7 +77,7 @@
@@ -66,7 +69,7 @@
*/
public void unloadChunksIfNotNearSpawn(int par1, int par2)
{
@ -19,7 +19,7 @@
{
ChunkCoordinates chunkcoordinates = this.worldObj.getSpawnPoint();
int k = par1 * 16 + 8 - chunkcoordinates.posX;
@@ -117,7 +120,11 @@
@@ -109,7 +112,11 @@
if (chunk == null)
{
@ -32,7 +32,7 @@
if (chunk == null)
{
@@ -314,6 +321,11 @@
@@ -305,6 +312,11 @@
{
if (!this.worldObj.canNotSave)
{
@ -44,14 +44,14 @@
for (int i = 0; i < 100; ++i)
{
if (!this.chunksToUnload.isEmpty())
@@ -326,6 +338,11 @@
@@ -317,6 +329,11 @@
this.chunksToUnload.remove(olong);
this.id2ChunkMap.remove(olong.longValue());
this.loadedChunkHashMap.remove(olong.longValue());
this.loadedChunks.remove(chunk);
+ ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.chunkXZ2Int(chunk.xPosition, chunk.zPosition), chunk);
+ if(loadedChunks.size() == 0 && ForgeChunkManager.getPersistentChunksFor(this.worldObj).size() == 0 && !DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId)) {
+ DimensionManager.unloadWorld(this.worldObj.provider.dimensionId);
+ return serverChunkGenerator.unload100OldestChunks();
+ return currentChunkProvider.unloadQueuedChunks();
+ }
}
}

View File

@ -1,10 +1,8 @@
--- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java
+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java
@@ -1,8 +1,11 @@
package net.minecraft.world.gen.feature;
@@ -2,7 +2,9 @@
import java.util.Random;
+
import net.minecraft.block.Block;
+import net.minecraft.block.BlockSapling;
import net.minecraft.world.World;
@ -12,7 +10,7 @@
public class WorldGenForest extends WorldGenerator
{
@@ -45,7 +48,9 @@
@@ -45,7 +47,9 @@
{
l1 = par1World.getBlockId(j1, i1, k1);
@ -23,7 +21,7 @@
{
flag = false;
}
@@ -65,10 +70,12 @@
@@ -65,10 +69,12 @@
else
{
i1 = par1World.getBlockId(par3, par4 - 1, par5);
@ -38,19 +36,18 @@
int i2;
for (i2 = par4 - 3 + l; i2 <= par4 + l; ++i2)
@@ -84,7 +91,10 @@
{
int l2 = k2 - par5;
- if ((Math.abs(j2) != k1 || Math.abs(l2) != k1 || par2Random.nextInt(2) != 0 && j1 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(l1, i2, k2)])
+ Block block = Block.blocksList[par1World.getBlockId(l1, i2, k2)];
+
+ if ((Math.abs(j2) != k1 || Math.abs(l2) != k1 || par2Random.nextInt(2) != 0 && j1 != 0) &&
+ (block == null || block.canBeReplacedByLeaves(par1World, l1, i2, k2)))
@@ -87,8 +93,9 @@
if (Math.abs(j2) != k1 || Math.abs(l2) != k1 || par2Random.nextInt(2) != 0 && j1 != 0)
{
this.setBlockAndMetadata(par1World, l1, i2, k2, Block.leaves.blockID, 2);
}
@@ -96,7 +106,9 @@
int i3 = par1World.getBlockId(l1, i2, k2);
+ Block block = Block.blocksList[i3];
- if (i3 == 0 || i3 == Block.leaves.blockID)
+ if (block == null || block.canBeReplacedByLeaves(par1World, l1, i2, k2))
{
this.setBlockAndMetadata(par1World, l1, i2, k2, Block.leaves.blockID, 2);
}
@@ -101,7 +108,9 @@
{
j1 = par1World.getBlockId(par3, par4 + i2, par5);

View File

@ -83,21 +83,19 @@
{
this.setBlockAndMetadata(par1World, par3, par4 + j1, par5 + 1, Block.wood.blockID, this.woodMetadata);
@@ -219,7 +229,12 @@
{
int k2 = j2 - par3;
- if ((i2 >= 0 || k2 >= 0 || i2 * i2 + k2 * k2 <= k1 * k1) && (i2 <= 0 && k2 <= 0 || i2 * i2 + k2 * k2 <= (k1 + 1) * (k1 + 1)) && (par6Random.nextInt(4) != 0 || i2 * i2 + k2 * k2 <= (k1 - 1) * (k1 - 1)) && !Block.opaqueCubeLookup[par1World.getBlockId(l1, i1, j2)])
+ Block block = Block.blocksList[par1World.getBlockId(l1, i1, j2)];
+
+ if ((i2 >= 0 || k2 >= 0 || i2 * i2 + k2 * k2 <= k1 * k1) &&
+ (i2 <= 0 && k2 <= 0 || i2 * i2 + k2 * k2 <= (k1 + 1) * (k1 + 1)) &&
+ (par6Random.nextInt(4) != 0 || i2 * i2 + k2 * k2 <= (k1 - 1) * (k1 - 1)) &&
+ (block == null || block.canBeReplacedByLeaves(par1World, l1, i1, j2)))
@@ -222,8 +232,9 @@
if ((i2 >= 0 || k2 >= 0 || i2 * i2 + k2 * k2 <= k1 * k1) && (i2 <= 0 && k2 <= 0 || i2 * i2 + k2 * k2 <= (k1 + 1) * (k1 + 1)) && (par6Random.nextInt(4) != 0 || i2 * i2 + k2 * k2 <= (k1 - 1) * (k1 - 1)))
{
this.setBlockAndMetadata(par1World, l1, i1, j2, Block.leaves.blockID, this.leavesMetadata);
}
@@ -227,4 +242,13 @@
int l2 = par1World.getBlockId(l1, i1, j2);
-
- if (l2 == 0 || l2 == Block.leaves.blockID)
+ Block block = Block.blocksList[l2];
+
+ if (block == null || block.canBeReplacedByLeaves(par1World, l1, i1, j2))
{
this.setBlockAndMetadata(par1World, l1, i1, j2, Block.leaves.blockID, this.leavesMetadata);
}
@@ -232,4 +243,13 @@
}
}
}

View File

@ -43,19 +43,19 @@
b0 = 3;
byte b1 = 0;
int i2;
@@ -110,7 +120,10 @@
{
int i3 = l2 - par5;
- if ((Math.abs(k2) != i2 || Math.abs(i3) != i2 || par2Random.nextInt(2) != 0 && k1 != 0) && par1World.isAirBlock(j2, j1, l2))
+ Block block = Block.blocksList[par1World.getBlockId(j2, j1, l2)];
+
+ if ((Math.abs(k2) != i2 || Math.abs(i3) != i2 || par2Random.nextInt(2) != 0 && k1 != 0) &&
+ (block == null || block.canBeReplacedByLeaves(par1World, j2, j1, l2)))
@@ -113,8 +123,9 @@
if (Math.abs(k2) != i2 || Math.abs(i3) != i2 || par2Random.nextInt(2) != 0 && k1 != 0)
{
this.setBlockAndMetadata(par1World, j2, j1, l2, Block.leaves.blockID, this.metaLeaves);
}
@@ -122,7 +135,9 @@
int j3 = par1World.getBlockId(j2, j1, l2);
-
- if (j3 == 0 || j3 == Block.leaves.blockID)
+ Block block = Block.blocksList[j3];
+
+ if (block == null || block.canBeReplacedByLeaves(par1World, j2, j1, l2))
{
this.setBlockAndMetadata(par1World, j2, j1, l2, Block.leaves.blockID, this.metaLeaves);
}
@@ -127,7 +138,9 @@
{
k1 = par1World.getBlockId(par3, par4 + j1, par5);
@ -66,7 +66,7 @@
{
this.setBlockAndMetadata(par1World, par3, par4 + j1, par5, Block.wood.blockID, this.metaWood);
@@ -162,7 +177,8 @@
@@ -167,7 +180,8 @@
{
for (k2 = par5 - i2; k2 <= par5 + i2; ++k2)
{