From 13c99700cff6ef0f3f94bec66f65ddf4ad58afc9 Mon Sep 17 00:00:00 2001 From: Technus Date: Sat, 29 Oct 2016 12:27:36 +0200 Subject: [PATCH] Teleporter and missing texture --- src/main/java/gregtech/api/GregTech_API.java | 6 +++--- .../java/gregtech/api/util/GT_Utility.java | 20 +++++++++--------- .../iconsets/OVERLAY_AUTOMAINTENANCE_IDLE.png | Bin 0 -> 2187 bytes .../OVERLAY_AUTOMAINTENANCE_IDLE.png.mcmeta | 5 +++++ 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java index 9f55a87a..813d1ed9 100644 --- a/src/main/java/gregtech/api/GregTech_API.java +++ b/src/main/java/gregtech/api/GregTech_API.java @@ -205,9 +205,9 @@ public class GregTech_API { sItemStackMappings.add(sCovers); sItemStackMappings.add(sCoverBehaviors); - sDimensionalList.add(-1); - sDimensionalList.add(0); - sDimensionalList.add(1); + //sDimensionalList.add(-1); + //sDimensionalList.add(0); + //sDimensionalList.add(1); sSoundList.put(0, "random.break"); sSoundList.put(1, "random.anvil_use"); diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index c9d1e6db..bb04b6ec 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -51,6 +51,7 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.world.ChunkPosition; +import net.minecraft.world.Teleporter; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraftforge.common.DimensionManager; @@ -1455,19 +1456,13 @@ public class GT_Utility { * Used for my Teleporter. //I have a different opinion... Planets are fine :P */ public static boolean isRealDimension(int aDimensionID) { - try { - if (DimensionManager.getProvider(aDimensionID).getClass().getName().contains("com.xcompwiz.mystcraft")) - return true; - } catch (Throwable e) {/*Do nothing*/} - try { - if (DimensionManager.getProvider(aDimensionID).getClass().getName().contains("TwilightForest")) return true; - } catch (Throwable e) {/*Do nothing*/} + if(aDimensionID<=1 && aDimensionID>=-1 && !GregTech_API.sDimensionalList.contains(aDimensionID)) return true; return !GregTech_API.sDimensionalList.contains(aDimensionID) && DimensionManager.isDimensionRegistered(aDimensionID); } public static boolean moveEntityToDimensionAtCoords(Entity aEntity, int aDimension, double aX, double aY, double aZ) { WorldServer tTargetWorld = DimensionManager.getWorld(aDimension), tOriginalWorld = DimensionManager.getWorld(aEntity.worldObj.provider.dimensionId); - if (tTargetWorld != null && tOriginalWorld != null && tTargetWorld != tOriginalWorld) { + if (tTargetWorld != null && tOriginalWorld != null && aEntity.worldObj.provider.dimensionId != aDimension) { if (aEntity.ridingEntity != null) aEntity.mountEntity(null); if (aEntity.riddenByEntity != null) aEntity.riddenByEntity.mountEntity(null); @@ -1489,9 +1484,14 @@ public class GT_Utility { // aPlayer.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(aPlayer.getEntityId(), potioneffect)); // } // FMLCommonHandler.instance().firePlayerChangedDimensionEvent(aPlayer, tOriginalWorld.provider.dimensionId, aDimension); - aPlayer.travelToDimension(aDimension); + System.out.println("GT teleporting: "+aPlayer.getDisplayName()+" to dimension: "+aDimension); + tTargetWorld.theChunkProviderServer.loadChunk((int)aX >> 4, (int)aY >> 4); + aPlayer.mcServer.getConfigurationManager().transferPlayerToDimension(aPlayer,aDimension, new Teleporter(aPlayer.mcServer.worldServerForDimension(aDimension))); + aPlayer.mcServer.getConfigurationManager().func_72375_a(aPlayer,tTargetWorld); aPlayer.playerNetServerHandler.setPlayerLocation(aX + 0.5, aY + 0.5, aZ + 0.5, aPlayer.rotationYaw, aPlayer.rotationPitch); - + //aPlayer.theItemInWorldManager.setWorld(tTargetWorld); + //aPlayer.mcServer.getConfigurationManager().updateTimeAndWeatherForPlayer(aPlayer, tTargetWorld); + //aPlayer.mcServer.getConfigurationManager().syncPlayerInventory(aPlayer); } else { aEntity.setPosition(aX + 0.5, aY + 0.5, aZ + 0.5); aEntity.worldObj.removeEntity(aEntity); diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_AUTOMAINTENANCE_IDLE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_AUTOMAINTENANCE_IDLE.png index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..62895be74ad53b293863861f94559950c949fecd 100644 GIT binary patch literal 2187 zcmeHHJ#5oJ6#neQvEvew6x3E_XeAH~6=DKpAVX15evm3uK%yHUmTXAu4Ba|2WMN=q z099J$5@PJ3sh*S f86!TBUHzNNNn`KviRHJ~S+si)zqa70$ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_AUTOMAINTENANCE_IDLE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_AUTOMAINTENANCE_IDLE.png.mcmeta index e69de29b..4db606ae 100644 --- a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_AUTOMAINTENANCE_IDLE.png.mcmeta +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_AUTOMAINTENANCE_IDLE.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":10 + } +} \ No newline at end of file