mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Add FastBench Compat, closes #1035
This commit is contained in:
parent
7fadd4368f
commit
532aa1ca60
9 changed files with 86 additions and 97 deletions
|
@ -28,6 +28,7 @@ minecraft {
|
|||
mappings = "snapshot_20180119"
|
||||
replaceIn "ModUtil.java"
|
||||
replace "@VERSION@", project.version.toString()
|
||||
makeObfSourceJar = false
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
@ -43,7 +44,7 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
deobfCompile "mezz.jei:jei_1.12.1:+"
|
||||
deobfCompile "mezz.jei:jei_1.12.2:+"
|
||||
deobfCompile "mcp.mobius.waila:Hwyla:+"
|
||||
deobfCompile "org.cyclops.commoncapabilities:CommonCapabilities:1.12.2-+"
|
||||
}
|
||||
|
|
BIN
libs/FastWorkbench-1.12.2-1.2.1.jar
Normal file
BIN
libs/FastWorkbench-1.12.2-1.2.1.jar
Normal file
Binary file not shown.
|
@ -37,7 +37,6 @@ import de.ellpeck.actuallyadditions.mod.recipe.TreasureChestHandler;
|
|||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
|
||||
import de.ellpeck.actuallyadditions.mod.update.UpdateChecker;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
@ -48,7 +47,11 @@ import net.minecraftforge.fml.common.Mod;
|
|||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.Mod.Instance;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.*;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartedEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStoppedEvent;
|
||||
|
||||
@Mod(modid = ModUtil.MOD_ID, name = ModUtil.NAME, version = ModUtil.VERSION, guiFactory = "de.ellpeck.actuallyadditions.mod.config.GuiFactory", acceptedMinecraftVersions = "[1.12, 1.13)")
|
||||
public class ActuallyAdditions{
|
||||
|
@ -101,7 +104,6 @@ public class ActuallyAdditions{
|
|||
TileEntityBase.init();
|
||||
new CommonEvents();
|
||||
InitEntities.init();
|
||||
CompatUtil.registerCraftingTweaksCompat();
|
||||
|
||||
proxy.init(event);
|
||||
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
/*
|
||||
* This file ("ContainerCrafter.java") is part of the Actually Additions mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2017 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.inventory;
|
||||
|
||||
|
||||
import invtweaks.api.container.InventoryContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ContainerWorkbench;
|
||||
|
||||
@InventoryContainer
|
||||
public class ContainerCrafter extends ContainerWorkbench{
|
||||
|
||||
public ContainerCrafter(EntityPlayer player){
|
||||
super(player.inventory, player.world, player.getPosition());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player){
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -15,10 +15,38 @@ import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiBooklet;
|
|||
import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiMainPage;
|
||||
import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils;
|
||||
import de.ellpeck.actuallyadditions.mod.data.PlayerData;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.*;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiBag;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiBioReactor;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiBreaker;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCanolaPress;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoalGenerator;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiDirectionalBreaker;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiDrill;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiDropper;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiEnergizer;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiEnervator;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFarmer;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFeeder;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFermentingBarrel;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFilter;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFluidCollector;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiGiantChest;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiGrinder;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiInputter;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiLaserRelayItemWhitelist;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiMiner;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiOilGenerator;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiPhantomPlacer;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiRangedCollector;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiRepairer;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiSmileyCloud;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiXPSolidifier;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ItemBooklet;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -48,7 +76,7 @@ public class GuiHandler implements IGuiHandler{
|
|||
case GIANT_CHEST_PAGE_3:
|
||||
return new ContainerGiantChest(player.inventory, tile, 2);
|
||||
case CRAFTER:
|
||||
return new ContainerCrafter(player);
|
||||
return CompatUtil.getCrafterContainerElement(player, world, x, y, z);
|
||||
case GRINDER:
|
||||
return new ContainerGrinder(player.inventory, tile, false);
|
||||
case GRINDER_DOUBLE:
|
||||
|
@ -130,7 +158,7 @@ public class GuiHandler implements IGuiHandler{
|
|||
case GIANT_CHEST_PAGE_3:
|
||||
return new GuiGiantChest(player.inventory, tile, 2);
|
||||
case CRAFTER:
|
||||
return new GuiCrafter(player);
|
||||
return CompatUtil.getCrafterGuiElement(player, world, x, y, z);
|
||||
case GRINDER:
|
||||
return new GuiGrinder(player.inventory, tile);
|
||||
case GRINDER_DOUBLE:
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
/*
|
||||
* This file ("GuiCrafter.java") is part of the Actually Additions mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2017 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCrafter;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiCrafter extends GuiWtfMojang{
|
||||
|
||||
private static final ResourceLocation RES_LOC = new ResourceLocation("textures/gui/container/crafting_table.png");
|
||||
|
||||
public GuiCrafter(EntityPlayer player){
|
||||
super(new ContainerCrafter(player));
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||
AssetUtil.displayNameString(this.fontRenderer, this.xSize, -10, StringUtil.localize("container."+ModUtil.MOD_ID+".crafting.name"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(RES_LOC);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
}
|
|
@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
|
|||
import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCrafter;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiGrinder;
|
||||
|
@ -44,7 +43,6 @@ import mezz.jei.api.JEIPlugin;
|
|||
import mezz.jei.api.ingredients.IIngredientBlacklist;
|
||||
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@JEIPlugin
|
||||
|
@ -94,9 +92,6 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{
|
|||
blacklist.addIngredientToBlacklist(new ItemStack(InitBlocks.blockColoredLampOn, 1, Util.WILDCARD));
|
||||
blacklist.addIngredientToBlacklist(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.YOUTUBE_ICON.ordinal()));
|
||||
|
||||
IRecipeTransferRegistry transfer = registry.getRecipeTransferRegistry();
|
||||
transfer.addRecipeTransferHandler(ContainerCrafter.class, VanillaRecipeCategoryUid.CRAFTING, 1, 9, 10, 36);
|
||||
|
||||
registry.addRecipeCatalyst(new ItemStack(InitItems.itemCrafterOnAStick), VanillaRecipeCategoryUid.CRAFTING);
|
||||
registry.addRecipeCatalyst(new ItemStack(InitBlocks.blockFurnaceDouble), VanillaRecipeCategoryUid.SMELTING);
|
||||
registry.addRecipeCatalyst(new ItemStack(InitBlocks.blockGrinder), CrusherRecipeCategory.NAME);
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package de.ellpeck.actuallyadditions.mod.util.compat;
|
||||
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import shadows.fastbench.gui.ContainerFastBench;
|
||||
import shadows.fastbench.gui.GuiFastBench;
|
||||
|
||||
public class CompatFastBench {
|
||||
|
||||
public static Container getFastBenchContainer(EntityPlayer p, World world, int x, int y, int z) {
|
||||
return new ContainerFastBench(p, world, x, y, z) {
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer playerIn) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
|
@ -10,16 +10,28 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.util.compat;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCrafter;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
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;
|
||||
|
||||
public final class CompatUtil{
|
||||
public final class CompatUtil {
|
||||
|
||||
public static void registerCraftingTweaksCompat(){
|
||||
NBTTagCompound tagCompound = new NBTTagCompound();
|
||||
tagCompound.setString("ContainerClass", ContainerCrafter.class.getName());
|
||||
tagCompound.setString("AlignToGrid", "left");
|
||||
FMLInterModComms.sendMessage("craftingtweaks", "RegisterProvider", tagCompound);
|
||||
}
|
||||
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;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue