Fix the rest of the "easy" compile errors (#5151)

* Add Entity.changeDimension patch and transitively required patches

* Fix throws declaration on CommandSetDimension#execute

* Fix rest of errors in fluid package

* Add PLAYER_REACH attribute

* Fix compile errors in fml.client.config and add GuiButton patch

* Delete unnecessary client.config classes, fix all config errors

* Comment some fluid errors in models

* Fix all errors in common package root, except ForgeHooks

* Mass comment network package

* Experimental conversion of extended states to generic base class

* Fix errors in common.util

* Remove config annotation stuff cuz lex said so

* Make extended state stuff compile fully
This commit is contained in:
tterrag authored and GitHub committed 2018-09-18 00:04:02 -04:00
1 parent 6814cbf0df
commit c4cf950863
72 files changed
+610 -5996

No files matched your search

@@ -26,3 +26,60 @@
}
public EntityType<?> func_200600_R() {
@@ -2053,6 +2056,14 @@
@Nullable
public Entity changeDimension(int dimensionIn) {
+ if (this.world.isRemote || this.isDead) return null;
+ return changeDimension(dimensionIn, this.getServer().getWorld(dimensionIn).getDefaultTeleporter());
+ }
+
+ @Nullable // Forge: Entities that require custom handling should override this method, not the other
+ public Entity changeDimension(int dimensionIn, net.minecraftforge.common.util.ITeleporter teleporter)
+ {
+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, dimensionIn)) return null;
if (!this.world.isRemote && !this.isDead) {
this.world.profiler.startSection("changeDimension");
MinecraftServer minecraftserver = this.getServer();
@@ -2060,7 +2071,7 @@
WorldServer worldserver = minecraftserver.getWorld(i);
WorldServer worldserver1 = minecraftserver.getWorld(dimensionIn);
this.dimension = dimensionIn;
- if (i == 1 && dimensionIn == 1) {
+ if (i == 1 && dimensionIn == 1 && teleporter.isVanilla()) {
worldserver1 = minecraftserver.func_200667_a(DimensionType.OVERWORLD);
this.dimension = 0;
}
@@ -2069,16 +2080,17 @@
this.isDead = false;
this.world.profiler.startSection("reposition");
BlockPos blockpos;
- if (dimensionIn == 1) {
+ if (dimensionIn == 1 && teleporter.isVanilla()) {
blockpos = worldserver1.getSpawnCoordinate();
} else {
- double d0 = this.posX;
- double d1 = this.posZ;
+ double moveFactor = worldserver.provider.getMovementFactor() / worldserver1.provider.getMovementFactor();
+ double d0 = MathHelper.clamp(this.posX * moveFactor, worldserver1.getWorldBorder().minX() + 16.0D, worldserver1.getWorldBorder().maxX() - 16.0D);
+ double d1 = MathHelper.clamp(this.posZ * moveFactor, worldserver1.getWorldBorder().minZ() + 16.0D, worldserver1.getWorldBorder().maxZ() - 16.0D);
double d2 = 8.0D;
- if (dimensionIn == -1) {
+ if (false && dimensionIn == -1) {
d0 = MathHelper.clamp(d0 / 8.0D, worldserver1.getWorldBorder().minX() + 16.0D, worldserver1.getWorldBorder().maxX() - 16.0D);
d1 = MathHelper.clamp(d1 / 8.0D, worldserver1.getWorldBorder().minZ() + 16.0D, worldserver1.getWorldBorder().maxZ() - 16.0D);
- } else if (dimensionIn == 0) {
+ } else if (false && dimensionIn == 0) {
d0 = MathHelper.clamp(d0 * 8.0D, worldserver1.getWorldBorder().minX() + 16.0D, worldserver1.getWorldBorder().maxX() - 16.0D);
d1 = MathHelper.clamp(d1 * 8.0D, worldserver1.getWorldBorder().minZ() + 16.0D, worldserver1.getWorldBorder().maxZ() - 16.0D);
}
@@ -2087,8 +2099,7 @@
d1 = (double)MathHelper.clamp((int)d1, -29999872, 29999872);
float f = this.rotationYaw;
this.setLocationAndAngles(d0, this.posY, d1, 90.0F, 0.0F);
- Teleporter teleporter = worldserver1.getDefaultTeleporter();
- teleporter.placeInExistingPortal(this, f);
+ teleporter.placeEntity(worldserver1, this, f);
blockpos = new BlockPos(this);
}