mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-10-25 20:22:23 +00:00
Fix anchor distance config option not working (#79)
This commit is contained in:
1 parent
cf41b89ae4
commit
37bc1d700c
1 file changed
+12
-1
@@ -2,6 +2,9 @@ package crazypants.enderio.api.teleport;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public enum TravelSource {
|
||||
BLOCK() {
|
||||
@@ -39,7 +42,15 @@ public enum TravelSource {
|
||||
}
|
||||
|
||||
public static int getMaxDistanceSq() {
|
||||
return STAFF.getMaxDistanceTravelledSq();
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
if (player == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return TravelController.instance.isTravelItemActive(player)
|
||||
? TravelSource.STAFF.getMaxDistanceTravelledSq()
|
||||
: TravelSource.BLOCK.getMaxDistanceTravelledSq();
|
||||
}
|
||||
|
||||
public final String sound;
|
||||
|
||||
Reference in new issue
Block a user