Update forge for MCP naming updates

Updated FML:
MinecraftForge/FML@d0c6e92900 Update MCP data
This commit is contained in:
Christian 2013-09-03 15:52:58 -04:00
parent 5c334d7627
commit 0d44234239
61 changed files with 359 additions and 380 deletions

View file

@ -84,7 +84,7 @@ public class ForgeHooksClient
}
boolean is3D = customRenderer.shouldUseRenderHelper(ENTITY, item, BLOCK_3D);
engine.func_110577_a(item.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c);
engine.bindTexture(item.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
Block block = (item.itemID < Block.blocksList.length ? Block.blocksList[item.itemID] : null);
if (is3D || (block != null && RenderBlocks.renderItemIn3d(block.getRenderType())))
{
@ -133,7 +133,7 @@ public class ForgeHooksClient
return false;
}
engine.func_110577_a(item.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c);
engine.bindTexture(item.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
if (customRenderer.shouldUseRenderHelper(INVENTORY, item, INVENTORY_BLOCK))
{
GL11.glPushMatrix();
@ -246,8 +246,8 @@ public class ForgeHooksClient
{
MinecraftForge.EVENT_BUS.post(new TextureStitchEvent.Post(map));
FluidRegistry.WATER.setIcons(BlockFluid.func_94424_b("water_still"), BlockFluid.func_94424_b("water_flow"));
FluidRegistry.LAVA.setIcons(BlockFluid.func_94424_b("lava_still"), BlockFluid.func_94424_b("lava_flow"));
FluidRegistry.WATER.setIcons(BlockFluid.getFluidIcon("water_still"), BlockFluid.getFluidIcon("water_flow"));
FluidRegistry.LAVA.setIcons(BlockFluid.getFluidIcon("lava_still"), BlockFluid.getFluidIcon("lava_flow"));
}
/**

View file

@ -93,7 +93,7 @@ public class GuiControlsScrollPanel extends GuiSlot
boolean flag = _mouseX >= xPosition && _mouseY >= yPosition && _mouseX < xPosition + width && _mouseY < yPosition + height;
int k = (flag ? 2 : 1);
mc.renderEngine.func_110577_a(WIDGITS);
mc.renderEngine.bindTexture(WIDGITS);
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

@ -94,7 +94,7 @@ public class GuiIngameForge extends GuiIngame
int height = res.getScaledHeight();
renderHealthMount = mc.thePlayer.ridingEntity instanceof EntityLivingBase;
renderFood = mc.thePlayer.ridingEntity == null;
renderJumpBar = mc.thePlayer.func_110317_t();
renderJumpBar = mc.thePlayer.isRidingHorse();
right_height = 39;
left_height = 39;
@ -189,7 +189,7 @@ public class GuiIngameForge extends GuiIngame
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.func_110577_a(WIDGITS);
mc.renderEngine.bindTexture(WIDGITS);
InventoryPlayer inv = mc.thePlayer.inventory;
drawTexturedModalRect(width / 2 - 91, height - 22, 0, 0, 182, 22);
@ -215,7 +215,7 @@ public class GuiIngameForge extends GuiIngame
protected void renderCrosshairs(int width, int height)
{
if (pre(CROSSHAIRS)) return;
bind(Gui.field_110324_m);
bind(Gui.icons);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR);
drawTexturedModalRect(width / 2 - 7, height / 2 - 7, 0, 0, 16, 16);
@ -325,7 +325,7 @@ public class GuiIngameForge extends GuiIngame
public void renderHealth(int width, int height)
{
bind(field_110324_m);
bind(icons);
if (pre(HEALTH)) return;
mc.mcProfiler.startSection("health");
@ -336,11 +336,11 @@ public class GuiIngameForge extends GuiIngame
highlight = false;
}
AttributeInstance attrMaxHealth = this.mc.thePlayer.func_110148_a(SharedMonsterAttributes.field_111267_a);
int health = MathHelper.ceiling_float_int(mc.thePlayer.func_110143_aJ());
AttributeInstance attrMaxHealth = this.mc.thePlayer.getEntityAttribute(SharedMonsterAttributes.maxHealth);
int health = MathHelper.ceiling_float_int(mc.thePlayer.getHealth());
int healthLast = MathHelper.ceiling_float_int(mc.thePlayer.prevHealth);
float healthMax = (float)attrMaxHealth.func_111126_e();
float absorb = this.mc.thePlayer.func_110139_bj();
float healthMax = (float)attrMaxHealth.getAttributeValue();
float absorb = this.mc.thePlayer.getAbsorptionAmount();
int healthRows = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F / 10.0F);
int rowHeight = Math.max(10 - (healthRows - 2), 3);
@ -484,7 +484,7 @@ public class GuiIngameForge extends GuiIngame
protected void renderExperience(int width, int height)
{
bind(field_110324_m);
bind(icons);
if (pre(EXPERIENCE)) return;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@ -533,12 +533,12 @@ public class GuiIngameForge extends GuiIngame
protected void renderJumpBar(int width, int height)
{
bind(field_110324_m);
bind(icons);
if (pre(JUMPBAR)) return;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.mcProfiler.startSection("jumpBar");
float charge = mc.thePlayer.func_110319_bJ();
float charge = mc.thePlayer.getHorseJumpPower();
final int barWidth = 182;
int x = (width / 2) - (barWidth / 2);
int filled = (int)(charge * (float)(barWidth + 1));
@ -790,7 +790,7 @@ public class GuiIngameForge extends GuiIngame
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.func_110434_K().func_110577_a(Gui.field_110324_m);
mc.getTextureManager().bindTexture(Gui.icons);
int pingIndex = 4;
int ping = player.responseTime;
if (ping < 0) pingIndex = 5;
@ -812,7 +812,7 @@ public class GuiIngameForge extends GuiIngame
Entity tmp = mc.thePlayer.ridingEntity;
if (!(tmp instanceof EntityLivingBase)) return;
bind(field_110324_m);
bind(icons);
if (pre(HEALTHMOUNT)) return;
@ -821,8 +821,8 @@ public class GuiIngameForge extends GuiIngame
mc.mcProfiler.endStartSection("mountHealth");
EntityLivingBase mount = (EntityLivingBase)tmp;
int health = (int)Math.ceil((double)mount.func_110143_aJ());
float healthMax = mount.func_110138_aP();
int health = (int)Math.ceil((double)mount.getHealth());
float healthMax = mount.getMaxHealth();
int hearts = (int)(healthMax + 0.5F) / 2;
if (hearts > 30) hearts = 30;
@ -866,6 +866,6 @@ public class GuiIngameForge extends GuiIngame
}
private void bind(ResourceLocation res)
{
mc.func_110434_K().func_110577_a(res);
mc.getTextureManager().bindTexture(res);
}
}

View file

@ -849,7 +849,7 @@ public class ForgeChunkManager
{
ticket.setCompoundTag("ModData", tick.modData);
}
if (tick.ticketType == Type.ENTITY && tick.entity != null && tick.entity.addEntityID(new NBTTagCompound()))
if (tick.ticketType == Type.ENTITY && tick.entity != null && tick.entity.writeToNBTOptional(new NBTTagCompound()))
{
ticket.setInteger("chunkX", MathHelper.floor_double(tick.entity.chunkCoordX));
ticket.setInteger("chunkZ", MathHelper.floor_double(tick.entity.chunkCoordZ));

View file

@ -203,11 +203,11 @@ public class LiquidStack
{
if (itemID == Block.waterStill.blockID)
{
return BlockFluid.func_94424_b("water");
return BlockFluid.getFluidIcon("water");
}
else if (itemID == Block.lavaStill.blockID)
{
return BlockFluid.func_94424_b("lava");
return BlockFluid.getFluidIcon("lava");
}
return renderingIcon;
}

View file

@ -19,7 +19,7 @@ import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.server.ForgeTimeTracker;
public class ForgeCommand extends CommandBase {
private MinecraftServer server;
public ForgeCommand(MinecraftServer server)
@ -27,7 +27,7 @@ public class ForgeCommand extends CommandBase {
this.server = server;
}
private static final DecimalFormat timeFormatter = new DecimalFormat("########0.000");
@Override
public String getCommandName()
{
@ -82,7 +82,7 @@ public class ForgeCommand extends CommandBase {
}
String type = args[1];
int duration = parseIntBounded(sender, args[2], 1, 60);
if ("te".equals(type))
{
doTurnOnTileEntityTracking(sender, duration);
@ -97,12 +97,12 @@ public class ForgeCommand extends CommandBase {
{
ForgeTimeTracker.tileEntityTrackingDuration = duration;
ForgeTimeTracker.tileEntityTracking = true;
sender.sendChatToPlayer(ChatMessageComponent.func_111082_b("commands.forge.tracking.te.enabled", duration));
sender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.forge.tracking.te.enabled", duration));
}
private void doTPSLog(ICommandSender sender, String[] args)
{
}
private void displayTPS(ICommandSender sender, String[] args)
@ -120,17 +120,17 @@ public class ForgeCommand extends CommandBase {
{
double worldTickTime = ForgeCommand.mean(this.server.worldTickTimes.get(dimId)) * 1.0E-6D;
double worldTPS = Math.min(1000.0/worldTickTime, 20);
sender.sendChatToPlayer(ChatMessageComponent.func_111082_b("commands.forge.tps.summary",String.format("Dim %d", dimId), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS)));
sender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.forge.tps.summary",String.format("Dim %d", dimId), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS)));
}
double meanTickTime = ForgeCommand.mean(this.server.tickTimeArray) * 1.0E-6D;
double meanTPS = Math.min(1000.0/meanTickTime, 20);
sender.sendChatToPlayer(ChatMessageComponent.func_111082_b("commands.forge.tps.summary","Overall", timeFormatter.format(meanTickTime), timeFormatter.format(meanTPS)));
sender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.forge.tps.summary","Overall", timeFormatter.format(meanTickTime), timeFormatter.format(meanTPS)));
}
else
{
double worldTickTime = ForgeCommand.mean(this.server.worldTickTimes.get(dim)) * 1.0E-6D;
double worldTPS = Math.min(1000.0/worldTickTime, 20);
sender.sendChatToPlayer(ChatMessageComponent.func_111082_b("commands.forge.tps.summary",String.format("Dim %d", dim), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS)));
sender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.forge.tps.summary",String.format("Dim %d", dim), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS)));
}
}
@ -141,7 +141,7 @@ public class ForgeCommand extends CommandBase {
{
sum+=v;
}
return sum / values.length;
}
}

2
fml

@ -1 +1 @@
Subproject commit 2a9c485edc4cf3382154d5b3b9b600386f2ab8ae
Subproject commit d0c6e92900590f578b80d9a6c00fa28fd333d3bf

View file

@ -86,9 +86,9 @@
}
@SideOnly(Side.CLIENT)
@@ -646,7 +666,13 @@
/**
* ejects contained items into the world, and notifies neighbours of an update, as appropriate
@@ -648,7 +668,13 @@
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
* metadata
*/
- public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {}
+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
@ -101,7 +101,7 @@
/**
* Returns the quantity of items to drop on block destruction.
@@ -671,7 +697,7 @@
@@ -673,7 +699,7 @@
public float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5)
{
float f = this.getBlockHardness(par2World, par3, par4, par5);
@ -110,7 +110,7 @@
}
/**
@@ -689,18 +715,13 @@
@@ -691,18 +717,13 @@
{
if (!par1World.isRemote)
{
@ -133,7 +133,7 @@
}
}
}
@@ -933,7 +954,8 @@
@@ -935,7 +956,8 @@
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
int l = par1World.getBlockId(par2, par3, par4);
@ -143,7 +143,7 @@
}
/**
@@ -1093,7 +1115,7 @@
@@ -1095,7 +1117,7 @@
par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
par2EntityPlayer.addExhaustion(0.025F);
@ -152,7 +152,7 @@
{
ItemStack itemstack = this.createStackedBlock(par6);
@@ -1109,12 +1131,13 @@
@@ -1111,12 +1133,13 @@
}
}
@ -167,7 +167,7 @@
}
/**
@@ -1454,4 +1477,979 @@
@@ -1457,4 +1480,979 @@
canBlockGrass[0] = true;
StatList.initBreakableStats();
}

View file

@ -23,8 +23,8 @@
}
@@ -182,4 +186,22 @@
this.cactusTopIcon = par1IconRegister.registerIcon(this.func_111023_E() + "_top");
this.cactusBottomIcon = par1IconRegister.registerIcon(this.func_111023_E() + "_bottom");
this.cactusTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top");
this.cactusBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_bottom");
}
+
+ @Override

View file

@ -9,7 +9,7 @@
public class BlockChest extends BlockContainer
{
private final Random random = new Random();
@@ -444,7 +446,7 @@
@@ -446,7 +448,7 @@
{
return null;
}
@ -18,7 +18,7 @@
{
return null;
}
@@ -452,19 +454,19 @@
@@ -454,19 +456,19 @@
{
return null;
}

View file

@ -38,7 +38,7 @@
@SideOnly(Side.CLIENT)
@@ -248,4 +258,10 @@
this.iconArray[i] = par1IconRegister.registerIcon(this.func_111023_E() + "_stage_" + i);
this.iconArray[i] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + i);
}
}
+

View file

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/block/BlockComparator.java
+++ ../src_work/minecraft/net/minecraft/block/BlockComparator.java
@@ -266,4 +266,17 @@
@@ -268,4 +268,17 @@
{
return new TileEntityComparator();
}

View file

@ -20,7 +20,7 @@
{
public static final String[] LEAF_TYPES = new String[] {"oak", "spruce", "birch", "jungle"};
public static final String[][] field_94396_b = new String[][] {{"leaves_oak", "leaves_spruce", "leaves_birch", "leaves_jungle"}, {"leaves_oak_opaque", "leaves_spruce_opaque", "leaves_birch_opaque", "leaves_jungle_opaque"}};
@@ -107,10 +111,9 @@
@@ -111,10 +115,9 @@
{
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
@ -33,7 +33,7 @@
}
}
}
@@ -156,11 +159,13 @@
@@ -160,11 +163,13 @@
{
k2 = par1World.getBlockId(par2 + l1, par3 + i2, par4 + j2);
@ -49,7 +49,7 @@
{
this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
}
@@ -325,15 +330,7 @@
@@ -329,15 +334,7 @@
*/
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
{
@ -66,7 +66,7 @@
}
/**
@@ -414,4 +411,30 @@
@@ -418,4 +415,30 @@
}
}
}

View file

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/block/BlockLog.java
+++ ../src_work/minecraft/net/minecraft/block/BlockLog.java
@@ -60,14 +60,9 @@
@@ -62,14 +62,9 @@
{
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
@ -17,8 +17,8 @@
}
}
}
@@ -125,4 +120,16 @@
this.tree_top[i] = par1IconRegister.registerIcon(this.func_111023_E() + "_" + woodType[i] + "_top");
@@ -135,4 +130,16 @@
this.tree_top[i] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[i] + "_top");
}
}
+

View file

@ -55,7 +55,7 @@
/**
@@ -142,4 +128,23 @@
this.iconArray[i] = par1IconRegister.registerIcon(this.func_111023_E() + "_stage_" + i);
this.iconArray[i] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + i);
}
}
+

View file

@ -26,7 +26,7 @@
}
/**
@@ -242,4 +243,107 @@
@@ -244,4 +245,107 @@
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, par5);
}
}

View file

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

View file

@ -21,16 +21,16 @@
* Called when the block is attempted to be harvested
*/
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer)
@@ -150,6 +147,8 @@
@@ -149,6 +146,8 @@
par5 |= 8;
par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 4);
}
+ dropBlockAsItem(par1World, par2, par3, par4, par5, 0);
+
+ dropBlockAsItem(par1World, par2, par3, par4, par5, 0);
super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer);
}
@@ -158,24 +157,30 @@
@@ -160,24 +159,30 @@
*/
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
{

View file

@ -138,7 +138,7 @@
- }
- else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot)
- {
- j = Item.field_111214_ch.itemID;
- j = Item.leash.itemID;
- }
- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame)
- {

View file

@ -21,7 +21,7 @@
- this.ticksBeforeMusic = this.rand.nextInt(12000);
+ this.ticksBeforeMusic = this.rand.nextInt(MUSIC_INTERVAL);
this.options = par2GameSettings;
this.field_130085_i = par3File;
this.fileAssets = par3File;
this.soundPoolSounds = new SoundPool(par1ResourceManager, "sound", true);
@@ -75,6 +81,7 @@
SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
@ -33,12 +33,12 @@
{
@@ -90,6 +97,7 @@
this.stopAllSounds();
this.closeMinecraft();
this.cleanup();
this.tryToSetLibraryAndCodecs();
+ MinecraftForge.EVENT_BUS.post(new SoundLoadEvent(this));
}
private void func_130083_h()
private void loadSounds()
@@ -236,10 +244,11 @@
else
{
@ -49,7 +49,7 @@
{
- this.ticksBeforeMusic = this.rand.nextInt(12000) + 12000;
+ this.ticksBeforeMusic = this.rand.nextInt(MUSIC_INTERVAL) + MUSIC_INTERVAL;
this.sndSystem.backgroundMusic("BgMusic", soundpoolentry.func_110457_b(), soundpoolentry.func_110458_a(), false);
this.sndSystem.backgroundMusic("BgMusic", soundpoolentry.getSoundUrl(), soundpoolentry.getSoundName(), false);
this.sndSystem.setVolume("BgMusic", this.options.musicVolume);
this.sndSystem.play("BgMusic");
@@ -307,6 +316,7 @@
@ -62,7 +62,7 @@
{
@@ -317,6 +327,7 @@
this.sndSystem.newStreamingSource(true, s1, soundpoolentry.func_110457_b(), soundpoolentry.func_110458_a(), false, par2, par3, par4, 2, 64.0F);
this.sndSystem.newStreamingSource(true, s1, soundpoolentry.getSoundUrl(), soundpoolentry.getSoundName(), false, par2, par3, par4, 2, 64.0F);
this.sndSystem.setVolume(s1, 0.5F * this.options.soundVolume);
+ MinecraftForge.EVENT_BUS.post(new PlayStreamingSourceEvent(this, s1, par2, par3, par4));
this.sndSystem.play(s1);

View file

@ -29,24 +29,22 @@
- this.buttonList.add(new GuiSmallButton(j, i + j % 2 * 160, this.height / 6 + 24 * (j >> 1), 70, 20, this.options.getOptionDisplayString(j)));
- }
-
- this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.func_135053_a("gui.done")));
- this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done")));
+ scrollPane = new GuiControlsScrollPanel(this, options, mc);
+ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height - 28, I18n.func_135053_a("gui.done")));
+ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height - 28, I18n.getString("gui.done")));
+ scrollPane.registerScrollButtons(7, 8);
this.screenTitle = I18n.func_135053_a("controls.title");
this.screenTitle = I18n.getString("controls.title");
}
@@ -58,20 +57,10 @@
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
@@ -59,19 +58,9 @@
*/
protected void actionPerformed(GuiButton par1GuiButton)
- {
{
- for (int i = 0; i < this.options.keyBindings.length; ++i)
- {
- ((GuiButton)this.buttonList.get(i)).displayString = this.options.getOptionDisplayString(i);
- }
-
+ {
if (par1GuiButton.id == 200)
{
this.mc.displayGuiScreen(this.parentScreen);

View file

@ -4,7 +4,7 @@
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
Tessellator tessellator = Tessellator.instance;
- this.mc.func_110434_K().func_110577_a(Gui.field_110325_k);
- this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- float f1 = 32.0F;
- tessellator.startDrawingQuads();
@ -25,7 +25,7 @@
+
+ protected void drawContainerBackground(Tessellator tess)
+ {
+ this.mc.func_110434_K().func_110577_a(Gui.field_110325_k);
+ this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ float height = 32.0F;
+ tess.startDrawingQuads();

View file

@ -48,7 +48,7 @@
@@ -76,6 +93,7 @@
{
this.buttonList.clear();
this.buttonList.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.func_135053_a("gui.done")));
this.buttonList.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.getString("gui.done")));
+ this.buttonList.add(button = new GuiSmallButton(2, (width - achievementsPaneWidth) / 2 + 24, height / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage)));
}
@ -59,7 +59,7 @@
this.mc.setIngameFocus();
+ }
+
+ if (par1GuiButton.id == 2)
+ if (par1GuiButton.id == 2)
+ {
+ currentPage++;
+ if (currentPage >= AchievementPage.getAchievementPages().size())

View file

@ -12,7 +12,7 @@
}
}
+ //Forge: Force lighting to be disabled as there are some issue where lighting would
+ //Forge: Force lighting to be disabled as there are some issue where lighting would
+ //incorrectly be applied based on items that are in the inventory.
+ GL11.glDisable(GL11.GL_LIGHTING);
this.drawGuiContainerForegroundLayer(par1, par2);
@ -24,13 +24,13 @@
GL11.glTranslatef(0.0F, 0.0F, 32.0F);
this.zLevel = 200.0F;
itemRenderer.zLevel = 200.0F;
- itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.func_110434_K(), par1ItemStack, par2, par3);
- itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.func_110434_K(), par1ItemStack, par2, par3 - (this.draggedStack == null ? 0 : 8), par4Str);
- itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), par1ItemStack, par2, par3);
- itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), par1ItemStack, par2, par3 - (this.draggedStack == null ? 0 : 8), par4Str);
+ FontRenderer font = null;
+ if (par1ItemStack != null) font = par1ItemStack.getItem().getFontRenderer(par1ItemStack);
+ if (font == null) font = fontRenderer;
+ itemRenderer.renderItemAndEffectIntoGUI(font, this.mc.func_110434_K(), par1ItemStack, par2, par3);
+ itemRenderer.renderItemOverlayIntoGUI(font, this.mc.func_110434_K(), par1ItemStack, par2, par3 - (this.draggedStack == null ? 0 : 8), par4Str);
+ itemRenderer.renderItemAndEffectIntoGUI(font, this.mc.getTextureManager(), par1ItemStack, par2, par3);
+ itemRenderer.renderItemOverlayIntoGUI(font, this.mc.getTextureManager(), par1ItemStack, par2, par3 - (this.draggedStack == null ? 0 : 8), par4Str);
this.zLevel = 0.0F;
itemRenderer.zLevel = 0.0F;
}

