Crossdimensional Teleposition (including entities, into unloaded chunks etc) (#1385)

* AWAITING ALLOWANCE FROM BRANDON3055 (PERMISSION TO USE CODE SNIPPET FOR INTERDIMENSIONAL/CROSSDIMENSIONAL TELEPORT) COPYRIGHT ALL RIGHTS RESERVED FOR BRANDON3055 (CODE SNIPPET)
AWAITING ALLOWANCE FROM TEHNUT, WAYOFTIME TO USE FOREIGN CODE (AS IT NEEDS ALLOWANCE & POSSIBLE CREDITS)

DO NOT USE.

* Forgot something.

                   Requires permission from Brandon3055 (copyright on code snippet)
                   Requires permission from WayofTime, TehNut (because it uses foreign code that might need attribution)

                   Do not use.

* License permits usage.

Sorry for bothering everyone involved.

Don't merge. Teleposer broken. Teleposition sigil works though.

* IT WORKS!!!!

- re-enabled cross dimensional telepositioning
- works even if target teleposer is unloaded at the time of activation (force loads the chunk so the teleposer can be found, releases ticket when player arrives)
- entity teleposition works properly
- I'm tired and slightly insane
- nobody asked for this.

closes #973 (rewrite might still be needed though)

might be able to close the following issue:
    - #1198 (improved cross dimensional teleportation code thanks to brandon3055)

* Zombies stop holding onto tickets now.

* Oversight.
This commit is contained in:
AEon - Tobias 2018-08-08 02:50:56 +02:00 committed by Nick Ignoffo
parent c0570af36f
commit 2c92a9e0c1
3 changed files with 90 additions and 43 deletions

View file

@ -26,6 +26,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
import java.util.List;
import java.util.UUID;
public class ItemSigilTeleposition extends ItemSigilBase {
@ -62,16 +63,17 @@ public class ItemSigilTeleposition extends ItemSigilBase {
TileEntity tile = teleportTo.getTileEntity(location.pos);
if (tile instanceof TileTeleposer) {
BlockPos blockPos = location.pos.up();
UUID bindingOwnerID = binding.getOwnerId();
if (world.provider.getDimension() == location.dim) {
TeleportQueue.getInstance().addITeleport(new Teleports.TeleportSameDim(blockPos, player, binding.getOwnerId(), true));
TeleportQueue.getInstance().addITeleport(new Teleports.TeleportSameDim(blockPos, player, bindingOwnerID, true));
} else {
TeleportQueue.getInstance().addITeleport(new Teleports.TeleportToDim(blockPos, player, bindingOwnerID, world, tile.getWorld().provider.getDimension(), true));
}
// FIXME - Fix cross-dimension teleports causing major desync
// } else {
// TeleportQueue.getInstance().addITeleport(new Teleports.TeleportToDim(blockPos, player, getOwnerUUID(stack), world, getValue(stack.getTagCompound(), Constants.NBT.DIMENSION_ID), true));
// }
}
}
}
}
return super.onItemRightClick(world, player, hand);
}