equivalent-exchange-3/src/main/java/com/pahimar/ee3/api/util/TileEntityDataProxy.java

96 lines
2.4 KiB
Java
Raw Normal View History

2015-05-07 19:45:06 +02:00
package com.pahimar.ee3.api.util;
2023-01-03 17:47:36 +01:00
import java.util.UUID;
import com.pahimar.ee3.EquivalentExchange3;
import cpw.mods.fml.common.Mod;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
2023-01-03 17:47:36 +01:00
public class TileEntityDataProxy {
@Mod.Instance("EE3")
private static Object ee3Mod;
2023-01-03 17:47:36 +01:00
public static Class
getTileEntityClass(World world, int xCoord, int yCoord, int zCoord) {
init();
2023-01-03 17:47:36 +01:00
if (ee3Mod != null) {
return EE3Wrapper.ee3mod.getTileEntityDataHelper().getTileEntityClass(
world, xCoord, yCoord, zCoord
);
}
return null;
}
2023-01-03 17:47:36 +01:00
public static ForgeDirection
getOrientation(World world, int xCoord, int yCoord, int zCoord) {
init();
2023-01-03 17:47:36 +01:00
if (ee3Mod != null) {
return EE3Wrapper.ee3mod.getTileEntityDataHelper().getOrientation(
world, xCoord, yCoord, zCoord
);
}
return null;
}
2023-01-03 17:47:36 +01:00
public static short getState(World world, int xCoord, int yCoord, int zCoord) {
init();
2023-01-03 17:47:36 +01:00
if (ee3Mod != null) {
return EE3Wrapper.ee3mod.getTileEntityDataHelper().getState(
world, xCoord, yCoord, zCoord
);
}
return Short.MIN_VALUE;
}
2023-01-03 17:47:36 +01:00
public static String getCustomName(World world, int xCoord, int yCoord, int zCoord) {
init();
2023-01-03 17:47:36 +01:00
if (ee3Mod != null) {
return EE3Wrapper.ee3mod.getTileEntityDataHelper().getCustomName(
world, xCoord, yCoord, zCoord
);
}
return null;
}
2023-01-03 17:47:36 +01:00
public static UUID getOwnerUUID(World world, int xCoord, int yCoord, int zCoord) {
init();
2023-01-03 17:47:36 +01:00
if (ee3Mod != null) {
return EE3Wrapper.ee3mod.getTileEntityDataHelper().getOwnerUUID(
world, xCoord, yCoord, zCoord
);
}
return null;
}
2023-01-03 17:47:36 +01:00
public static String getOwnerName(World world, int xCoord, int yCoord, int zCoord) {
init();
2023-01-03 17:47:36 +01:00
if (ee3Mod != null) {
return EE3Wrapper.ee3mod.getTileEntityDataHelper().getOwnerName(
world, xCoord, yCoord, zCoord
);
}
return null;
}
2023-01-03 17:47:36 +01:00
private static class EE3Wrapper { private static EquivalentExchange3 ee3mod; }
2023-01-03 17:47:36 +01:00
private static void init() {
if (ee3Mod != null) {
EE3Wrapper.ee3mod = (EquivalentExchange3) ee3Mod;
}
}
}