View file

@ -78,7 +78,7 @@
- if (creativetabs.drawInForegroundOfTab())
+ if (creativetabs != null && creativetabs.drawInForegroundOfTab())
{
this.fontRenderer.drawString(I18n.func_135053_a(creativetabs.getTranslatedTabLabel()), 8, 6, 4210752);
this.fontRenderer.drawString(I18n.getString(creativetabs.getTranslatedTabLabel()), 8, 6, 4210752);
}
@@ -462,7 +485,7 @@
{
@ -148,7 +148,7 @@
+
if (this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, par1, par2))
{
this.drawCreativeTabHoveringText(I18n.func_135053_a("inventory.binSlot"), par1, par2);
this.drawCreativeTabHoveringText(I18n.getString("inventory.binSlot"), par1, par2);
+ }
+
+ if (maxPages != 0)
@ -176,7 +176,7 @@
+ for (l = start; l < k; ++l)
{
CreativeTabs creativetabs1 = acreativetabs[l];
this.mc.func_110434_K().func_110577_a(field_110424_t);
this.mc.getTextureManager().bindTexture(field_110424_t);
- if (creativetabs1.getTabIndex() != selectedTabIndex)
+ if (creativetabs1 != null && creativetabs1.getTabIndex() != selectedTabIndex)
@ -189,12 +189,12 @@
+ {
+ if (creativetabs != CreativeTabs.tabAllSearch)
+ {
+ this.mc.func_110434_K().func_110577_a(field_110424_t);
+ this.mc.getTextureManager().bindTexture(field_110424_t);
+ renderCreativeTab(CreativeTabs.tabAllSearch);
+ }
+ if (creativetabs != CreativeTabs.tabInventory)
+ {
+ this.mc.func_110434_K().func_110577_a(field_110424_t);
+ this.mc.getTextureManager().bindTexture(field_110424_t);
+ renderCreativeTab(CreativeTabs.tabInventory);
}
}
@ -244,8 +244,8 @@
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- ItemStack itemstack = new ItemStack(par1CreativeTabs.getTabIconItem());
+ ItemStack itemstack = par1CreativeTabs.getIconItemStack();
itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.func_110434_K(), itemstack, l, i1);
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.func_110434_K(), itemstack, l, i1);
itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), itemstack, l, i1);
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), itemstack, l, i1);
GL11.glDisable(GL11.GL_LIGHTING);
@@ -912,6 +998,15 @@
{

View file

@ -25,18 +25,18 @@
public void handleChat(Packet3Chat par1Packet3Chat)
{
par1Packet3Chat = FMLNetworkHandler.handleChatMessage(this, par1Packet3Chat);
- this.mc.ingameGUI.getChatGUI().printChatMessage(ChatMessageComponent.func_111078_c(par1Packet3Chat.message).func_111068_a(true));
- this.mc.ingameGUI.getChatGUI().printChatMessage(ChatMessageComponent.createFromJson(par1Packet3Chat.message).toStringWithFormatting(true));
+ ClientChatReceivedEvent event = new ClientChatReceivedEvent(par1Packet3Chat.message);
+ if (!MinecraftForge.EVENT_BUS.post(event) && event.message != null)
+ {
+ this.mc.ingameGUI.getChatGUI().printChatMessage(ChatMessageComponent.func_111078_c(event.message).func_111068_a(true));
+ this.mc.ingameGUI.getChatGUI().printChatMessage(ChatMessageComponent.createFromJson(event.message).toStringWithFormatting(true));
+ }
}
public void handleAnimation(Packet18Animation par1Packet18Animation)
@@ -1354,6 +1363,10 @@
{
tileentity.readFromNBT(par1Packet132TileEntityData.customParam1);
tileentity.readFromNBT(par1Packet132TileEntityData.data);
}
+ else
+ {

View file

@ -15,8 +15,8 @@
+ {
super(par1World, par2, par4, par6, par8, par10, par12);
this.blockInstance = par14Block;
- this.func_110125_a(par14Block.getIcon(0, par15));
+ this.func_110125_a(par14Block.getIcon(side, par15));
- this.setParticleIcon(par14Block.getIcon(0, par15));
+ this.setParticleIcon(par14Block.getIcon(side, par15));
this.particleGravity = par14Block.blockParticleGravity;
this.particleRed = this.particleGreen = this.particleBlue = 0.6F;
this.particleScale /= 2.0F;

View file

@ -24,7 +24,7 @@
public class ItemRenderer
{
@@ -54,15 +63,32 @@
this.mapItemRenderer = new MapItemRenderer(par1Minecraft.gameSettings, par1Minecraft.func_110434_K());
this.mapItemRenderer = new MapItemRenderer(par1Minecraft.gameSettings, par1Minecraft.getTextureManager());
}
+ public void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3)
@ -39,7 +39,7 @@
+ public void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3, ItemRenderType type)
{
GL11.glPushMatrix();
TextureManager texturemanager = this.mc.func_110434_K();
TextureManager texturemanager = this.mc.getTextureManager();
- if (par2ItemStack.getItemSpriteNumber() == 0 && par2ItemStack.itemID < Block.blocksList.length && Block.blocksList[par2ItemStack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
+ Block block = null;
@ -51,16 +51,16 @@
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, type);
+ if (customRenderer != null)
+ {
+ texturemanager.func_110577_a(texturemanager.func_130087_a(par2ItemStack.getItemSpriteNumber()));
+ texturemanager.bindTexture(texturemanager.getResourceLocation(par2ItemStack.getItemSpriteNumber()));
+ ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksInstance, par1EntityLivingBase, par2ItemStack);
+ }
+ else if (block != null && par2ItemStack.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
{
texturemanager.func_110577_a(texturemanager.func_130087_a(0));
texturemanager.bindTexture(texturemanager.getResourceLocation(0));
this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
@@ -94,7 +120,7 @@
GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
renderItemIn2D(tessellator, f1, f2, f, f3, icon.getOriginX(), icon.getOriginY(), 0.0625F);
renderItemIn2D(tessellator, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
- if (par2ItemStack.hasEffect() && par3 == 0)
+ if (par2ItemStack.hasEffect(par3))
@ -84,7 +84,7 @@
-
- if (mapdata != null)
- {
- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.func_110434_K(), mapdata);
- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), mapdata);
+
+ IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP);
+ MapData mapdata = ((ItemMap)itemstack.getItem()).getMapData(itemstack, this.mc.theWorld);
@ -93,12 +93,12 @@
+ {
+ if (mapdata != null)
+ {
+ this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.func_110434_K(), mapdata);
+ this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), mapdata);
+ }
+ }
+ else
+ {
+ custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.func_110434_K(), mapdata);
+ custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.getTextureManager(), mapdata);
}
GL11.glPopMatrix();

