Move all mod compatibility out into its own mod, ic2 support is gone and will come back in some more basic form once ic2 is on 1.13
The new mod compatibility will be included (either shaded or jar-in-jar) in the main TR distrubtion, this has been done to aid development
This commit is contained in:
parent
4ea0dc1e9a
commit
b65e963f12
119 changed files with 975 additions and 1146 deletions
|
@ -55,8 +55,6 @@ import techreborn.api.TechRebornAPI;
|
|||
import techreborn.blocks.cable.EnumCableType;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.command.TechRebornDevCommand;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.dispenser.BehaviorDispenseScrapbox;
|
||||
import techreborn.entities.EntityNukePrimed;
|
||||
import techreborn.events.BlockBreakHandler;
|
||||
|
@ -120,11 +118,6 @@ public class Core {
|
|||
ModFixs dataFixes = FMLCommonHandler.instance().getDataFixer().init(ModInfo.MOD_ID, 1);
|
||||
ModTileEntities.initDataFixer(dataFixes);
|
||||
|
||||
CompatManager.isIC2Loaded = Loader.isModLoaded("ic2");
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
compatModule.preInit(event);
|
||||
}
|
||||
|
||||
//Ore Dictionary
|
||||
OreDict.init();
|
||||
proxy.preInit(event);
|
||||
|
@ -144,10 +137,6 @@ public class Core {
|
|||
MinecraftForge.EVENT_BUS.register(new ModLoot());
|
||||
// Sounds
|
||||
ModSounds.init();
|
||||
// Compat
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
compatModule.init(event);
|
||||
}
|
||||
// Client only init, needs to be done before parts system
|
||||
proxy.init(event);
|
||||
// WorldGen
|
||||
|
@ -180,10 +169,6 @@ public class Core {
|
|||
|
||||
@Mod.EventHandler
|
||||
public void postinit(FMLPostInitializationEvent event) throws Exception {
|
||||
// Has to be done here as Buildcraft registers their recipes late
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
compatModule.postInit(event);
|
||||
}
|
||||
proxy.postInit(event);
|
||||
|
||||
ModRecipes.postInit();
|
||||
|
@ -197,9 +182,6 @@ public class Core {
|
|||
@Mod.EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
event.registerServerCommand(new TechRebornDevCommand());
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
compatModule.serverStarting(event);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
|
@ -32,8 +32,6 @@ public interface ISubItemRetriever {
|
|||
|
||||
ItemStack getCellByName(String name, int count);
|
||||
|
||||
ItemStack getCellByName(String name, int count, boolean lookForIC2);
|
||||
|
||||
ItemStack getDustByName(String name);
|
||||
|
||||
ItemStack getDustByName(String name, int count);
|
||||
|
|
|
@ -43,8 +43,6 @@ import reborncore.common.powerSystem.TilePowerAcceptor;
|
|||
import techreborn.Core;
|
||||
import techreborn.client.container.builder.slot.FilteredSlot;
|
||||
import techreborn.client.container.builder.slot.UpgradeSlot;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.utils.IC2ItemCharger;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.IntConsumer;
|
||||
|
@ -89,8 +87,7 @@ public class ContainerTileInventoryBuilder {
|
|||
|
||||
public ContainerTileInventoryBuilder energySlot(final int index, final int x, final int y) {
|
||||
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y)
|
||||
.setFilter(stack -> stack.hasCapability(CapabilityEnergy.ENERGY, EnumFacing.UP)
|
||||
|| (CompatManager.isIC2Loaded && IC2ItemCharger.isIC2PoweredItem(stack))));
|
||||
.setFilter(stack -> stack.hasCapability(CapabilityEnergy.ENERGY, EnumFacing.UP)));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat;
|
||||
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class CompatConfigs {
|
||||
@ConfigRegistry(config = "compat", category = "buildcraft", key = "ExpensiveQuarryRecipe", comment = "Buildcraft's quarry will require an advanced circuit and diamond drill if enabled")
|
||||
public static boolean expensiveQuarry = true;
|
||||
|
||||
@ConfigRegistry(config = "compat", category = "buildcraft", key = "EnableBuildcraftFuels", comment = "Allow Buildcraft fuels to be used in fuel generators")
|
||||
public static boolean allowBCFuels = true;
|
||||
|
||||
@ConfigRegistry(config = "compat", category = "theoneprobe", key = "EnableTOPSupport", comment = "Display machine info in The One Probe's HUD")
|
||||
public static boolean enableTOP = true;
|
||||
|
||||
@ConfigRegistry(config = "compat", category = "jei", key = "ShowScrabpox", comment = "Show Scrapbox loot in JEI")
|
||||
public static boolean showScrapbox = false;
|
||||
|
||||
}
|
|
@ -1,172 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistryFactory;
|
||||
import techreborn.compat.buildcraft.BuildcraftBuildersCompat;
|
||||
import techreborn.compat.buildcraft.BuildcraftCompat;
|
||||
import techreborn.compat.crafttweaker.CraftTweakerCompat;
|
||||
import techreborn.compat.ic2.RecipesIC2;
|
||||
import techreborn.compat.immersiveengineering.RecipeImmersiveEngineering;
|
||||
import techreborn.compat.opencomputers.CompatOpenComputers;
|
||||
import techreborn.compat.theoneprobe.TheOneProbeCompat;
|
||||
import techreborn.compat.thermalexpansion.RecipeThermalExpansion;
|
||||
import techreborn.compat.tinkers.CompatModuleTinkers;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CompatManager {
|
||||
|
||||
public static CompatManager INSTANCE = new CompatManager();
|
||||
public static boolean isIC2Loaded = false;
|
||||
public static boolean isQuantumStorageLoaded = false;
|
||||
public ArrayList<ICompatModule> compatModules = new ArrayList<>();
|
||||
|
||||
public CompatManager() {
|
||||
isIC2Loaded = Loader.isModLoaded("ic2");
|
||||
isQuantumStorageLoaded = Loader.isModLoaded("quantumstorage");
|
||||
register(CraftTweakerCompat.class, "crafttweaker");
|
||||
register(CompatModuleTinkers.class, "tconstruct");
|
||||
register(TheOneProbeCompat.class, "theoneprobe");
|
||||
//register(CompatModulePsi.class, "Psi");
|
||||
register(RecipesIC2.class, "ic2");
|
||||
register(BuildcraftBuildersCompat.class, "buildcraftbuilders");
|
||||
register(BuildcraftCompat.class, "buildcraftcore");
|
||||
register(RecipeThermalExpansion.class, "thermalexpansion");
|
||||
register(CompatOpenComputers.class, "opencomputers");
|
||||
register(RecipeImmersiveEngineering.class, "immersiveengineering");
|
||||
}
|
||||
|
||||
public void register(Class<? extends ICompatModule> moduleClass, Object... objs) {
|
||||
registerCompact(moduleClass, true, objs);
|
||||
}
|
||||
|
||||
public void registerCompact(Class<? extends ICompatModule> moduleClass, boolean config, Object... objs) {
|
||||
if(config){
|
||||
if(!shouldLoad(moduleClass.getSimpleName())){
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (Object obj : objs) {
|
||||
if (obj instanceof String) {
|
||||
String modid = (String) obj;
|
||||
if (modid.startsWith("@")) {
|
||||
if (modid.equals("@client")) {
|
||||
if (FMLCommonHandler.instance().getSide() != Side.CLIENT) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (modid.startsWith("!")) {
|
||||
if (Loader.isModLoaded(modid.replaceAll("!", ""))) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!Loader.isModLoaded(modid)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (obj instanceof Boolean) {
|
||||
Boolean boo = (Boolean) obj;
|
||||
if (!boo) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
compatModules.add(moduleClass.newInstance());
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//This is a hack, and is bad. Dont do this.
|
||||
public boolean shouldLoad(String name){
|
||||
ConfigRegistry configRegistry = new ConfigRegistry(){
|
||||
@Override
|
||||
public Class<? extends Annotation> annotationType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String category() {
|
||||
return "modules";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String key() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String comment() {
|
||||
return "Should the compat module '" + name + "' be loaded";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String config() {
|
||||
return "compat";
|
||||
}
|
||||
};
|
||||
|
||||
RebornRegistry rebornRegistry = new RebornRegistry(){
|
||||
|
||||
@Override
|
||||
public Class<? extends Annotation> annotationType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modID() {
|
||||
return ModInfo.MOD_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int priority() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean earlyReg() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
Configuration configuration = ConfigRegistryFactory.getOrCreateConfig(configRegistry, rebornRegistry);
|
||||
Property property = ConfigRegistryFactory.get(configRegistry.category(), configRegistry.key(), true, configRegistry.comment(), boolean.class, configuration);
|
||||
configuration.save();
|
||||
return property.getBoolean();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat;
|
||||
|
||||
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.FMLServerStartingEvent;
|
||||
|
||||
public interface ICompatModule {
|
||||
|
||||
public void preInit(FMLPreInitializationEvent event);
|
||||
|
||||
public void init(FMLInitializationEvent event);
|
||||
|
||||
public void postInit(FMLPostInitializationEvent event);
|
||||
|
||||
public void serverStarting(FMLServerStartingEvent event);
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.buildcraft;
|
||||
|
||||
import buildcraft.builders.BCBuildersBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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.FMLServerStartingEvent;
|
||||
import reborncore.common.util.RebornCraftingHelper;
|
||||
import reborncore.common.util.RecipeRemover;
|
||||
import techreborn.Core;
|
||||
import techreborn.compat.CompatConfigs;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
/**
|
||||
* Created by Mark on 02/06/2017.
|
||||
*/
|
||||
public class BuildcraftBuildersCompat implements ICompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if (CompatConfigs.expensiveQuarry) {
|
||||
RecipeRemover.removeAnyRecipe(new ItemStack(BCBuildersBlocks.quarry));
|
||||
RebornCraftingHelper.addShapedOreRecipe(new ItemStack(BCBuildersBlocks.quarry),
|
||||
"IAI", "GIG", "DED",
|
||||
'I', "gearIron",
|
||||
'G', "gearGold",
|
||||
'D', "gearDiamond",
|
||||
'A', "circuitAdvanced",
|
||||
'E', new ItemStack(ModItems.DIAMOND_DRILL));
|
||||
}
|
||||
//The recipebook still knows about the old recipe so crashes, this should update it to have it replaced by the new recipe
|
||||
Core.proxy.rebuildRecipeBook();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.buildcraft;
|
||||
|
||||
import buildcraft.api.fuels.IFuel;
|
||||
import buildcraft.lib.fluid.FuelRegistry;
|
||||
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.FMLServerStartingEvent;
|
||||
import reborncore.common.RebornCoreConfig;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.api.generator.GeneratorRecipeHelper;
|
||||
import techreborn.compat.CompatConfigs;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
/**
|
||||
* Created by Mark on 02/06/2017.
|
||||
*/
|
||||
public class BuildcraftCompat implements ICompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if (CompatConfigs.allowBCFuels) {
|
||||
for (IFuel fuel : FuelRegistry.INSTANCE.getFuels()) {
|
||||
// getPowerPerCycle returns micro mj values
|
||||
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.THERMAL, fuel.getFluid().getFluid(), (int) (fuel.getPowerPerCycle() / RebornCoreConfig.euPerFU * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
|
||||
/**
|
||||
* mods.techreborn.alloySmelter.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, <minecraft:diamond>, 20, 100);
|
||||
* mods.techreborn.alloySmelter.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, <minecraft:diamond>, 20, 100).setUseOreDict(false);
|
||||
*/
|
||||
|
||||
@ZenClass("mods.techreborn.alloySmelter")
|
||||
public class CTAlloySmelter extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick)")
|
||||
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
AlloySmelterRecipe r = new AlloySmelterRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.ALLOY_SMELTER_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.assemblingMachine")
|
||||
public class CTAssemblingMachine extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
AssemblingMachineRecipe r = new AssemblingMachineRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.ASSEMBLING_MACHINE_RECIPE;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.blastFurnace")
|
||||
public class CTBlastFurnace extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
BlastFurnaceRecipe r = new BlastFurnaceRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), ticktime, euTick, neededHeat);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.BLAST_FURNACE_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.centrifuge")
|
||||
public class CTCentrifuge extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
CentrifugeRecipe r = new CentrifugeRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.CENTRIFUGE_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.chemicalReactorRecipe")
|
||||
public class CTChemicalReactor extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
ChemicalReactorRecipe r = new ChemicalReactorRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.CHEMICAL_REACTOR_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.CompressorRecipe;
|
||||
|
||||
/*
|
||||
* mods.techreborn.compressor.addRecipe(<minecraft:clay>,<minecraft:clay_ball>, 40,100);
|
||||
*/
|
||||
|
||||
@ZenClass("mods.techreborn.compressor")
|
||||
public class CTCompressor extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IIngredient input1, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IIngredient input1, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
CompressorRecipe r = new CompressorRecipe(oInput1, CraftTweakerCompat.toStack(output1), ticktime, euTick);
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.COMPRESSOR_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.DistillationTowerRecipe;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
@ZenClass("mods.techreborn.distillationTower")
|
||||
public class CTDistillationTower extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
DistillationTowerRecipe r = new DistillationTowerRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.DISTILLATION_TOWER_RECIPE;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.ExtractorRecipe;
|
||||
|
||||
/**
|
||||
* mods.techreborn.extractor.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, 20, 100);
|
||||
*/
|
||||
@ZenClass("mods.techreborn.extractor")
|
||||
public class CTExtractor extends CTGeneric {
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient input1, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
|
||||
ExtractorRecipe r = new ExtractorRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.EXTRACTOR_RECIPE;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.api.generator.GeneratorRecipeHelper;
|
||||
|
||||
@ZenClass("mods.techreborn.fluidGen")
|
||||
public class CTFluidGen {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
|
||||
public static void addThermalFluid(ILiquidStack fluid, int energyPerMb) {
|
||||
addFluid(EFluidGenerator.THERMAL, fluid, energyPerMb);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
|
||||
public static void addGasFluid(ILiquidStack fluid, int energyPerMb) {
|
||||
addFluid(EFluidGenerator.GAS, fluid, energyPerMb);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
|
||||
public static void addSemiFluid(ILiquidStack fluid, int energyPerMb) {
|
||||
addFluid(EFluidGenerator.SEMIFLUID, fluid, energyPerMb);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
|
||||
public static void addDieselFluid(ILiquidStack fluid, int energyPerMb) {
|
||||
addFluid(EFluidGenerator.DIESEL, fluid, energyPerMb);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
|
||||
public static void addPlasmaFluid(ILiquidStack fluid, int energyPerMb) {
|
||||
addFluid(EFluidGenerator.PLASMA, fluid, energyPerMb);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removeThermalFluid(ILiquidStack fluid) {
|
||||
removeFluid(EFluidGenerator.THERMAL, fluid);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removeGasFluid(ILiquidStack fluid) {
|
||||
removeFluid(EFluidGenerator.GAS, fluid);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removeSemiFluid(ILiquidStack fluid) {
|
||||
removeFluid(EFluidGenerator.SEMIFLUID, fluid);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removeDieselFluid(ILiquidStack fluid) {
|
||||
removeFluid(EFluidGenerator.DIESEL, fluid);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removePlasmaFluid(ILiquidStack fluid) {
|
||||
removeFluid(EFluidGenerator.PLASMA, fluid);
|
||||
}
|
||||
|
||||
private static void addFluid(EFluidGenerator type, ILiquidStack fluid, int energyPerMb) {
|
||||
GeneratorRecipeHelper.registerFluidRecipe(type, CraftTweakerCompat.toFluidStack(fluid).getFluid(), energyPerMb);
|
||||
}
|
||||
|
||||
private static void removeFluid(EFluidGenerator type, ILiquidStack fluid) {
|
||||
GeneratorRecipeHelper.removeFluidRecipe(type, CraftTweakerCompat.toFluidStack(fluid).getFluid());
|
||||
}
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipe;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipeList;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
@ZenClass("mods.techreborn.fluidReplicator")
|
||||
public class CTFluidReplicator {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("int input, ILiquidStack output, int ticks, int euPerTick")
|
||||
public static void addRecipe(int input, ILiquidStack output, int ticks, int euPerTick) {
|
||||
if (input > 0 || ticks > 0 || euPerTick > 0) {
|
||||
FluidReplicatorRecipeList.addRecipe(new FluidReplicatorRecipe(input,
|
||||
CraftTweakerCompat.toFluidStack(output).getFluid(), ticks, euPerTick));
|
||||
}
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("ILiquidStack fluid")
|
||||
public static void removeRecipe(ILiquidStack output) {
|
||||
Optional<FluidReplicatorRecipe> recipe = FluidReplicatorRecipeList
|
||||
.getRecipeForFluid(CraftTweakerCompat.toFluidStack(output).getFluid());
|
||||
if (recipe.isPresent()) {
|
||||
FluidReplicatorRecipeList.removeRecipe(recipe.get());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,181 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.IAction;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.minecraft.CraftTweakerMC;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ZenClass("mods.techreborn.fusionReactor")
|
||||
public class CTFusionReactor {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime")
|
||||
public static void addRecipe(IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime) {
|
||||
FusionReactorRecipe reactorRecipe = new FusionReactorRecipe((ItemStack) CraftTweakerCompat.toObject(topInput), (ItemStack) CraftTweakerCompat.toObject(bottomInput), CraftTweakerCompat.toStack(output), startEU, euTick, tickTime);
|
||||
CraftTweakerAPI.apply(new Add(reactorRecipe));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeTopInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveTopInput(iIngredient));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeBottomInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveBottomInput(iIngredient));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output)));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll() {
|
||||
CraftTweakerAPI.apply(new RemoveAll());
|
||||
}
|
||||
|
||||
private static class Add implements IAction {
|
||||
private final FusionReactorRecipe recipe;
|
||||
|
||||
public Add(FusionReactorRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
FusionReactorRecipeHelper.registerRecipe(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding Fusion Reactor recipe for " + recipe.getOutput().getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove implements IAction {
|
||||
private final ItemStack output;
|
||||
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
if (ItemUtils.isItemEqual(recipeType.getOutput(), output, true, false)) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class RemoveTopInput implements IAction {
|
||||
private final IIngredient output;
|
||||
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
|
||||
|
||||
public RemoveTopInput(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
if (output.matches(CraftTweakerMC.getIItemStack(recipeType.getTopInput()))) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe";
|
||||
}
|
||||
}
|
||||
|
||||
private static class RemoveBottomInput implements IAction {
|
||||
private final IIngredient output;
|
||||
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
|
||||
|
||||
public RemoveBottomInput(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
if (output.matches(CraftTweakerMC.getIItemStack(recipeType.getBottomInput()))) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe";
|
||||
}
|
||||
}
|
||||
|
||||
private static class RemoveAll implements IAction {
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
FusionReactorRecipeHelper.reactorRecipes.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing all Fusion Reactor recipes";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,152 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.IAction;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.minecraft.CraftTweakerMC;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.api.recipe.IBaseRecipeType;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CTGeneric {
|
||||
|
||||
public static void addRecipe(BaseRecipe recipe) {
|
||||
CraftTweakerAPI.apply(new Add(recipe));
|
||||
}
|
||||
|
||||
private static class Add implements IAction {
|
||||
private final BaseRecipe recipe;
|
||||
|
||||
public Add(BaseRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
RecipeHandler.addRecipe(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding " + recipe.getRecipeName() + " recipe for " + recipe.getOutput(0).getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Remove implements IAction {
|
||||
private final ItemStack output;
|
||||
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
|
||||
private final String name;
|
||||
|
||||
public Remove(ItemStack output, String machineName) {
|
||||
this.output = output;
|
||||
this.name = machineName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + name + " recipe for " + output.getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
public static class RemoveInput implements IAction {
|
||||
private final IIngredient ingredient;
|
||||
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
|
||||
private final String name;
|
||||
|
||||
public RemoveInput(IIngredient ingredient, String machineName) {
|
||||
this.ingredient = ingredient;
|
||||
this.name = machineName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
|
||||
for (Object recipeInput : recipeType.getInputs()) {
|
||||
ItemStack ingredientStack = CraftTweakerMC.getItemStack(ingredient);
|
||||
if (!ingredientStack.isEmpty()) {
|
||||
if (ItemUtils.isInputEqual(recipeInput, ingredientStack, true, false, true)) {
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
//Old method of checking, just in case
|
||||
} else if(recipeInput instanceof ItemStack && ingredient.matches(CraftTweakerMC.getIItemStack((ItemStack) recipeInput))){
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + name + " recipe";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class RemoveAll implements IAction {
|
||||
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
|
||||
private final String name;
|
||||
|
||||
public RemoveAll(String machineName) {
|
||||
this.name = machineName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing all recipes from " + name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
|
||||
/**
|
||||
* mods.techreborn.grinder.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, 20, 100);
|
||||
*/
|
||||
|
||||
@ZenClass("mods.techreborn.grinder")
|
||||
public class CTGrinder extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient input1, int ticktime, int euTick")
|
||||
public static void addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
|
||||
GrinderRecipe r = new GrinderRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.GRINDER_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.implosionCompressor")
|
||||
public class CTImplosionCompressor extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
ImplosionCompressorRecipe r = new ImplosionCompressorRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.IMPLOSION_COMPRESSOR_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.industrialElectrolyzer")
|
||||
public class CTIndustrialElectrolyzer extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(cells);
|
||||
Object oInput2 = CraftTweakerCompat.toObject(input2);
|
||||
|
||||
IndustrialElectrolyzerRecipe r = new IndustrialElectrolyzerRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.INDUSTRIAL_ELECTROLYZER_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
||||
|
||||
/**
|
||||
* Craftweaker class to change Industrial Grinder recipes.
|
||||
*/
|
||||
@ZenClass("mods.techreborn.industrialGrinder")
|
||||
public class CTIndustrialGrinder extends CTGeneric {
|
||||
|
||||
/**
|
||||
* Add recipe for Industrial Grinder
|
||||
* @param output1 ItemStack First recipe output
|
||||
* @param output2 ItemStack Second recipe output
|
||||
* @param output3 ItemStack Third recipe output
|
||||
* @param output4 ItemStack Fourth recipe output
|
||||
* @param input1 First recipe input
|
||||
* @param input2 Second recipe input. Not used )
|
||||
* @param ticktime Amount of ticks to complete crafting
|
||||
* @param euTick Amount of EU per tick consumed during crafting
|
||||
* @return RecipeSettings RecipeSettings for this recipe
|
||||
*/
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
return addRecipe(output1, output2, output3, output4, input1, input2, null, ticktime, euTick);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add recipe for Industrial Grinder
|
||||
* @param output1 ItemStack First recipe output
|
||||
* @param output2 ItemStack Second recipe output
|
||||
* @param output3 ItemStack Third recipe output
|
||||
* @param output4 ItemStack Fourth recipe output
|
||||
* @param input1 First recipe input
|
||||
* @param input2 Second recipe input. Not used )
|
||||
* @param fluid LiquidStack Liquid used for grinding
|
||||
* @param ticktime Amount of ticks to complete crafting
|
||||
* @param euTick Amount of EU per tick consumed during crafting
|
||||
* @return RecipeSettings RecipeSettings for this recipe
|
||||
*/
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
|
||||
// There is only one input slot in Industrial Grinder
|
||||
//ItemStack oInput2 = (ItemStack) CraftTweakerCompat.toObject(input2);
|
||||
|
||||
FluidStack fluidStack = null;
|
||||
if (fluid != null) {
|
||||
fluidStack = CraftTweakerCompat.toFluidStack(fluid);
|
||||
}
|
||||
|
||||
IndustrialGrinderRecipe r = new IndustrialGrinderRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove recipe for Industrial Grinder based on input ingredient
|
||||
* @param iIngredient Recipe input for which we should remove recipe
|
||||
*/
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) { CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName())); }
|
||||
|
||||
/**
|
||||
* Remove recipe for Industrial Grinder based on output
|
||||
* @param output Recipe output for which we should remove recipe
|
||||
*/
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get reference machine name
|
||||
* @return String Reference name for Industrial Grinder
|
||||
*/
|
||||
public static String getMachineName() {
|
||||
return Reference.INDUSTRIAL_GRINDER_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.industrialSawmill")
|
||||
public class CTIndustrialSawmill extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick) {
|
||||
return addRecipe(output1, output2, output3, input1, fluid, ticktime, euTick, true);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick) {
|
||||
return addRecipe(output1, output2, output3, input1, null, ticktime, euTick, true);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick, boolean useOreDic")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick, boolean useOreDic) {
|
||||
return addRecipe(output1, output2, output3, input1, null, ticktime, euTick, useOreDic);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic")
|
||||
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
|
||||
FluidStack fluidStack = null;
|
||||
if (fluid != null) {
|
||||
fluidStack = CraftTweakerCompat.toFluidStack(fluid);
|
||||
}
|
||||
|
||||
IndustrialSawmillRecipe r = new IndustrialSawmillRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), ticktime, euTick, useOreDic);
|
||||
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.INDUSTRIAL_SAWMILL_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,150 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.IAction;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import gnu.trove.set.TCharSet;
|
||||
import gnu.trove.set.hash.TCharHashSet;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
import techreborn.api.TechRebornAPI;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ZenClass("mods.techreborn.rollingMachine")
|
||||
public class CTRollingMachine {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient[][] ingredients")
|
||||
public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
|
||||
TechRebornAPI.addRollingOreMachinceRecipe(RollingMachineRecipe.getNameForRecipe(CraftTweakerCompat.toStack(output)), CraftTweakerCompat.toStack(output), toShapedObjects(ingredients));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient[] ingredients")
|
||||
public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
|
||||
TechRebornAPI.addShapelessOreRollingMachinceRecipe(RollingMachineRecipe.getNameForRecipe(CraftTweakerCompat.toStack(output)), CraftTweakerCompat.toStack(output), toObjects(ingredients));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
List<ResourceLocation> toRemove = new ArrayList<>();
|
||||
for (Map.Entry<ResourceLocation, IRecipe> recipe : RollingMachineRecipe.instance.getRecipeList().entrySet()) {
|
||||
if (ItemUtils.isItemEqual(recipe.getValue().getRecipeOutput(), CraftTweakerCompat.toStack(output), true, false)) {
|
||||
toRemove.add(recipe.getKey());
|
||||
}
|
||||
}
|
||||
for (ResourceLocation resourceLocation : toRemove) {
|
||||
RollingMachineRecipe.instance.getRecipeList().remove(resourceLocation);
|
||||
}
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll() {
|
||||
CraftTweakerAPI.apply(new RemoveAll());
|
||||
}
|
||||
|
||||
private static class RemoveAll implements IAction{
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
RollingMachineRecipe.instance.getRecipeList().clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing all Rolling Machine recipes";
|
||||
}
|
||||
}
|
||||
|
||||
//Stolen from https://github.com/jaredlll08/MTLib/blob/1.12/src/main/java/com/blamejared/mtlib/helpers/InputHelper.java#L170-L213
|
||||
//License as seen here: https://github.com/jaredlll08/MTLib/blob/1.12/LICENSE.md (MIT at time of writing)
|
||||
public static Object[] toShapedObjects(IIngredient[][] ingredients) {
|
||||
if (ingredients == null)
|
||||
return null;
|
||||
else {
|
||||
ArrayList<Object> prep = new ArrayList<>();
|
||||
TCharSet usedCharSet = new TCharHashSet();
|
||||
|
||||
prep.add("abc");
|
||||
prep.add("def");
|
||||
prep.add("ghi");
|
||||
char[][] map = new char[][] { { 'a', 'b', 'c' }, { 'd', 'e', 'f' }, { 'g', 'h', 'i' } };
|
||||
for (int x = 0; x < ingredients.length; x++) {
|
||||
if (ingredients[x] != null) {
|
||||
for (int y = 0; y < ingredients[x].length; y++) {
|
||||
if (ingredients[x][y] != null && x < map.length && y < map[x].length) {
|
||||
prep.add(map[x][y]);
|
||||
usedCharSet.add(map[x][y]);
|
||||
prep.add(CraftTweakerCompat.toObject(ingredients[x][y]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 3; i++) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (prep.get(i) instanceof String) {
|
||||
String s = (String) prep.get(i);
|
||||
for (int j = 0; j < 3; j++) {
|
||||
char c = s.charAt(j);
|
||||
if (usedCharSet.contains(c)) {
|
||||
sb.append(c);
|
||||
} else {
|
||||
sb.append(" ");
|
||||
}
|
||||
}
|
||||
prep.set(i, sb.toString());
|
||||
}
|
||||
}
|
||||
return prep.toArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static Object[] toObjects(IIngredient[] ingredient) {
|
||||
if (ingredient == null)
|
||||
return null;
|
||||
else {
|
||||
Object[] output = new Object[ingredient.length];
|
||||
for (int i = 0; i < ingredient.length; i++) {
|
||||
if (ingredient[i] != null) {
|
||||
output[i] = CraftTweakerCompat.toObject(ingredient[i]);
|
||||
} else
|
||||
output[i] = "";
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.IAction;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.minecraft.CraftTweakerMC;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.ScrapboxRecipe;
|
||||
import techreborn.compat.crafttweaker.CTGeneric.Remove;
|
||||
|
||||
/**
|
||||
* Created by Mark on 02/06/2017.
|
||||
*/
|
||||
@ZenClass("mods.techreborn.scrapbox")
|
||||
public class CTScrapbox {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient input")
|
||||
public static void addScrapboxDrop(IIngredient input) {
|
||||
RecipeHandler.addRecipe(new ScrapboxRecipe(CraftTweakerMC.getItemStack(input), 20, 2));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll() {
|
||||
CraftTweakerAPI.apply(new RemoveAll());
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.SCRAPBOX_RECIPE;
|
||||
}
|
||||
|
||||
public static class RemoveAll implements IAction {
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
RecipeHandler.recipeList.removeAll(RecipeHandler.getRecipeClassFromName(Reference.SCRAPBOX_RECIPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing all Scrapbox recipies";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.vacuumFreezer")
|
||||
public class CTVacuumFreezer extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output, IIngredient input, int ticktime, int euTick")
|
||||
public static RecipeSettings addRecipe(IItemStack output, IIngredient input, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input);
|
||||
|
||||
VacuumFreezerRecipe r = new VacuumFreezerRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick);
|
||||
addRecipe(r);
|
||||
return new RecipeSettings(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IIngredient iIngredient")
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("IItemStack output")
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.VACUUM_FREEZER_RECIPE;
|
||||
}
|
||||
}
|
|
@ -1,111 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.item.IngredientStack;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import crafttweaker.api.oredict.IOreDictEntry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
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.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
import static crafttweaker.api.minecraft.CraftTweakerMC.getItemStack;
|
||||
import static crafttweaker.api.minecraft.CraftTweakerMC.getLiquidStack;
|
||||
|
||||
public class CraftTweakerCompat implements ICompatModule {
|
||||
public static ItemStack toStack(IItemStack iStack) {
|
||||
if (iStack == null){
|
||||
return null;
|
||||
}
|
||||
return getItemStack(iStack);
|
||||
}
|
||||
|
||||
public static Object toObject(IIngredient iStack) {
|
||||
if (iStack == null)
|
||||
return null;
|
||||
else {
|
||||
if (iStack instanceof IOreDictEntry)
|
||||
return ((IOreDictEntry) iStack).getName();
|
||||
else if (iStack instanceof IItemStack)
|
||||
return getItemStack((IItemStack) iStack);
|
||||
else if (iStack instanceof IngredientStack) {
|
||||
IIngredient ingr = ReflectionHelper.getPrivateValue(IngredientStack.class, (IngredientStack) iStack, "ingredient");
|
||||
return toObject(ingr);
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static FluidStack toFluidStack(ILiquidStack iStack) {
|
||||
return getLiquidStack(iStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
CraftTweakerAPI.registerClass(CTAlloySmelter.class);
|
||||
CraftTweakerAPI.registerClass(CTAssemblingMachine.class);
|
||||
CraftTweakerAPI.registerClass(CTBlastFurnace.class);
|
||||
CraftTweakerAPI.registerClass(CTCentrifuge.class);
|
||||
CraftTweakerAPI.registerClass(CTChemicalReactor.class);
|
||||
CraftTweakerAPI.registerClass(CTCompressor.class);
|
||||
CraftTweakerAPI.registerClass(CTIndustrialGrinder.class);
|
||||
CraftTweakerAPI.registerClass(CTImplosionCompressor.class);
|
||||
CraftTweakerAPI.registerClass(CTIndustrialElectrolyzer.class);
|
||||
CraftTweakerAPI.registerClass(CTIndustrialSawmill.class);
|
||||
CraftTweakerAPI.registerClass(CTFusionReactor.class);
|
||||
CraftTweakerAPI.registerClass(CTVacuumFreezer.class);
|
||||
CraftTweakerAPI.registerClass(CTFluidGen.class);
|
||||
CraftTweakerAPI.registerClass(CTRollingMachine.class);
|
||||
CraftTweakerAPI.registerClass(CTScrapbox.class);
|
||||
CraftTweakerAPI.registerClass(CTDistillationTower.class);
|
||||
CraftTweakerAPI.registerClass(CTGrinder.class);
|
||||
CraftTweakerAPI.registerClass(CTExtractor.class);
|
||||
CraftTweakerAPI.registerClass(CTFluidReplicator.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
@ZenClass("mods.techreborn.RecipeSettings")
|
||||
public class RecipeSettings {
|
||||
|
||||
private BaseRecipe baseRecipe;
|
||||
|
||||
public RecipeSettings(BaseRecipe baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@ZenDocumentation("boolean useOreDict")
|
||||
public void setUseOreDict(boolean useOreDict){
|
||||
baseRecipe.setOreDict(useOreDict);
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* This is used to give better detail for a method's parameters when generating the crafttweaker documentation.
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface ZenDocumentation {
|
||||
|
||||
String value();
|
||||
|
||||
}
|
|
@ -1,123 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.ic2;
|
||||
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.core.ref.ItemName;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
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.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.util.RebornCraftingHelper;
|
||||
import techreborn.api.recipe.machines.CompressorRecipe;
|
||||
import techreborn.api.recipe.machines.ExtractorRecipe;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.init.recipes.RecipeMethods;
|
||||
import techreborn.items.ItemParts;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Mark on 06/06/2016.
|
||||
*/
|
||||
public class RecipesIC2 implements ICompatModule {
|
||||
|
||||
List<RecipeDuplicate> recipeDuplicateList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
// LOW is used as we want it to load as late as possible, but before crafttweaker
|
||||
@SubscribeEvent(priority = EventPriority.LOW)
|
||||
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
|
||||
recipeDuplicateList.add(new RecipeDuplicate(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 0),
|
||||
IC2Items.getItem("resource", "machine")));
|
||||
|
||||
for (RecipeDuplicate duplicate : recipeDuplicateList) {
|
||||
duplicate.add();
|
||||
}
|
||||
|
||||
RebornCraftingHelper.addShapelessRecipe(ItemParts.getPartByName("rubber"),
|
||||
IC2Items.getItem("crafting", "rubber"));
|
||||
RebornCraftingHelper.addShapelessRecipe(IC2Items.getItem("crafting", "rubber"),
|
||||
ItemParts.getPartByName("rubber"));
|
||||
RebornCraftingHelper.addShapelessRecipe(IC2Items.getItem("electric_wrench"), new ItemStack(ModItems.WRENCH),
|
||||
IC2Items.getItem("crafting", "small_power_unit"));
|
||||
|
||||
RecipeHandler.addRecipe(new CompressorRecipe(IC2Items.getItem("crafting", "carbon_mesh"),
|
||||
IC2Items.getItem("crafting", "carbon_plate"), 300, 4));
|
||||
RecipeHandler.addRecipe(new CompressorRecipe(IC2Items.getItem("crafting", "coal_ball"),
|
||||
IC2Items.getItem("crafting", "coal_block"), 300, 4));
|
||||
|
||||
RecipeHandler.addRecipe(new GrinderRecipe(ItemName.crafting.getItemStack("tin_can"),
|
||||
RecipeMethods.getOre("dustTin", 2), 300, 16));
|
||||
|
||||
RecipeHandler.addRecipe(new ExtractorRecipe(ItemName.filled_tin_can.getItemStack(),
|
||||
ItemName.crafting.getItemStack("tin_can"), 300, 16));
|
||||
}
|
||||
|
||||
public class RecipeDuplicate {
|
||||
ItemStack stack1;
|
||||
ItemStack stack2;
|
||||
|
||||
public RecipeDuplicate(ItemStack stack1, ItemStack stack2) {
|
||||
this.stack1 = stack1;
|
||||
this.stack2 = stack2;
|
||||
}
|
||||
|
||||
public void add() {
|
||||
RebornCraftingHelper.addShapelessRecipe(stack2, stack1);
|
||||
RebornCraftingHelper.addShapelessRecipe(stack1, stack2);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.immersiveengineering;
|
||||
|
||||
|
||||
import blusunrize.immersiveengineering.common.IEContent;
|
||||
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.FMLServerStartingEvent;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.api.generator.GeneratorRecipeHelper;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
public class RecipeImmersiveEngineering implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.SEMIFLUID, IEContent.fluidCreosote, 40);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.*;
|
||||
|
||||
public abstract class BaseRecipeWrapper<T extends BaseRecipe> implements IRecipeWrapper {
|
||||
protected final T baseRecipe;
|
||||
@Nonnull
|
||||
private final List<List<ItemStack>> inputs;
|
||||
@Nonnull
|
||||
private final List<List<ItemStack>> outputs;
|
||||
|
||||
public BaseRecipeWrapper(T baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
|
||||
inputs = new ArrayList<>();
|
||||
outputs = new ArrayList<>();
|
||||
for (Object input : baseRecipe.getInputs()) {
|
||||
if (input instanceof ItemStack) {
|
||||
ItemStack stack = (ItemStack) input;
|
||||
if (baseRecipe.useOreDic()) {
|
||||
List<ItemStack> oreDictInputs = expandOreDict(stack);
|
||||
inputs.add(oreDictInputs);
|
||||
} else {
|
||||
inputs.add(Collections.singletonList(stack));
|
||||
}
|
||||
} else if (input instanceof String) {
|
||||
inputs.add(OreDictionary.getOres((String) input));
|
||||
}
|
||||
}
|
||||
for (ItemStack input : baseRecipe.getOutputs()) {
|
||||
if (baseRecipe.useOreDic()) {
|
||||
List<ItemStack> oreDictInputs = expandOreDict(input);
|
||||
outputs.add(oreDictInputs);
|
||||
} else {
|
||||
outputs.add(Collections.singletonList(input));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static List<ItemStack> expandOreDict(ItemStack itemStack) {
|
||||
int[] oreIds = OreDictionary.getOreIDs(itemStack);
|
||||
if (oreIds.length == 0) {
|
||||
return Collections.singletonList(itemStack);
|
||||
}
|
||||
|
||||
Set<ItemStack> itemStackSet = new HashSet<>();
|
||||
for (int oreId : oreIds) {
|
||||
String oreName = OreDictionary.getOreName(oreId);
|
||||
List<ItemStack> ores = OreDictionary.getOres(oreName);
|
||||
for (ItemStack ore : ores) {
|
||||
if (ore.getCount() != itemStack.getCount()) {
|
||||
ItemStack oreCopy = ore.copy();
|
||||
oreCopy.setCount(itemStack.getCount());
|
||||
itemStackSet.add(oreCopy);
|
||||
} else {
|
||||
itemStackSet.add(ore);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList<>(itemStackSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
ingredients.setInputLists(ItemStack.class, inputs);
|
||||
ingredients.setOutputs(ItemStack.class, baseRecipe.getOutputs());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public List<List<ItemStack>> getInputs() {
|
||||
return inputs;
|
||||
}
|
||||
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs() {
|
||||
List<ItemStack> stacks = new ArrayList<>();
|
||||
for (List<ItemStack> stackList : outputs) {
|
||||
stacks.addAll(stackList);
|
||||
}
|
||||
return stacks;
|
||||
}
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei;
|
||||
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferInfo;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BuiltContainerTransferInfo implements IRecipeTransferInfo<BuiltContainer> {
|
||||
|
||||
private final String containerName, recipeCategory;
|
||||
|
||||
private final int recipeSlotStart, recipeSlotCount, inventorySlotStart, inventorySlotCount;
|
||||
|
||||
public BuiltContainerTransferInfo(final String containerName, final String recipeCategory,
|
||||
final int recipeSlotStart, final int recipeSlotCount, final int inventorySlotStart,
|
||||
final int inventorySlotCount) {
|
||||
this.containerName = containerName;
|
||||
this.recipeCategory = recipeCategory;
|
||||
|
||||
this.recipeSlotStart = recipeSlotStart;
|
||||
this.recipeSlotCount = recipeSlotCount;
|
||||
|
||||
this.inventorySlotStart = inventorySlotStart;
|
||||
this.inventorySlotCount = inventorySlotCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<BuiltContainer> getContainerClass() {
|
||||
return BuiltContainer.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return this.recipeCategory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHandle(final BuiltContainer container) {
|
||||
return container.getName().equals(this.containerName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> getRecipeSlots(final BuiltContainer container) {
|
||||
final List<Slot> slots = new ArrayList<>();
|
||||
for (int i = this.recipeSlotStart; i < this.recipeSlotStart + this.recipeSlotCount; i++)
|
||||
slots.add(container.getSlot(i));
|
||||
return slots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> getInventorySlots(final BuiltContainer container) {
|
||||
final List<Slot> slots = new ArrayList<>();
|
||||
for (int i = this.inventorySlotStart; i < this.inventorySlotStart + this.inventorySlotCount; i++)
|
||||
slots.add(container.getSlot(i));
|
||||
return slots;
|
||||
}
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei;
|
||||
|
||||
public class RecipeCategoryUids {
|
||||
public static final String ALLOY_SMELTER = "TechReborn.AlloySmelter";
|
||||
public static final String ASSEMBLING_MACHINE = "TechReborn.AssemblingMachine";
|
||||
public static final String BLAST_FURNACE = "TechReborn.BlastFurnace";
|
||||
public static final String CENTRIFUGE = "TechReborn.Centrifuge";
|
||||
public static final String CHEMICAL_REACTOR = "TechReborn.ChemicalReactor";
|
||||
public static final String FUSION_REACTOR = "TechReborn.FusionReactor";
|
||||
public static final String INDUSTRIAL_GRINDER = "TechReborn.IndustrialGrinder";
|
||||
public static final String IMPLOSION_COMPRESSOR = "TechReborn.ImplosionCompressor";
|
||||
public static final String INDUSTRIAL_ELECTROLYZER = "TechReborn.IndustrialElectrolyzer";
|
||||
public static final String ROLLING_MACHINE = "TechReborn.RollingMachine";
|
||||
public static final String VACUUM_FREEZER = "TechReborn.VacuumFreezer";
|
||||
public static final String GRINDER = "TechReborn.Grinder";
|
||||
public static final String EXTRACTOR = "TechReborn.Extractor";
|
||||
public static final String COMPRESSOR = "TechReborn.Compressor";
|
||||
public static final String SCRAPBOX = "TechReborn.Scrapbox";
|
||||
public static final String INDUSTRIAL_SAWMILL = "TechReborn.IndustrialSawmill";
|
||||
public static final String DISTILLATION_TOWER = "TechReborn.DistillationTower";
|
||||
public static final String FLUID_REPLICATOR = "TechReborn.FluidReplicator";
|
||||
|
||||
private RecipeCategoryUids() {
|
||||
}
|
||||
}
|
|
@ -1,187 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei;
|
||||
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.util.StringUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class RecipeUtil {
|
||||
private static final int color = Color.darkGray.getRGB();
|
||||
|
||||
private RecipeUtil() {
|
||||
}
|
||||
|
||||
public static void drawInfo(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int x, int y, final double startCost,
|
||||
final double euPerTick, final int tickTime) {
|
||||
FontRenderer fontRenderer = minecraft.fontRenderer;
|
||||
int lineSpacing = fontRenderer.FONT_HEIGHT + 1;
|
||||
|
||||
String startCostEU = PowerSystem.getLocaliszedPower(startCost);
|
||||
//String startCostString = I18n.translateToLocalFormatted("techreborn.jei.recipe.start.cost", startCostEU);
|
||||
String startCostString = StringUtils.t("techreborn.jei.recipe.start.cost", startCostEU);
|
||||
fontRenderer.drawString(startCostString, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
drawInfo(minecraft, x, y, euPerTick, tickTime);
|
||||
}
|
||||
|
||||
public static void drawInfo(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int x, int y, final double euPerTick, final int tickTime) {
|
||||
FontRenderer fontRenderer = minecraft.fontRenderer;
|
||||
int lineSpacing = fontRenderer.FONT_HEIGHT + 1;
|
||||
|
||||
String runningCostString = StringUtils.t("techreborn.jei.recipe.running.cost", PowerSystem.getDisplayPower().abbreviation.toUpperCase(), PowerSystem.getLocaliszedPowerFormattedNoSuffix(euPerTick));
|
||||
//String runningCostString = I18n.translateToLocalFormatted("techreborn.jei.recipe.running.cost",PowerSystem.getDisplayPower().abbreviation.toUpperCase(), PowerSystem.getLocaliszedPowerFormattedNoSuffix(euPerTick));
|
||||
fontRenderer.drawString(runningCostString, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
// String processingTimeString1 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.1", tickTime);
|
||||
String processingTimeString1 = StringUtils.t("techreborn.jei.recipe.processing.time.1", tickTime);
|
||||
fontRenderer.drawString(processingTimeString1, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
int seconds = tickTime / 20;
|
||||
//String processingTimeString2 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.2", seconds);
|
||||
String processingTimeString2 = StringUtils.t("techreborn.jei.recipe.processing.time.2", seconds);
|
||||
fontRenderer.drawString(processingTimeString2, x + 10, y, color);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void setRecipeItems(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
BaseRecipeWrapper<?> recipe,
|
||||
@Nullable
|
||||
int[] itemInputSlots,
|
||||
@Nullable
|
||||
int[] itemOutputSlots,
|
||||
@Nullable
|
||||
int[] fluidInputSlots,
|
||||
@Nullable
|
||||
int[] fluidOutputSlots) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
|
||||
if (itemInputSlots != null) {
|
||||
List<List<ItemStack>> inputs = recipe.getInputs();
|
||||
for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++) {
|
||||
int inputSlot = itemInputSlots[i];
|
||||
guiItemStacks.set(inputSlot, inputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (itemOutputSlots != null) {
|
||||
List<ItemStack> outputs = recipe.getOutputs();
|
||||
for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++) {
|
||||
int outputSlot = itemOutputSlots[i];
|
||||
guiItemStacks.set(outputSlot, outputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidInputSlots != null) {
|
||||
List<FluidStack> fluidInputs = recipe.getFluidInputs();
|
||||
for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++) {
|
||||
int inputTank = fluidInputSlots[i];
|
||||
guiFluidStacks.set(inputTank, fluidInputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
//TODO 1.11
|
||||
// if (fluidOutputSlots != null) {
|
||||
// List<FluidStack> fluidOutputs = recipe.getFluidOutputs();
|
||||
// for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++) {
|
||||
// int outputTank = fluidOutputSlots[i];
|
||||
// guiFluidStacks.set(outputTank, fluidOutputs.get(i));
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
public static void setRecipeItems(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
IIngredients ingredients,
|
||||
@Nullable
|
||||
int[] itemInputSlots,
|
||||
@Nullable
|
||||
int[] itemOutputSlots,
|
||||
@Nullable
|
||||
int[] fluidInputSlots,
|
||||
@Nullable
|
||||
int[] fluidOutputSlots) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
|
||||
if (itemInputSlots != null) {
|
||||
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
|
||||
for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++) {
|
||||
int inputSlot = itemInputSlots[i];
|
||||
guiItemStacks.set(inputSlot, inputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (itemOutputSlots != null) {
|
||||
List<List<ItemStack>> outputs = ingredients.getOutputs(ItemStack.class);
|
||||
for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++) {
|
||||
int outputSlot = itemOutputSlots[i];
|
||||
guiItemStacks.set(outputSlot, outputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidInputSlots != null) {
|
||||
List<List<FluidStack>> fluidInputs = ingredients.getInputs(FluidStack.class);
|
||||
for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++) {
|
||||
int inputTank = fluidInputSlots[i];
|
||||
guiFluidStacks.set(inputTank, fluidInputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidOutputSlots != null) {
|
||||
List<List<FluidStack>> fluidOutputs = ingredients.getOutputs(FluidStack.class);
|
||||
for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++) {
|
||||
int outputTank = fluidOutputSlots[i];
|
||||
guiFluidStacks.set(outputTank, fluidOutputs.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,506 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei;
|
||||
|
||||
import mezz.jei.api.*;
|
||||
import mezz.jei.api.gui.IAdvancedGuiHandler;
|
||||
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferRegistry;
|
||||
import mezz.jei.collect.ListMultiMap;
|
||||
import mezz.jei.config.Config;
|
||||
import mezz.jei.gui.TooltipRenderer;
|
||||
import mezz.jei.gui.recipes.RecipeClickableArea;
|
||||
import mezz.jei.util.ErrorUtil;
|
||||
import mezz.jei.util.Translator;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.Core;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipe;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipeList;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.api.generator.FluidGeneratorRecipe;
|
||||
import techreborn.api.generator.GeneratorRecipeHelper;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
import techreborn.api.recipe.machines.*;
|
||||
import techreborn.blocks.cable.EnumCableType;
|
||||
import techreborn.client.gui.*;
|
||||
import techreborn.client.gui.slot.GuiSlotConfiguration;
|
||||
import techreborn.compat.CompatConfigs;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.compat.jei.alloySmelter.AlloySmelterRecipeCategory;
|
||||
import techreborn.compat.jei.alloySmelter.AlloySmelterRecipeWrapper;
|
||||
import techreborn.compat.jei.assemblingMachine.AssemblingMachineRecipeCategory;
|
||||
import techreborn.compat.jei.assemblingMachine.AssemblingMachineRecipeWrapper;
|
||||
import techreborn.compat.jei.blastFurnace.BlastFurnaceRecipeCategory;
|
||||
import techreborn.compat.jei.blastFurnace.BlastFurnaceRecipeWrapper;
|
||||
import techreborn.compat.jei.centrifuge.CentrifugeRecipeCategory;
|
||||
import techreborn.compat.jei.centrifuge.CentrifugeRecipeWrapper;
|
||||
import techreborn.compat.jei.chemicalReactor.ChemicalReactorRecipeCategory;
|
||||
import techreborn.compat.jei.chemicalReactor.ChemicalReactorRecipeWrapper;
|
||||
import techreborn.compat.jei.compressor.CompressorRecipeCategory;
|
||||
import techreborn.compat.jei.compressor.CompressorRecipeWrapper;
|
||||
import techreborn.compat.jei.distillationTower.DistillationTowerRecipeCategory;
|
||||
import techreborn.compat.jei.distillationTower.DistillationTowerRecipeWrapper;
|
||||
import techreborn.compat.jei.extractor.ExtractorRecipeCategory;
|
||||
import techreborn.compat.jei.extractor.ExtractorRecipeWrapper;
|
||||
import techreborn.compat.jei.fluidReplicator.FluidReplicatorRecipeCategory;
|
||||
import techreborn.compat.jei.fluidReplicator.FluidReplicatorRecipeWrapper;
|
||||
import techreborn.compat.jei.fusionReactor.FusionReactorRecipeCategory;
|
||||
import techreborn.compat.jei.fusionReactor.FusionReactorRecipeWrapper;
|
||||
import techreborn.compat.jei.generators.fluid.FluidGeneratorRecipeCategory;
|
||||
import techreborn.compat.jei.generators.fluid.FluidGeneratorRecipeWrapper;
|
||||
import techreborn.compat.jei.grinder.GrinderRecipeCategory;
|
||||
import techreborn.compat.jei.grinder.GrinderRecipeWrapper;
|
||||
import techreborn.compat.jei.implosionCompressor.ImplosionCompressorRecipeCategory;
|
||||
import techreborn.compat.jei.implosionCompressor.ImplosionCompressorRecipeWrapper;
|
||||
import techreborn.compat.jei.industrialElectrolyzer.IndustrialElectrolyzerRecipeCategory;
|
||||
import techreborn.compat.jei.industrialElectrolyzer.IndustrialElectrolyzerRecipeWrapper;
|
||||
import techreborn.compat.jei.industrialGrinder.IndustrialGrinderRecipeCategory;
|
||||
import techreborn.compat.jei.industrialGrinder.IndustrialGrinderRecipeWrapper;
|
||||
import techreborn.compat.jei.industrialSawmill.IndustrialSawmillRecipeCategory;
|
||||
import techreborn.compat.jei.industrialSawmill.IndustrialSawmillRecipeWrapper;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeCategory;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeMaker;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeWrapper;
|
||||
import techreborn.compat.jei.scrapbox.ScrapboxRecipeCategory;
|
||||
import techreborn.compat.jei.scrapbox.ScrapboxRecipeWrapper;
|
||||
import techreborn.compat.jei.vacuumFreezer.VacuumFreezerRecipeCategory;
|
||||
import techreborn.compat.jei.vacuumFreezer.VacuumFreezerRecipeWrapper;
|
||||
import techreborn.dispenser.BehaviorDispenseScrapbox;
|
||||
import techreborn.init.IC2Duplicates;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModFluids;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.ItemParts;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@mezz.jei.api.JEIPlugin
|
||||
public class TechRebornJeiPlugin implements IModPlugin {
|
||||
|
||||
public static final ListMultiMap<Class<? extends GuiContainer>, RecipeClickableArea> recipeClickableAreas = new ListMultiMap<>();
|
||||
|
||||
static IRecipesGui recipesGui;
|
||||
|
||||
static {
|
||||
MinecraftForge.EVENT_BUS.register(TechRebornJeiPlugin.class);
|
||||
}
|
||||
|
||||
private static void addDebugRecipes(IModRegistry registry) {
|
||||
ItemStack diamondBlock = new ItemStack(Blocks.DIAMOND_BLOCK);
|
||||
ItemStack dirtBlock = new ItemStack(Blocks.DIRT);
|
||||
List<Object> debugRecipes = new ArrayList<>();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
int time = (int) Math.round(200 + Math.random() * 100);
|
||||
AssemblingMachineRecipe assemblingMachineRecipe = new AssemblingMachineRecipe(diamondBlock, diamondBlock,
|
||||
dirtBlock, time, 120);
|
||||
debugRecipes.add(assemblingMachineRecipe);
|
||||
}
|
||||
registry.addRecipes(debugRecipes, RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
debugRecipes.clear();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
int time = (int) Math.round(200 + Math.random() * 100);
|
||||
ImplosionCompressorRecipe recipe = new ImplosionCompressorRecipe(diamondBlock, diamondBlock, dirtBlock,
|
||||
dirtBlock, time, 120);
|
||||
debugRecipes.add(recipe);
|
||||
}
|
||||
registry.addRecipes(debugRecipes, RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCategories(IRecipeCategoryRegistration registry) {
|
||||
final IJeiHelpers jeiHelpers = registry.getJeiHelpers();
|
||||
final IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
|
||||
registry.addRecipeCategories(new AlloySmelterRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new AssemblingMachineRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new BlastFurnaceRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new CentrifugeRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new ChemicalReactorRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new DistillationTowerRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new FusionReactorRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new GrinderRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new ImplosionCompressorRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new IndustrialGrinderRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new IndustrialElectrolyzerRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new IndustrialSawmillRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new RollingMachineRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new VacuumFreezerRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new FluidReplicatorRecipeCategory(guiHelper));
|
||||
|
||||
for (EFluidGenerator type : EFluidGenerator.values())
|
||||
registry.addRecipeCategories(new FluidGeneratorRecipeCategory(type, guiHelper));
|
||||
|
||||
if (CompatConfigs.showScrapbox) {
|
||||
registry.addRecipeCategories(new ScrapboxRecipeCategory(guiHelper));
|
||||
}
|
||||
|
||||
if (!IC2Duplicates.deduplicate()) {
|
||||
registry.addRecipeCategories(new CompressorRecipeCategory(guiHelper));
|
||||
registry.addRecipeCategories(new ExtractorRecipeCategory(guiHelper));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void register(@Nonnull IModRegistry registry) {
|
||||
final IJeiHelpers jeiHelpers = registry.getJeiHelpers();
|
||||
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_BERYLLIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_CALCIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_CALCIUM_CARBONATE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_CHLORITE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_DEUTERIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_GLYCERYL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_HELIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_HELIUM_3));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_HELIUMPLASMA));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_HYDROGEN));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_LITHIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_MERCURY));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_METHANE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITROCOAL_FUEL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITROFUEL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITROGEN));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITROGENDIOXIDE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_POTASSIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SILICON));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SODIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SODIUMPERSULFATE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_TRITIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_WOLFRAMIUM));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SULFUR));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SULFURIC_ACID));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_CARBON));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_CARBON_FIBER));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITRO_CARBON));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_SODIUM_SULFIDE));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_DIESEL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_NITRO_DIESEL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_OIL));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_ELECTROLYZED_WATER));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModFluids.BLOCK_COMPRESSED_AIR));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModItems.MISSING_RECIPE_PLACEHOLDER));
|
||||
|
||||
if (CompatManager.isQuantumStorageLoaded) {
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.QUANTUM_CHEST));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.QUANTUM_TANK));
|
||||
}
|
||||
|
||||
if (IC2Duplicates.deduplicate()) {
|
||||
for (IC2Duplicates duplicate : IC2Duplicates.values()) {
|
||||
if (duplicate.hasIC2Stack()) {
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(duplicate.getTrStack());
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < EnumCableType.values().length; i++) {
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.CABLE, 1, i));
|
||||
}
|
||||
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(ItemParts.getPartByName("rubber"));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(ItemParts.getPartByName("rubberSap"));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(ItemParts.getPartByName("electronicCircuit"));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(ItemParts.getPartByName("advancedCircuit"));
|
||||
if (!Core.worldGen.config.rubberTreeConfig.shouldSpawn) {
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.RUBBER_SAPLING));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.RUBBER_LOG));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.RUBBER_PLANKS));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModBlocks.RUBBER_LEAVES));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModItems.TREE_TAP));
|
||||
jeiHelpers.getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(ModItems.ELECTRIC_TREE_TAP));
|
||||
}
|
||||
}
|
||||
|
||||
registry.handleRecipes(AlloySmelterRecipe.class, recipe -> new AlloySmelterRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.ALLOY_SMELTER);
|
||||
registry.handleRecipes(AssemblingMachineRecipe.class, recipe -> new AssemblingMachineRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
registry.handleRecipes(BlastFurnaceRecipe.class, recipe -> new BlastFurnaceRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.BLAST_FURNACE);
|
||||
registry.handleRecipes(CentrifugeRecipe.class, recipe -> new CentrifugeRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.CENTRIFUGE);
|
||||
registry.handleRecipes(ChemicalReactorRecipe.class, recipe -> new ChemicalReactorRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.CHEMICAL_REACTOR);
|
||||
registry.handleRecipes(FusionReactorRecipe.class, FusionReactorRecipeWrapper::new, RecipeCategoryUids.FUSION_REACTOR);
|
||||
registry.handleRecipes(GrinderRecipe.class, recipe -> new GrinderRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.GRINDER);
|
||||
registry.handleRecipes(ImplosionCompressorRecipe.class, recipe -> new ImplosionCompressorRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
registry.handleRecipes(IndustrialElectrolyzerRecipe.class, recipe -> new IndustrialElectrolyzerRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
registry.handleRecipes(IndustrialGrinderRecipe.class, recipe -> new IndustrialGrinderRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.INDUSTRIAL_GRINDER);
|
||||
registry.handleRecipes(IndustrialSawmillRecipe.class, recipe -> new IndustrialSawmillRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.INDUSTRIAL_SAWMILL);
|
||||
registry.handleRecipes(VacuumFreezerRecipe.class, recipe -> new VacuumFreezerRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.VACUUM_FREEZER);
|
||||
registry.handleRecipes(DistillationTowerRecipe.class, recipe -> new DistillationTowerRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.DISTILLATION_TOWER);
|
||||
registry.handleRecipes(FluidReplicatorRecipe.class, recipe -> new FluidReplicatorRecipeWrapper(jeiHelpers,recipe), RecipeCategoryUids.FLUID_REPLICATOR);
|
||||
registry.handleRecipes(ShapelessRecipes.class, recipe -> new RollingMachineRecipeWrapper((IRecipeWrapper) recipe), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.handleRecipes(ShapedRecipes.class, recipe -> new RollingMachineRecipeWrapper((IRecipeWrapper) recipe), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.handleRecipes(ShapedOreRecipe.class, recipe -> new RollingMachineRecipeWrapper((IRecipeWrapper) recipe), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.handleRecipes(ShapelessOreRecipe.class, recipe -> new RollingMachineRecipeWrapper((IRecipeWrapper) recipe), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
|
||||
for (EFluidGenerator type : EFluidGenerator.values()) {
|
||||
registry.handleRecipes(FluidGeneratorRecipe.class, recipe -> new FluidGeneratorRecipeWrapper(jeiHelpers, recipe), type.getRecipeID());
|
||||
}
|
||||
|
||||
if (CompatConfigs.showScrapbox) {
|
||||
registry.handleRecipes(ScrapboxRecipe.class, recipe -> new ScrapboxRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.SCRAPBOX);
|
||||
}
|
||||
|
||||
if (!IC2Duplicates.deduplicate()) {
|
||||
registry.handleRecipes(CompressorRecipe.class, recipe -> new CompressorRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.COMPRESSOR);
|
||||
registry.handleRecipes(ExtractorRecipe.class, recipe -> new ExtractorRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.EXTRACTOR);
|
||||
}
|
||||
|
||||
registry.addRecipes(RecipeHandler.recipeList.stream().filter(recipe -> {
|
||||
if (recipe instanceof ScrapboxRecipe) {
|
||||
return CompatConfigs.showScrapbox;
|
||||
}
|
||||
return true;
|
||||
}).collect(Collectors.toList()));
|
||||
|
||||
registry.addRecipes(FusionReactorRecipeHelper.reactorRecipes, RecipeCategoryUids.FUSION_REACTOR);
|
||||
registry.addRecipes(FluidReplicatorRecipeList.recipes, RecipeCategoryUids.FLUID_REPLICATOR);
|
||||
GeneratorRecipeHelper.fluidRecipes.forEach((type, list) -> registry.addRecipes(list.getRecipes(), type.getRecipeID()));
|
||||
|
||||
try {
|
||||
registry.addRecipes(RollingMachineRecipeMaker.getRecipes(jeiHelpers), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
} catch (final RuntimeException e) {
|
||||
Core.logHelper
|
||||
.error("Could not register rolling machine recipes. JEI may have changed its internal recipe wrapper locations.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (Config.isDebugModeEnabled()) {
|
||||
TechRebornJeiPlugin.addDebugRecipes(registry);
|
||||
}
|
||||
|
||||
registry.addIngredientInfo(ItemParts.getPartByName("rubberSap"), ItemStack.class, StringUtils.t("techreborn.desc.rubberSap"));
|
||||
if (!BehaviorDispenseScrapbox.dispenseScrapboxes) {
|
||||
registry.addIngredientInfo(new ItemStack(ModItems.SCRAP_BOX), ItemStack.class, StringUtils.t("techreborn.desc.scrapBoxNoDispenser"));
|
||||
} else {
|
||||
registry.addIngredientInfo(new ItemStack(ModItems.SCRAP_BOX), ItemStack.class, StringUtils.t("techreborn.desc.scrapBox"));
|
||||
}
|
||||
|
||||
//NEW ONES
|
||||
addRecipeClickArea(GuiCentrifuge.class, 150, 4, 20, 12, RecipeCategoryUids.CENTRIFUGE);
|
||||
addRecipeClickArea(GuiElectricFurnace.class, 150, 4, 20, 12, VanillaRecipeCategoryUid.SMELTING);
|
||||
addRecipeClickArea(GuiGenerator.class, 150, 4, 20, 12, VanillaRecipeCategoryUid.FUEL);
|
||||
addRecipeClickArea(GuiExtractor.class, 150, 4, 20, 12, RecipeCategoryUids.EXTRACTOR);
|
||||
addRecipeClickArea(GuiCompressor.class, 150, 4, 20, 12, RecipeCategoryUids.COMPRESSOR);
|
||||
addRecipeClickArea(GuiGrinder.class, 150, 4, 20, 12, RecipeCategoryUids.GRINDER);
|
||||
addRecipeClickArea(GuiVacuumFreezer.class, 150, 4, 20, 12, RecipeCategoryUids.VACUUM_FREEZER);
|
||||
addRecipeClickArea(GuiBlastFurnace.class, 150, 4, 20, 12, RecipeCategoryUids.BLAST_FURNACE);
|
||||
addRecipeClickArea(GuiChemicalReactor.class, 150, 4, 20, 12, RecipeCategoryUids.CHEMICAL_REACTOR);
|
||||
addRecipeClickArea(GuiImplosionCompressor.class, 150, 4, 20, 12, RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
addRecipeClickArea(GuiIndustrialGrinder.class, 150, 4, 20, 12, RecipeCategoryUids.INDUSTRIAL_GRINDER);
|
||||
addRecipeClickArea(GuiIndustrialSawmill.class, 150, 4, 20, 15, RecipeCategoryUids.INDUSTRIAL_SAWMILL);
|
||||
addRecipeClickArea(GuiIndustrialElectrolyzer.class, 150, 4, 20, 12, RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
addRecipeClickArea(GuiSemifluidGenerator.class, 150, 4, 18, 18, EFluidGenerator.SEMIFLUID.getRecipeID());
|
||||
addRecipeClickArea(GuiDieselGenerator.class, 150, 4, 18, 18, EFluidGenerator.DIESEL.getRecipeID());
|
||||
addRecipeClickArea(GuiGasTurbine.class, 150, 4, 18, 18, EFluidGenerator.GAS.getRecipeID());
|
||||
addRecipeClickArea(GuiThermalGenerator.class, 150, 4, 18, 18, EFluidGenerator.THERMAL.getRecipeID());
|
||||
addRecipeClickArea(GuiAlloySmelter.class, 150, 4, 18, 18, RecipeCategoryUids.ALLOY_SMELTER);
|
||||
addRecipeClickArea(GuiPlasmaGenerator.class, 150, 4, 18, 18, EFluidGenerator.PLASMA.getRecipeID());
|
||||
addRecipeClickArea(GuiDistillationTower.class, 150, 4, 18, 18, RecipeCategoryUids.DISTILLATION_TOWER);
|
||||
addRecipeClickArea(GuiScrapboxinator.class, 150, 4, 18, 18, RecipeCategoryUids.SCRAPBOX);
|
||||
addRecipeClickArea(GuiFusionReactor.class, 150, 4, 18, 18, RecipeCategoryUids.FUSION_REACTOR);
|
||||
addRecipeClickArea(GuiRollingMachine.class, 150, 4, 20, 12, RecipeCategoryUids.ROLLING_MACHINE);
|
||||
addRecipeClickArea(GuiFluidReplicator.class, 150, 4, 20, 12, RecipeCategoryUids.FLUID_REPLICATOR);
|
||||
addRecipeClickArea(GuiAssemblingMachine.class, 150, 4, 20, 12, RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
|
||||
//OLD ONES
|
||||
addRecipeClickArea(GuiAlloyFurnace.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER,
|
||||
VanillaRecipeCategoryUid.FUEL);
|
||||
addRecipeClickArea(GuiIronFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING,
|
||||
VanillaRecipeCategoryUid.FUEL);
|
||||
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.IRON_FURNACE), VanillaRecipeCategoryUid.SMELTING, VanillaRecipeCategoryUid.FUEL);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.IRON_ALLOY_FURNACE), RecipeCategoryUids.ALLOY_SMELTER, VanillaRecipeCategoryUid.FUEL);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.SOLID_FUEL_GENEREATOR), VanillaRecipeCategoryUid.FUEL);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.SEMI_FLUID_GENERATOR), EFluidGenerator.SEMIFLUID.getRecipeID());
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.GAS_TURBINE), EFluidGenerator.GAS.getRecipeID());
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.DIESEL_GENERATOR), EFluidGenerator.DIESEL.getRecipeID());
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.THERMAL_GENERATOR), EFluidGenerator.THERMAL.getRecipeID());
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.COMPRESSOR), RecipeCategoryUids.COMPRESSOR);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.EXTRACTOR), RecipeCategoryUids.EXTRACTOR);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.GRINDER), RecipeCategoryUids.GRINDER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.VACUUM_FREEZER), RecipeCategoryUids.VACUUM_FREEZER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.ELECTRIC_FURNACE), VanillaRecipeCategoryUid.SMELTING);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.ALLOY_SMELTER), RecipeCategoryUids.ALLOY_SMELTER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.ASSEMBLY_MACHINE), RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.CHEMICAL_REACTOR), RecipeCategoryUids.CHEMICAL_REACTOR);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.FUSION_CONTROL_COMPUTER), RecipeCategoryUids.FUSION_REACTOR);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.IMPLOSION_COMPRESSOR), RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.INDUSTRIAL_BLAST_FURNACE), RecipeCategoryUids.BLAST_FURNACE);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), RecipeCategoryUids.CENTRIFUGE);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.INDUSTRIAL_GRINDER), RecipeCategoryUids.INDUSTRIAL_GRINDER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.INDUSTRIAL_SAWMILL), RecipeCategoryUids.INDUSTRIAL_SAWMILL);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.ROLLING_MACHINE), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.DISTILLATION_TOWER), RecipeCategoryUids.DISTILLATION_TOWER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.FLUID_REPLICATOR), RecipeCategoryUids.FLUID_REPLICATOR);
|
||||
|
||||
if (CompatConfigs.showScrapbox) {
|
||||
registry.addRecipeCatalyst(new ItemStack(ModItems.SCRAP_BOX), RecipeCategoryUids.SCRAPBOX);
|
||||
}
|
||||
|
||||
final IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
|
||||
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("fusionreactor", RecipeCategoryUids.FUSION_REACTOR, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("industrialelectrolyzer", RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("industrialgrinder", RecipeCategoryUids.GRINDER, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("implosioncompressor", RecipeCategoryUids.IMPLOSION_COMPRESSOR, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("vacuumfreezer", RecipeCategoryUids.VACUUM_FREEZER, 36, 1, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("blastfurnace", RecipeCategoryUids.BLAST_FURNACE, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("alloyfurnace", RecipeCategoryUids.ALLOY_SMELTER, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("alloyfurnace", VanillaRecipeCategoryUid.FUEL, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("alloysmelter", RecipeCategoryUids.ALLOY_SMELTER, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("assemblingmachine", RecipeCategoryUids.ASSEMBLING_MACHINE, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("chemicalreactor", RecipeCategoryUids.CHEMICAL_REACTOR, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("centrifuge", RecipeCategoryUids.CENTRIFUGE, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("grinder", RecipeCategoryUids.GRINDER, 36, 1, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("extractor", RecipeCategoryUids.EXTRACTOR, 36, 1, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("compressor", RecipeCategoryUids.COMPRESSOR, 36, 1, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("industrialsawmill", RecipeCategoryUids.INDUSTRIAL_SAWMILL, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("distillationtower", RecipeCategoryUids.DISTILLATION_TOWER, 36, 2, 0, 36));
|
||||
|
||||
registry.addAdvancedGuiHandlers(new AdvancedGuiHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {
|
||||
recipesGui = jeiRuntime.getRecipesGui();
|
||||
}
|
||||
|
||||
public static class AdvancedGuiHandler implements IAdvancedGuiHandler<GuiBase> {
|
||||
|
||||
@Override
|
||||
public Class<GuiBase> getGuiContainerClass() {
|
||||
return GuiBase.class;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<Rectangle> getGuiExtraAreas(GuiBase guiContainer) {
|
||||
return GuiSlotConfiguration.getExtraSpace(guiContainer);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getIngredientUnderMouse(GuiBase guiContainer, int mouseX, int mouseY) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//Taken from JEI so we can have a custom impliemntation of it
|
||||
//This is done as I didnt see an easy way to disable the show recipes button when a certain condition is met
|
||||
public void addRecipeClickArea(Class<? extends GuiContainer> guiContainerClass, int xPos, int yPos, int width, int height, String... recipeCategoryUids) {
|
||||
ErrorUtil.checkNotNull(guiContainerClass, "guiContainerClass");
|
||||
ErrorUtil.checkNotEmpty(recipeCategoryUids, "recipeCategoryUids");
|
||||
|
||||
RecipeClickableArea recipeClickableArea = new RecipeClickableArea(yPos, yPos + height, xPos, xPos + width, recipeCategoryUids);
|
||||
recipeClickableAreas.put(guiContainerClass, recipeClickableArea);
|
||||
}
|
||||
|
||||
public static RecipeClickableArea getRecipeClickableArea(GuiContainer gui, int mouseX, int mouseY) {
|
||||
for (RecipeClickableArea recipeClickableArea : recipeClickableAreas.toImmutable().get(gui.getClass())) {
|
||||
if (recipeClickableArea.checkHover(mouseX, mouseY)) {
|
||||
return recipeClickableArea;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public static void drawScreenEvent(GuiScreenEvent.DrawScreenEvent.Post event) {
|
||||
if (GuiBase.showSlotConfig) {
|
||||
return;
|
||||
}
|
||||
GuiScreen gui = event.getGui();
|
||||
if (gui instanceof GuiContainer) {
|
||||
GuiContainer guiContainer = (GuiContainer) gui;
|
||||
if (getRecipeClickableArea(guiContainer, event.getMouseX() - guiContainer.getGuiLeft(), event.getMouseY() - guiContainer.getGuiTop()) != null) {
|
||||
TooltipRenderer.drawHoveringText(guiContainer.mc, Translator.translateToLocal("jei.tooltip.show.recipes"), event.getMouseX(), event.getMouseY());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public static void handleMouseClick(GuiScreenEvent.MouseInputEvent.Pre event) {
|
||||
if (GuiBase.showSlotConfig) {
|
||||
return;
|
||||
}
|
||||
final int eventButton = Mouse.getEventButton();
|
||||
if (eventButton > -1) {
|
||||
if (Mouse.getEventButtonState()) {
|
||||
if (event.getGui() instanceof GuiContainer) {
|
||||
int x = Mouse.getEventX() * event.getGui().width / event.getGui().mc.displayWidth;
|
||||
int y = event.getGui().height - Mouse.getEventY() * event.getGui().height / event.getGui().mc.displayHeight - 1;
|
||||
GuiContainer guiContainer = (GuiContainer) event.getGui();
|
||||
RecipeClickableArea clickableArea = getRecipeClickableArea(guiContainer, x - guiContainer.getGuiLeft(), y - guiContainer.getGuiTop());
|
||||
if (clickableArea != null) {
|
||||
List<String> recipeCategoryUids = clickableArea.getRecipeCategoryUids();
|
||||
recipesGui.showCategories(recipeCategoryUids);
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.alloySmelter;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlloySmelterRecipeCategory implements IRecipeCategory<AlloySmelterRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public AlloySmelterRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 172, 116, 52);
|
||||
title = StringUtils.t("tile.techreborn:alloy_smelter.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ALLOY_SMELTER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull AlloySmelterRecipeWrapper recipeWrapper,
|
||||
@Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 95, 7);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.alloySmelter;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlloySmelterRecipeWrapper extends BaseRecipeWrapper<AlloySmelterRecipe> {
|
||||
private final IDrawableAnimated progressright;
|
||||
private final IDrawableAnimated progressleft;
|
||||
|
||||
public AlloySmelterRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
AlloySmelterRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressrightStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
IDrawableStatic progressleftStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 84, 161, 16, 10);
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
|
||||
this.progressright = guiHelper.createAnimatedDrawable(progressrightStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
this.progressleft = guiHelper.createAnimatedDrawable(progressleftStatic, ticksPerCycle, IDrawableAnimated.StartDirection.RIGHT, false);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progressright.draw(minecraft, 25, 12);
|
||||
progressleft.draw(minecraft, 75, 12);
|
||||
|
||||
int y = 30;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2), y, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2), y + lineHeight, 0x444444);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.assemblingMachine;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.*;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AssemblingMachineRecipeCategory implements IRecipeCategory<AssemblingMachineRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public AssemblingMachineRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 125, 65, 74, 42);
|
||||
title = StringUtils.t("tile.techreborn:assembly_machine.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ASSEMBLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull AssemblingMachineRecipeWrapper recipeWrapper,
|
||||
@Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 2);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 3, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 12);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.assemblingMachine;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AssemblingMachineRecipeWrapper extends BaseRecipeWrapper<AssemblingMachineRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public AssemblingMachineRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull AssemblingMachineRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 16);
|
||||
}
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.blastFurnace;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlastFurnaceRecipeCategory implements IRecipeCategory<BlastFurnaceRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public BlastFurnaceRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 94, 120, 78);
|
||||
title = StringUtils.t("tile.techreborn:industrial_blast_furnace.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.BLAST_FURNACE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull BlastFurnaceRecipeWrapper recipeWrapper,
|
||||
@Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 21, 3);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 21, 23);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 63, 12);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 81, 12);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.blastFurnace;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlastFurnaceRecipeWrapper extends BaseRecipeWrapper<BlastFurnaceRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
private final IDrawable heat;
|
||||
|
||||
public BlastFurnaceRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
BlastFurnaceRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
int j = (int) ((double) baseRecipe.neededHeat / (double) 3230 * 106);
|
||||
if (j < 0)
|
||||
j = 0;
|
||||
|
||||
this.heat = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 0, 246, j, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 43, 17);
|
||||
heat.draw(minecraft, 7, 47);
|
||||
|
||||
int y = 64;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString(baseRecipe.neededHeat + " Heat", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.neededHeat + " Heat") / 2), 48, 0xFFFFFF);
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2), y, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2), y + lineHeight, 0x444444);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.centrifuge;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CentrifugeRecipeCategory implements IRecipeCategory<CentrifugeRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public CentrifugeRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 0, 104, 62);
|
||||
title = StringUtils.t("tile.techreborn:industrial_centrifuge.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.CENTRIFUGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
CentrifugeRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 12);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 3, 32);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 45, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 64, 3);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 83, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 64, 41);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.centrifuge;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CentrifugeRecipeWrapper extends BaseRecipeWrapper<CentrifugeRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public CentrifugeRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
CentrifugeRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 26);
|
||||
|
||||
int y1 = 1;
|
||||
int y2 = 54;
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2) - 40, y1, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2) - 40, y2, 0x444444);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.chemicalReactor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public class ChemicalReactorRecipeCategory implements IRecipeCategory<ChemicalReactorRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public ChemicalReactorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 172, 116, 52);
|
||||
title = StringUtils.t("tile.techreborn:chemical_reactor.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.CHEMICAL_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ChemicalReactorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 95, 7);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.chemicalReactor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper<ChemicalReactorRecipe> {
|
||||
private final IDrawableAnimated progressright;
|
||||
private final IDrawableAnimated progressleft;
|
||||
|
||||
public ChemicalReactorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ChemicalReactorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressrightStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
IDrawableStatic progressleftStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 84, 161, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime(); // speed up the animation
|
||||
|
||||
this.progressright = guiHelper.createAnimatedDrawable(progressrightStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
this.progressleft = guiHelper.createAnimatedDrawable(progressleftStatic, ticksPerCycle, IDrawableAnimated.StartDirection.RIGHT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progressright.draw(minecraft, 25, 12);
|
||||
progressleft.draw(minecraft, 75, 12);
|
||||
|
||||
int y = 30;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2), y, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2), y + lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.compressor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompressorRecipeCategory implements IRecipeCategory<CompressorRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public CompressorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
|
||||
title = StringUtils.t("tile.techreborn:compressor.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
CompressorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.compressor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.CompressorRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompressorRecipeWrapper extends BaseRecipeWrapper<CompressorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public CompressorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
CompressorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime(); // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 11);
|
||||
}
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.distillationTower;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
|
||||
public class DistillationTowerRecipeCategory implements IRecipeCategory<DistillationTowerRecipeWrapper> {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public DistillationTowerRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 0, 104, 62);
|
||||
title = StringUtils.t("tile.techreborn:distillation_tower.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.DISTILLATION_TOWER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull DistillationTowerRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 12);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 3, 32);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 45, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 64, 3);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 83, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 64, 41);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.distillationTower;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.DistillationTowerRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class DistillationTowerRecipeWrapper extends BaseRecipeWrapper<DistillationTowerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
/**
|
||||
* @param jeiHelpers JEI Helper Class
|
||||
* @param baseRecipe Distillation Tower recipe
|
||||
*/
|
||||
|
||||
public DistillationTowerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull DistillationTowerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 26);
|
||||
|
||||
int y1 = 1;
|
||||
int y2 = 54;
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2) - 40, y1, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2) - 40, y2, 0x444444);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.extractor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ExtractorRecipeCategory implements IRecipeCategory<ExtractorRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public ExtractorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
|
||||
title = StringUtils.t("tile.techreborn:extractor.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.EXTRACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ExtractorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.extractor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.ExtractorRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ExtractorRecipeWrapper extends BaseRecipeWrapper<ExtractorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ExtractorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ExtractorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime(); // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 11);
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.fluidReplicator;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class FluidReplicatorRecipeCategory implements IRecipeCategory<FluidReplicatorRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] OUTPUT_TANKS = { 0 };
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private final IDrawable background;
|
||||
private final IDrawable tankOverlay;
|
||||
private final String title;
|
||||
|
||||
public FluidReplicatorRecipeCategory(@Nonnull IGuiHelper guiHelper) {
|
||||
this.background = guiHelper.createDrawable(texture, 125, 0, 72, 60);
|
||||
this.tankOverlay = guiHelper.createDrawable(texture, 196, 0, 12, 47);
|
||||
this.title = StringUtils.t("tile.techreborn:fluid_replicator.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.FLUID_REPLICATOR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, FluidReplicatorRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 2, 21);
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(OUTPUT_TANKS[0], false, 52, 6, 12, 47, 10_000, true, tankOverlay);
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, null, null, OUTPUT_TANKS);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.fluidReplicator;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class FluidReplicatorRecipeWrapper implements IRecipeWrapper {
|
||||
private final FluidReplicatorRecipe recipe;
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public FluidReplicatorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull FluidReplicatorRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
int ticksPerCycle = recipe.getTickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see mezz.jei.api.recipe.IRecipeWrapper#getIngredients(mezz.jei.api.ingredients.IIngredients)
|
||||
*/
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setInput(ItemStack.class, new ItemStack(ModItems.UU_MATTER, recipe.getInput()));
|
||||
ingredients.setOutput(FluidStack.class, new FluidStack(recipe.getFluid(), Fluid.BUCKET_VOLUME));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
progress.draw(minecraft, 25, 25);
|
||||
}
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.fusionReactor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class FusionReactorRecipeCategory implements IRecipeCategory<FusionReactorRecipeWrapper> {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int inputSlotTop = 0;
|
||||
private static final int inputSlotBottom = 1;
|
||||
private static final int outputSlot = 2;
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background;
|
||||
@Nonnull
|
||||
private final String title;
|
||||
|
||||
public FusionReactorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 172, 116, 64, 0, 40, 20, 20);
|
||||
title = StringUtils.t("tile.techreborn:fusion_control_computer.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.FUSION_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
FusionReactorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
itemStacks.init(inputSlotTop, true, 23, 7);
|
||||
itemStacks.init(inputSlotBottom, true, 115, 7);
|
||||
itemStacks.init(outputSlot, false, 69, 7);
|
||||
|
||||
itemStacks.set(inputSlotTop, recipeWrapper.getTopInput());
|
||||
itemStacks.set(inputSlotBottom, recipeWrapper.getBottomInput());
|
||||
itemStacks.set(outputSlot, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.fusionReactor;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class FusionReactorRecipeWrapper implements IRecipeWrapper {
|
||||
private final FusionReactorRecipe baseRecipe;
|
||||
|
||||
public FusionReactorRecipeWrapper(FusionReactorRecipe baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(@Nonnull IIngredients ingredients) {
|
||||
ingredients.setInputs(ItemStack.class, Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput()));
|
||||
ingredients.setOutput(ItemStack.class, baseRecipe.getOutput());
|
||||
}
|
||||
|
||||
public ItemStack getTopInput() {
|
||||
return baseRecipe.getTopInput();
|
||||
}
|
||||
|
||||
public ItemStack getBottomInput() {
|
||||
return baseRecipe.getBottomInput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
RecipeUtil.drawInfo(minecraft, 0, 67, baseRecipe.getStartEU(), baseRecipe.getEuTick(), baseRecipe.getTickTime());
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.generators.fluid;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
public class FluidGeneratorRecipeCategory implements IRecipeCategory<FluidGeneratorRecipeWrapper> {
|
||||
public static ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei_fluid_generator.png");
|
||||
|
||||
private static final int[] INPUT_TANKS = { 0 };
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
private final IDrawable tankOverlay;
|
||||
private final EFluidGenerator generatorType;
|
||||
|
||||
public FluidGeneratorRecipeCategory(EFluidGenerator generatorType, IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 42, 16, 102, 60);
|
||||
tankOverlay = guiHelper.createDrawable(texture, 176, 72, 12, 47);
|
||||
title = StringUtils.t("techreborn.jei.category.generator." + generatorType.name().toLowerCase());
|
||||
this.generatorType = generatorType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUid() {
|
||||
return this.generatorType.getRecipeID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, FluidGeneratorRecipeWrapper recipeWrapper,
|
||||
IIngredients ingredients) {
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 8, 12, 47, 10000, true, tankOverlay);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.generators.fluid;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.generator.FluidGeneratorRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class FluidGeneratorRecipeWrapper implements IRecipeWrapper {
|
||||
|
||||
private final FluidGeneratorRecipe baseRecipe;
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public FluidGeneratorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull FluidGeneratorRecipe recipe) {
|
||||
this.baseRecipe = recipe;
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(FluidGeneratorRecipeCategory.texture, 176, 3, 25, 14);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, 200, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
progress.draw(minecraft, 73, 26);
|
||||
minecraft.fontRenderer
|
||||
.drawString(PowerSystem.getLocaliszedPowerFormattedNoSuffix(baseRecipe.getEnergyPerMb() * 1000) + " "
|
||||
+ PowerSystem.getDisplayPower().abbreviation, 70, 13, 0x444444);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(final IIngredients ingredients) {
|
||||
ingredients.setInput(FluidStack.class, new FluidStack(this.baseRecipe.getFluid(), Fluid.BUCKET_VOLUME));
|
||||
}
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.grinder;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class GrinderRecipeCategory implements IRecipeCategory<GrinderRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public GrinderRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
|
||||
title = StringUtils.t("tile.techreborn:grinder.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull GrinderRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.grinder;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class GrinderRecipeWrapper extends BaseRecipeWrapper<GrinderRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public GrinderRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
GrinderRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime(); // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 11);
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.implosionCompressor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ImplosionCompressorRecipeCategory implements IRecipeCategory<ImplosionCompressorRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = {0, 1};
|
||||
private static final int[] OUTPUT_SLOTS = {2, 3};
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public ImplosionCompressorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 95, 120, 42);
|
||||
title = StringUtils.t("tile.techreborn:implosion_compressor.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.IMPLOSION_COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 21, 2);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 21, 22);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 63, 11);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 81, 11);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.implosionCompressor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ImplosionCompressorRecipeWrapper extends BaseRecipeWrapper<ImplosionCompressorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ImplosionCompressorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 43, 16);
|
||||
|
||||
int x = -35;
|
||||
int y = 13;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRenderer.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.industrialElectrolyzer;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeCategory implements IRecipeCategory<IndustrialElectrolyzerRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
private final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_electrolyzer.png");
|
||||
|
||||
public IndustrialElectrolyzerRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 49, 18, 78, 50);
|
||||
title = StringUtils.t("tile.techreborn:industrial_electrolyzer.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 30, 32);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 32);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 0, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 20, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 40, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 60, 0);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.industrialElectrolyzer;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeWrapper extends BaseRecipeWrapper<IndustrialElectrolyzerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
private final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_electrolyzer.png");
|
||||
|
||||
public IndustrialElectrolyzerRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(this.texture, 176, 14, 30, 10);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.BOTTOM, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 24, 20);
|
||||
|
||||
int x = 60;
|
||||
int y = 20;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,116 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.industrialGrinder;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.tiles.multiblock.TileIndustrialGrinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialGrinderRecipeCategory implements IRecipeCategory<IndustrialGrinderRecipeWrapper> {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_grinder.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
private static final int[] INPUT_TANKS = { 0 };
|
||||
private final IDrawable background;
|
||||
// for covering the lightning power symbol
|
||||
private final IDrawable blankArea;
|
||||
private final IDrawable tankOverlay;
|
||||
private final String title;
|
||||
|
||||
public IndustrialGrinderRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 7, 15, 141, 55);
|
||||
blankArea = guiHelper.createDrawable(texture, 50, 45, 6, 6);
|
||||
tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47);
|
||||
title = StringUtils.t("tile.techreborn:industrial_grinder.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(
|
||||
@Nonnull
|
||||
Minecraft minecraft) {
|
||||
blankArea.draw(minecraft, 129, 49);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 87, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 105, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 123, 19);
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialGrinder.TANK_CAPACITY, true, tankOverlay);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.industrialGrinder;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class IndustrialGrinderRecipeWrapper extends BaseRecipeWrapper<IndustrialGrinderRecipe> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_grinder.png");
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public IndustrialGrinderRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(texture, 176, 14, 24, 17);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
final IIngredients ingredients) {
|
||||
ingredients.setInput(FluidStack.class, this.baseRecipe.fluidStack);
|
||||
super.getIngredients(ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
if (baseRecipe.fluidStack != null) {
|
||||
return Collections.singletonList(baseRecipe.fluidStack);
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 44, 20);
|
||||
|
||||
int x = 70;
|
||||
int y = 40;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRenderer.drawString("Energy: " + PowerSystem.getLocaliszedPowerFormattedNoSuffix(baseRecipe.euPerTick) + " " + PowerSystem.getDisplayPower().abbreviation + "/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.industrialSawmill;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.tiles.multiblock.TileIndustrialSawmill;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialSawmillRecipeCategory implements IRecipeCategory<IndustrialSawmillRecipeWrapper> {
|
||||
|
||||
private final String title;
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_sawmill.png");
|
||||
private final IDrawable background;
|
||||
private final IDrawable tankOverlay;
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4 };
|
||||
private static final int[] INPUT_TANKS = { 0 };
|
||||
|
||||
public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper) {
|
||||
title = StringUtils.t("tile.techreborn:industrial_sawmill.name");
|
||||
background = guiHelper.createDrawable(texture, 7, 15, 141, 55);
|
||||
tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IndustrialSawmillRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 112, 19);
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialSawmill.TANK_CAPACITY, true, tankOverlay);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.industrialSawmill;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*/
|
||||
public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper<IndustrialSawmillRecipe> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_sawmill.png");
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public IndustrialSawmillRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
IndustrialSawmillRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(texture, 176, 14, 20, 13);
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
final IIngredients ingredients) {
|
||||
ingredients.setInput(FluidStack.class, this.baseRecipe.fluidStack);
|
||||
super.getIngredients(ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
if (baseRecipe.fluidStack != null) {
|
||||
return Collections.singletonList(baseRecipe.fluidStack);
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 48, 23);
|
||||
|
||||
if (minecraft.fontRenderer != null) {
|
||||
int x = 70;
|
||||
int y = 40;
|
||||
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRenderer.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRenderer.drawString("FE: " + baseRecipe.euPerTick + " FE/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.*;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RollingMachineRecipeCategory implements IRecipeCategory<RollingMachineRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
private static final int[] OUTPUT_SLOTS = { 10 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final IDrawableAnimated progress;
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
private final String title;
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/rolling_machine.png");
|
||||
|
||||
public RollingMachineRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 29, 16, 116, 54);
|
||||
title = StringUtils.t("tile.techreborn:rolling_machine.name");
|
||||
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(texture, 176, 14, 20, 18);
|
||||
progress = guiHelper.createAnimatedDrawable(progressStatic, 250, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
|
||||
craftingGridHelper = guiHelper.createCraftingGridHelper(INPUT_SLOTS[0], OUTPUT_SLOTS[0]);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ROLLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(@Nonnull Minecraft minecraft) {
|
||||
progress.draw(minecraft, 62, 18);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull RollingMachineRecipeWrapper recipeWrapper,
|
||||
@Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
for (int l = 0; l < 3; l++) {
|
||||
for (int k1 = 0; k1 < 3; k1++) {
|
||||
int i = k1 + l * 3;
|
||||
guiItemStacks.init(INPUT_SLOTS[i], true, k1 * 18, l * 18);
|
||||
}
|
||||
}
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 94, 18);
|
||||
|
||||
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class));
|
||||
guiItemStacks.set(OUTPUT_SLOTS[0], ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class RollingMachineRecipeMaker {
|
||||
private RollingMachineRecipeMaker() {
|
||||
|
||||
}
|
||||
|
||||
public static List<Object> getRecipes(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
List<Object> recipes = new ArrayList<>();
|
||||
for (Map.Entry<ResourceLocation, IRecipe> recipe : RollingMachineRecipe.instance.getRecipeList().entrySet()) {
|
||||
RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(jeiHelpers, recipe.getValue());
|
||||
if (recipeWrapper != null) {
|
||||
recipes.add(recipeWrapper);
|
||||
}
|
||||
}
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapedOreRecipeWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapedRecipesWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapelessRecipeWrapper;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class RollingMachineRecipeWrapper implements IRecipeWrapper {
|
||||
private final IRecipeWrapper baseRecipe;
|
||||
|
||||
public RollingMachineRecipeWrapper(IRecipeWrapper baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static RollingMachineRecipeWrapper create(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers, IRecipe baseRecipe) {
|
||||
IRecipeWrapper recipeWrapper;
|
||||
if (baseRecipe instanceof ShapelessRecipes) {
|
||||
recipeWrapper = new ShapelessRecipeWrapper<IRecipe>(jeiHelpers, baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedRecipes) {
|
||||
recipeWrapper = new ShapedRecipesWrapper(jeiHelpers, (ShapedRecipes) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedOreRecipe) {
|
||||
recipeWrapper = new ShapedOreRecipeWrapper(jeiHelpers, (ShapedOreRecipe) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapelessOreRecipe) {
|
||||
recipeWrapper = new ShapelessRecipeWrapper<IRecipe>(jeiHelpers, baseRecipe);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new RollingMachineRecipeWrapper(recipeWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(@Nonnull IIngredients ingredients) {
|
||||
baseRecipe.getIngredients(ingredients);
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.scrapbox;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ScrapboxRecipeCategory implements IRecipeCategory<ScrapboxRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public ScrapboxRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
|
||||
title = StringUtils.t("jei.techreborn.scrapbox.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.SCRAPBOX;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ScrapboxRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.scrapbox;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import techreborn.api.recipe.machines.ScrapboxRecipe;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ScrapboxRecipeWrapper extends BaseRecipeWrapper<ScrapboxRecipe> {
|
||||
public ScrapboxRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ScrapboxRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.vacuumFreezer;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class VacuumFreezerRecipeCategory implements IRecipeCategory<VacuumFreezerRecipeWrapper> {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public VacuumFreezerRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
|
||||
title = StringUtils.t("tile.techreborn:vacuum_freezer.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.VACUUM_FREEZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
VacuumFreezerRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 7);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 49, 7);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.jei.vacuumFreezer;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class VacuumFreezerRecipeWrapper extends BaseRecipeWrapper<VacuumFreezerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public VacuumFreezerRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
VacuumFreezerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime(); // speed up the animation
|
||||
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 11);
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.opencomputers;
|
||||
|
||||
import li.cil.oc.api.Driver;
|
||||
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.FMLServerStartingEvent;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
public class CompatOpenComputers implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
Driver.add(new DriverMachine());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,153 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.opencomputers;
|
||||
|
||||
import li.cil.oc.api.Network;
|
||||
import li.cil.oc.api.driver.DriverBlock;
|
||||
import li.cil.oc.api.driver.NamedBlock;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.ManagedEnvironment;
|
||||
import li.cil.oc.api.network.Visibility;
|
||||
import li.cil.oc.api.prefab.AbstractManagedEnvironment;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.IUpgradeable;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.function.IntFunction;
|
||||
|
||||
public class DriverMachine implements DriverBlock {
|
||||
@Override
|
||||
public boolean worksWith(World world, BlockPos blockPos, EnumFacing enumFacing) {
|
||||
return world.getTileEntity(blockPos) instanceof TilePowerAcceptor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ManagedEnvironment createEnvironment(World world, BlockPos blockPos, EnumFacing enumFacing) {
|
||||
return new MachineEnvironment((TilePowerAcceptor) world.getTileEntity(blockPos));
|
||||
}
|
||||
|
||||
public static class MachineEnvironment extends AbstractManagedEnvironment implements NamedBlock {
|
||||
TilePowerAcceptor machine;
|
||||
|
||||
public MachineEnvironment(TilePowerAcceptor machine) {
|
||||
this.machine = machine;
|
||||
setNode(Network.newNode(this, Visibility.Network).withComponent("tr_machine", Visibility.Network).create());
|
||||
}
|
||||
|
||||
@Callback(value = "getTeir", getter = true, doc = "Gets the current teir of the machine, this changes with upgrades")
|
||||
public Object[] getTeir(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine.getTier().name());
|
||||
}
|
||||
|
||||
@Callback(value = "getEnergy", getter = true, doc = "Gets the currentally stored energy of the machine. in EU")
|
||||
public Object[] getEnergy(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine.getEnergy());
|
||||
}
|
||||
|
||||
|
||||
@Callback(value = "getMaxPower", getter = true, doc = "Gets the maximum energy that can be stored in the machine. in EU")
|
||||
public Object[] getMaxPower(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine.getMaxPower());
|
||||
}
|
||||
|
||||
@Callback(value = "getMaxInput", getter = true, doc = "Gets the maximum energy that can be inputted in to the machine. in EU")
|
||||
public Object[] getMaxInput(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine.getMaxInput());
|
||||
}
|
||||
|
||||
@Callback(value = "getMaxOutput", getter = true, doc = "Gets the maximum energy that can be extracted from the machine. in EU")
|
||||
public Object[] getMaxOutput(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine.getMaxOutput());
|
||||
}
|
||||
|
||||
@Callback(value = "canBeUprgraded", getter = true, doc = "Returns true if the machine can be upgraded")
|
||||
public Object[] canBeUprgraded(Context context, Arguments arguments) throws Exception {
|
||||
return getObjects(machine instanceof IUpgradeable && machine.canBeUpgraded());
|
||||
}
|
||||
|
||||
@Callback(value = "hasRecipeCrafter", getter = true, doc = "Returns true if the machine has a recipe crafter")
|
||||
public Object[] hasRecipeCrafter(Context context, Arguments arguments) throws Exception{
|
||||
return getObjects(machine instanceof IRecipeCrafterProvider);
|
||||
}
|
||||
|
||||
@Callback(value = "getRecipeName", getter = true, doc = "Gets the name of the recipe that the machine crafts")
|
||||
public Object[] getRecipeName(Context context, Arguments arguments) throws Exception{
|
||||
if(!(machine instanceof IRecipeCrafterProvider)){
|
||||
return null;
|
||||
}
|
||||
return getObjects(((IRecipeCrafterProvider) machine).getRecipeCrafter().recipeName);
|
||||
}
|
||||
|
||||
@Callback(value = "getInputSlots", getter = true, doc = "Gets the slot ids that the crafter uses to look for inputs")
|
||||
public Object[] getInputSlots(Context context, Arguments arguments) throws Exception{
|
||||
if(!(machine instanceof IRecipeCrafterProvider)){
|
||||
return null;
|
||||
}
|
||||
return Arrays.stream(((IRecipeCrafterProvider) machine).getRecipeCrafter().inputSlots).mapToObj((IntFunction<Object>) value -> value).toArray();
|
||||
}
|
||||
|
||||
@Callback(value = "getOutputSlots", getter = true, doc = "Gets the slot ids that the crafter uses for outputs")
|
||||
public Object[] getOutputSlots(Context context, Arguments arguments) throws Exception{
|
||||
if(!(machine instanceof IRecipeCrafterProvider)){
|
||||
return null;
|
||||
}
|
||||
return Arrays.stream(((IRecipeCrafterProvider) machine).getRecipeCrafter().outputSlots).mapToObj((IntFunction<Object>) value -> value).toArray();
|
||||
}
|
||||
|
||||
@Callback(value = "isActive", getter = true, doc = "Returns a boolean if the machine is actice")
|
||||
public Object[] isActive(Context context, Arguments arguments) throws Exception{
|
||||
return getObjects(machine.isActive());
|
||||
}
|
||||
|
||||
@Callback(value = "getFacing", getter = true, doc = "Gets the facing for the machine")
|
||||
public Object[] getFacing(Context context, Arguments arguments) throws Exception{
|
||||
EnumFacing facing = machine.getFacing();
|
||||
if(facing == null){
|
||||
return null;
|
||||
}
|
||||
return getObjects(facing.getName());
|
||||
}
|
||||
|
||||
private Object[] getObjects(Object... objects){
|
||||
return objects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String preferredName() {
|
||||
return "tr_machine";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int priority() {
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
//package techreborn.compat.psi;
|
||||
//
|
||||
//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.FMLServerStartingEvent;
|
||||
//import techreborn.compat.ICompatModule;
|
||||
//import techreborn.compat.psi.spell.trick.block.PieceTrickBlockTap;
|
||||
//import vazkii.psi.api.PsiAPI;
|
||||
//import vazkii.psi.api.spell.Spell;
|
||||
//import vazkii.psi.api.spell.SpellPiece;
|
||||
//import vazkii.psi.common.lib.LibPieceGroups;
|
||||
//
|
||||
//public class CompatModulePsi implements ICompatModule {
|
||||
// public static PieceContainer trickTreetap;
|
||||
// public static final String TRICK_TAP_BLOCK = "trickTapBlock";
|
||||
//
|
||||
// @Override
|
||||
// public void preInit(FMLPreInitializationEvent event) {
|
||||
// trickTreetap = register(PieceTrickBlockTap.class, TRICK_TAP_BLOCK, LibPieceGroups.BLOCK_WORKS);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void init(FMLInitializationEvent event) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void postInit(FMLPostInitializationEvent event) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void serverStarting(FMLServerStartingEvent event) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public static PieceContainer register(Class<? extends SpellPiece> clazz, String name, String group) {
|
||||
// return register(clazz, name, group, false);
|
||||
// }
|
||||
//
|
||||
// public static PieceContainer register(Class<? extends SpellPiece> clazz, String name, String group, boolean main) {
|
||||
// PsiAPI.registerSpellPieceAndTexture(name, clazz);
|
||||
// PsiAPI.addPieceToGroup(clazz, group, main);
|
||||
// return (Spell s) -> {
|
||||
// return SpellPiece.create(clazz, s);
|
||||
// };
|
||||
// }
|
||||
//
|
||||
// public static interface PieceContainer {
|
||||
// public SpellPiece get(Spell s);
|
||||
// }
|
||||
//
|
||||
//}
|
|
@ -1,126 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
//package techreborn.compat.psi.spell.trick.block;
|
||||
//
|
||||
//import java.util.Random;
|
||||
//
|
||||
//import net.minecraft.block.state.IBlockState;
|
||||
//import net.minecraft.entity.item.EntityItem;
|
||||
//import net.minecraft.util.EnumFacing;
|
||||
//import net.minecraft.util.math.BlockPos;
|
||||
//import techreborn.blocks.BlockRubberLog;
|
||||
//import techreborn.items.ItemParts;
|
||||
//import vazkii.psi.api.internal.Vector3;
|
||||
//import vazkii.psi.api.spell.EnumSpellStat;
|
||||
//import vazkii.psi.api.spell.Spell;
|
||||
//import vazkii.psi.api.spell.SpellCompilationException;
|
||||
//import vazkii.psi.api.spell.SpellContext;
|
||||
//import vazkii.psi.api.spell.SpellMetadata;
|
||||
//import vazkii.psi.api.spell.SpellParam;
|
||||
//import vazkii.psi.api.spell.SpellRuntimeException;
|
||||
//import vazkii.psi.api.spell.param.ParamVector;
|
||||
//import vazkii.psi.api.spell.piece.PieceTrick;
|
||||
//
|
||||
//public class PieceTrickBlockTap extends PieceTrick {
|
||||
//
|
||||
// SpellParam position;
|
||||
// SpellParam side;
|
||||
//
|
||||
// public PieceTrickBlockTap(Spell spell) {
|
||||
// super(spell);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void initParams() {
|
||||
// addParam(position = new ParamVector(SpellParam.GENERIC_NAME_POSITION, SpellParam.BLUE, false, false));
|
||||
// addParam(side = new ParamVector("Side", SpellParam.GREEN, false, false));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void addToMetadata(SpellMetadata meta) throws SpellCompilationException {
|
||||
// super.addToMetadata(meta);
|
||||
//
|
||||
// meta.addStat(EnumSpellStat.POTENCY, 20);
|
||||
// meta.addStat(EnumSpellStat.COST, 25);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Object execute(SpellContext context) throws SpellRuntimeException {
|
||||
// if (context.caster.worldObj.isRemote)
|
||||
// return null;
|
||||
//
|
||||
// Vector3 positionVal = this.<Vector3> getParamValue(context, position);
|
||||
// Vector3 sideVal = this.<Vector3> getParamValue(context, side);
|
||||
//
|
||||
// if (positionVal == null)
|
||||
// throw new SpellRuntimeException(SpellRuntimeException.NULL_VECTOR);
|
||||
// if (!context.isInRadius(positionVal))
|
||||
// throw new SpellRuntimeException(SpellRuntimeException.OUTSIDE_RADIUS);
|
||||
//
|
||||
// if (sideVal == null)
|
||||
// throw new SpellRuntimeException(SpellRuntimeException.NULL_VECTOR);
|
||||
// if (!context.isInRadius(sideVal))
|
||||
// throw new SpellRuntimeException(SpellRuntimeException.OUTSIDE_RADIUS);
|
||||
//
|
||||
// if(!sideVal.isAxial()){
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// BlockPos pos = new BlockPos(positionVal.x, positionVal.y, positionVal.z);
|
||||
// IBlockState state = context.caster.worldObj.getBlockState(pos);
|
||||
// if (state.getBlock() instanceof BlockRubberLog) {
|
||||
// System.out.println("Is rubber log");
|
||||
// if (state.getValue(BlockRubberLog.HAS_SAP)) {
|
||||
// System.out.println("Has sap");
|
||||
// if (state.getValue(BlockRubberLog.SAP_SIDE) == null) {
|
||||
// System.out.println("got this far");
|
||||
// context.caster.worldObj.setBlockState(pos, state.withProperty(BlockRubberLog.HAS_SAP, false)
|
||||
// .withProperty(BlockRubberLog.SAP_SIDE, EnumFacing.getHorizontal(0)));
|
||||
// // TODO 1.9 sounds
|
||||
// // worldIn.playSoundAtEntity(playerIn,
|
||||
// // "techreborn:sap_extract", 0.8F, 1F);
|
||||
// if (!context.caster.worldObj.isRemote) {
|
||||
// System.out.println("doing stuff");
|
||||
// Random rand = new Random();
|
||||
// BlockPos itemPos = pos.offset(context.positionBroken.sideHit);
|
||||
// EntityItem item = new EntityItem(context.caster.worldObj, itemPos.getX(), itemPos.getY(),
|
||||
// itemPos.getZ(), ItemParts.getPartByName("rubberSap").copy());
|
||||
// float factor = 0.05F;
|
||||
// item.motionX = rand.nextGaussian() * factor;
|
||||
// item.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||
// item.motionZ = rand.nextGaussian() * factor;
|
||||
// context.caster.worldObj.spawnEntityInWorld(item);
|
||||
// }
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
// return null;
|
||||
//
|
||||
// }
|
||||
//}
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.theoneprobe;
|
||||
|
||||
import mcjty.theoneprobe.api.IProbeConfig;
|
||||
import mcjty.theoneprobe.api.IProbeConfigProvider;
|
||||
import mcjty.theoneprobe.api.IProbeHitData;
|
||||
import mcjty.theoneprobe.api.IProbeHitEntityData;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
|
||||
/**
|
||||
* Created by Mark on 04/06/2016.
|
||||
*/
|
||||
public class ProbeConfig implements IProbeConfigProvider {
|
||||
@Override
|
||||
public void getProbeConfig(IProbeConfig config, EntityPlayer player, World world, Entity entity, IProbeHitEntityData data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getProbeConfig(IProbeConfig config, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
|
||||
TileEntity tile = world.getTileEntity(data.getPos());
|
||||
if (tile instanceof TilePowerAcceptor) {
|
||||
config.setRFMode(0);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,130 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.theoneprobe;
|
||||
|
||||
import mcjty.theoneprobe.api.*;
|
||||
import mcjty.theoneprobe.apiimpl.providers.ChestInfoTools;
|
||||
import mcjty.theoneprobe.apiimpl.styles.ProgressStyle;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.power.IEnergyInterfaceTile;
|
||||
import reborncore.common.RebornCoreConfig;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.StringUtils;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by Mark on 04/06/2016.
|
||||
*/
|
||||
public class ProbeProvider implements IProbeInfoProvider {
|
||||
|
||||
ProgressStyle euStyle = new ProgressStyle().backgroundColor(0xFF8B8B8B).borderColor(0xFF373737).alternateFilledColor(PowerSystem.getDisplayPower().altColour).filledColor(PowerSystem.getDisplayPower().colour);
|
||||
|
||||
MethodHandle methodHandle_addStacks;
|
||||
|
||||
public ProbeProvider() {
|
||||
euStyle.suffix(" " + PowerSystem.getDisplayPower().abbreviation);
|
||||
euStyle.numberFormat(NumberFormat.COMMAS);
|
||||
|
||||
try {
|
||||
//Can we just all agree to make things that might be useful to others public, thanks.
|
||||
MethodHandles.Lookup lookup = MethodHandles.lookup();
|
||||
Method pm = ChestInfoTools.class.getDeclaredMethod("showChestContents", IProbeInfo.class, World.class, BlockPos.class, List.class, boolean.class);
|
||||
pm.setAccessible(true);
|
||||
methodHandle_addStacks = lookup.unreflect(pm);
|
||||
} catch (NoSuchMethodException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return "TechReborn";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
|
||||
euStyle = new ProgressStyle().backgroundColor(0xFF8B8B8B).borderColor(0xFF373737).alternateFilledColor(PowerSystem.getDisplayPower().altColour).filledColor(PowerSystem.getDisplayPower().colour);
|
||||
euStyle.suffix(" " + PowerSystem.getDisplayPower().abbreviation);
|
||||
TileEntity tile = world.getTileEntity(data.getPos());
|
||||
if (tile instanceof IListInfoProvider) {
|
||||
List<String> strs = new ArrayList<>();
|
||||
((IListInfoProvider) tile).addInfo(strs, true);
|
||||
for (String string : strs) {
|
||||
probeInfo.text(string);
|
||||
}
|
||||
}
|
||||
if (tile instanceof IEnergyInterfaceTile) {
|
||||
IEnergyInterfaceTile energy = (IEnergyInterfaceTile) tile;
|
||||
if (PowerSystem.getDisplayPower() != PowerSystem.EnergySystem.EU) {
|
||||
probeInfo.progress((int) energy.getEnergy() * RebornCoreConfig.euPerFU, (int) energy.getMaxPower() * RebornCoreConfig.euPerFU, euStyle);
|
||||
} else {
|
||||
probeInfo.progress((int) energy.getEnergy(), (int) energy.getMaxPower(), euStyle);
|
||||
}
|
||||
}
|
||||
if (tile instanceof TileLegacyMachineBase && methodHandle_addStacks != null) {
|
||||
TileLegacyMachineBase legacyMachineBase = (TileLegacyMachineBase) tile;
|
||||
if (legacyMachineBase.getInventoryForTile().isPresent()) {
|
||||
if (player.isSneaking()) {
|
||||
probeInfo.text(StringUtils.t("techreborn.tooltip.inventory"));
|
||||
}
|
||||
Inventory inventory = legacyMachineBase.getInventoryForTile().get();
|
||||
if(!inventory.isEmpty()){
|
||||
List<ItemStack> stacks = Arrays.stream(inventory.contents).filter(stack -> !stack.isEmpty()).collect(Collectors.toList());
|
||||
try {
|
||||
methodHandle_addStacks.invoke(probeInfo, world, null, stacks, player.isSneaking());
|
||||
} catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!legacyMachineBase.upgradeInventory.isEmpty() && player.isSneaking()) {
|
||||
probeInfo.horizontal();
|
||||
probeInfo.text(StringUtils.t("techreborn.tooltip.upgrades"));
|
||||
List<ItemStack> stacks = Arrays.stream(legacyMachineBase.upgradeInventory.contents).filter(stack -> !stack.isEmpty()).collect(Collectors.toList());
|
||||
try {
|
||||
methodHandle_addStacks.invoke(probeInfo, world, null, stacks, player.isSneaking());
|
||||
} catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.theoneprobe;
|
||||
|
||||
import mcjty.theoneprobe.TheOneProbe;
|
||||
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.FMLServerStartingEvent;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
import static techreborn.compat.CompatConfigs.enableTOP;
|
||||
|
||||
/**
|
||||
* Created by Mark on 04/06/2016.
|
||||
*/
|
||||
public class TheOneProbeCompat implements ICompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if (enableTOP) {
|
||||
TheOneProbe.theOneProbeImp.registerProvider(new ProbeProvider());
|
||||
TheOneProbe.theOneProbeImp.registerProbeConfigProvider(new ProbeConfig());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.thermalexpansion;
|
||||
|
||||
import cofh.api.util.ThermalExpansionHelper;
|
||||
import cofh.thermalfoundation.init.TFFluids;
|
||||
import cofh.thermalfoundation.item.ItemMaterial;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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.FMLServerStartingEvent;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipe;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipeList;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.api.generator.GeneratorRecipeHelper;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.init.recipes.RecipeMethods;
|
||||
import techreborn.items.ItemDusts;
|
||||
import techreborn.items.ItemPlates;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 06/07/2017.
|
||||
*/
|
||||
public class RecipeThermalExpansion implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
ThermalExpansionHelper.addPulverizerRecipe(2000, new ItemStack(Items.ENDER_PEARL), RecipeMethods.getMaterial("ender_pearl", 1, RecipeMethods.Type.DUST));
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, new ItemStack(Items.ENDER_EYE), RecipeMethods.getMaterial("ender_eye", 2, RecipeMethods.Type.DUST));
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, new ItemStack(Items.FLINT), RecipeMethods.getMaterial("flint", 2, RecipeMethods.Type.SMALL_DUST), RecipeMethods.getMaterial("flint", 2, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(2500, new ItemStack(ModItems.CELL), RecipeMethods.getMaterial("tin", 4, RecipeMethods.Type.SMALL_DUST));
|
||||
ThermalExpansionHelper.addPulverizerRecipe(2500, new ItemStack(Blocks.END_STONE), RecipeMethods.getMaterial("endstone", 1, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("endstone", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("galena", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("galena", 1, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("sulfur", 1, RecipeMethods.Type.DUST), 50);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("ruby", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("ruby", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("red_garnet", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("sapphire", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("sapphire", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("sphalerite", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("bauxite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("bauxite", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("aluminum", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("pyrite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("pyrite", 5, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("iron", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("cinnabar", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("cinnabar", 3, RecipeMethods.Type.DUST), new ItemStack(Items.REDSTONE), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(4000, RecipeMethods.getMaterial("sphalerite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("sphalerite", 4, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("zinc", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(5000, RecipeMethods.getMaterial("tungsten", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("tungsten", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("manganese", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("peridot", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("peridot", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("emerald", 1, RecipeMethods.Type.DUST), 10);
|
||||
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("sodalite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("sodalite", 12, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("aluminum", 1, RecipeMethods.Type.DUST), 10);
|
||||
|
||||
for(String plate : ItemPlates.types){
|
||||
if(!plate.equals(ModItems.META_PLACEHOLDER) && ItemDusts.hasDust(plate)){
|
||||
ThermalExpansionHelper.addPulverizerRecipe(5000, RecipeMethods.getMaterial(plate, 1, RecipeMethods.Type.PLATE), RecipeMethods.getMaterial(plate, 1, RecipeMethods.Type.DUST));
|
||||
}
|
||||
}
|
||||
|
||||
ThermalExpansionHelper.addSmelterRecipe(4000, new ItemStack(Items.IRON_INGOT, 2), new ItemStack(Blocks.SAND), RecipeMethods.getMaterial("refined_iron", 2, RecipeMethods.Type.INGOT), ItemMaterial.crystalSlag.copy(), 25);
|
||||
|
||||
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.THERMAL, TFFluids.fluidPyrotheum, 80);
|
||||
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.SEMIFLUID, TFFluids.fluidCreosote, 40);
|
||||
|
||||
FluidReplicatorRecipeList.addRecipe(new FluidReplicatorRecipe(4, TFFluids.fluidCoal, 100, 20));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.tinkers;
|
||||
|
||||
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.FMLServerStartingEvent;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
/**
|
||||
* @author Prospector on 08/05/16
|
||||
*/
|
||||
public class CompatModuleTinkers implements ICompatModule {
|
||||
|
||||
public CompatModuleTinkers() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
// TinkersFluids.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
//package techreborn.compat.tinkers;
|
||||
//
|
||||
//import net.minecraft.item.EnumRarity;
|
||||
//import net.minecraft.nbt.NBTTagCompound;
|
||||
//import net.minecraft.nbt.NBTTagList;
|
||||
//import net.minecraft.util.ResourceLocation;
|
||||
//import net.minecraftforge.fluids.Fluid;
|
||||
//import net.minecraftforge.fluids.FluidRegistry;
|
||||
//import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
//import slimeknights.tconstruct.library.fluid.FluidMolten;
|
||||
//
|
||||
///**
|
||||
// * @author Prospector on 08/05/16
|
||||
// */
|
||||
//public class TinkersFluids {
|
||||
// private static ResourceLocation moltenMetal = new ResourceLocation("tconstruct:blocks/fluids/molten_metal");
|
||||
// private static ResourceLocation moltenMetalFlowing = new ResourceLocation(
|
||||
// "tconstruct:blocks/fluids/molten_metal_flow");
|
||||
//
|
||||
// public static FluidMolten moltenChrome = new FluidMolten("chrome", 0x90C9C9, moltenMetal, moltenMetalFlowing);
|
||||
// public static FluidMolten moltenInvar = new FluidMolten("invar", 0x7F907F, moltenMetal, moltenMetalFlowing);
|
||||
// public static FluidMolten moltenIridium = new FluidMolten("iridium", 0xFFFFFF, moltenMetal, moltenMetalFlowing);
|
||||
// public static FluidMolten moltenPlatinum = new FluidMolten("platinum", 0x34BFBF, moltenMetal, moltenMetalFlowing);
|
||||
// public static FluidMolten moltenTitanium = new FluidMolten("titanium", 0x3C372F, moltenMetal, moltenMetalFlowing);
|
||||
// public static FluidMolten moltenTungsten = new FluidMolten("tungsten", 0x3A464F, moltenMetal, moltenMetalFlowing);
|
||||
//
|
||||
// public static void init() {
|
||||
// addFluidStuff(moltenChrome, "Chrome");
|
||||
// moltenChrome.setTemperature(800);
|
||||
// addFluidStuff(moltenInvar, "Invar");
|
||||
// moltenInvar.setTemperature(580);
|
||||
// addFluidStuff(moltenIridium, "Iridium");
|
||||
// moltenIridium.setTemperature(4000);
|
||||
// moltenIridium.setRarity(EnumRarity.EPIC);
|
||||
// addFluidStuff(moltenPlatinum, "Platinum");
|
||||
// moltenPlatinum.setTemperature(900);
|
||||
// addFluidStuff(moltenTitanium, "Titanium");
|
||||
// moltenTitanium.setTemperature(1000);
|
||||
// addFluidStuff(moltenTungsten, "Tungsten");
|
||||
// moltenTungsten.setTemperature(1200);
|
||||
//
|
||||
// //Invar Alloying
|
||||
// NBTTagList tagList = new NBTTagList();
|
||||
// NBTTagCompound fluid = new NBTTagCompound();
|
||||
// fluid.setString("FluidName", "invar");
|
||||
// fluid.setInteger("Amount", 144);
|
||||
// tagList.appendTag(fluid);
|
||||
// fluid = new NBTTagCompound();
|
||||
// fluid.setString("FluidName", "iron");
|
||||
// fluid.setInteger("Amount", 96);
|
||||
// tagList.appendTag(fluid);
|
||||
// fluid = new NBTTagCompound();
|
||||
// fluid.setString("FluidName", "nickel");
|
||||
// fluid.setInteger("Amount", 48);
|
||||
// tagList.appendTag(fluid);
|
||||
//
|
||||
// NBTTagCompound message = new NBTTagCompound();
|
||||
// message.setTag("alloy", tagList);
|
||||
// FMLInterModComms.sendMessage("tconstruct", "alloy", message);
|
||||
// }
|
||||
//
|
||||
// public static void addFluidStuff(Fluid fluid, String oreSuffix) {
|
||||
// FluidRegistry.registerFluid(fluid);
|
||||
// FluidRegistry.addBucketForFluid(fluid);
|
||||
// NBTTagCompound tag = new NBTTagCompound();
|
||||
// tag.setString("fluid", fluid.getName());
|
||||
// tag.setString("ore", oreSuffix);
|
||||
// tag.setBoolean("toolforge", true);
|
||||
// FMLInterModComms.sendMessage("tconstruct", "integrateSmeltery", tag);
|
||||
// }
|
||||
//}
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaPlugin;
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import mcp.mobius.waila.api.WailaPlugin;
|
||||
import reborncore.common.BaseTileBlock;
|
||||
|
||||
@WailaPlugin
|
||||
public class CompatModuleWaila implements IWailaPlugin {
|
||||
|
||||
@Override
|
||||
public void register(IWailaRegistrar registrar) {
|
||||
registrar.registerBodyProvider(new WailaProviderMachines(), BaseTileBlock.class);
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.compat.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class WailaProviderMachines implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack item, List<String> tip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
if (accessor.getTileEntity() instanceof IListInfoProvider) {
|
||||
((IListInfoProvider) accessor.getTileEntity()).addInfo(tip, true);
|
||||
}
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack item, List<String> tip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack item, List<String> tip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World w, BlockPos pos) {
|
||||
return tag;
|
||||
}
|
||||
}
|
|
@ -33,9 +33,6 @@ public class ConfigTechReborn {
|
|||
@ConfigRegistry(config = "recipes", category = "railcraft", key = "disableRailcraftNugget", comment = "When true TechReborn will remove Railcraft's Iron Nugget to steel nugget recipe.")
|
||||
public static boolean disableRailcraftSteelNuggetRecipe = false;
|
||||
|
||||
@ConfigRegistry(config = "recipes", category = "ic2", key = "deduplicate", comment = "Changes a lot of recipes and hides blocks to integrate TechReborn into IC2")
|
||||
public static boolean REMOVE_DUPLICATES = false;
|
||||
|
||||
@ConfigRegistry(config = "misc", category = "general", key = "enableGemTools", comment = "Enable Gem armor and tools")
|
||||
public static boolean enableGemArmorAndTools = true;
|
||||
|
||||
|
|
|
@ -1,151 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.init;
|
||||
|
||||
import ic2.core.block.BlockIC2Fence;
|
||||
import ic2.core.block.BlockTexGlass;
|
||||
import ic2.core.block.type.ResourceBlock;
|
||||
import ic2.core.block.wiring.CableType;
|
||||
import ic2.core.item.block.ItemCable;
|
||||
import ic2.core.item.type.CraftingItemType;
|
||||
import ic2.core.item.type.MiscResourceType;
|
||||
import ic2.core.item.type.NuclearResourceType;
|
||||
import ic2.core.ref.BlockName;
|
||||
import ic2.core.ref.ItemName;
|
||||
import ic2.core.ref.TeBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.util.OreUtil;
|
||||
import techreborn.Core;
|
||||
import techreborn.api.recipe.machines.ExtractorRecipe;
|
||||
import techreborn.items.ItemParts;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 16/07/2016.
|
||||
*/
|
||||
public class IC2Dict {
|
||||
|
||||
//TODO IC2
|
||||
public static void init() {
|
||||
|
||||
IC2Duplicates.GRINDER.setIc2Stack(BlockName.te.getItemStack(TeBlock.macerator.getName()));
|
||||
IC2Duplicates.ELECTRICAL_FURNACE.setIc2Stack(BlockName.te.getItemStack(TeBlock.electric_furnace.getName()));
|
||||
IC2Duplicates.IRON_FURNACE.setIc2Stack(BlockName.te.getItemStack(TeBlock.iron_furnace.getName()));
|
||||
IC2Duplicates.GENERATOR.setIc2Stack(BlockName.te.getItemStack(TeBlock.generator.getName()));
|
||||
IC2Duplicates.EXTRACTOR.setIc2Stack(BlockName.te.getItemStack(TeBlock.extractor.getName()));
|
||||
IC2Duplicates.RECYCLER.setIc2Stack(BlockName.te.getItemStack(TeBlock.recycler.getName()));
|
||||
IC2Duplicates.COMPRESSOR.setIc2Stack(BlockName.te.getItemStack(TeBlock.compressor.getName()));
|
||||
IC2Duplicates.BAT_BOX.setIc2Stack(BlockName.te.getItemStack(TeBlock.batbox.getName()));
|
||||
IC2Duplicates.MFE.setIc2Stack(BlockName.te.getItemStack(TeBlock.mfe.getName()));
|
||||
IC2Duplicates.MFSU.setIc2Stack(BlockName.te.getItemStack(TeBlock.mfsu.getName()));
|
||||
IC2Duplicates.LVT.setIc2Stack(BlockName.te.getItemStack(TeBlock.lv_transformer.getName()));
|
||||
IC2Duplicates.MVT.setIc2Stack(BlockName.te.getItemStack(TeBlock.mv_transformer.getName()));
|
||||
IC2Duplicates.HVT.setIc2Stack(BlockName.te.getItemStack(TeBlock.hv_transformer.getName()));
|
||||
IC2Duplicates.CABLE_COPPER.setIc2Stack(getIC2Cable(CableType.copper, 0));
|
||||
IC2Duplicates.CABLE_GOLD.setIc2Stack(getIC2Cable(CableType.gold, 0));
|
||||
IC2Duplicates.CABLE_ICOPPER.setIc2Stack(getIC2Cable(CableType.copper, 1));
|
||||
IC2Duplicates.CABLE_IGOLD.setIc2Stack(getIC2Cable(CableType.gold, 1));
|
||||
IC2Duplicates.CABLE_HV.setIc2Stack(getIC2Cable(CableType.tin, 0));
|
||||
IC2Duplicates.CABLE_IHV.setIc2Stack(getIC2Cable(CableType.tin, 1));
|
||||
IC2Duplicates.CABLE_IIHV.setIc2Stack(getIC2Cable(CableType.tin, 2));
|
||||
IC2Duplicates.CABLE_GLASSFIBER.setIc2Stack(getIC2Cable(CableType.glass, 0));
|
||||
|
||||
IC2Duplicates.MIXED_METAL.setIc2Stack(ItemName.ingot.getItemStack("alloy"));
|
||||
IC2Duplicates.CARBON_FIBER.setIc2Stack(ItemName.crafting.getItemStack("carbon_fibre"));
|
||||
IC2Duplicates.CARBON_MESH.setIc2Stack(ItemName.crafting.getItemStack("carbon_mesh"));
|
||||
IC2Duplicates.REFINED_IRON.setIc2Stack(ItemName.plate.getItemStack("iron"));
|
||||
IC2Duplicates.SCRAP.setIc2Stack(ItemName.crafting.getItemStack(CraftingItemType.scrap));
|
||||
IC2Duplicates.FREQ_TRANSMITTER.setIc2Stack(ItemName.frequency_transmitter.getItemStack());
|
||||
//Rubber - ore dic: itemRubber, hidden from JEI
|
||||
//Rubber Sap - only used to make rubber, hidden from JEI
|
||||
//Rubber tree blocks, hidden when deduplication is on, and rubber tress are not set to gen, includes tree taps
|
||||
//Circuits are hidden in JEI
|
||||
|
||||
RecipeHandler.addRecipe(
|
||||
new ExtractorRecipe(ItemName.misc_resource.getItemStack("resin"),
|
||||
ItemParts.getPartByName("rubber", 3), 400, 2));
|
||||
|
||||
try {
|
||||
CraftingItemType.circuit.getName();
|
||||
|
||||
OreUtil.registerOre("reBattery", ItemName.re_battery.getItemStack());
|
||||
|
||||
OreUtil.registerOre("circuitBasic", ItemName.crafting.getItemStack(CraftingItemType.circuit));
|
||||
OreUtil.registerOre("circuitAdvanced", ItemName.crafting.getItemStack(CraftingItemType.advanced_circuit));
|
||||
|
||||
OreUtil.registerOre("machineBlockBasic", BlockName.resource.getItemStack(ResourceBlock.machine));
|
||||
OreUtil.registerOre("machineBlockAdvanced", BlockName.resource.getItemStack(ResourceBlock.advanced_machine));
|
||||
|
||||
OreUtil.registerOre("lapotronCrystal", ItemName.lapotron_crystal.getItemStack());
|
||||
OreUtil.registerOre("energyCrystal", ItemName.energy_crystal.getItemStack());
|
||||
|
||||
OreUtil.registerOre("drillBasic", ItemName.drill.getItemStack());
|
||||
OreUtil.registerOre("drillDiamond", ItemName.diamond_drill.getItemStack());
|
||||
OreUtil.registerOre("drillAdvanced", ItemName.iridium_drill.getItemStack());
|
||||
|
||||
ItemStack industrialTnt = BlockName.te.getItemStack(TeBlock.itnt);
|
||||
industrialTnt.setItemDamage(1);
|
||||
OreUtil.registerOre("industrialTnt", industrialTnt);
|
||||
|
||||
OreUtil.registerOre("craftingIndustrialDiamond", ItemName.crafting.getItemStack(CraftingItemType.industrial_diamond));
|
||||
OreUtil.registerOre("fertilizer", ItemName.crafting.getItemStack(CraftingItemType.bio_chaff));
|
||||
OreUtil.registerOre("hvTransformer", BlockName.te.getItemStack(TeBlock.hv_transformer));
|
||||
|
||||
OreUtil.registerOre("uran235", ItemName.nuclear.getItemStack(NuclearResourceType.uranium_235));
|
||||
OreUtil.registerOre("uran238", ItemName.nuclear.getItemStack(NuclearResourceType.uranium_238));
|
||||
OreUtil.registerOre("smallUran238", ItemName.nuclear.getItemStack(NuclearResourceType.small_uranium_238));
|
||||
OreUtil.registerOre("smallUran235", ItemName.nuclear.getItemStack(NuclearResourceType.small_uranium_235));
|
||||
|
||||
OreUtil.registerOre("fenceIron", BlockName.fence.getItemStack(BlockIC2Fence.IC2FenceType.iron));
|
||||
OreUtil.registerOre("rubberWood", BlockName.rubber_wood.getItemStack());
|
||||
OreUtil.registerOre("glassReinforced", BlockName.glass.getItemStack(BlockTexGlass.GlassType.reinforced));
|
||||
|
||||
OreUtil.registerOre("oreIridium", ItemName.misc_resource.getItemStack(MiscResourceType.iridium_ore));
|
||||
|
||||
OreUtil.registerOre("plateIridiumAlloy", ItemName.crafting.getItemStack(CraftingItemType.iridium));
|
||||
|
||||
} catch (NoClassDefFoundError notFound) {
|
||||
Core.logHelper.warn(
|
||||
"Can't enable integration: IC2 installed but cannot be hooked\n" +
|
||||
"Do you use incompatible IC2 version?\n" +
|
||||
"Please create issue on github and provide FULL LOG and mod list");
|
||||
} catch (Throwable error) {
|
||||
Core.logHelper.warn(
|
||||
"Exception thrown during IC2 integration init\n" +
|
||||
"Do you use incompatible IC2 version?\n" +
|
||||
"Please create issue on github and provide FULL LOG and mod list.\n" +
|
||||
"Error stack trace: ");
|
||||
error.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack getIC2Cable(CableType type, int insulation) {
|
||||
if (insulation > type.maxInsulation) {
|
||||
return null;
|
||||
}
|
||||
return ItemCable.getCable(type, insulation);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,118 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.init;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.blocks.cable.EnumCableType;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.items.ItemIngots;
|
||||
import techreborn.items.ItemParts;
|
||||
|
||||
/**
|
||||
* Created by Mark on 18/12/2016.
|
||||
*/
|
||||
public enum IC2Duplicates {
|
||||
|
||||
GRINDER(new ItemStack(ModBlocks.GRINDER)),
|
||||
ELECTRICAL_FURNACE(new ItemStack(ModBlocks.ELECTRIC_FURNACE)),
|
||||
IRON_FURNACE(new ItemStack(ModBlocks.IRON_FURNACE)),
|
||||
GENERATOR(new ItemStack(ModBlocks.SOLID_FUEL_GENEREATOR)),
|
||||
EXTRACTOR(new ItemStack(ModBlocks.EXTRACTOR)),
|
||||
RECYCLER(new ItemStack(ModBlocks.RECYCLER)),
|
||||
COMPRESSOR(new ItemStack(ModBlocks.COMPRESSOR)),
|
||||
BAT_BOX(new ItemStack(ModBlocks.LOW_VOLTAGE_SU)),
|
||||
MFE(new ItemStack(ModBlocks.MEDIUM_VOLTAGE_SU)),
|
||||
MFSU(new ItemStack(ModBlocks.HIGH_VOLTAGE_SU)),
|
||||
LVT(new ItemStack(ModBlocks.LV_TRANSFORMER)),
|
||||
MVT(new ItemStack(ModBlocks.MV_TRANSFORMER)),
|
||||
HVT(new ItemStack(ModBlocks.HV_TRANSFORMER)),
|
||||
CABLE_COPPER(EnumCableType.COPPER.getStack()),
|
||||
CABLE_GLASSFIBER(EnumCableType.GLASSFIBER.getStack()),
|
||||
CABLE_GOLD(EnumCableType.GOLD.getStack()),
|
||||
CABLE_HV(EnumCableType.HV.getStack()),
|
||||
CABLE_ICOPPER(EnumCableType.ICOPPER.getStack()),
|
||||
CABLE_IGOLD(EnumCableType.IGOLD.getStack()),
|
||||
CABLE_IHV(EnumCableType.IHV.getStack()),
|
||||
CABLE_IIHV(EnumCableType.TIN.getStack()),
|
||||
MIXED_METAL(ItemIngots.getIngotByName("mixed_metal")),
|
||||
CARBON_FIBER(ItemParts.getPartByName("carbon_fiber")),
|
||||
CARBON_MESH(ItemParts.getPartByName("carbon_mesh")),
|
||||
REFINED_IRON(ItemIngots.getIngotByName("refined_iron")),
|
||||
SCRAP(ItemParts.getPartByName("scrap")),
|
||||
FREQ_TRANSMITTER(new ItemStack(ModItems.FREQUENCY_TRANSMITTER));
|
||||
|
||||
ItemStack ic2Stack;
|
||||
ItemStack trStack;
|
||||
|
||||
IC2Duplicates(ItemStack trStack) {
|
||||
this.trStack = trStack;
|
||||
}
|
||||
|
||||
IC2Duplicates(ItemStack ic2Stack, ItemStack trStack) {
|
||||
this.ic2Stack = ic2Stack;
|
||||
this.trStack = trStack;
|
||||
}
|
||||
|
||||
public static boolean deduplicate() {
|
||||
if (!CompatManager.isIC2Loaded) {
|
||||
return false;
|
||||
}
|
||||
return ConfigTechReborn.REMOVE_DUPLICATES;
|
||||
}
|
||||
|
||||
public ItemStack getIc2Stack() {
|
||||
if (!CompatManager.isIC2Loaded) {
|
||||
throw new RuntimeException("IC2 isnt loaded");
|
||||
}
|
||||
if (ic2Stack.isEmpty()) {
|
||||
throw new RuntimeException("IC2 stack wasnt set ");
|
||||
}
|
||||
return ic2Stack;
|
||||
}
|
||||
|
||||
public void setIc2Stack(ItemStack ic2Stack) {
|
||||
this.ic2Stack = ic2Stack;
|
||||
}
|
||||
|
||||
public boolean hasIC2Stack() {
|
||||
if (ic2Stack == null) {
|
||||
return false;
|
||||
}
|
||||
return !ic2Stack.isEmpty();
|
||||
}
|
||||
|
||||
public ItemStack getTrStack() {
|
||||
return trStack;
|
||||
}
|
||||
|
||||
public ItemStack getStackBasedOnConfig() {
|
||||
if (deduplicate()) {
|
||||
return getIc2Stack();
|
||||
}
|
||||
return getTrStack();
|
||||
}
|
||||
|
||||
}
|
|
@ -31,7 +31,6 @@ import net.minecraft.item.crafting.FurnaceRecipes;
|
|||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
|
@ -44,7 +43,6 @@ import techreborn.api.recipe.machines.CompressorRecipe;
|
|||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.recipes.*;
|
||||
import techreborn.items.*;
|
||||
|
@ -66,8 +64,6 @@ public class ModRecipes {
|
|||
public static void init() {
|
||||
//Gonna rescan to make sure we have an uptodate list
|
||||
OreUtil.scanForOres();
|
||||
//Done again incase we loaded before QuantumStorage
|
||||
CompatManager.isQuantumStorageLoaded = Loader.isModLoaded("quantumstorage");
|
||||
|
||||
CraftingTableRecipes.init();
|
||||
SmeltingRecipes.init();
|
||||
|
@ -87,7 +83,6 @@ public class ModRecipes {
|
|||
|
||||
addBlastFurnaceRecipes();
|
||||
addVacuumFreezerRecipes();
|
||||
addIc2Recipes();
|
||||
addGrinderRecipes();
|
||||
addCompressorRecipes();
|
||||
}
|
||||
|
@ -115,7 +110,7 @@ public class ModRecipes {
|
|||
private static void addCompressorRecipes() {
|
||||
RecipeHandler.addRecipe(new CompressorRecipe(ItemIngots.getIngotByName("advanced_alloy"),
|
||||
ItemPlates.getPlateByName("advanced_alloy"), 400, 20));
|
||||
RecipeHandler.addRecipe(new CompressorRecipe(IC2Duplicates.CARBON_MESH.getStackBasedOnConfig(),
|
||||
RecipeHandler.addRecipe(new CompressorRecipe(ItemParts.getPartByName("carbon_mesh"),
|
||||
ItemPlates.getPlateByName("carbon"), 400, 2));
|
||||
RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("plankWood", 1),
|
||||
OreUtil.getStackFromName("plateWood", 1), 300, 4));
|
||||
|
@ -385,57 +380,7 @@ public class ModRecipes {
|
|||
new ItemStack(Items.IRON_INGOT, 2), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000));
|
||||
}
|
||||
|
||||
static void addIc2Recipes() {
|
||||
RebornCraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.MANUAL), IC2Duplicates.REFINED_IRON.getStackBasedOnConfig(),
|
||||
Items.BOOK);
|
||||
|
||||
// RebornCraftingHelper
|
||||
// .addShapedOreRecipe(ItemParts.getPartByName("machineParts", 16), "CSC", "SCS", "CSC", 'S', "ingotSteel",
|
||||
// 'C', "circuitBasic");
|
||||
//
|
||||
// RebornCraftingHelper.addShapedOreRecipe(new
|
||||
// ItemStack(ModBlocks.magicalAbsorber),
|
||||
// "CSC", "IBI", "CAC",
|
||||
// 'C', "circuitMaster",
|
||||
// 'S', "craftingSuperconductor",
|
||||
// 'B', Blocks.beacon,
|
||||
// 'A', ModBlocks.magicEnergeyConverter,
|
||||
// 'I', "plateIridium");
|
||||
//
|
||||
// RebornCraftingHelper.addShapedOreRecipe(new
|
||||
// ItemStack(ModBlocks.magicEnergeyConverter),
|
||||
// "CTC", "PBP", "CLC",
|
||||
// 'C', "circuitAdvanced",
|
||||
// 'P', "platePlatinum",
|
||||
// 'B', Blocks.beacon,
|
||||
// 'L', "lapotronCrystal",
|
||||
// 'T', TechRebornAPI.recipeCompact.getItem("teleporter"));
|
||||
|
||||
// RebornCraftingHelper.addShapedOreRecipe(new
|
||||
// ItemStack(ModBlocks.electricCraftingTable),
|
||||
// "ITI", "IBI", "ICI",
|
||||
// 'I', "plateIron",
|
||||
// 'C', "circuitAdvanced",
|
||||
// 'T', "crafterWood",
|
||||
// 'B', "machineBlockBasic");
|
||||
|
||||
// RebornCraftingHelper.addShapedOreRecipe(new
|
||||
// ItemStack(ModBlocks.electricCraftingTable),
|
||||
// "ATA", "ABA", "ACA",
|
||||
// 'A', "plateAluminum",
|
||||
// 'C', "circuitAdvanced",
|
||||
// 'T', "crafterWood",
|
||||
// 'B', "machineBlockBasic");
|
||||
|
||||
// RebornCraftingHelper.addShapedOreRecipe(new
|
||||
// ItemStack(ModBlocks.chunkLoader),
|
||||
// "SCS", "CMC", "SCS",
|
||||
// 'S', "plateSteel",
|
||||
// 'C', "circuitMaster",
|
||||
// 'M', new ItemStack(ModItems.parts, 1, 39));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static ItemStack getBucketWithFluid(Fluid fluid) {
|
||||
return FluidUtil.getFilledBucket(new FluidStack(fluid, Fluid.BUCKET_VOLUME));
|
||||
|
|
|
@ -46,11 +46,6 @@ public class OreDict {
|
|||
);
|
||||
|
||||
public static void init() {
|
||||
if (Loader.isModLoaded("ic2")) {
|
||||
Core.logHelper.info("IC2 installed, enabling integration");
|
||||
IC2Dict.init();
|
||||
}
|
||||
|
||||
OreUtil.registerOre("reBattery", ModItems.RE_BATTERY);
|
||||
|
||||
OreUtil.registerOre("circuitBasic", ItemParts.getPartByName("electronicCircuit"));
|
||||
|
@ -74,20 +69,12 @@ public class OreDict {
|
|||
OreUtil.registerOre("insulatedGoldCableItem", BlockCable.getCableByName("insulatedgold"));
|
||||
OreUtil.registerOre("fertilizer", new ItemStack(Items.DYE, 1, 15));
|
||||
|
||||
OreUtil.registerOre("ic2Generator", ModBlocks.SOLID_FUEL_GENEREATOR);
|
||||
OreUtil.registerOre("ic2SolarPanel", ModBlocks.SOLAR_PANEL);
|
||||
OreUtil.registerOre("ic2Macerator", ModBlocks.GRINDER);
|
||||
OreUtil.registerOre("ic2Extractor", ModBlocks.EXTRACTOR);
|
||||
OreUtil.registerOre("ic2Windmill", ModBlocks.WIND_MILL);
|
||||
OreUtil.registerOre("ic2Watermill", ModBlocks.WATER_MILL);
|
||||
|
||||
//OreUtil.registerOre("uran235", nothing);
|
||||
//OreUtil.registerOre("uran238", nothing);
|
||||
//OreUtil.registerOre("smallUran235", nothing);
|
||||
|
||||
OreUtil.registerOre("fenceIron", ModBlocks.REFINED_IRON_FENCE);
|
||||
//TODO ic2 bug? Disabled as it crashes with this line
|
||||
//OreUtil.registerOre("woodRubber", ModBlocks.RUBBER_LOG);
|
||||
OreUtil.registerOre("woodRubber", ModBlocks.RUBBER_LOG);
|
||||
OreUtil.registerOre("glassReinforced", ModBlocks.REINFORCED_GLASS);
|
||||
|
||||
OreUtil.registerOre("craftingDiamondGrinder", ItemParts.getPartByName("diamondGrindingHead"));
|
||||
|
|
|
@ -44,11 +44,6 @@ public class SubItemRetriever implements ISubItemRetriever {
|
|||
return ItemCells.getCellByName(name, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCellByName(String name, int count, boolean lookForIC2) {
|
||||
return ItemCells.getCellByName(name, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getDustByName(String name) {
|
||||
return ItemDusts.getDustByName(name);
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
package techreborn.init.recipes;
|
||||
|
||||
import ic2.api.item.IC2Items;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -57,14 +56,6 @@ public class ChemicalReactorRecipes extends RecipeMethods {
|
|||
register(getMaterial("compressedair", Type.CELL), getMaterial("hydrogen", 2, Type.CELL), getMaterial("water", Type.CELL), 400);
|
||||
register(getMaterial("compressedair", 2, Type.CELL), getMaterial("nitrogen", Type.CELL), getMaterial("nitrogenDioxide", Type.CELL), 400);
|
||||
register(getMaterial("oil", Type.CELL), getMaterial("nitrogen", Type.CELL), getMaterial("nitrofuel", 2, Type.CELL), 800);
|
||||
|
||||
//Dusts
|
||||
if (techreborn.compat.CompatManager.isIC2Loaded){
|
||||
ItemStack f = IC2Items.getItem("crop_res", "fertilizer");
|
||||
register(getMaterial("calcite", Type.DUST), getMaterial("sulfur", Type.DUST), f, 40);
|
||||
//There is no recipe for phosphorous yet.
|
||||
//register(getMaterial("calcite", Type.DUST), getMaterial("phosphorous", Type.DUST), f, 40);
|
||||
}
|
||||
}
|
||||
|
||||
static void register(ItemStack in1, ItemStack in2, ItemStack out, int tickTime, int euPerTick){
|
||||
|
|
|
@ -36,9 +36,8 @@ import reborncore.common.util.StringUtils;
|
|||
import techreborn.Core;
|
||||
import techreborn.blocks.BlockStorage;
|
||||
import techreborn.blocks.BlockStorage2;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.blocks.cable.EnumCableType;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.IC2Duplicates;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.*;
|
||||
|
@ -89,11 +88,11 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
}
|
||||
|
||||
//Upgrades
|
||||
registerShaped(ItemUpgrades.getUpgradeByName("energy_storage"), "PPP", "WBW", "PCP", 'P', "plankWood", 'W', getStack(IC2Duplicates.CABLE_ICOPPER), 'C', "circuitBasic", 'B', "reBattery");
|
||||
registerShaped(ItemUpgrades.getUpgradeByName("overclock"), "TTT", "WCW", 'T', getMaterial("coolant_simple", Type.PART), 'W', getStack(IC2Duplicates.CABLE_ICOPPER), 'C', "circuitBasic");
|
||||
registerShaped(ItemUpgrades.getUpgradeByName("overclock", 2), " T ", "WCW", 'T', getMaterial("helium_coolant_triple", Type.PART), 'W', getStack(IC2Duplicates.CABLE_ICOPPER), 'C', "circuitBasic");
|
||||
registerShaped(ItemUpgrades.getUpgradeByName("overclock", 2), " T ", "WCW", 'T', getMaterial("nak_coolant_simple", Type.PART), 'W', getStack(IC2Duplicates.CABLE_ICOPPER), 'C', "circuitBasic");
|
||||
registerShaped(ItemUpgrades.getUpgradeByName("transformer"), "GGG", "WTW", "GCG", 'G', "blockGlass", 'W', getStack(IC2Duplicates.CABLE_IGOLD), 'C', "circuitBasic", 'T', getStack(IC2Duplicates.MVT));
|
||||
registerShaped(ItemUpgrades.getUpgradeByName("energy_storage"), "PPP", "WBW", "PCP", 'P', "plankWood", 'W', EnumCableType.ICOPPER.getStack(), 'C', "circuitBasic", 'B', "reBattery");
|
||||
registerShaped(ItemUpgrades.getUpgradeByName("overclock"), "TTT", "WCW", 'T', getMaterial("coolant_simple", Type.PART), 'W', EnumCableType.ICOPPER.getStack(), 'C', "circuitBasic");
|
||||
registerShaped(ItemUpgrades.getUpgradeByName("overclock", 2), " T ", "WCW", 'T', getMaterial("helium_coolant_triple", Type.PART), 'W', EnumCableType.ICOPPER.getStack(), 'C', "circuitBasic");
|
||||
registerShaped(ItemUpgrades.getUpgradeByName("overclock", 2), " T ", "WCW", 'T', getMaterial("nak_coolant_simple", Type.PART), 'W', EnumCableType.ICOPPER.getStack(), 'C', "circuitBasic");
|
||||
registerShaped(ItemUpgrades.getUpgradeByName("transformer"), "GGG", "WTW", "GCG", 'G', "blockGlass", 'W', EnumCableType.IGOLD.getStack(), 'C', "circuitBasic", 'T', getStack(ModBlocks.MV_TRANSFORMER));
|
||||
|
||||
//Machines
|
||||
registerShaped(getMaterial("standard", 4, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "ingotRefinedIron", 'C', "circuitBasic", 'A', "machineBlockBasic");
|
||||
|
@ -103,48 +102,48 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
registerShaped(getMaterial("reinforced", 1, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "plateSteel", 'C', "circuitAdvanced", 'A', getMaterial("standard", Type.MACHINE_CASING));
|
||||
registerShaped(getMaterial("advanced", 4, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "plateChrome", 'C', "circuitElite", 'A', "machineBlockElite");
|
||||
registerShaped(getMaterial("advanced", 1, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "plateChrome", 'C', "circuitElite", 'A', getMaterial("reinforced", Type.MACHINE_CASING));
|
||||
registerShapeless(getStack(IC2Duplicates.GENERATOR), "reBattery", "machineBlockBasic", getStack(Blocks.FURNACE));
|
||||
registerShaped(getStack(ModBlocks.SEMI_FLUID_GENERATOR), "III", "IHI", "CGC", 'I', "plateIron", 'H', "glassReinforced", 'C', "circuitBasic", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.SEMI_FLUID_GENERATOR), "III", "IHI", "CGC", 'I', "plateAluminum", 'H', "glassReinforced", 'C', "circuitBasic", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.DIESEL_GENERATOR), "III", "I I", "CGC", 'I', "ingotRefinedIron", 'C', "circuitBasic", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.DIESEL_GENERATOR), "III", "I I", "CGC", 'I', "plateAluminum", 'C', "circuitBasic", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShapeless(getStack(ModBlocks.SOLID_FUEL_GENEREATOR), "reBattery", "machineBlockBasic", getStack(Blocks.FURNACE));
|
||||
registerShaped(getStack(ModBlocks.SEMI_FLUID_GENERATOR), "III", "IHI", "CGC", 'I', "plateIron", 'H', "glassReinforced", 'C', "circuitBasic", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
|
||||
registerShaped(getStack(ModBlocks.SEMI_FLUID_GENERATOR), "III", "IHI", "CGC", 'I', "plateAluminum", 'H', "glassReinforced", 'C', "circuitBasic", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
|
||||
registerShaped(getStack(ModBlocks.DIESEL_GENERATOR), "III", "I I", "CGC", 'I', "ingotRefinedIron", 'C', "circuitBasic", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
|
||||
registerShaped(getStack(ModBlocks.DIESEL_GENERATOR), "III", "I I", "CGC", 'I', "plateAluminum", 'C', "circuitBasic", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
|
||||
registerShaped(getStack(ModBlocks.GAS_TURBINE), "IAI", "WGW", "IAI", 'I', "plateInvar", 'A', "circuitAdvanced", 'W', getStack(ModBlocks.WIND_MILL), 'G', "glassReinforced");
|
||||
registerShaped(getStack(ModBlocks.GAS_TURBINE), "IAI", "WGW", "IAI", 'I', "plateAluminum", 'A', "circuitAdvanced", 'W', getStack(ModBlocks.WIND_MILL), 'G', "glassReinforced");
|
||||
registerShaped(getStack(ModBlocks.THERMAL_GENERATOR), "III", "IRI", "CGC", 'I', "plateInvar", 'R', "glassReinforced", 'G', getStack(IC2Duplicates.GENERATOR), 'C', "circuitBasic");
|
||||
registerShaped(getStack(ModBlocks.WIND_MILL), " I ", " G ", " I ", 'I', "plateMagnalium", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.WIND_MILL), "IGI", 'I', "plateMagnalium", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.WATER_MILL), "SWS", "WGW", "SWS", 'S', "stickWood", 'W', "plankWood", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.THERMAL_GENERATOR), "III", "IRI", "CGC", 'I', "plateInvar", 'R', "glassReinforced", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR), 'C', "circuitBasic");
|
||||
registerShaped(getStack(ModBlocks.WIND_MILL), " I ", " G ", " I ", 'I', "plateMagnalium", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
|
||||
registerShaped(getStack(ModBlocks.WIND_MILL), "IGI", 'I', "plateMagnalium", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
|
||||
registerShaped(getStack(ModBlocks.WATER_MILL), "SWS", "WGW", "SWS", 'S', "stickWood", 'W', "plankWood", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
|
||||
registerShaped(getStack(ModBlocks.LIGHTNING_ROD), "CAC", "ACA", "CAC", 'A', getStack(ModBlocks.MACHINE_CASINGS, 1, 2), 'C', "circuitMaster");
|
||||
registerShaped(getStack(ModBlocks.IRON_ALLOY_FURNACE), "III", "F F", "III", 'I', "ingotRefinedIron", 'F', getStack(IC2Duplicates.IRON_FURNACE));
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), "RER", "CFC", "RER", 'R', "plateIron", 'E', getStack(IC2Duplicates.EXTRACTOR), 'C', "circuitAdvanced", 'F', "machineBlockAdvanced");
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), "RCR", "AEA", "RCR", 'R', "ingotRefinedIron", 'E', getStack(IC2Duplicates.EXTRACTOR), 'A', "machineBlockAdvanced", 'C', "circuitAdvanced");
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), "RCR", "AEA", "RCR", 'R', "plateAluminum", 'E', getStack(IC2Duplicates.EXTRACTOR), 'A', "machineBlockAdvanced", 'C', "circuitAdvanced");
|
||||
registerShaped(getStack(ModBlocks.IRON_ALLOY_FURNACE), "III", "F F", "III", 'I', "ingotRefinedIron", 'F', getStack(ModBlocks.IRON_FURNACE));
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), "RER", "CFC", "RER", 'R', "plateIron", 'E', getStack(ModBlocks.EXTRACTOR), 'C', "circuitAdvanced", 'F', "machineBlockAdvanced");
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), "RCR", "AEA", "RCR", 'R', "ingotRefinedIron", 'E', getStack(ModBlocks.EXTRACTOR), 'A', "machineBlockAdvanced", 'C', "circuitAdvanced");
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), "RCR", "AEA", "RCR", 'R', "plateAluminum", 'E', getStack(ModBlocks.EXTRACTOR), 'A', "machineBlockAdvanced", 'C', "circuitAdvanced");
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_SAWMILL), "PAP", "SSS", "ACA", 'P', "ingotRefinedIron", 'A', "circuitAdvanced", 'S', getMaterial("diamond_saw_blade", Type.PART), 'C', "machineBlockAdvanced");
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_BLAST_FURNACE), "CHC", "HBH", "FHF", 'H', getMaterial("cupronickelHeatingCoil", Type.PART), 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'F', getStack(IC2Duplicates.ELECTRICAL_FURNACE));
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_GRINDER), "ECG", "HHH", "CBC", 'E', getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), 'H', "craftingDiamondGrinder", 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'G', getStack(IC2Duplicates.GRINDER));
|
||||
registerShaped(getStack(ModBlocks.IMPLOSION_COMPRESSOR), "ABA", "CPC", "ABA", 'A', getMaterialObject("advancedAlloy", Type.INGOT), 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'P', getStack(IC2Duplicates.COMPRESSOR));
|
||||
registerShaped(getStack(ModBlocks.VACUUM_FREEZER), "SPS", "CGC", "SPS", 'S', "plateSteel", 'C', "circuitAdvanced", 'G', "glassReinforced", 'P', getStack(IC2Duplicates.EXTRACTOR));
|
||||
registerShaped(getStack(ModBlocks.DISTILLATION_TOWER), "CMC", "PBP", "EME", 'E', getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), 'M', "circuitMaster", 'B', "machineBlockElite", 'C', getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), 'P', getStack(IC2Duplicates.EXTRACTOR));
|
||||
registerShaped(getStack(ModBlocks.CHEMICAL_REACTOR), "IMI", "CPC", "IEI", 'I', "plateInvar", 'C', "circuitAdvanced", 'M', getStack(IC2Duplicates.EXTRACTOR), 'P', getStack(IC2Duplicates.COMPRESSOR), 'E', getStack(IC2Duplicates.EXTRACTOR));
|
||||
registerShaped(getStack(ModBlocks.ROLLING_MACHINE), "PCP", "MBM", "PCP", 'P', getStack(Blocks.PISTON), 'C', "circuitAdvanced", 'M', getStack(IC2Duplicates.COMPRESSOR), 'B', "machineBlockBasic");
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_BLAST_FURNACE), "CHC", "HBH", "FHF", 'H', getMaterial("cupronickelHeatingCoil", Type.PART), 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'F', getStack(ModBlocks.ELECTRIC_FURNACE));
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_GRINDER), "ECG", "HHH", "CBC", 'E', getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), 'H', "craftingDiamondGrinder", 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'G', getStack(ModBlocks.GRINDER));
|
||||
registerShaped(getStack(ModBlocks.IMPLOSION_COMPRESSOR), "ABA", "CPC", "ABA", 'A', getMaterialObject("advancedAlloy", Type.INGOT), 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'P', getStack(ModBlocks.COMPRESSOR));
|
||||
registerShaped(getStack(ModBlocks.VACUUM_FREEZER), "SPS", "CGC", "SPS", 'S', "plateSteel", 'C', "circuitAdvanced", 'G', "glassReinforced", 'P', getStack(ModBlocks.EXTRACTOR));
|
||||
registerShaped(getStack(ModBlocks.DISTILLATION_TOWER), "CMC", "PBP", "EME", 'E', getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), 'M', "circuitMaster", 'B', "machineBlockElite", 'C', getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), 'P', getStack(ModBlocks.EXTRACTOR));
|
||||
registerShaped(getStack(ModBlocks.CHEMICAL_REACTOR), "IMI", "CPC", "IEI", 'I', "plateInvar", 'C', "circuitAdvanced", 'M', getStack(ModBlocks.EXTRACTOR), 'P', getStack(ModBlocks.COMPRESSOR), 'E', getStack(ModBlocks.EXTRACTOR));
|
||||
registerShaped(getStack(ModBlocks.ROLLING_MACHINE), "PCP", "MBM", "PCP", 'P', getStack(Blocks.PISTON), 'C', "circuitAdvanced", 'M', getStack(ModBlocks.COMPRESSOR), 'B', "machineBlockBasic");
|
||||
registerShaped(getStack(ModBlocks.AUTO_CRAFTING_TABLE), "MPM", "PCP", "MPM", 'M', "circuitAdvanced", 'C', "workbench", 'P', "plateIron");
|
||||
registerShaped(getStack(ModBlocks.CHARGE_O_MAT), "ETE", "COC", "EAE", 'E', "circuitMaster", 'T', "energyCrystal", 'C', "chest", 'O', getStack(ModItems.LAPOTRONIC_ORB), 'A', "machineBlockAdvanced");
|
||||
registerShaped(getStack(ModBlocks.ALLOY_SMELTER), " C ", "FMF", " ", 'C', "circuitBasic", 'F', getStack(IC2Duplicates.ELECTRICAL_FURNACE), 'M', "machineBlockBasic");
|
||||
registerShaped(getStack(ModBlocks.ALLOY_SMELTER), " C ", "FMF", " ", 'C', "circuitBasic", 'F', getStack(ModBlocks.ELECTRIC_FURNACE), 'M', "machineBlockBasic");
|
||||
registerShaped(getStack(ModBlocks.INTERDIMENSIONAL_SU), "PAP", "ACA", "PAP", 'P', "plateIridiumAlloy", 'C', "chestEnder", 'A', getStack(ModBlocks.ADJUSTABLE_SU));
|
||||
registerShaped(getStack(ModBlocks.ADJUSTABLE_SU), "LLL", "LCL", "LLL", 'L', getStack(ModItems.LAPOTRONIC_ORB), 'C', "energyCrystal");
|
||||
registerShaped(getStack(ModBlocks.LAPOTRONIC_SU), " L ", "CBC", " M ", 'L', getStack(IC2Duplicates.LVT), 'C', "circuitAdvanced", 'M', getStack(IC2Duplicates.MVT), 'B', getStack(ModBlocks.LSU_STORAGE));
|
||||
registerShaped(getStack(ModBlocks.LAPOTRONIC_SU), " L ", "CBC", " M ", 'L', getStack(ModBlocks.LV_TRANSFORMER), 'C', "circuitAdvanced", 'M', getStack(ModBlocks.MV_TRANSFORMER), 'B', getStack(ModBlocks.LSU_STORAGE));
|
||||
registerShaped(getStack(ModBlocks.LSU_STORAGE), "LLL", "LCL", "LLL", 'L', "blockLapis", 'C', "circuitBasic");
|
||||
registerShaped(getStack(ModBlocks.SCRAPBOXINATOR), "ICI", "DSD", "ICI", 'S', getStack(ModItems.SCRAP_BOX), 'C', "circuitBasic", 'I', "plateIron", 'D', "dirt");
|
||||
registerShaped(getStack(ModBlocks.FUSION_CONTROL_COMPUTER), "CCC", "PTP", "CCC", 'P', "energyCrystal", 'T', getStack(ModBlocks.FUSION_COIL), 'C', "circuitMaster");
|
||||
registerShaped(getStack(ModBlocks.FUSION_COIL), "CSC", "NAN", "CRC", 'A', getStack(ModBlocks.MACHINE_CASINGS, 1, 2), 'N', getMaterial("nichromeHeatingCoil", Type.PART), 'C', "circuitMaster", 'S', "craftingSuperconductor", 'R', getMaterial("iridiumNeutronReflector", Type.PART));
|
||||
registerShaped(getStack(ModBlocks.DIGITAL_CHEST), "PPP", "PDP", "PCP", 'P', "plateAluminum", 'D', getMaterial("data_orb", Type.PART), 'C', getMaterial("computer_monitor", Type.PART));
|
||||
registerShaped(getStack(ModBlocks.DIGITAL_CHEST), "PPP", "PDP", "PCP", 'P', "plateSteel", 'D', getMaterial("data_orb", Type.PART), 'C', getMaterial("computer_monitor", Type.PART));
|
||||
registerShaped(getStack(ModBlocks.MATTER_FABRICATOR), "ETE", "AOA", "ETE", 'E', "circuitMaster", 'T', getStack(IC2Duplicates.EXTRACTOR), 'A', "machineBlockElite", 'O', getStack(ModItems.LAPOTRONIC_ORB));
|
||||
registerShaped(getStack(ModBlocks.MATTER_FABRICATOR), "ETE", "AOA", "ETE", 'E', "circuitMaster", 'T', getStack(ModBlocks.EXTRACTOR), 'A', "machineBlockElite", 'O', getStack(ModItems.LAPOTRONIC_ORB));
|
||||
registerShaped(getStack(ModBlocks.COMPUTER_CUBE), "OMC", "MFM", "CMO", 'O', getMaterial("data_orb", Type.PART), 'M', getMaterial("computer_monitor", Type.PART), 'C', "circuitMaster", 'F', "machineBlockAdvanced");
|
||||
registerShaped(getStack(ModBlocks.PLAYER_DETECTOR, true), " D ", "CFC", " D ", 'D', "circuitStorage", 'C', "circuitAdvanced", 'F', getStack(ModBlocks.COMPUTER_CUBE));
|
||||
registerShaped(getStack(ModBlocks.DRAGON_EGG_SYPHON), "CTC", "PSP", "CBC", 'C', "circuitMaster", 'T', getStack(IC2Duplicates.MFE), 'P', "plateIridiumAlloy", 'S', "craftingSuperconductor", 'B', getStack(ModItems.LAPOTRONIC_ORB));
|
||||
registerShaped(getStack(ModBlocks.PLASMA_GENERATOR), "PPP", "PTP", "CGC", 'P', "plateTungstensteel", 'T', getStack(IC2Duplicates.HVT), 'C', "circuitMaster", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.SOLAR_PANEL, 1, 0), "DLD", "LDL", "CGC", 'D', "dustCoal", 'L', "paneGlass", 'G', getStack(IC2Duplicates.GENERATOR), 'C', "circuitBasic");
|
||||
registerShaped(getStack(ModBlocks.DRAGON_EGG_SYPHON), "CTC", "PSP", "CBC", 'C', "circuitMaster", 'T', getStack(ModBlocks.MEDIUM_VOLTAGE_SU), 'P', "plateIridiumAlloy", 'S', "craftingSuperconductor", 'B', getStack(ModItems.LAPOTRONIC_ORB));
|
||||
registerShaped(getStack(ModBlocks.PLASMA_GENERATOR), "PPP", "PTP", "CGC", 'P', "plateTungstensteel", 'T', getStack(ModBlocks.HV_TRANSFORMER), 'C', "circuitMaster", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
|
||||
registerShaped(getStack(ModBlocks.SOLAR_PANEL, 1, 0), "DLD", "LDL", "CGC", 'D', "dustCoal", 'L', "paneGlass", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR), 'C', "circuitBasic");
|
||||
registerShaped(getStack(ModBlocks.SOLAR_PANEL, 1, 1), "DLD", "LDL", "CPC", 'D', "dustCoal", 'L', "blockGlass", 'C', "circuitAdvanced", 'P', getStack(ModBlocks.SOLAR_PANEL, 1, 0));
|
||||
registerShaped(getStack(ModBlocks.SOLAR_PANEL, 1, 1), "DLD", "LDL", "CPC", 'D', "dustCoal", 'L', "blockGlass", 'C', "circuitAdvanced", 'P', "machineBlockBasic");
|
||||
registerShaped(getStack(ModBlocks.SOLAR_PANEL, 1, 2), "DLD", "LDL", "CPC", 'D', "dustDiamond", 'L', "blockGlass", 'C', "circuitAdvanced", 'P', getStack(ModBlocks.SOLAR_PANEL, 1, 1));
|
||||
|
@ -156,27 +155,23 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
registerShaped(getStack(ModBlocks.ALARM, 1, 0), "ICI", "SRS", "ICI", 'I', "ingotIron", 'C', getMaterial("copper", Type.CABLE), 'S', getMaterial("insulatedcopper", Type.CABLE), 'R', "blockRedstone" );
|
||||
registerShaped(getStack(ModBlocks.FLUID_REPLICATOR), "PCP", "CFC", "ESR", 'P', "plateTungstensteel", 'F', "machineBlockElite", 'C', "circuitMaster", 'E', getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), 'S', "craftingSuperconductor",'R', getStack(ModBlocks.CHEMICAL_REACTOR));
|
||||
|
||||
if (!IC2Duplicates.deduplicate()) {
|
||||
registerShaped(getStack(IC2Duplicates.HVT), " H ", " M ", " H ", 'M', getStack(IC2Duplicates.MVT), 'H', getStack(IC2Duplicates.CABLE_IHV));
|
||||
registerShaped(getStack(IC2Duplicates.MVT), " G ", " M ", " G ", 'M', "machineBlockBasic", 'G', getStack(IC2Duplicates.CABLE_IGOLD));
|
||||
registerShaped(getStack(IC2Duplicates.LVT), "PWP", "CCC", "PPP", 'P', "plankWood", 'C', "ingotCopper", 'W', getStack(IC2Duplicates.CABLE_ICOPPER));
|
||||
registerShaped(getStack(IC2Duplicates.BAT_BOX), "WCW", "BBB", "WWW", 'W', "plankWood", 'B', "reBattery", 'C', getStack(IC2Duplicates.CABLE_ICOPPER));
|
||||
registerShaped(getStack(IC2Duplicates.MFE), "GEG", "EME", "GEG", 'M', "machineBlockBasic", 'E', "energyCrystal", 'G', getStack(IC2Duplicates.CABLE_IGOLD));
|
||||
registerShaped(getStack(IC2Duplicates.MFSU), "LAL", "LML", "LOL", 'A', "circuitAdvanced", 'L', "lapotronCrystal", 'M', getStack(IC2Duplicates.MFE), 'O', "machineBlockAdvanced");
|
||||
registerShaped(getStack(IC2Duplicates.COMPRESSOR), "S S", "SCS", "SMS", 'C', "circuitBasic", 'M', "machineBlockBasic", 'S', "stone");
|
||||
registerShaped(getStack(IC2Duplicates.ELECTRICAL_FURNACE), " C ", "RFR", " ", 'C', "circuitBasic", 'F', getStack(IC2Duplicates.IRON_FURNACE), 'R', "dustRedstone");
|
||||
registerShaped(getStack(IC2Duplicates.RECYCLER), " E ", "DCD", "GDG", 'D', "dirt", 'C', getStack(IC2Duplicates.COMPRESSOR), 'G', "dustGlowstone", 'E', "circuitBasic");
|
||||
registerShaped(getStack(IC2Duplicates.IRON_FURNACE), "III", "I I", "III", 'I', "ingotIron");
|
||||
registerShaped(getStack(IC2Duplicates.IRON_FURNACE), " I ", "I I", "IFI", 'I', "ingotIron", 'F', getStack(Blocks.FURNACE));
|
||||
registerShaped(getStack(IC2Duplicates.EXTRACTOR), "TMT", "TCT", " ", 'T', getStack(ModItems.TREE_TAP, true), 'M', "machineBlockBasic", 'C', "circuitBasic");
|
||||
registerShaped(getStack(IC2Duplicates.GRINDER), "FFF", "SMS", " C ", 'F', Items.FLINT, 'S', getStack(Blocks.COBBLESTONE), 'M', getMaterial("machine", Type.MACHINE_FRAME), 'C', "circuitBasic");
|
||||
registerShapeless(getStack(IC2Duplicates.FREQ_TRANSMITTER), getStack(IC2Duplicates.CABLE_ICOPPER), "circuitBasic");
|
||||
}
|
||||
|
||||
if (!CompatManager.isQuantumStorageLoaded) {
|
||||
registerShaped(getStack(ModBlocks.QUANTUM_CHEST), "DCD", "ATA", "DQD", 'D', getMaterial("dataOrb", Type.PART), 'C', getMaterial("computerMonitor", Type.PART), 'A', "machineBlockElite", 'Q', getStack(ModBlocks.DIGITAL_CHEST), 'T', getStack(IC2Duplicates.COMPRESSOR));
|
||||
registerShaped(getStack(ModBlocks.QUANTUM_TANK), "EPE", "PCP", "EPE", 'P', "platePlatinum", 'E', "circuitAdvanced", 'C', getStack(ModBlocks.QUANTUM_CHEST));
|
||||
}
|
||||
registerShaped(getStack(ModBlocks.HV_TRANSFORMER), " H ", " M ", " H ", 'M', getStack(ModBlocks.MV_TRANSFORMER), 'H', EnumCableType.IHV.getStack());
|
||||
registerShaped(getStack(ModBlocks.MV_TRANSFORMER), " G ", " M ", " G ", 'M', "machineBlockBasic", 'G', EnumCableType.IGOLD.getStack());
|
||||
registerShaped(getStack(ModBlocks.LV_TRANSFORMER), "PWP", "CCC", "PPP", 'P', "plankWood", 'C', "ingotCopper", 'W', EnumCableType.ICOPPER.getStack());
|
||||
registerShaped(getStack(ModBlocks.LOW_VOLTAGE_SU), "WCW", "BBB", "WWW", 'W', "plankWood", 'B', "reBattery", 'C', EnumCableType.ICOPPER.getStack());
|
||||
registerShaped(getStack(ModBlocks.MEDIUM_VOLTAGE_SU), "GEG", "EME", "GEG", 'M', "machineBlockBasic", 'E', "energyCrystal", 'G', EnumCableType.IGOLD.getStack());
|
||||
registerShaped(getStack(ModBlocks.HIGH_VOLTAGE_SU), "LAL", "LML", "LOL", 'A', "circuitAdvanced", 'L', "lapotronCrystal", 'M', getStack(ModBlocks.MEDIUM_VOLTAGE_SU), 'O', "machineBlockAdvanced");
|
||||
registerShaped(getStack(ModBlocks.COMPRESSOR), "S S", "SCS", "SMS", 'C', "circuitBasic", 'M', "machineBlockBasic", 'S', "stone");
|
||||
registerShaped(getStack(ModBlocks.ELECTRIC_FURNACE), " C ", "RFR", " ", 'C', "circuitBasic", 'F', getStack(ModBlocks.IRON_FURNACE), 'R', "dustRedstone");
|
||||
registerShaped(getStack(ModBlocks.RECYCLER), " E ", "DCD", "GDG", 'D', "dirt", 'C', getStack(ModBlocks.COMPRESSOR), 'G', "dustGlowstone", 'E', "circuitBasic");
|
||||
registerShaped(getStack(ModBlocks.IRON_FURNACE), "III", "I I", "III", 'I', "ingotIron");
|
||||
registerShaped(getStack(ModBlocks.IRON_FURNACE), " I ", "I I", "IFI", 'I', "ingotIron", 'F', getStack(Blocks.FURNACE));
|
||||
registerShaped(getStack(ModBlocks.EXTRACTOR), "TMT", "TCT", " ", 'T', getStack(ModItems.TREE_TAP, true), 'M', "machineBlockBasic", 'C', "circuitBasic");
|
||||
registerShaped(getStack(ModBlocks.GRINDER), "FFF", "SMS", " C ", 'F', Items.FLINT, 'S', getStack(Blocks.COBBLESTONE), 'M', getMaterial("machine", Type.MACHINE_FRAME), 'C', "circuitBasic");
|
||||
registerShapeless(getStack(ModItems.FREQUENCY_TRANSMITTER), EnumCableType.ICOPPER.getStack(), "circuitBasic");
|
||||
registerShaped(getStack(ModBlocks.QUANTUM_CHEST), "DCD", "ATA", "DQD", 'D', getMaterial("dataOrb", Type.PART), 'C', getMaterial("computerMonitor", Type.PART), 'A', "machineBlockElite", 'Q', getStack(ModBlocks.DIGITAL_CHEST), 'T', getStack(ModBlocks.COMPRESSOR));
|
||||
registerShaped(getStack(ModBlocks.QUANTUM_TANK), "EPE", "PCP", "EPE", 'P', "platePlatinum", 'E', "circuitAdvanced", 'C', getStack(ModBlocks.QUANTUM_CHEST));
|
||||
|
||||
//Lighting
|
||||
registerShaped(getStack(ModBlocks.LAMP_INCANDESCENT), "GGG", "TCT", "GGG", 'G', "paneGlass", 'T', getMaterial("copper", Type.CABLE), 'C', getMaterial("carbon_fiber", Type.PART));
|
||||
|
@ -184,8 +179,8 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
|
||||
//Parts
|
||||
registerShaped(getMaterial("iridium_alloy", Type.INGOT), "IAI", "ADA", "IAI", 'I', "ingotIridium", 'D', "dustDiamond", 'A', "plateAdvancedAlloy");
|
||||
registerShaped(getStack(ModItems.RE_BATTERY), " W ", "TRT", "TRT", 'T', "ingotTin", 'R', "dustRedstone", 'W', getStack(IC2Duplicates.CABLE_ICOPPER));
|
||||
registerShaped(getStack(ModItems.LITHIUM_BATTERY), " C ", "PFP", "PFP", 'F', getCell("lithium"), 'P', "plateAluminum", 'C', getStack(IC2Duplicates.CABLE_IGOLD));
|
||||
registerShaped(getStack(ModItems.RE_BATTERY), " W ", "TRT", "TRT", 'T', "ingotTin", 'R', "dustRedstone", 'W', EnumCableType.ICOPPER.getStack());
|
||||
registerShaped(getStack(ModItems.LITHIUM_BATTERY), " C ", "PFP", "PFP", 'F', getCell("lithium"), 'P', "plateAluminum", 'C', EnumCableType.IGOLD.getStack());
|
||||
registerShaped(getStack(ModItems.LITHIUM_BATTERY_PACK), "BCB", "BPB", "B B", 'B', getStack(ModItems.LITHIUM_BATTERY), 'P', "plateAluminum", 'C', "circuitAdvanced");
|
||||
registerShaped(getStack(ModItems.ENERGY_CRYSTAL), "RRR", "RDR", "RRR", 'R', "dustRedstone", 'D', "gemDiamond");
|
||||
registerShaped(getStack(ModItems.LAPOTRONIC_CRYSTAL), "LCL", "LEL", "LCL", 'L', "dyeBlue", 'E', "energyCrystal", 'C', "circuitBasic");
|
||||
|
@ -217,32 +212,32 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
registerShaped(getMaterial("neutron_reflector", Type.PART), "TCT", "CPC", "TCT", 'T', "dustTin", 'C', "dustCoal", 'P', "plateCopper");
|
||||
registerShaped(getMaterial("super_conductor", 4, Type.PART), "CCC", "TIT", "EEE", 'E', "circuitMaster", 'C', getMaterial("heliumCoolantSimple", Type.PART), 'T', "ingotTungsten", 'I', "plateIridiumAlloy");
|
||||
|
||||
if (!IC2Duplicates.deduplicate()) {
|
||||
registerShaped(getMaterial("copper", 6, Type.CABLE), "CCC", 'C', "ingotCopper");
|
||||
registerShaped(getMaterial("tin", 9, Type.CABLE), "TTT", 'T', "ingotTin");
|
||||
registerShaped(getMaterial("gold", 12, Type.CABLE), "GGG", 'G', "ingotGold");
|
||||
registerShaped(getMaterial("hv", 12, Type.CABLE), "RRR", 'R', "ingotRefinedIron");
|
||||
registerShaped(getMaterial("insulatedcopper", 6, Type.CABLE), "RRR", "CCC", "RRR", 'R', "itemRubber", 'C', "ingotCopper");
|
||||
registerShaped(getMaterial("insulatedcopper", 6, Type.CABLE), "RCR", "RCR", "RCR", 'R', "itemRubber", 'C', "ingotCopper");
|
||||
registerShapeless(getMaterial("insulatedcopper", Type.CABLE), "itemRubber", getMaterial("copper", Type.CABLE));
|
||||
registerShaped(getMaterial("insulatedgold", 4, Type.CABLE), "RRR", "RGR", "RRR", 'R', "itemRubber", 'G', "ingotGold");
|
||||
registerShapeless(getMaterial("insulatedgold", Type.CABLE), "itemRubber", "itemRubber", getMaterial("gold", Type.CABLE));
|
||||
registerShaped(getMaterial("insulatedhv", 4, Type.CABLE), "RRR", "RIR", "RRR", 'R', "itemRubber", 'I', "ingotRefinedIron");
|
||||
registerShapeless(getMaterial("insulatedhv", Type.CABLE), "itemRubber", "itemRubber", getMaterial("hv", Type.CABLE));
|
||||
registerShaped(getMaterial("glassfiber", 4, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "gemDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 4, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "dustDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 3, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "gemRuby", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 3, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "dustRuby", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 6, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotSilver", 'D', "gemDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 6, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotSilver", 'D', "dustDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 8, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotElectrum", 'D', "gemDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 8, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotElectrum", 'D', "dustDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("carbon_fiber", Type.PART), " C ", "C C", " C ", 'C', "dustCoal");
|
||||
registerShaped(getMaterial("carbon_fiber", Type.PART), "CCC", "C C", "CCC", 'C', getCell("carbon"));
|
||||
registerShapeless(getMaterial("carbon_mesh", Type.PART), getMaterial("carbon_fiber", Type.PART), getMaterial("carbon_fiber", Type.PART));
|
||||
registerShaped(getMaterial("electronic_circuit", Type.PART), "WWW", "SRS", "WWW", 'R', "ingotRefinedIron", 'S', Items.REDSTONE, 'W', getStack(IC2Duplicates.CABLE_ICOPPER));
|
||||
registerShaped(getMaterial("advanced_circuit", Type.PART), "RGR", "LCL", "RGR", 'R', "dustRedstone", 'G', "dustGlowstone", 'L', "gemLapis", 'C', "circuitBasic");
|
||||
}
|
||||
|
||||
registerShaped(getMaterial("copper", 6, Type.CABLE), "CCC", 'C', "ingotCopper");
|
||||
registerShaped(getMaterial("tin", 9, Type.CABLE), "TTT", 'T', "ingotTin");
|
||||
registerShaped(getMaterial("gold", 12, Type.CABLE), "GGG", 'G', "ingotGold");
|
||||
registerShaped(getMaterial("hv", 12, Type.CABLE), "RRR", 'R', "ingotRefinedIron");
|
||||
registerShaped(getMaterial("insulatedcopper", 6, Type.CABLE), "RRR", "CCC", "RRR", 'R', "itemRubber", 'C', "ingotCopper");
|
||||
registerShaped(getMaterial("insulatedcopper", 6, Type.CABLE), "RCR", "RCR", "RCR", 'R', "itemRubber", 'C', "ingotCopper");
|
||||
registerShapeless(getMaterial("insulatedcopper", Type.CABLE), "itemRubber", getMaterial("copper", Type.CABLE));
|
||||
registerShaped(getMaterial("insulatedgold", 4, Type.CABLE), "RRR", "RGR", "RRR", 'R', "itemRubber", 'G', "ingotGold");
|
||||
registerShapeless(getMaterial("insulatedgold", Type.CABLE), "itemRubber", "itemRubber", getMaterial("gold", Type.CABLE));
|
||||
registerShaped(getMaterial("insulatedhv", 4, Type.CABLE), "RRR", "RIR", "RRR", 'R', "itemRubber", 'I', "ingotRefinedIron");
|
||||
registerShapeless(getMaterial("insulatedhv", Type.CABLE), "itemRubber", "itemRubber", getMaterial("hv", Type.CABLE));
|
||||
registerShaped(getMaterial("glassfiber", 4, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "gemDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 4, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "dustDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 3, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "gemRuby", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 3, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "dustRuby", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 6, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotSilver", 'D', "gemDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 6, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotSilver", 'D', "dustDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 8, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotElectrum", 'D', "gemDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("glassfiber", 8, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotElectrum", 'D', "dustDiamond", 'G', "blockGlass");
|
||||
registerShaped(getMaterial("carbon_fiber", Type.PART), " C ", "C C", " C ", 'C', "dustCoal");
|
||||
registerShaped(getMaterial("carbon_fiber", Type.PART), "CCC", "C C", "CCC", 'C', getCell("carbon"));
|
||||
registerShapeless(getMaterial("carbon_mesh", Type.PART), getMaterial("carbon_fiber", Type.PART), getMaterial("carbon_fiber", Type.PART));
|
||||
registerShaped(getMaterial("electronic_circuit", Type.PART), "WWW", "SRS", "WWW", 'R', "ingotRefinedIron", 'S', Items.REDSTONE, 'W', EnumCableType.ICOPPER.getStack());
|
||||
registerShaped(getMaterial("advanced_circuit", Type.PART), "RGR", "LCL", "RGR", 'R', "dustRedstone", 'G', "dustGlowstone", 'L', "gemLapis", 'C', "circuitBasic");
|
||||
|
||||
|
||||
//UU-Matter
|
||||
ItemStack uuStack = new ItemStack(ModItems.UU_MATTER);
|
||||
|
@ -291,6 +286,10 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
registerShaped(new ItemStack(ModBlocks.RUBBER_LOG_SLAB_HALF), "WWW", 'W', new ItemStack(ModBlocks.RUBBER_PLANKS));
|
||||
registerShaped(new ItemStack(ModBlocks.RUBBER_LOG_STAIR), "W ", "WW ", "WWW", 'W', new ItemStack(ModBlocks.RUBBER_PLANKS));
|
||||
|
||||
RebornCraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.MANUAL), "ingotRefinedIron",
|
||||
Items.BOOK);
|
||||
|
||||
|
||||
Core.logHelper.info("Crafting Table Recipes Added");
|
||||
}
|
||||
|
||||
|
@ -336,31 +335,29 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
}
|
||||
|
||||
static void registerMixedMetalIngotRecipes() {
|
||||
if (!IC2Duplicates.deduplicate()) {
|
||||
registerMixedMetal("ingotRefinedIron", "ingotBronze", "ingotTin", 2);
|
||||
registerMixedMetal("ingotRefinedIron", "ingotBronze", "ingotZinc", 2);
|
||||
registerMixedMetal("ingotRefinedIron", "ingotBronze", "ingotTin", 2);
|
||||
registerMixedMetal("ingotRefinedIron", "ingotBronze", "ingotZinc", 2);
|
||||
|
||||
registerMixedMetal("ingotNickel", "ingotBronze", "ingotTin", 3);
|
||||
registerMixedMetal("ingotNickel", "ingotBronze", "ingotZinc", 3);
|
||||
registerMixedMetal("ingotNickel", "ingotBronze", "ingotTin", 3);
|
||||
registerMixedMetal("ingotNickel", "ingotBronze", "ingotZinc", 3);
|
||||
|
||||
registerMixedMetal("ingotNickel", "ingotBronze", "ingotAluminum", 4);
|
||||
registerMixedMetal("ingotInvar", "ingotBronze", "ingotTin", 4);
|
||||
registerMixedMetal("ingotInvar", "ingotBronze", "ingotZinc", 4);
|
||||
registerMixedMetal("ingotNickel", "ingotBronze", "ingotAluminum", 4);
|
||||
registerMixedMetal("ingotInvar", "ingotBronze", "ingotTin", 4);
|
||||
registerMixedMetal("ingotInvar", "ingotBronze", "ingotZinc", 4);
|
||||
|
||||
registerMixedMetal("ingotInvar", "ingotBronze", "ingotAluminum", 5);
|
||||
registerMixedMetal("ingotTitanium", "ingotBronze", "ingotTin", 5);
|
||||
registerMixedMetal("ingotTitanium", "ingotBronze", "ingotZinc", 5);
|
||||
registerMixedMetal("ingotTungsten", "ingotBronze", "ingotTin", 5);
|
||||
registerMixedMetal("ingotTungsten", "ingotBronze", "ingotZinc", 5);
|
||||
registerMixedMetal("ingotInvar", "ingotBronze", "ingotAluminum", 5);
|
||||
registerMixedMetal("ingotTitanium", "ingotBronze", "ingotTin", 5);
|
||||
registerMixedMetal("ingotTitanium", "ingotBronze", "ingotZinc", 5);
|
||||
registerMixedMetal("ingotTungsten", "ingotBronze", "ingotTin", 5);
|
||||
registerMixedMetal("ingotTungsten", "ingotBronze", "ingotZinc", 5);
|
||||
|
||||
registerMixedMetal("ingotTitanium", "ingotBronze", "ingotAluminum", 6);
|
||||
registerMixedMetal("ingotTungsten", "ingotBronze", "ingotAluminum", 6);
|
||||
registerMixedMetal("ingotTitanium", "ingotBronze", "ingotAluminum", 6);
|
||||
registerMixedMetal("ingotTungsten", "ingotBronze", "ingotAluminum", 6);
|
||||
|
||||
registerMixedMetal("ingotTungstensteel", "ingotBronze", "ingotTin", 8);
|
||||
registerMixedMetal("ingotTungstensteel", "ingotBronze", "ingotZinc", 8);
|
||||
registerMixedMetal("ingotTungstensteel", "ingotBronze", "ingotTin", 8);
|
||||
registerMixedMetal("ingotTungstensteel", "ingotBronze", "ingotZinc", 8);
|
||||
|
||||
registerMixedMetal("ingotTungstensteel", "ingotBronze", "ingotAluminum", 9);
|
||||
}
|
||||
registerMixedMetal("ingotTungstensteel", "ingotBronze", "ingotAluminum", 9);
|
||||
}
|
||||
|
||||
static void registerMixedMetal(String top, String middle, String bottom, int amount) {
|
||||
|
@ -373,8 +370,8 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
if (!OreDictionary.doesOreNameExist(bottom)) {
|
||||
return;
|
||||
}
|
||||
if (top.equals("ingotRefinedIron") && IC2Duplicates.deduplicate()) {
|
||||
registerShaped(getMaterial("mixed_metal", amount, Type.INGOT), "TTT", "MMM", "BBB", 'T', getStack(IC2Duplicates.REFINED_IRON), 'M', middle, 'B', bottom);
|
||||
if (top.equals("ingotRefinedIron")) {
|
||||
registerShaped(getMaterial("mixed_metal", amount, Type.INGOT), "TTT", "MMM", "BBB", 'T', "ingotRefinedIron", 'M', middle, 'B', bottom);
|
||||
} else {
|
||||
registerShaped(getMaterial("mixed_metal", amount, Type.INGOT), "TTT", "MMM", "BBB", 'T', top, 'M', middle, 'B', bottom);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ import techreborn.blocks.BlockMachineCasing;
|
|||
import techreborn.blocks.BlockMachineFrames;
|
||||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.blocks.cable.BlockCable;
|
||||
import techreborn.init.IC2Duplicates;
|
||||
import techreborn.items.*;
|
||||
|
||||
/**
|
||||
|
@ -170,16 +169,6 @@ public abstract class RecipeMethods {
|
|||
return getStack(Item.getItemFromBlock(block), count, metadata);
|
||||
}
|
||||
|
||||
public static ItemStack getStack(IC2Duplicates ic2Duplicates) {
|
||||
return getStack(ic2Duplicates, 1);
|
||||
}
|
||||
|
||||
public static ItemStack getStack(IC2Duplicates ic2Duplicates, int count) {
|
||||
ItemStack stack = ic2Duplicates.getStackBasedOnConfig();
|
||||
stack.setCount(count);
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static Ingredient getCell(String name, int count){
|
||||
return new IngredientCell(ItemCells.getCellByName(name, count));
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.item.ItemStack;
|
|||
import reborncore.common.util.RebornCraftingHelper;
|
||||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.blocks.BlockOre2;
|
||||
import techreborn.init.IC2Duplicates;
|
||||
import techreborn.items.ItemIngots;
|
||||
|
||||
/**
|
||||
* Created by Prospector
|
||||
|
@ -38,15 +38,14 @@ public class SmeltingRecipes extends RecipeMethods {
|
|||
public static void init() {
|
||||
|
||||
register(getMaterial("sap", Type.PART), getMaterial("rubber", Type.PART));
|
||||
if (!IC2Duplicates.deduplicate()) {
|
||||
register(getStack(Items.IRON_INGOT), getMaterial("refined_iron", Type.INGOT));
|
||||
}
|
||||
register(getStack(Items.IRON_INGOT), getMaterial("refined_iron", Type.INGOT));
|
||||
|
||||
register(BlockOre2.getOreByName("copper"), getMaterial("copper", Type.INGOT));
|
||||
register(BlockOre2.getOreByName("tin"), getMaterial("tin", Type.INGOT));
|
||||
register(BlockOre.getOreByName("silver"), getMaterial("silver", Type.INGOT));
|
||||
register(BlockOre.getOreByName("lead"), getMaterial("lead", Type.INGOT));
|
||||
register(BlockOre.getOreByName("sheldonite"), getMaterial("platinum", Type.INGOT));
|
||||
register(IC2Duplicates.MIXED_METAL.getStackBasedOnConfig(), getMaterial("advanced_alloy", Type.INGOT));
|
||||
register(ItemIngots.getIngotByName("mixed_metal"), getMaterial("advanced_alloy", Type.INGOT));
|
||||
|
||||
// Dust smelting
|
||||
register(getMaterial("iron", Type.DUST), getStack(Items.IRON_INGOT));
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
|
||||
package techreborn.items.tools;
|
||||
|
||||
import ic2.core.item.tool.ItemTreetap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -45,10 +42,8 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
import reborncore.api.power.IEnergyItemInfo;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.powerSystem.PoweredItemContainerProvider;
|
||||
import reborncore.common.powerSystem.forge.ForgePowerItemManager;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.utils.TechRebornCreativeTab;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.ItemTR;
|
||||
|
||||
|
@ -69,20 +64,6 @@ public class ItemElectricTreetap extends ItemTR implements IEnergyItemInfo {
|
|||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
// Item
|
||||
@Override
|
||||
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
IEnergyStorage capEnergy = playerIn.getHeldItem(hand).getCapability(CapabilityEnergy.ENERGY, null);
|
||||
if (CompatManager.isIC2Loaded && block == Block.getBlockFromName("ic2:rubber_wood") && capEnergy.getEnergyStored() >= cost)
|
||||
if (ItemTreetap.attemptExtract(playerIn, worldIn, pos, side, state, null) && !worldIn.isRemote) {
|
||||
capEnergy.extractEnergy(cost, false);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
return 1 - ItemUtils.getPowerForDurabilityBar(stack);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue