This commit is contained in:
Shadows_of_Fire 2018-03-16 19:07:15 -04:00
parent 349640c07f
commit 3fcebcdd05
2 changed files with 6 additions and 0 deletions

View file

@ -5,6 +5,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import shadows.fastbench.gui.ContainerFastBench; import shadows.fastbench.gui.ContainerFastBench;
import shadows.fastbench.gui.GuiFastBench; import shadows.fastbench.gui.GuiFastBench;
@ -19,6 +21,7 @@ public class CompatFastBench {
}; };
} }
@SideOnly(Side.CLIENT)
public static Gui getFastBenchGui(EntityPlayer p, World world, int x, int y, int z) { public static Gui getFastBenchGui(EntityPlayer p, World world, int x, int y, int z) {
return new GuiFastBench(p.inventory, world, new BlockPos(x, y, z)); return new GuiFastBench(p.inventory, world, new BlockPos(x, y, z));
} }

View file

@ -16,11 +16,14 @@ import net.minecraft.inventory.ContainerWorkbench;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public final class CompatUtil { public final class CompatUtil {
static boolean fb = Loader.isModLoaded("fastbench"); static boolean fb = Loader.isModLoaded("fastbench");
@SideOnly(Side.CLIENT)
public static Object getCrafterGuiElement(EntityPlayer player, World world, int x, int y, int z) { public static Object getCrafterGuiElement(EntityPlayer player, World world, int x, int y, int z) {
if (fb) return CompatFastBench.getFastBenchGui(player, world, x, y, z); if (fb) return CompatFastBench.getFastBenchGui(player, world, x, y, z);
return new GuiCrafting(player.inventory, world, new BlockPos(x, y, z)); return new GuiCrafting(player.inventory, world, new BlockPos(x, y, z));