mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 04:32:15 +00:00
e88ddc5- Make the exception print for headless servers if the Downloader cant initalize.f24ff07- Remove a bunch of warning about javadoc, not a real fix, but no more warning.3420ea7- Update MCP Mapings87104f0- Makes GetModSrc check the common folder when attempting to extract source files640446b- Tie parent/child containers together again. Should close #962cf4917- Village mating produces added villagers, and the egg should place added villagers too. Closes #97.6394ee8- Clean up stale references to the Player stored in the NetworkRegistry, closes #1007299e05- Merge pull request #99 from CovertJaguar/patch-1c4bd040- More readable init logs
60 lines
2.1 KiB
Diff
60 lines
2.1 KiB
Diff
--- ../src_base/common/net/minecraft/src/EntityPlayerMP.java
|
|
+++ ../src_work/common/net/minecraft/src/EntityPlayerMP.java
|
|
@@ -8,6 +8,9 @@
|
|
import java.util.LinkedList;
|
|
import java.util.List;
|
|
import net.minecraft.server.MinecraftServer;
|
|
+import net.minecraftforge.common.ForgeHooks;
|
|
+import net.minecraftforge.common.MinecraftForge;
|
|
+import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
|
|
|
public class EntityPlayerMP extends EntityPlayer implements ICrafting
|
|
{
|
|
@@ -85,17 +88,10 @@
|
|
par4ItemInWorldManager.thisPlayerMP = this;
|
|
this.theItemInWorldManager = par4ItemInWorldManager;
|
|
this.renderDistance = par1MinecraftServer.getConfigurationManager().getViewDistance();
|
|
- ChunkCoordinates var5 = par2World.getSpawnPoint();
|
|
+ ChunkCoordinates var5 = par2World.provider.getRandomizedSpawnPoint();
|
|
int var6 = var5.posX;
|
|
int var7 = var5.posZ;
|
|
int var8 = var5.posY;
|
|
-
|
|
- if (!par2World.provider.hasNoSky && par2World.getWorldInfo().getGameType() != EnumGameType.ADVENTURE)
|
|
- {
|
|
- var6 += this.rand.nextInt(20) - 10;
|
|
- var8 = par2World.getTopSolidOrLiquidBlock(var6, var7);
|
|
- var7 += this.rand.nextInt(20) - 10;
|
|
- }
|
|
|
|
this.setLocationAndAngles((double)var6 + 0.5D, (double)var8, (double)var7 + 0.5D, 0.0F, 0.0F);
|
|
this.mcServer = par1MinecraftServer;
|
|
@@ -336,8 +332,27 @@
|
|
*/
|
|
public void onDeath(DamageSource par1DamageSource)
|
|
{
|
|
+ if (ForgeHooks.onLivingDeath(this, par1DamageSource))
|
|
+ {
|
|
+ return;
|
|
+ }
|
|
+
|
|
this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet3Chat(par1DamageSource.getDeathMessage(this)));
|
|
+
|
|
+ captureDrops = true;
|
|
+ capturedDrops.clear();
|
|
+
|
|
this.inventory.dropAllItems();
|
|
+
|
|
+ captureDrops = false;
|
|
+ PlayerDropsEvent event = new PlayerDropsEvent(this, par1DamageSource, capturedDrops, recentlyHit > 0);
|
|
+ if (!MinecraftForge.EVENT_BUS.post(event))
|
|
+ {
|
|
+ for (EntityItem item : capturedDrops)
|
|
+ {
|
|
+ joinEntityItemWithWorld(item);
|
|
+ }
|
|
+ }
|
|
}
|
|
|
|
/**
|