View file

@ -24,40 +24,26 @@
--this.renderEntitiesStartupCounter;
}
else
@@ -456,26 +464,33 @@
@@ -456,6 +464,8 @@
this.theWorld.theProfiler.startSection("prepare");
TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.mc.func_110434_K(), this.mc.fontRenderer, this.mc.renderViewEntity, par3);
RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.func_110434_K(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntityLiving, this.mc.gameSettings, par3);
- this.countEntitiesTotal = 0;
- this.countEntitiesRendered = 0;
- this.countEntitiesHidden = 0;
- EntityLivingBase entitylivingbase = this.mc.renderViewEntity;
- RenderManager.renderPosX = entitylivingbase.lastTickPosX + (entitylivingbase.posX - entitylivingbase.lastTickPosX) * (double)par3;
- RenderManager.renderPosY = entitylivingbase.lastTickPosY + (entitylivingbase.posY - entitylivingbase.lastTickPosY) * (double)par3;
- RenderManager.renderPosZ = entitylivingbase.lastTickPosZ + (entitylivingbase.posZ - entitylivingbase.lastTickPosZ) * (double)par3;
- TileEntityRenderer.staticPlayerX = entitylivingbase.lastTickPosX + (entitylivingbase.posX - entitylivingbase.lastTickPosX) * (double)par3;
- TileEntityRenderer.staticPlayerY = entitylivingbase.lastTickPosY + (entitylivingbase.posY - entitylivingbase.lastTickPosY) * (double)par3;
- TileEntityRenderer.staticPlayerZ = entitylivingbase.lastTickPosZ + (entitylivingbase.posZ - entitylivingbase.lastTickPosZ) * (double)par3;
+ if (pass == 0)
TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, par3);
RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntityLiving, this.mc.gameSettings, par3);
+ if (pass == 0) // no indentation to shrink patch
+ {
+ this.countEntitiesTotal = 0;
+ this.countEntitiesRendered = 0;
+ this.countEntitiesHidden = 0;
+ EntityLivingBase entitylivingbase = this.mc.renderViewEntity;
+ RenderManager.renderPosX = entitylivingbase.lastTickPosX + (entitylivingbase.posX - entitylivingbase.lastTickPosX) * (double)par3;
+ RenderManager.renderPosY = entitylivingbase.lastTickPosY + (entitylivingbase.posY - entitylivingbase.lastTickPosY) * (double)par3;
+ RenderManager.renderPosZ = entitylivingbase.lastTickPosZ + (entitylivingbase.posZ - entitylivingbase.lastTickPosZ) * (double)par3;
+ TileEntityRenderer.staticPlayerX = entitylivingbase.lastTickPosX + (entitylivingbase.posX - entitylivingbase.lastTickPosX) * (double)par3;
+ TileEntityRenderer.staticPlayerY = entitylivingbase.lastTickPosY + (entitylivingbase.posY - entitylivingbase.lastTickPosY) * (double)par3;
+ TileEntityRenderer.staticPlayerZ = entitylivingbase.lastTickPosZ + (entitylivingbase.posZ - entitylivingbase.lastTickPosZ) * (double)par3;
this.countEntitiesTotal = 0;
this.countEntitiesRendered = 0;
this.countEntitiesHidden = 0;
@@ -466,16 +476,21 @@
TileEntityRenderer.staticPlayerX = entitylivingbase.lastTickPosX + (entitylivingbase.posX - entitylivingbase.lastTickPosX) * (double)par3;
TileEntityRenderer.staticPlayerY = entitylivingbase.lastTickPosY + (entitylivingbase.posY - entitylivingbase.lastTickPosY) * (double)par3;
TileEntityRenderer.staticPlayerZ = entitylivingbase.lastTickPosZ + (entitylivingbase.posZ - entitylivingbase.lastTickPosZ) * (double)par3;
+ }
this.mc.entityRenderer.enableLightmap((double)par3);
this.theWorld.theProfiler.endStartSection("global");
List list = this.theWorld.getLoadedEntityList();
- this.countEntitiesTotal = list.size();
+ if (pass == 0)
+ if (pass == 0) // no indentation for smaller patch size
+ {
+ this.countEntitiesTotal = list.size();
this.countEntitiesTotal = list.size();
+ }
int i;
Entity entity;

View file

