Update forge

This commit is contained in:
AbrarSyed committed 2013-11-17 12:07:22 -06:00
commit 74104fe5d0
7 files changed
+61 -19

No files matched your search

+1 -1
Submodule fml updated: a6dc03aa7e...4d46abf761.
@@ -21,10 +21,10 @@
this.disconnected = true;
this.mc.loadWorld((WorldClient)null);
@@ -866,7 +871,11 @@
public void handleChat(Packet3Chat par1Packet3Chat)
{
par1Packet3Chat = FMLNetworkHandler.handleChatMessage(this, par1Packet3Chat);
@@ -870,7 +875,11 @@
{
return;
}
- 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)
@@ -34,7 +34,7 @@
}
public void handleAnimation(Packet18Animation par1Packet18Animation)
@@ -1354,6 +1363,10 @@
@@ -1358,6 +1367,10 @@
{
tileentity.readFromNBT(par1Packet132TileEntityData.data);
}
@@ -13,11 +13,16 @@
public class EntityPlayerMP extends EntityPlayer implements ICrafting
{
private String translator = "en_US";
@@ -165,18 +171,10 @@
@@ -164,19 +170,14 @@
super(par2World, par3Str);
par4ItemInWorldManager.thisPlayerMP = this;
this.theItemInWorldManager = par4ItemInWorldManager;
this.renderDistance = par1MinecraftServer.getConfigurationManager().getViewDistance();
- this.renderDistance = par1MinecraftServer.getConfigurationManager().getViewDistance();
- ChunkCoordinates chunkcoordinates = par2World.getSpawnPoint();
+ if (par1MinecraftServer == null) //ToDo: Remove this in 1.7, Fake players shouldn't be used purely client side.
+ this.renderDistance = 0;
+ else
+ this.renderDistance = par1MinecraftServer.getConfigurationManager().getViewDistance();
+ ChunkCoordinates chunkcoordinates = par2World.provider.getRandomizedSpawnPoint();
int i = chunkcoordinates.posX;
int j = chunkcoordinates.posZ;
@@ -33,7 +38,7 @@
this.mcServer = par1MinecraftServer;
this.stepHeight = 0.0F;
@@ -240,11 +238,6 @@
@@ -240,11 +241,6 @@
this.yOffset = 0.0F;
}
@@ -45,7 +50,7 @@
/**
* Called to update the entity's position/logic.
*/
@@ -254,7 +247,7 @@
@@ -254,7 +250,7 @@
--this.initialInvulnerability;
this.openContainer.detectAndSendChanges();
@@ -54,7 +59,7 @@
{
this.closeScreen();
this.openContainer = this.inventoryContainer;
@@ -290,7 +283,10 @@
@@ -290,7 +286,10 @@
if (chunkcoordintpair != null && this.worldObj.blockExists(chunkcoordintpair.chunkXPos << 4, 0, chunkcoordintpair.chunkZPos << 4))
{
arraylist.add(this.worldObj.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos));
@@ -66,7 +71,7 @@
}
}
@@ -311,6 +307,7 @@
@@ -311,6 +310,7 @@
{
Chunk chunk = (Chunk)iterator2.next();
this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk);
@@ -74,7 +79,7 @@
}
}
}
@@ -383,11 +380,25 @@
@@ -383,11 +383,25 @@
*/
public void onDeath(DamageSource par1DamageSource)
{
@@ -100,7 +105,7 @@
}
Collection collection = this.worldObj.getScoreboard().func_96520_a(ScoreObjectiveCriteria.deathCount);
@@ -1054,4 +1065,16 @@
@@ -1054,4 +1068,16 @@
{
this.field_143005_bX = MinecraftServer.getSystemTimeMillis();
}
@@ -127,7 +127,7 @@
{
this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, par1Packet15Place.getXOffset(), par1Packet15Place.getYOffset(), par1Packet15Place.getZOffset());
}
@@ -695,6 +733,8 @@
@@ -698,6 +736,8 @@
}
ChatMessageComponent chatmessagecomponent = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.text", new Object[] {this.playerEntity.getTranslatedEntityName(), s});
@@ -136,7 +136,7 @@
this.mcServer.getConfigurationManager().func_110459_a(chatmessagecomponent, false);
}
@@ -849,7 +889,7 @@
@@ -852,7 +892,7 @@
return;
}
@@ -1,11 +1,15 @@
package net.minecraftforge.common;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemInWorldManager;
import net.minecraft.network.packet.Packet204ClientInfo;
import net.minecraft.server.MinecraftServer;
import net.minecraft.stats.StatBase;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
//Preliminary, simple Fake Player class
@@ -25,4 +29,20 @@ public class FakePlayer extends EntityPlayerMP
@Override
public void sendChatToPlayer(ChatMessageComponent chatmessagecomponent){}
@Override
public void addStat(StatBase par1StatBase, int par2){}
@Override
public void openGui(Object mod, int modGuiId, World world, int x, int y, int z){}
@Override
public boolean isEntityInvulnerable(){ return true; }
@Override
public boolean canAttackPlayer(EntityPlayer player){ return false; }
@Override
public void onDeath(DamageSource source){ return; }
@Override
public void onUpdate(){ return; }
@Override
public void travelToDimension(int dim){ return; }
@Override
public void updateClientInfo(Packet204ClientInfo pkt){ return; }
}
@@ -22,6 +22,7 @@ import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.network.NetServerHandler;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet53BlockChange;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
@@ -487,7 +488,11 @@ public class ForgeHooks
TileEntity tileentity = world.getBlockTileEntity(x, y, z);
if (tileentity != null)
{
entityPlayer.playerNetServerHandler.sendPacketToPlayer(tileentity.getDescriptionPacket());
Packet pkt = tileentity.getDescriptionPacket();
if (pkt != null)
{
entityPlayer.playerNetServerHandler.sendPacketToPlayer(pkt);
}
}
}
return event;
@@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event;
@@ -25,8 +26,19 @@ public abstract class FluidRegistry
static BiMap<String, Integer> fluidIDs = HashBiMap.create();
static BiMap<Block, Fluid> fluidBlocks;
public static final Fluid WATER = new Fluid("water").setBlockID(Block.waterStill.blockID).setUnlocalizedName(Block.waterStill.getUnlocalizedName());
public static final Fluid LAVA = new Fluid("lava").setBlockID(Block.lavaStill.blockID).setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300).setUnlocalizedName(Block.lavaStill.getUnlocalizedName());
public static final Fluid WATER = new Fluid("water") {
@Override
public String getLocalizedName() {
return StatCollector.translateToLocal("tile.water.name");
}
}.setBlockID(Block.waterStill.blockID).setUnlocalizedName(Block.waterStill.getUnlocalizedName());
public static final Fluid LAVA = new Fluid("lava") {
@Override
public String getLocalizedName() {
return StatCollector.translateToLocal("tile.lava.name");
}
}.setBlockID(Block.lavaStill.blockID).setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300).setUnlocalizedName(Block.lavaStill.getUnlocalizedName());
public static int renderIdFluid = -1;