From 63289fe116c15b44141056dea0a669ae3611a6c2 Mon Sep 17 00:00:00 2001 From: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Date: Wed, 21 Apr 2021 09:10:33 +0100 Subject: [PATCH 1/3] Fix teleposer costing no LP with interdim travel The teleposer currently costs no LP if the x, y and z coordinates of your teleposers are the same between the dimensions you're teleporting between. This adds a base cost of 2000 making sure it will always drain some LP. This is a very simple PR but I don't program in java usually so appreciate scrutiny :p --- .../common/tileEntity/TETeleposer.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java index e9ae36df..01568dd8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java @@ -146,10 +146,14 @@ public class TETeleposer extends TEInventory { entityCount = 0; } - - SoulNetworkHandler.syphonFromNetwork(focus, damage * transportCount + damage * entityCount); - //Teleport - + + //Teleport + if (damage * transportCount + damage * entityCount < 2000) { + SoulNetworkHandler.syphonFromNetwork(focus, 2000); + } else { + SoulNetworkHandler.syphonFromNetwork(focus, damage * transportCount + damage * entityCount); + } + if (worldF.equals(worldObj)) { iterator1 = list1.iterator(); From 00f9ac485bf1b08cbf136503f7f4320eedd299cc Mon Sep 17 00:00:00 2001 From: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Date: Wed, 21 Apr 2021 10:44:17 +0100 Subject: [PATCH 2/3] Update TETeleposer.java --- .../common/tileEntity/TETeleposer.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java index 01568dd8..94bf998d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java @@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.tileEntity; import java.util.Iterator; import java.util.List; +import import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import net.minecraft.entity.EntityLivingBase; @@ -147,12 +148,9 @@ public class TETeleposer extends TEInventory entityCount = 0; } - //Teleport - if (damage * transportCount + damage * entityCount < 2000) { - SoulNetworkHandler.syphonFromNetwork(focus, 2000); - } else { - SoulNetworkHandler.syphonFromNetwork(focus, damage * transportCount + damage * entityCount); - } + //Teleport with minimum cost of 2000 LP. + int cost = Math.max(damage * transportCount + damage * entityCount, 2000); + SoulNetworkHandler.syphonFromNetwork(focus, cost); if (worldF.equals(worldObj)) { From ae654620bb182a643ad7a2ba4b62f3da2d63420f Mon Sep 17 00:00:00 2001 From: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Date: Wed, 21 Apr 2021 11:08:09 +0100 Subject: [PATCH 3/3] Update TETeleposer.java --- .../alchemicalWizardry/common/tileEntity/TETeleposer.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java index 94bf998d..60c2de4a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java @@ -2,7 +2,6 @@ package WayofTime.alchemicalWizardry.common.tileEntity; import java.util.Iterator; import java.util.List; -import import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import net.minecraft.entity.EntityLivingBase;