Files
CatServer/patches/net/minecraft/world/WorldProviderEnd.java.patch
2019-02-24 22:29:41 +08:00

44 lines
1.6 KiB
Diff

--- ../src-base/minecraft/net/minecraft/world/WorldProviderEnd.java
+++ ../src-work/minecraft/net/minecraft/world/WorldProviderEnd.java
@@ -20,7 +20,7 @@
public void init()
{
this.biomeProvider = new BiomeProviderSingle(Biomes.SKY);
- NBTTagCompound nbttagcompound = this.world.getWorldInfo().getDimensionData(DimensionType.THE_END);
+ NBTTagCompound nbttagcompound = this.world.getWorldInfo().getDimensionData(this.world.provider.getDimension());
this.dragonFightManager = this.world instanceof WorldServer ? new DragonFightManager((WorldServer)this.world, nbttagcompound.getCompoundTag("DragonFight")) : null;
}
@@ -113,7 +113,7 @@
nbttagcompound.setTag("DragonFight", this.dragonFightManager.getCompound());
}
- this.world.getWorldInfo().setDimensionData(DimensionType.THE_END, nbttagcompound);
+ this.world.getWorldInfo().setDimensionData(this.world.provider.getDimension(), nbttagcompound);
}
public void onWorldUpdateEntities()
@@ -129,4 +129,22 @@
{
return this.dragonFightManager;
}
+
+ @Override
+ public void onPlayerAdded(net.minecraft.entity.player.EntityPlayerMP player)
+ {
+ if (this.dragonFightManager != null)
+ {
+ this.dragonFightManager.addPlayer(player);
+ }
+ }
+
+ @Override
+ public void onPlayerRemoved(net.minecraft.entity.player.EntityPlayerMP player)
+ {
+ if (this.dragonFightManager != null)
+ {
+ this.dragonFightManager.removePlayer(player);
+ }
+ }
}