mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 15:33:18 +00:00
MinecraftForge/FML@064b66af3d Prevent players from logging in until server has finished starting. MinecraftForge/FML@2aa73afa15 Fix ExampleMod.java for build #1024+ MinecraftForge/FML@c890206268 Try and handle removal of mods a bit better. Currently no way to allow a world which has missing blocks to load - but i have the code in place to allow it i think. MinecraftForge/FML@995c204338 Fix failing to load a world with missing mod blocks and items. There will be a way to force worlds to load when stuff is missing, but for right now, it will fail as this is "world safe". MinecraftForge/FML@fa5f4c8842 Some argumentation MinecraftForge/FML@45409bfa0c Prevent player dat files getting reset during disconnects. MinecraftForge/FML@33100d6bab Merge pull request #371 from bl4ckscor3/patch-1 MinecraftForge/FML@572d32358a Merge pull request #373 from bloodmc/master MinecraftForge/FML@d0dd05a15c FML expands S3F to support payloads up to 2 megs in size. Should be transparent
114 lines
6.0 KiB
Diff
114 lines
6.0 KiB
Diff
--- ../src-base/minecraft/net/minecraft/server/management/ServerConfigurationManager.java
|
|
+++ ../src-work/minecraft/net/minecraft/server/management/ServerConfigurationManager.java
|
|
@@ -54,7 +54,9 @@
|
|
import net.minecraft.util.EnumChatFormatting;
|
|
import net.minecraft.util.IChatComponent;
|
|
import net.minecraft.util.MathHelper;
|
|
+import net.minecraft.world.Teleporter;
|
|
import net.minecraft.world.World;
|
|
+import net.minecraft.world.WorldProvider;
|
|
import net.minecraft.world.WorldServer;
|
|
import net.minecraft.world.WorldSettings;
|
|
import net.minecraft.world.demo.DemoWorldManager;
|
|
@@ -379,13 +381,23 @@
|
|
// JAVADOC METHOD $$ func_72368_a
|
|
public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3)
|
|
{
|
|
+ World world = mcServer.worldServerForDimension(par2);
|
|
+ if (world == null)
|
|
+ {
|
|
+ par2 = 0;
|
|
+ }
|
|
+ else if (!world.provider.canRespawnHere())
|
|
+ {
|
|
+ par2 = world.provider.getRespawnDimension(par1EntityPlayerMP);
|
|
+ }
|
|
+
|
|
par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(par1EntityPlayerMP);
|
|
par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removeEntityFromAllTrackingPlayers(par1EntityPlayerMP);
|
|
par1EntityPlayerMP.getServerForPlayer().getPlayerManager().removePlayer(par1EntityPlayerMP);
|
|
this.playerEntityList.remove(par1EntityPlayerMP);
|
|
this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension).removePlayerEntityDangerously(par1EntityPlayerMP);
|
|
- ChunkCoordinates chunkcoordinates = par1EntityPlayerMP.getBedLocation();
|
|
- boolean flag1 = par1EntityPlayerMP.isSpawnForced();
|
|
+ ChunkCoordinates chunkcoordinates = par1EntityPlayerMP.getBedLocation(par2);
|
|
+ boolean flag1 = par1EntityPlayerMP.isSpawnForced(par2);
|
|
par1EntityPlayerMP.dimension = par2;
|
|
Object object;
|
|
|
|
@@ -401,6 +413,7 @@
|
|
EntityPlayerMP entityplayermp1 = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension), par1EntityPlayerMP.getGameProfile(), (ItemInWorldManager)object);
|
|
entityplayermp1.playerNetServerHandler = par1EntityPlayerMP.playerNetServerHandler;
|
|
entityplayermp1.clonePlayer(par1EntityPlayerMP, par3);
|
|
+ entityplayermp1.dimension = par2;
|
|
entityplayermp1.setEntityId(par1EntityPlayerMP.getEntityId());
|
|
WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
|
this.func_72381_a(entityplayermp1, par1EntityPlayerMP, worldserver);
|
|
@@ -445,6 +458,11 @@
|
|
|
|
public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
|
|
{
|
|
+ transferPlayerToDimension(par1EntityPlayerMP, par2, mcServer.worldServerForDimension(par2).getDefaultTeleporter());
|
|
+ }
|
|
+
|
|
+ public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2, Teleporter teleporter)
|
|
+ {
|
|
int j = par1EntityPlayerMP.dimension;
|
|
WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
|
par1EntityPlayerMP.dimension = par2;
|
|
@@ -452,7 +470,7 @@
|
|
par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S07PacketRespawn(par1EntityPlayerMP.dimension, par1EntityPlayerMP.worldObj.difficultySetting, par1EntityPlayerMP.worldObj.getWorldInfo().getTerrainType(), par1EntityPlayerMP.theItemInWorldManager.getGameType()));
|
|
worldserver.removePlayerEntityDangerously(par1EntityPlayerMP);
|
|
par1EntityPlayerMP.isDead = false;
|
|
- this.transferEntityToWorld(par1EntityPlayerMP, j, worldserver, worldserver1);
|
|
+ this.transferEntityToWorld(par1EntityPlayerMP, j, worldserver, worldserver1, teleporter);
|
|
this.func_72375_a(par1EntityPlayerMP, worldserver);
|
|
par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
|
|
par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1);
|
|
@@ -471,15 +489,23 @@
|
|
// JAVADOC METHOD $$ func_82448_a
|
|
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.getDefaultTeleporter());
|
|
+ }
|
|
+
|
|
+ public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer, Teleporter teleporter)
|
|
+ {
|
|
+ WorldProvider pOld = par3WorldServer.provider;
|
|
+ WorldProvider pNew = par4WorldServer.provider;
|
|
+ double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor();
|
|
+ double d0 = par1Entity.posX * moveFactor;
|
|
+ double d1 = par1Entity.posZ * moveFactor;
|
|
double d3 = par1Entity.posX;
|
|
double d4 = par1Entity.posY;
|
|
double d5 = par1Entity.posZ;
|
|
float f = par1Entity.rotationYaw;
|
|
par3WorldServer.theProfiler.startSection("moving");
|
|
|
|
+ /*
|
|
if (par1Entity.dimension == -1)
|
|
{
|
|
d0 /= d2;
|
|
@@ -502,7 +528,8 @@
|
|
par3WorldServer.updateEntityWithOptionalForce(par1Entity, false);
|
|
}
|
|
}
|
|
- else
|
|
+ */
|
|
+ if (par1Entity.dimension == 1)
|
|
{
|
|
ChunkCoordinates chunkcoordinates;
|
|
|
|
@@ -537,7 +564,7 @@
|
|
if (par1Entity.isEntityAlive())
|
|
{
|
|
par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch);
|
|
- par4WorldServer.getDefaultTeleporter().placeInPortal(par1Entity, d3, d4, d5, f);
|
|
+ teleporter.placeInPortal(par1Entity, d3, d4, d5, f);
|
|
par4WorldServer.spawnEntityInWorld(par1Entity);
|
|
par4WorldServer.updateEntityWithOptionalForce(par1Entity, false);
|
|
}
|