2015-08-29 14:33:25 +02:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("CompatUtil.java") is part of the Actually Additions mod for Minecraft.
|
2015-08-29 14:33:25 +02:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2015-08-29 14:33:25 +02:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2017-01-01 16:23:26 +01:00
|
|
|
* © 2015-2017 Ellpeck
|
2015-08-29 14:33:25 +02:00
|
|
|
*/
|
|
|
|
|
2016-06-17 14:00:52 +02:00
|
|
|
package de.ellpeck.actuallyadditions.mod.util.compat;
|
2015-06-28 03:12:32 +02:00
|
|
|
|
2018-03-07 03:08:25 +01:00
|
|
|
import net.minecraft.client.gui.inventory.GuiCrafting;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.inventory.ContainerWorkbench;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraftforge.fml.common.Loader;
|
2015-06-28 03:12:32 +02:00
|
|
|
|
2018-03-07 03:08:25 +01:00
|
|
|
public final class CompatUtil {
|
2015-06-28 03:12:32 +02:00
|
|
|
|
2018-03-07 03:08:25 +01:00
|
|
|
static boolean fb = Loader.isModLoaded("fastbench");
|
|
|
|
|
|
|
|
public static Object getCrafterGuiElement(EntityPlayer player, World world, int x, int y, int z) {
|
|
|
|
if (fb) return CompatFastBench.getFastBenchGui(player, world, x, y, z);
|
|
|
|
return new GuiCrafting(player.inventory, world, new BlockPos(x, y, z));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Object getCrafterContainerElement(EntityPlayer player, World world, int x, int y, int z) {
|
|
|
|
if (fb) return CompatFastBench.getFastBenchContainer(player, world, x, y, z);
|
|
|
|
return new ContainerWorkbench(player.inventory, world, new BlockPos(x, y, z)) {
|
|
|
|
public boolean canInteractWith(EntityPlayer playerIn) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2015-06-28 03:12:32 +02:00
|
|
|
}
|