@ -68,8 +68,8 @@
if (item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
- this.func_110776_a(func_110857_a(itemarmor, par2));
+ this.func_110776_a(getArmorResource(par1EntityLiving, itemstack, par2, null));
- this.bindTexture(func_110857_a(itemarmor, par2));
+ this.bindTexture(getArmorResource(par1EntityLiving, itemstack, par2, null));
ModelBiped modelbiped = par2 == 2 ? this.field_82425_h : this.field_82423_g;
modelbiped.bipedHead.showModel = par2 == 0;
modelbiped.bipedHeadwear.showModel = par2 == 0;
@ -98,8 +98,8 @@
if (item instanceof ItemArmor)
{
- this.func_110776_a(func_110858_a((ItemArmor)item, par2, "overlay"));
+ this.func_110776_a(getArmorResource(par1EntityLiving, itemstack, par2, "overlay"));
- this.bindTexture(func_110858_a((ItemArmor)item, par2, "overlay"));
+ this.bindTexture(getArmorResource(par1EntityLiving, itemstack, par2, "overlay"));
float f1 = 1.0F;
GL11.glColor3f(f1, f1, f1);
}

View file

@ -156,11 +156,11 @@
+
+ if (itemstack.getItemSpriteNumber() == 0)
{
this.func_110776_a(TextureMap.field_110575_b);
this.bindTexture(TextureMap.locationBlocksTexture);
}
@@ -277,7 +266,7 @@
GL11.glColor4f(par5, par6, par7, 1.0F);
ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, ((Icon)par2Icon).getOriginX(), ((Icon)par2Icon).getOriginY(), f12);
ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, ((Icon)par2Icon).getIconWidth(), ((Icon)par2Icon).getIconHeight(), f12);
- if (itemstack.hasEffect())
+ if (itemstack.hasEffect(pass))
@ -186,7 +186,7 @@
+ Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null);
+ if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType()))
{
par2TextureManager.func_110577_a(TextureMap.field_110575_b);
par2TextureManager.bindTexture(TextureMap.locationBlocksTexture);
- Block block = Block.blocksList[k];
GL11.glPushMatrix();
GL11.glTranslatef((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel);
@ -195,7 +195,7 @@
else if (Item.itemsList[k].requiresMultipleRenderPasses())
{
GL11.glDisable(GL11.GL_LIGHTING);
- par2TextureManager.func_110577_a(TextureMap.field_110576_c);
- par2TextureManager.bindTexture(TextureMap.locationItemsTexture);
-
- for (int j1 = 0; j1 <= 1; ++j1)
- {
@ -203,7 +203,7 @@
+
+ for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1)
+ {
+ par2TextureManager.func_110577_a(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c);
+ par2TextureManager.bindTexture(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
+ Icon icon = Item.itemsList[k].getIcon(par3ItemStack, j1);
int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1);
f1 = (float)(k1 >> 16 & 255) / 255.0F;
@ -220,7 +220,7 @@
}
GL11.glEnable(GL11.GL_LIGHTING);
@@ -429,10 +427,33 @@
@@ -429,11 +427,34 @@
this.renderIcon(par4, par5, (Icon)object, 16, 16);
GL11.glEnable(GL11.GL_LIGHTING);
@ -233,13 +233,13 @@
GL11.glEnable(GL11.GL_CULL_FACE);
}
+
+ private void renderEffect(TextureManager manager, int x, int y)
+ {
+ GL11.glDepthFunc(GL11.GL_GREATER);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDepthMask(false);
+ manager.func_110577_a(field_110798_h);
+ manager.bindTexture(RES_ITEM_GLINT);
+ this.zLevel -= 50.0F;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
@ -251,9 +251,10 @@
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glDepthFunc(GL11.GL_LEQUAL);
+ }
+
/**
* Render the item's icon or block into the GUI, including the glint effect.
*/
@@ -441,8 +462,12 @@
{
if (par3ItemStack != null)
@ -277,7 +278,7 @@
}
}
@@ -583,4 +609,47 @@
@@ -586,4 +612,47 @@
{
this.doRenderItem((EntityItem)par1Entity, par2, par4, par6, par8, par9);
}

View file

@ -41,8 +41,8 @@
if (item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
- this.func_110776_a(RenderBiped.func_110857_a(itemarmor, par2));
+ this.func_110776_a(RenderBiped.getArmorResource(par1AbstractClientPlayer, itemstack, par2, null));
- this.bindTexture(RenderBiped.func_110857_a(itemarmor, par2));
+ this.bindTexture(RenderBiped.getArmorResource(par1AbstractClientPlayer, itemstack, par2, null));
ModelBiped modelbiped = par2 == 2 ? this.modelArmor : this.modelArmorChestplate;
modelbiped.bipedHead.showModel = par2 == 0;
modelbiped.bipedHeadwear.showModel = par2 == 0;
@ -71,8 +71,8 @@
if (item instanceof ItemArmor)
{
- this.func_110776_a(RenderBiped.func_110858_a((ItemArmor)item, par2, "overlay"));
+ this.func_110776_a(RenderBiped.getArmorResource(par1AbstractClientPlayer, itemstack, par2, "overlay"));
- this.bindTexture(RenderBiped.func_110858_a((ItemArmor)item, par2, "overlay"));
+ this.bindTexture(RenderBiped.getArmorResource(par1AbstractClientPlayer, itemstack, par2, "overlay"));
float f1 = 1.0F;
GL11.glColor3f(f1, f1, f1);
}
@ -128,7 +128,7 @@
f2 = 0.625F;
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
@@ -226,6 +255,7 @@
boolean flag = par1AbstractClientPlayer.func_110310_o().func_110557_a();
boolean flag = par1AbstractClientPlayer.getTextureCape().isTextureUploaded();
boolean flag1 = !par1AbstractClientPlayer.isInvisible();
boolean flag2 = !par1AbstractClientPlayer.getHideCape();
+ flag = event.renderCape && flag;

View file

@ -22,7 +22,7 @@
this.mainModel = par1ModelBase;
@@ -68,6 +74,7 @@
public void func_130000_a(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9)
public void doRenderLiving(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9)
{
+ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Pre(par1EntityLivingBase, this))) return;
GL11.glPushMatrix();

View file

@ -12,10 +12,11 @@
@SideOnly(Side.CLIENT)
public class TextureAtlasSprite implements Icon
@@ -184,6 +186,20 @@
this.field_130224_d = par1;
@@ -297,4 +299,18 @@
{
return "TextureAtlasSprite{name=\'" + this.iconName + '\'' + ", frameCount=" + this.framesTextureData.size() + ", rotated=" + this.rotated + ", x=" + this.originX + ", y=" + this.originY + ", height=" + this.height + ", width=" + this.width + ", u0=" + this.minU + ", u1=" + this.maxU + ", v0=" + this.minV + ", v1=" + this.maxV + '}';
}
+
+ /**
+ * Load the specified resource as this sprite's data.
+ * Returning false from this function will prevent this icon from being stitched onto the master texture.
@ -26,10 +27,7 @@
+ */
+ public boolean load(ResourceManager manager, ResourceLocation location) throws IOException
+ {
+ func_130100_a(manager.func_110536_a(location));
+ loadSprite(manager.getResource(location));
+ return true;
+ }
+
public void func_130100_a(Resource par1Resource) throws IOException
{
this.func_130102_n();
}

View file

@ -10,23 +10,23 @@
public class TextureMap extends AbstractTexture implements TickableTextureObject, IconRegister
@@ -58,10 +59,13 @@
public void func_110571_b(ResourceManager par1ResourceManager)
public void loadTextureAtlas(ResourceManager par1ResourceManager)
{
+ func_110573_f(); //Re-gather list of Icons, allows for addition/removal of blocks/items after this map was inital constrcuted.
+ registerIcons(); //Re-gather list of Icons, allows for addition/removal of blocks/items after this map was initially constructed.
+
int i = Minecraft.getGLMaximumTextureSize();
Stitcher stitcher = new Stitcher(i, i, true);
this.mapTexturesStiched.clear();
this.listTextureStiched.clear();
this.mapUploadedSprites.clear();
this.listAnimatedSprites.clear();
+ ForgeHooksClient.onTextureStitchedPre(this);
Iterator iterator = this.field_110574_e.entrySet().iterator();
Iterator iterator = this.mapRegisteredSprites.entrySet().iterator();
while (iterator.hasNext())
@@ -73,7 +77,7 @@
try
{
- textureatlassprite.func_130100_a(par1ResourceManager.func_110536_a(resourcelocation1));
- textureatlassprite.loadSprite(par1ResourceManager.getResource(resourcelocation1));
+ if (!textureatlassprite.load(par1ResourceManager, resourcelocation1)) continue;
}
catch (RuntimeException runtimeexception)
@ -38,7 +38,7 @@
+ ForgeHooksClient.onTextureStitchedPost(this);
}
private void func_110573_f()
private void registerIcons()
@@ -212,6 +217,7 @@
if (par1Str == null)
{
@ -46,7 +46,7 @@
+ par1Str = "null"; //Don't allow things to actually register null..
}
Object object = (TextureAtlasSprite)this.field_110574_e.get(par1Str);
Object object = (TextureAtlasSprite)this.mapRegisteredSprites.get(par1Str);
@@ -253,4 +259,37 @@
{
this.updateAnimations();
@ -64,7 +64,7 @@
+ */
+ public TextureAtlasSprite getTextureExtry(String name)
+ {
+ return (TextureAtlasSprite)field_110574_e.get(name);
+ return (TextureAtlasSprite)mapRegisteredSprites.get(name);
+ }
+
+ /**
@ -77,9 +77,9 @@
+ */
+ public boolean setTextureEntry(String name, TextureAtlasSprite entry)
+ {
+ if (!field_110574_e.containsKey(name))
+ if (!mapRegisteredSprites.containsKey(name))
+ {
+ field_110574_e.put(name, entry);
+ mapRegisteredSprites.put(name, entry);
+ return true;
+ }
+ return false;

View file

@ -105,7 +105,7 @@
}
else
{
@@ -1523,6 +1564,21 @@
@@ -1529,6 +1570,21 @@
par1NBTTagCompound.setInteger("PortalCooldown", this.timeUntilPortal);
par1NBTTagCompound.setLong("UUIDMost", this.entityUniqueID.getMostSignificantBits());
par1NBTTagCompound.setLong("UUIDLeast", this.entityUniqueID.getLeastSignificantBits());
@ -127,7 +127,7 @@
this.writeEntityToNBT(par1NBTTagCompound);
if (this.ridingEntity != null)
@@ -1593,6 +1649,26 @@
@@ -1599,6 +1655,26 @@
this.setPosition(this.posX, this.posY, this.posZ);
this.setRotation(this.rotationYaw, this.rotationPitch);
@ -153,8 +153,8 @@
+ }
this.readEntityFromNBT(par1NBTTagCompound);
if (this.func_142008_O())
@@ -1705,7 +1781,14 @@
if (this.shouldSetPosAfterLoading())
@@ -1711,7 +1787,14 @@
{
EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack);
entityitem.delayBeforeCanPickup = 10;
@ -170,7 +170,7 @@
return entityitem;
}
}
@@ -2001,7 +2084,7 @@
@@ -2010,7 +2093,7 @@
*/
public boolean isRiding()
{
@ -179,16 +179,16 @@
}
/**
@@ -2363,7 +2446,7 @@
public float func_82146_a(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block)
@@ -2385,7 +2468,7 @@
*/
public float getBlockExplosionResistance(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block)
{
- return par6Block.getExplosionResistance(this);
+ return par6Block.getExplosionResistance(this, par2World, par3, par4, par5, posX, posY + (double)getEyeHeight(), posZ);
}
public boolean func_96091_a(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7)
@@ -2426,4 +2509,170 @@
public boolean shouldExplodeBlock(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7)
@@ -2451,4 +2534,170 @@
{
return this.getEntityName();
}
@ -251,7 +251,7 @@
+ }
+ else if (this instanceof EntityLeashKnot)
+ {
+ return new ItemStack(Item.field_111214_ch);
+ return new ItemStack(Item.leash);
+ }
+ else
+ {
@ -348,7 +348,7 @@
+ {
+ return false;
+ }
+
+
+ /**
+ * If the rider should be dismounted from the entity when the entity goes under water
+ *

View file

@ -20,7 +20,7 @@
public abstract class EntityLivingBase extends Entity
{
@@ -299,7 +302,7 @@
@@ -305,7 +308,7 @@
this.extinguish();
@ -29,15 +29,15 @@
{
this.mountEntity((Entity)null);
}
@@ -446,6 +449,7 @@
@@ -452,6 +455,7 @@
{
this.entityLivingToAttack = par1EntityLivingBase;
this.revengeTimer = this.ticksExisted;
+ ForgeHooks.onLivingSetAttackTarget(this, par1EntityLivingBase);
}
public EntityLivingBase func_110144_aD()
@@ -744,8 +748,6 @@
public EntityLivingBase getLastAttacker()
@@ -750,8 +754,6 @@
return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD;
}
@ -46,7 +46,7 @@
/**
* Remove the speified potion effect from this entity.
*/
@@ -826,6 +828,7 @@
@@ -832,6 +834,7 @@
*/
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
{
@ -54,7 +54,7 @@
if (this.isEntityInvulnerable())
{
return false;
@@ -976,6 +979,7 @@
@@ -982,6 +985,7 @@
*/
public void onDeath(DamageSource par1DamageSource)
{
@ -62,7 +62,7 @@
Entity entity = par1DamageSource.getEntity();
EntityLivingBase entitylivingbase = this.func_94060_bK();
@@ -1000,6 +1004,10 @@
@@ -1006,6 +1010,10 @@
i = EnchantmentHelper.getLootingModifier((EntityLivingBase)entity);
}
@ -73,7 +73,7 @@
if (!this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot"))
{
this.dropFewItems(this.recentlyHit > 0, i);
@@ -1007,12 +1015,22 @@
@@ -1013,12 +1021,22 @@
if (this.recentlyHit > 0)
{
@ -97,7 +97,7 @@
}
}
}
@@ -1082,7 +1100,7 @@
@@ -1088,7 +1106,7 @@
int j = MathHelper.floor_double(this.boundingBox.minY);
int k = MathHelper.floor_double(this.posZ);
int l = this.worldObj.getBlockId(i, j, k);
@ -106,7 +106,7 @@
}
/**
@@ -1098,6 +1116,8 @@
@@ -1104,6 +1122,8 @@
*/
protected void fall(float par1)
{
@ -115,7 +115,7 @@
super.fall(par1);
PotionEffect potioneffect = this.getActivePotionEffect(Potion.jump);
float f1 = potioneffect != null ? (float)(potioneffect.getAmplifier() + 1) : 0.0F;
@@ -1231,6 +1251,8 @@
@@ -1237,6 +1257,8 @@
{
if (!this.isEntityInvulnerable())
{
@ -124,7 +124,7 @@
par2 = this.applyArmorCalculations(par1DamageSource, par2);
par2 = this.applyPotionDamageCalculations(par1DamageSource, par2);
float f1 = par2;
@@ -1292,6 +1314,17 @@
@@ -1298,6 +1320,17 @@
*/
public void swingItem()
{
@ -139,10 +139,10 @@
+ }
+ }
+
if (!this.isSwingInProgress || this.field_110158_av >= this.getArmSwingAnimationEnd() / 2 || this.field_110158_av < 0)
if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0)
{
this.field_110158_av = -1;
@@ -1526,6 +1559,7 @@
this.swingProgressInt = -1;
@@ -1535,6 +1568,7 @@
}
this.isAirBorne = true;
@ -150,7 +150,7 @@
}
/**
@@ -1730,6 +1764,11 @@
@@ -1739,6 +1773,11 @@
*/
public void onUpdate()
{
@ -162,9 +162,9 @@
super.onUpdate();
if (!this.worldObj.isRemote)
@@ -2265,4 +2304,42 @@
@@ -2277,4 +2316,42 @@
{
return this.getTeam() != null ? this.getTeam().func_142054_a(par1Team) : false;
return this.getTeam() != null ? this.getTeam().isSameTeam(par1Team) : false;
}
+
+ /***

View file

@ -8,16 +8,16 @@
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
@@ -22,6 +23,8 @@
@@ -28,6 +29,8 @@
PathEntity entityPathEntity;
Class classTarget;
private int field_75445_i;
+
+
+ private int failedPathFindingPenalty;
public EntityAIAttackOnCollide(EntityCreature par1EntityCreature, Class par2Class, double par3, boolean par5)
{
@@ -59,8 +62,16 @@
@@ -65,8 +68,16 @@
}
else
{
@ -36,13 +36,13 @@
}
}
@@ -100,8 +111,24 @@
@@ -106,8 +117,24 @@
if ((this.field_75437_f || this.attacker.getEntitySenses().canSee(entitylivingbase)) && --this.field_75445_i <= 0)
if ((this.longMemory || this.attacker.getEntitySenses().canSee(entitylivingbase)) && --this.field_75445_i <= 0)
{
- this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7);
+ this.field_75445_i = failedPathFindingPenalty + 4 + this.attacker.getRNG().nextInt(7);
this.attacker.getNavigator().tryMoveToEntityLiving(entitylivingbase, this.field_75440_e);
this.attacker.getNavigator().tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget);
+ if (this.attacker.getNavigator().getPath() != null)
+ {
+ PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint();

View file

@ -9,9 +9,9 @@
public abstract class EntityMinecartContainer extends EntityMinecart implements IInventory
{
@@ -280,6 +282,10 @@
public boolean func_130002_c(EntityPlayer par1EntityPlayer)
@@ -283,6 +285,10 @@
*/
public boolean interactFirst(EntityPlayer par1EntityPlayer)
{
+ if(MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, par1EntityPlayer)))
+ {

View file

@ -9,9 +9,9 @@
public class EntityMinecartEmpty extends EntityMinecart
{
@@ -17,6 +19,10 @@
public boolean func_130002_c(EntityPlayer par1EntityPlayer)
@@ -20,6 +22,10 @@
*/
public boolean interactFirst(EntityPlayer par1EntityPlayer)
{
+ if(MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, par1EntityPlayer)))
+ {

View file

@ -9,9 +9,9 @@
public class EntityMinecartFurnace extends EntityMinecart
{
@@ -123,6 +125,10 @@
public boolean func_130002_c(EntityPlayer par1EntityPlayer)
@@ -126,6 +128,10 @@
*/
public boolean interactFirst(EntityPlayer par1EntityPlayer)
{
+ if(MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, par1EntityPlayer)))
+ {

View file

@ -9,9 +9,9 @@
public class EntityMinecartHopper extends EntityMinecartContainer implements Hopper
{
@@ -51,6 +53,10 @@
public boolean func_130002_c(EntityPlayer par1EntityPlayer)
@@ -54,6 +56,10 @@
*/
public boolean interactFirst(EntityPlayer par1EntityPlayer)
{
+ if(MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, par1EntityPlayer)))
+ {

View file

@ -9,7 +9,7 @@
public class EntityEnderman extends EntityMob
{
@@ -291,12 +293,17 @@
@@ -295,12 +297,17 @@
*/
protected boolean teleportTo(double par1, double par3, double par5)
{
@ -30,7 +30,7 @@
boolean flag = false;
int i = MathHelper.floor_double(this.posX);
int j = MathHelper.floor_double(this.posY);
@@ -473,7 +480,7 @@
@@ -477,7 +484,7 @@
}
}

View file

@ -13,7 +13,7 @@
{
public EntityMooshroom(World par1World)
{
@@ -38,31 +42,7 @@
@@ -38,28 +42,6 @@
}
}
@ -26,7 +26,7 @@
- {
- EntityCow entitycow = new EntityCow(this.worldObj);
- entitycow.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
- entitycow.setEntityHealth(this.func_110143_aJ());
- entitycow.setHealth(this.getHealth());
- entitycow.renderYawOffset = this.renderYawOffset;
- this.worldObj.spawnEntityInWorld(entitycow);
-
@ -39,14 +39,10 @@
- return true;
- }
- else
- {
- return super.interact(par1EntityPlayer);
- }
+ return super.interact(par1EntityPlayer);
}
public EntityMooshroom func_94900_c(EntityAgeable par1EntityAgeable)
@@ -82,4 +62,29 @@
{
return super.interact(par1EntityPlayer);
}
@@ -82,4 +64,29 @@
{
return this.func_94900_c(par1EntityAgeable);
}
@ -63,7 +59,7 @@
+ setDead();
+ EntityCow entitycow = new EntityCow(worldObj);
+ entitycow.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
+ entitycow.setEntityHealth(func_110143_aJ());
+ entitycow.setHealth(this.getHealth());
+ entitycow.renderYawOffset = renderYawOffset;
+ worldObj.spawnEntityInWorld(entitycow);
+ worldObj.spawnParticle("largeexplode", posX, posY + (double)(height / 2.0F), posZ, 0.0D, 0.0D, 0.0D);

View file

@ -253,7 +253,7 @@
if (this.isEntityInvulnerable())
{
return false;
@@ -1088,12 +1178,15 @@
@@ -1092,12 +1182,15 @@
{
if (!this.isEntityInvulnerable())
{
@ -269,8 +269,8 @@
+ if (par2 <= 0) return;
par2 = this.applyPotionDamageCalculations(par1DamageSource, par2);
float f1 = par2;
par2 = Math.max(par2 - this.func_110139_bj(), 0.0F);
@@ -1143,6 +1236,7 @@
par2 = Math.max(par2 - this.getAbsorptionAmount(), 0.0F);
@@ -1147,6 +1240,7 @@
public boolean interactWith(Entity par1Entity)
{
@ -278,7 +278,7 @@
ItemStack itemstack = this.getCurrentEquippedItem();
ItemStack itemstack1 = itemstack != null ? itemstack.copy() : null;
@@ -1199,7 +1293,9 @@
@@ -1203,7 +1297,9 @@
*/
public void destroyCurrentEquippedItem()
{
@ -288,7 +288,7 @@
}
/**
@@ -1216,6 +1312,15 @@
@@ -1220,6 +1316,15 @@
*/
public void attackTargetEntityWithCurrentItem(Entity par1Entity)
{
@ -303,8 +303,8 @@
+ }
if (par1Entity.canAttackWithItem())
{
if (!par1Entity.func_85031_j(this))
@@ -1369,6 +1474,12 @@
if (!par1Entity.hitByEntity(this))
@@ -1373,6 +1478,12 @@
*/
public EnumStatus sleepInBedAt(int par1, int par2, int par3)
{
@ -317,7 +317,7 @@
if (!this.worldObj.isRemote)
{
if (this.isPlayerSleeping() || !this.isEntityAlive())
@@ -1413,6 +1524,11 @@
@@ -1417,6 +1528,11 @@
{
int l = this.worldObj.getBlockMetadata(par1, par2, par3);
int i1 = BlockBed.getDirection(l);
@ -329,7 +329,7 @@
float f = 0.5F;
float f1 = 0.5F;
@@ -1483,10 +1599,12 @@
@@ -1487,10 +1603,12 @@
ChunkCoordinates chunkcoordinates = this.playerLocation;
ChunkCoordinates chunkcoordinates1 = this.playerLocation;
@ -346,7 +346,7 @@
if (chunkcoordinates1 == null)
{
@@ -1523,7 +1641,9 @@
@@ -1527,7 +1645,9 @@
*/
private boolean isInBed()
{
@ -357,7 +357,7 @@
}
/**
@@ -1538,9 +1658,12 @@
@@ -1542,9 +1662,12 @@
ichunkprovider.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
ichunkprovider.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
@ -373,7 +373,7 @@
return chunkcoordinates1;
}
else
@@ -1562,10 +1685,13 @@
@@ -1566,10 +1689,13 @@
{
if (this.playerLocation != null)
{
@ -391,7 +391,7 @@
{
case 0:
return 90.0F;
@@ -1631,14 +1757,40 @@
@@ -1635,14 +1761,40 @@
/**
* Returns the location of the bed the player will respawn at, or null if the player has not slept in a bed.
*/
@ -436,7 +436,7 @@
}
/**
@@ -1646,6 +1798,10 @@
@@ -1650,6 +1802,10 @@
*/
public void setSpawnChunk(ChunkCoordinates par1ChunkCoordinates, boolean par2)
{
@ -447,7 +447,7 @@
if (par1ChunkCoordinates != null)
{
this.spawnChunk = new ChunkCoordinates(par1ChunkCoordinates);
@@ -1657,7 +1813,32 @@
@@ -1661,7 +1817,32 @@
this.spawnForced = false;
}
}
@ -481,7 +481,7 @@
/**
* Will trigger the specified trigger.
*/
@@ -1839,6 +2020,10 @@
@@ -1843,6 +2024,10 @@
super.fall(par1);
}
@ -492,7 +492,7 @@
}
/**
@@ -1880,7 +2065,7 @@
@@ -1884,7 +2069,7 @@
{
if (par1ItemStack.getItem().requiresMultipleRenderPasses())
{
@ -501,7 +501,7 @@
}
if (this.itemInUse != null && par1ItemStack.itemID == Item.bow.itemID)
@@ -1902,6 +2087,7 @@
@@ -1906,6 +2091,7 @@
return Item.bow.getItemIconForUseDuration(0);
}
}
@ -509,7 +509,7 @@
}
return icon;
@@ -2123,7 +2309,17 @@
@@ -2127,7 +2313,17 @@
this.setScore(par1EntityPlayer.getScore());
}
@ -527,7 +527,7 @@
}
/**
@@ -2187,7 +2383,14 @@
@@ -2191,7 +2387,14 @@
*/
public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack)
{

View file

@ -78,4 +78,4 @@
+ }
}
Collection collection = this.worldObj.getScoreboard().func_96520_a(ScoreObjectiveCriteria.field_96642_c);
Collection collection = this.worldObj.getScoreboard().func_96520_a(ScoreObjectiveCriteria.deathCount);

View file

@ -47,7 +47,7 @@
+ @SideOnly(Side.CLIENT)
+ public ResourceLocation getBackgroundIconTexture()
+ {
+ return (texture == null ? TextureMap.field_110576_c : texture);
+ return (texture == null ? TextureMap.locationItemsTexture : texture);
+ }
+
+ /**

View file

@ -29,9 +29,9 @@
public class Item
{
@@ -248,13 +255,16 @@
protected Icon itemIcon;
protected String field_111218_cA;
@@ -250,13 +257,16 @@
/** The string associated with this Item's Icon. */
protected String iconString;
+ /** FORGE: To disable repair recipes. */
+ protected boolean canRepair = true;
@ -47,7 +47,7 @@
}
itemsList[256 + par1] = this;
@@ -600,6 +610,7 @@
@@ -606,6 +616,7 @@
}
@SideOnly(Side.CLIENT)
@ -55,7 +55,7 @@
public boolean hasEffect(ItemStack par1ItemStack)
{
return par1ItemStack.isItemEnchanted();
@@ -639,6 +650,10 @@
@@ -645,6 +656,10 @@
float f7 = f4 * f5;
float f8 = f3 * f5;
double d3 = 5.0D;
@ -66,7 +66,7 @@
Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3);
return par1World.rayTraceBlocks_do_do(vec3, vec31, par3, !par3);
}
@@ -740,4 +755,534 @@
@@ -753,4 +768,534 @@
{
StatList.initStats();
}

View file

@ -85,4 +85,4 @@
+ }
}
public boolean func_111207_a(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase)
/**

View file

@ -39,9 +39,9 @@
{
return par2Block.blockID != Block.web.blockID && par2Block.blockID != Block.leaves.blockID ? (par2Block.blockID == Block.cloth.blockID ? 5.0F : super.getStrVsBlock(par1ItemStack, par2Block)) : 15.0F;
}
+
+
+ @Override
+ public boolean func_111207_a(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity)
+ public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity)
+ {
+ if (entity.worldObj.isRemote)
+ {
@ -69,9 +69,9 @@
+ }
+ return false;
+ }
+
+
+ @Override
+ public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player)
+ public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player)
+ {
+ if (player.worldObj.isRemote)
+ {

View file

@ -8,8 +8,8 @@
public class ItemTool extends Item
{
@@ -111,4 +112,15 @@
multimap.put(SharedMonsterAttributes.field_111264_e.func_111108_a(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.damageVsEntity, 0));
@@ -114,4 +115,15 @@
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.damageVsEntity, 0));
return multimap;
}
+

View file

@ -120,17 +120,17 @@
}
else
{
- if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && !this.mcServer.func_96290_a(worldserver, i, j, k, this.playerEntity))
- if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && !this.mcServer.isBlockProtected(worldserver, i, j, k, this.playerEntity))
+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1;
+ dist *= dist;
+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && !this.mcServer.func_96290_a(worldserver, i, j, k, this.playerEntity))
+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && !this.mcServer.isBlockProtected(worldserver, i, j, k, this.playerEntity))
{
this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, par1Packet15Place.getXOffset(), par1Packet15Place.getYOffset(), par1Packet15Place.getZOffset());
}
@@ -691,6 +729,8 @@
}
ChatMessageComponent chatmessagecomponent = ChatMessageComponent.func_111082_b("chat.type.text", new Object[] {this.playerEntity.getTranslatedEntityName(), s});
ChatMessageComponent chatmessagecomponent = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.text", new Object[] {this.playerEntity.getTranslatedEntityName(), s});
+ chatmessagecomponent = ForgeHooks.onServerChatEvent(this, s, chatmessagecomponent);
+ if (chatmessagecomponent == null) return;
this.mcServer.getConfigurationManager().func_110459_a(chatmessagecomponent, false);

View file

@ -18,7 +18,7 @@
public class PlayerInstance
{
@@ -60,6 +64,8 @@
@@ -66,6 +70,8 @@
this.playersInChunk.remove(par1EntityPlayerMP);
par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation);
@ -27,16 +27,16 @@
if (this.playersInChunk.isEmpty())
{
long i = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32;
@@ -97,7 +103,7 @@
@@ -109,7 +115,7 @@
this.field_73260_f |= 1 << (par2 >> 4);
this.flagsYAreasToUpdate |= 1 << (par2 >> 4);
- if (this.numberOfTilesToUpdate < 64)
+ //if (this.numberOfTilesToUpdate < 64) //Forge; Cache everything, so always run
{
short short1 = (short)(par1 << 12 | par3 << 8 | par2);
@@ -109,6 +115,10 @@
@@ -121,6 +127,10 @@
}
}
@ -47,7 +47,7 @@
this.locationOfBlockChange[this.numberOfTilesToUpdate++] = short1;
}
}
@@ -150,12 +160,13 @@
@@ -162,12 +172,13 @@
{
int l;
@ -56,13 +56,13 @@
{
i = this.chunkLocation.chunkXPos * 16;
j = this.chunkLocation.chunkZPos * 16;
this.sendToAllPlayersWatchingChunk(new Packet51MapChunk(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.field_73260_f));
this.sendToAllPlayersWatchingChunk(new Packet51MapChunk(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.flagsYAreasToUpdate));
+ /* Forge: Grabs 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)
@@ -169,11 +180,14 @@
if ((this.flagsYAreasToUpdate & 1 << k) != 0)
@@ -181,11 +192,14 @@
}
}
}

View file

@ -12,7 +12,7 @@
import net.minecraft.world.World;
public class TileEntity
@@ -311,4 +314,94 @@
@@ -309,4 +312,94 @@
addMapping(TileEntityHopper.class, "Hopper");
addMapping(TileEntityComparator.class, "Comparator");
}

View file

@ -4,8 +4,8 @@
if (k1 > 0)
{
Block block = Block.blocksList[k1];
- float f3 = this.exploder != null ? this.exploder.func_82146_a(this, this.worldObj, l, i1, j1, block) : block.getExplosionResistance(this.exploder);
+ float f3 = this.exploder != null ? this.exploder.func_82146_a(this, this.worldObj, l, i1, j1, block) : block.getExplosionResistance(this.exploder, worldObj, l, i1, j1, explosionX, explosionY, explosionZ);
- float f3 = this.exploder != null ? this.exploder.getBlockExplosionResistance(this, this.worldObj, l, i1, j1, block) : block.getExplosionResistance(this.exploder);
+ float f3 = this.exploder != null ? this.exploder.getBlockExplosionResistance(this, this.worldObj, l, i1, j1, block) : block.getExplosionResistance(this.exploder, worldObj, l, i1, j1, explosionX, explosionY, explosionZ);
f1 -= (f3 + 0.3F) * f2;
}

View file

@ -43,12 +43,12 @@
{
++j2;
par1WorldServer.spawnEntityInWorld(entityliving);
- entitylivingdata = entityliving.func_110161_a(entitylivingdata);
- entitylivingdata = entityliving.onSpawnWithEgg(entitylivingdata);
-
- if (j2 >= entityliving.getMaxSpawnedInChunk())
+ if (!ForgeEventFactory.doSpecialSpawn(entityliving, par1WorldServer, f, f1, f2))
+ {
+ entitylivingdata = entityliving.func_110161_a(entitylivingdata);
+ entitylivingdata = entityliving.onSpawnWithEgg(entitylivingdata);
+ }
+
+ if (j2 >= ForgeEventFactory.getMaxSpawnPackSize(entityliving))

View file

@ -59,7 +59,7 @@
- this.mapStorage = new MapStorage(par1ISaveHandler);
+ perWorldStorage = new MapStorage((ISaveHandler)null);
this.worldLogAgent = par6ILogAgent;
+
+
+ }
+
+ // Broken up so that the WorldClient gets the chance to set the mapstorage object before the dimension initializes
@ -223,7 +223,7 @@
{
float f1 = this.getCelestialAngle(par2);
float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
@@ -1830,6 +1915,12 @@
@@ -1833,6 +1918,12 @@
@SideOnly(Side.CLIENT)
public Vec3 getCloudColour(float par1)
{
@ -236,7 +236,7 @@
float f1 = this.getCelestialAngle(par1);
float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
@@ -1901,6 +1992,8 @@
@@ -1904,6 +1995,8 @@
public int getTopSolidOrLiquidBlock(int par1, int par2)
{
Chunk chunk = this.getChunkFromBlockCoords(par1, par2);
@ -245,7 +245,7 @@
int k = chunk.getTopFilledSegment() + 15;
par1 &= 15;
@@ -1908,7 +2001,7 @@
@@ -1911,7 +2004,7 @@
{
int l = chunk.getBlockID(par1, k, par2);
@ -254,7 +254,7 @@
{
return k + 1;
}
@@ -1923,6 +2016,12 @@
@@ -1926,6 +2019,12 @@
* How bright are stars in the sky
*/
public float getStarBrightness(float par1)
@ -267,8 +267,8 @@
{
float f1 = this.getCelestialAngle(par1);
float f2 = 1.0F - (MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.25F);
@@ -1987,7 +2086,15 @@
entity.func_85029_a(crashreportcategory);
@@ -1990,7 +2089,15 @@
entity.addEntityCrashInfo(crashreportcategory);
}
- throw new ReportedException(crashreport);
@ -284,10 +284,10 @@
}
if (entity.isDead)
@@ -2049,7 +2156,16 @@
@@ -2052,7 +2159,16 @@
crashreport = CrashReport.makeCrashReport(throwable1, "Ticking entity");
crashreportcategory = crashreport.makeCategory("Entity being ticked");
entity.func_85029_a(crashreportcategory);
entity.addEntityCrashInfo(crashreportcategory);
- throw new ReportedException(crashreport);
+
+ if (ForgeDummyContainer.removeErroringEntities)
@ -302,7 +302,7 @@
}
}
@@ -2092,7 +2208,16 @@
@@ -2095,7 +2211,16 @@
crashreport = CrashReport.makeCrashReport(throwable2, "Ticking tile entity");
crashreportcategory = crashreport.makeCategory("Tile entity being ticked");
tileentity.func_85027_a(crashreportcategory);
@ -320,7 +320,7 @@
}
}
@@ -2106,7 +2231,7 @@
@@ -2109,7 +2234,7 @@
if (chunk != null)
{
@ -329,7 +329,7 @@
}
}
}
@@ -2115,6 +2240,10 @@
@@ -2118,6 +2243,10 @@
if (!this.entityRemoval.isEmpty())
{
@ -340,7 +340,7 @@
this.loadedTileEntityList.removeAll(this.entityRemoval);
this.entityRemoval.clear();
}
@@ -2135,18 +2264,18 @@
@@ -2138,18 +2267,18 @@
{
this.loadedTileEntityList.add(tileentity1);
}
@ -363,7 +363,7 @@
}
}
@@ -2159,13 +2288,13 @@
@@ -2162,13 +2291,13 @@
public void addTileEntity(Collection par1Collection)
{
@ -384,7 +384,7 @@
}
}
@@ -2185,9 +2314,17 @@
@@ -2188,9 +2317,17 @@
{
int i = MathHelper.floor_double(par1Entity.posX);
int j = MathHelper.floor_double(par1Entity.posZ);
@ -405,7 +405,7 @@
{
par1Entity.lastTickPosX = par1Entity.posX;
par1Entity.lastTickPosY = par1Entity.posY;
@@ -2421,6 +2558,14 @@
@@ -2424,6 +2561,14 @@
{
return true;
}
@ -420,7 +420,7 @@
}
}
}
@@ -2743,15 +2888,16 @@
@@ -2746,15 +2891,16 @@
*/
public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity)
{
@ -446,7 +446,7 @@
while (iterator.hasNext())
{
TileEntity tileentity1 = (TileEntity)iterator.next();
@@ -2762,20 +2908,21 @@
@@ -2765,20 +2911,21 @@
iterator.remove();
}
}
@ -479,7 +479,7 @@
}
/**
@@ -2783,28 +2930,13 @@
@@ -2786,28 +2933,13 @@
*/
public void removeBlockTileEntity(int par1, int par2, int par3)
{
@ -515,7 +515,7 @@
}
/**
@@ -2829,7 +2961,8 @@
@@ -2832,7 +2964,8 @@
*/
public boolean isBlockNormalCube(int par1, int par2, int par3)
{
@ -525,7 +525,7 @@
}
public boolean isBlockFullCube(int par1, int par2, int par3)
@@ -2852,16 +2985,17 @@
@@ -2855,16 +2988,17 @@
*/
public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3)
{
@ -545,7 +545,7 @@
return par1Block == null ? false : (par1Block.blockMaterial.isOpaque() && par1Block.renderAsNormalBlock() ? true : (par1Block instanceof BlockStairs ? (par2 & 4) == 4 : (par1Block instanceof BlockHalfSlab ? (par2 & 8) == 8 : (par1Block instanceof BlockHopper ? true : (par1Block instanceof BlockSnow ? (par2 & 7) == 7 : false)))));
}
@@ -2878,7 +3012,7 @@
@@ -2881,7 +3015,7 @@
if (chunk != null && !chunk.isEmpty())
{
Block block = Block.blocksList[this.getBlockId(par1, par2, par3)];
@ -554,7 +554,7 @@
}
else
{
@@ -2909,8 +3043,7 @@
@@ -2912,8 +3046,7 @@
*/
public void setAllowedSpawnTypes(boolean par1, boolean par2)
{
@ -564,7 +564,7 @@
}
/**
@@ -2926,6 +3059,11 @@
@@ -2929,6 +3062,11 @@
*/
private void calculateInitialWeather()
{
@ -576,7 +576,7 @@
if (this.worldInfo.isRaining())
{
this.rainingStrength = 1.0F;
@@ -2941,6 +3079,11 @@
@@ -2944,6 +3082,11 @@
* Updates all weather states.
*/
protected void updateWeather()
@ -588,7 +588,7 @@
{
if (!this.provider.hasNoSky)
{
@@ -3038,12 +3181,14 @@
@@ -3041,12 +3184,14 @@
public void toggleRain()
{
@ -604,7 +604,7 @@
this.theProfiler.startSection("buildList");
int i;
EntityPlayer entityplayer;
@@ -3150,6 +3295,11 @@
@@ -3153,6 +3298,11 @@
*/
public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4)
{
@ -616,7 +616,7 @@
BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3);
float f = biomegenbase.getFloatTemperature();
@@ -3208,6 +3358,11 @@
@@ -3211,6 +3361,11 @@
*/
public boolean canSnowAt(int par1, int par2, int par3)
{
@ -628,7 +628,7 @@
BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3);
float f = biomegenbase.getFloatTemperature();
@@ -3251,10 +3406,12 @@
@@ -3254,10 +3409,12 @@
else
{
int l = this.getBlockId(par1, par2, par3);
@ -645,7 +645,7 @@
{
j1 = 1;
}
@@ -3350,7 +3507,9 @@
@@ -3353,7 +3510,9 @@
int j4 = i2 + Facing.offsetsXForSide[i4];
int k4 = j2 + Facing.offsetsYForSide[i4];
int l4 = k2 + Facing.offsetsZForSide[i4];
@ -656,7 +656,7 @@
i3 = this.getSavedLightValue(par1EnumSkyBlock, j4, k4, l4);
if (i3 == l2 - i5 && i1 < this.lightUpdateBlockList.length)
@@ -3453,10 +3612,10 @@
@@ -3456,10 +3615,10 @@
public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{
ArrayList arraylist = new ArrayList();
@ -671,7 +671,7 @@
for (int i1 = i; i1 <= j; ++i1)
{
@@ -3482,10 +3641,10 @@
@@ -3485,10 +3644,10 @@
public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{
@ -686,7 +686,7 @@
ArrayList arraylist = new ArrayList();
for (int i1 = i; i1 <= j; ++i1)
@@ -3578,11 +3737,14 @@
@@ -3582,11 +3741,14 @@
*/
public void addLoadedEntities(List par1List)
{
@ -704,7 +704,7 @@
}
}
@@ -3616,6 +3778,11 @@
@@ -3620,6 +3782,11 @@
else
{
if (block != null && (block == Block.waterMoving || block == Block.waterStill || block == Block.lavaMoving || block == Block.lavaStill || block == Block.fire || block.blockMaterial.isReplaceable()))
@ -716,7 +716,7 @@
{
block = null;
}
@@ -3910,7 +4077,7 @@
@@ -3914,7 +4081,7 @@
*/
public long getSeed()
{
@ -725,7 +725,7 @@
}
public long getTotalWorldTime()
@@ -3920,7 +4087,7 @@
@@ -3924,7 +4091,7 @@
public long getWorldTime()
{
@ -734,7 +734,7 @@
}
/**
@@ -3928,7 +4095,7 @@
@@ -3932,7 +4099,7 @@
*/
public void setWorldTime(long par1)
{
@ -743,7 +743,7 @@
}
/**
@@ -3936,13 +4103,13 @@
@@ -3940,13 +4107,13 @@
*/
public ChunkCoordinates getSpawnPoint()
{
@ -759,7 +759,7 @@
}
@SideOnly(Side.CLIENT)
@@ -3966,7 +4133,10 @@
@@ -3970,7 +4137,10 @@
if (!this.loadedEntityList.contains(par1Entity))
{
@ -771,7 +771,7 @@
}
}
@@ -3974,6 +4144,11 @@
@@ -3978,6 +4148,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)
@ -783,7 +783,7 @@
{
return true;
}
@@ -4094,8 +4269,7 @@
@@ -4098,8 +4273,7 @@
*/
public boolean isBlockHighHumidity(int par1, int par2, int par3)
{
@ -793,7 +793,7 @@
}
/**
@@ -4170,7 +4344,7 @@
@@ -4174,7 +4348,7 @@
*/
public int getHeight()
{
@ -802,7 +802,7 @@
}
/**
@@ -4178,7 +4352,7 @@
@@ -4182,7 +4356,7 @@
*/
public int getActualHeight()
{
@ -810,8 +810,8 @@
+ return provider.getActualHeight();
}
public IUpdatePlayerListBox func_82735_a(EntityMinecart par1EntityMinecart)
@@ -4221,7 +4395,7 @@
public IUpdatePlayerListBox getMinecartSoundUpdater(EntityMinecart par1EntityMinecart)
@@ -4225,7 +4399,7 @@
*/
public double getHorizon()
{
@ -820,7 +820,7 @@
}
/**
@@ -4290,30 +4464,28 @@
@@ -4294,30 +4468,28 @@
public void func_96440_m(int par1, int par2, int par3, int par4)
{
@ -850,11 +850,11 @@
+ int k1 = par3 + dir.offsetZ;
+ int l1 = getBlockId(j1, y, k1);
+ Block block = Block.blocksList[l1];
+
+
+ if(block != null)
+ {
+ block.onNeighborTileChange(this, j1, y, k1, par1, par2, par3);
+
+
+ if(Block.isNormalCube(l1))
+ {
+ j1 += dir.offsetX;
@ -872,7 +872,7 @@
}
}
}
@@ -4349,4 +4521,115 @@
@@ -4363,4 +4535,115 @@
return MathHelper.clamp_float(f, 0.0F, flag ? 1.5F : 1.0F);
}

View file

@ -29,7 +29,7 @@
public class WorldServer extends World
{
@@ -89,6 +99,10 @@
@@ -93,6 +103,10 @@
/** An IntHashMap of entity IDs (integers) to their Entity objects. */
private IntHashMap entityIdMap;
@ -40,7 +40,7 @@
public WorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler, ILogAgent par7ILogAgent)
{
super(par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4), par6Profiler, par7ILogAgent);
@@ -121,8 +135,12 @@
@@ -125,8 +139,12 @@
this.mapStorage.setData("scoreboard", scoreboardsavedata);
}
@ -54,10 +54,10 @@
}
/**
@@ -184,6 +202,10 @@
@@ -188,6 +206,10 @@
this.villageSiegeObj.tick();
this.theProfiler.endStartSection("portalForcer");
this.field_85177_Q.removeStalePortalLocations(this.getTotalWorldTime());
this.worldTeleporter.removeStalePortalLocations(this.getTotalWorldTime());
+ for (Teleporter tele : customTeleporters)
+ {
+ tele.removeStalePortalLocations(getTotalWorldTime());
@ -65,7 +65,7 @@
this.theProfiler.endSection();
this.sendAndApplyBlockEvents();
}
@@ -194,6 +216,7 @@
@@ -198,6 +220,7 @@
public SpawnListEntry spawnRandomCreature(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4)
{
List list = this.getChunkProvider().getPossibleCreatures(par1EnumCreatureType, par2, par3, par4);
@ -73,7 +73,7 @@
return list != null && !list.isEmpty() ? (SpawnListEntry)WeightedRandom.getRandomItem(this.rand, list) : null;
}
@@ -237,10 +260,7 @@
@@ -241,10 +264,7 @@
private void resetRainAndThunder()
{
@ -85,7 +85,7 @@
}
public boolean areAllPlayersAsleep()
@@ -311,6 +331,14 @@
@@ -315,6 +335,14 @@
int i = 0;
int j = 0;
Iterator iterator = this.activeChunkSet.iterator();
@ -100,7 +100,7 @@
while (iterator.hasNext())
{
@@ -321,14 +349,18 @@
@@ -325,14 +353,18 @@
Chunk chunk = this.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos);
this.moodSoundAndLightCheck(k, l, chunk);
this.theProfiler.endStartSection("tickChunk");
@ -121,7 +121,7 @@
{
this.updateLCG = this.updateLCG * 3 + 1013904223;
i1 = this.updateLCG >> 2;
@@ -345,7 +377,7 @@
@@ -349,7 +381,7 @@
this.theProfiler.endStartSection("iceandsnow");
int i2;
@ -130,7 +130,7 @@
{
this.updateLCG = this.updateLCG * 3 + 1013904223;
i1 = this.updateLCG >> 2;
@@ -433,6 +465,9 @@
@@ -437,6 +469,9 @@
public void scheduleBlockUpdateWithPriority(int par1, int par2, int par3, int par4, int par5, int par6)
{
NextTickListEntry nextticklistentry = new NextTickListEntry(par1, par2, par3, par4);
@ -140,7 +140,7 @@
byte b0 = 0;
if (this.scheduledUpdatesAreImmediate && par4 > 0)
@@ -498,7 +533,7 @@
@@ -502,7 +537,7 @@
*/
public void updateEntities()
{
@ -149,7 +149,7 @@
{
if (this.updateEntityTick++ >= 1200)
{
@@ -564,6 +599,9 @@
@@ -568,6 +603,9 @@
{
nextticklistentry = (NextTickListEntry)iterator.next();
iterator.remove();
@ -159,7 +159,7 @@
byte b0 = 0;
if (this.checkChunksExist(nextticklistentry.xCoord - b0, nextticklistentry.yCoord - b0, nextticklistentry.zCoord - b0, nextticklistentry.xCoord + b0, nextticklistentry.yCoord + b0, nextticklistentry.zCoord + b0))
@@ -696,16 +734,28 @@
@@ -700,16 +738,28 @@
{
ArrayList arraylist = new ArrayList();
@ -198,7 +198,7 @@
return arraylist;
}
@@ -713,6 +763,11 @@
@@ -717,6 +767,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)
@ -208,9 +208,9 @@
+
+ public boolean canMineBlockBody(EntityPlayer par1EntityPlayer, int par2, int par3, int par4)
{
return !this.mcServer.func_96290_a(this, par2, par3, par4, par1EntityPlayer);
return !this.mcServer.isBlockProtected(this, par2, par3, par4, par1EntityPlayer);
}
@@ -797,7 +852,7 @@
@@ -801,7 +856,7 @@
*/
protected void createBonusChest()
{
@ -219,7 +219,7 @@
for (int i = 0; i < 10; ++i)
{
@@ -840,6 +895,7 @@
@@ -844,6 +899,7 @@
}
this.chunkProvider.saveChunks(par1, par2IProgressUpdate);
@ -227,7 +227,7 @@
}
}
@@ -859,6 +915,7 @@
@@ -866,6 +922,7 @@
this.checkSessionLock();
this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData());
this.mapStorage.saveAllData();
@ -235,9 +235,9 @@
}
protected void onEntityAdded(Entity par1Entity)
@@ -1066,4 +1123,9 @@
@@ -1073,4 +1130,9 @@
{
return this.field_85177_Q;
return this.worldTeleporter;
}
+
+ public File getChunkSaveLocation()

View file

@ -11,7 +11,7 @@
public class Chunk
{
/**
@@ -138,7 +142,9 @@
@@ -140,7 +144,9 @@
{
for (int j1 = 0; j1 < k; ++j1)
{
@ -22,7 +22,7 @@
if (b0 != 0)
{
@@ -157,6 +163,90 @@
@@ -159,6 +165,90 @@
}
/**
@ -113,7 +113,7 @@
* Checks whether the chunk is at the X/Z location specified
*/
public boolean isAtLocation(int par1, int par2)
@@ -220,7 +310,7 @@
@@ -222,7 +312,7 @@
{
int i1 = this.getBlockID(j, l - 1, k);
@ -122,7 +122,7 @@
{
--l;
continue;
@@ -526,7 +616,10 @@
@@ -528,7 +618,10 @@
public int getBlockLightOpacity(int par1, int par2, int par3)
{
@ -134,7 +134,7 @@
}
/**
@@ -613,9 +706,13 @@
@@ -615,9 +708,13 @@
{
Block.blocksList[l1].breakBlock(this.worldObj, j2, par2, k2, l1, i2);
}
@ -151,7 +151,7 @@
}
}
@@ -633,7 +730,7 @@
@@ -635,7 +732,7 @@
}
else
{
@ -160,7 +160,7 @@
{
if (par2 >= k1)
{
@@ -657,29 +754,21 @@
@@ -659,29 +756,21 @@
Block.blocksList[par4].onBlockAdded(this.worldObj, j2, par2, k2);
}
@ -193,7 +193,7 @@
}
}
@@ -714,7 +803,7 @@
@@ -716,7 +805,7 @@
extendedblockstorage.setExtBlockMetadata(par1, par2 & 15, par3, par4);
int j1 = extendedblockstorage.getExtBlockID(par1, par2 & 15, par3);
@ -202,7 +202,7 @@
{
TileEntity tileentity = this.getChunkBlockTileEntity(par1, par2, par3);
@@ -827,6 +916,7 @@
@@ -829,6 +918,7 @@
k = this.entityLists.length - 1;
}
@ -210,7 +210,7 @@
par1Entity.addedToChunk = true;
par1Entity.chunkCoordX = this.xPosition;
par1Entity.chunkCoordY = k;
@@ -876,33 +966,32 @@
@@ -878,33 +968,32 @@
ChunkPosition chunkposition = new ChunkPosition(par1, par2, par3);
TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(chunkposition);
@ -255,7 +255,7 @@
}
/**
@@ -917,7 +1006,7 @@
@@ -919,7 +1008,7 @@
if (this.isChunkLoaded)
{
@ -264,7 +264,7 @@
}
}
@@ -932,7 +1021,8 @@
@@ -934,7 +1023,8 @@
par4TileEntity.yCoord = par2;
par4TileEntity.zCoord = this.zPosition * 16 + par3;
@ -274,7 +274,7 @@
{
if (this.chunkTileEntityMap.containsKey(chunkposition))
{
@@ -982,6 +1072,7 @@
@@ -984,6 +1074,7 @@
this.worldObj.addLoadedEntities(this.entityLists[i]);
}
@ -282,7 +282,7 @@
}
/**
@@ -1002,6 +1093,7 @@
@@ -1004,6 +1095,7 @@
{
this.worldObj.unloadEntities(this.entityLists[i]);
}
@ -290,7 +290,7 @@
}
/**
@@ -1018,8 +1110,8 @@
@@ -1020,8 +1112,8 @@
*/
public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector)
{
@ -301,7 +301,7 @@
if (i < 0)
{
@@ -1068,8 +1160,8 @@
@@ -1070,8 +1162,8 @@
*/
public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector)
{
@ -312,7 +312,7 @@
if (i < 0)
{
@@ -1252,6 +1344,15 @@
@@ -1254,6 +1346,15 @@
*/
public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4)
{
@ -328,7 +328,7 @@
int k = 0;
boolean flag1 = !this.worldObj.provider.hasNoSky;
int l;
@@ -1352,12 +1453,26 @@
@@ -1354,12 +1455,26 @@
}
this.generateHeightMap();
@ -359,7 +359,7 @@
}
}
@@ -1466,4 +1581,18 @@
@@ -1468,4 +1583,18 @@
}
}
}

View file

@ -32,7 +32,7 @@
if (chunk == null)
{
@@ -303,6 +310,11 @@
@@ -307,6 +314,11 @@
{
if (!this.worldObj.canNotSave)
{
@ -44,7 +44,7 @@
for (int i = 0; i < 100; ++i)
{
if (!this.chunksToUnload.isEmpty())
@@ -315,6 +327,11 @@
@@ -319,6 +331,11 @@
this.chunksToUnload.remove(olong);
this.loadedChunkHashMap.remove(olong.longValue());
this.loadedChunks.remove(chunk);

View file

@ -8,26 +8,26 @@
/** The number of blocks to generate. */
private int numberOfBlocks;
@@ -24,6 +25,12 @@
@@ -26,6 +27,12 @@
this.minableBlockId = par1;
this.numberOfBlocks = par2;
this.field_94523_c = par3;
this.blockToReplace = par3;
+ }
+
+ public WorldGenMinable(int id, int meta, int number, int target)
+ {
+ this(id, number, target);
+ minableBlockMeta = meta;
+ this.minableBlockMeta = meta;
}
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
@@ -67,9 +74,10 @@
@@ -69,9 +76,10 @@
{
double d14 = ((double)i3 + 0.5D - d8) / (d10 / 2.0D);
- if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && par1World.getBlockId(k2, l2, i3) == this.field_94523_c)
- if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && par1World.getBlockId(k2, l2, i3) == this.blockToReplace)
+ Block block = Block.blocksList[par1World.getBlockId(k2, l2, i3)];
+ if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && (block != null && block.isGenMineableReplaceable(par1World, k2, l2, i3, field_94523_c)))
+ if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && (block != null && block.isGenMineableReplaceable(par1World, k2, l2, i3, this.blockToReplace)))
{
- par1World.setBlock(k2, l2, i3, this.minableBlockId, 0, 2);
+ par1World.setBlock(k2, l2, i3, this.minableBlockId, minableBlockMeta, 2);