It compiles, disable JEI as it needs redoing
This commit is contained in:
parent
a0e6a2dc34
commit
65e651f402
97 changed files with 246 additions and 1111 deletions
|
@ -48,7 +48,7 @@ import techreborn.world.VeinWorldGenerator;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
@Mod(modid = ModInfo.MOD_ID, name = ModInfo.MOD_NAME, version = ModInfo.MOD_VERSION, dependencies = ModInfo.MOD_DEPENDENCIES, guiFactory = ModInfo.GUI_FACTORY_CLASS, acceptedMinecraftVersions = "[1.9.4]")
|
||||
@Mod(modid = ModInfo.MOD_ID, name = ModInfo.MOD_NAME, version = ModInfo.MOD_VERSION, dependencies = ModInfo.MOD_DEPENDENCIES, guiFactory = ModInfo.GUI_FACTORY_CLASS, acceptedMinecraftVersions = "[1.11]")
|
||||
public class Core {
|
||||
|
||||
public Core() {
|
||||
|
@ -99,7 +99,7 @@ public class Core {
|
|||
// Register ModItems
|
||||
ModItems.init();
|
||||
// Entitys
|
||||
EntityRegistry.registerModEntity(EntityNukePrimed.class, "nuke", 0, INSTANCE, 160, 5, true);
|
||||
// EntityRegistry.registerModEntity(EntityNukePrimed.class, "nuke", 0, INSTANCE, 160, 5, true);
|
||||
|
||||
proxy.preInit(event);
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ public class BlockFlare extends BlockContainer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) {
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) {
|
||||
return FLARE_BB;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -69,7 +70,7 @@ public class BlockMachineCasing extends BlockMultiblockBase implements ITextured
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List<ItemStack> list) {
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.common.BaseBlock;
|
||||
|
@ -41,7 +42,7 @@ public class BlockMachineFrame extends BaseBlock implements ITexturedBlock {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List<ItemStack> list) {
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class BlockNuke extends BaseBlock implements ITexturedBlock {
|
|||
if (!worldIn.isRemote) {
|
||||
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F),
|
||||
(double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), igniter);
|
||||
worldIn.spawnEntityInWorld(entitynukeprimed);
|
||||
worldIn.spawnEntity(entitynukeprimed);
|
||||
// worldIn.playSoundAtEntity(entitynukeprimed, "game.tnt.primed",
|
||||
// 1.0F, 1.0F);
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class BlockNuke extends BaseBlock implements ITexturedBlock {
|
|||
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F),
|
||||
(double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy());
|
||||
entitynukeprimed.fuse = worldIn.rand.nextInt(entitynukeprimed.fuse / 4) + entitynukeprimed.fuse / 8;
|
||||
worldIn.spawnEntityInWorld(entitynukeprimed);
|
||||
worldIn.spawnEntity(entitynukeprimed);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ public class BlockNuke extends BaseBlock implements ITexturedBlock {
|
|||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
|
||||
EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.init.Items;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
@ -151,7 +152,7 @@ public class BlockOre extends BaseBlock implements ITexturedBlock, IOreNameProvi
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
|
||||
for (int meta = 0; meta < ores.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -75,7 +76,7 @@ public class BlockOre2 extends BaseBlock implements ITexturedBlock, IOreNameProv
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
|
||||
for (int meta = 0; meta < ores.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
@ -53,7 +54,7 @@ public class BlockPlayerDetector extends BlockMachineBase implements ITexturedBl
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
|
@ -104,7 +105,7 @@ public class BlockPlayerDetector extends BlockMachineBase implements ITexturedBl
|
|||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityPlayer,
|
||||
EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
String type = state.getValue(TYPE);
|
||||
String newType = type;
|
||||
TextFormatting color = TextFormatting.GREEN;
|
||||
|
|
|
@ -33,7 +33,7 @@ public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRota
|
|||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
|
||||
EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if (!playerIn.isSneaking())
|
||||
playerIn.openGui(Core.INSTANCE, GuiHandler.quantumChestID, worldIn, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
|
|
|
@ -64,13 +64,14 @@ public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IO
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack createStackedBlock(IBlockState state) {
|
||||
IBlockState newState = state.withProperty(CHECK_DECAY, false).withProperty(DECAYABLE,
|
||||
false);
|
||||
|
||||
return super.createStackedBlock(newState);
|
||||
}
|
||||
//TODO 1.11: what is this?
|
||||
// @Override
|
||||
// protected ItemStack createStackedBlock(IBlockState state) {
|
||||
// IBlockState newState = state.withProperty(CHECK_DECAY, false).withProperty(DECAYABLE,
|
||||
// false);
|
||||
//
|
||||
// return super.createStackedBlock(newState);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing) {
|
||||
|
|
|
@ -147,8 +147,8 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
|
|||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
|
||||
EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ);
|
||||
EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ);
|
||||
ItemStack stack = playerIn.getHeldItem(EnumHand.MAIN_HAND);
|
||||
if (stack != null)
|
||||
if ((stack.getItem() instanceof ItemElectricTreetap && PoweredItem.canUseEnergy(20, stack)) || stack.getItem() instanceof ItemTreeTap)
|
||||
|
@ -174,7 +174,7 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
|
|||
item.motionX = rand.nextGaussian() * factor;
|
||||
item.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||
item.motionZ = rand.nextGaussian() * factor;
|
||||
worldIn.spawnEntityInWorld(item);
|
||||
worldIn.spawnEntity(item);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
|
@ -39,7 +40,7 @@ public class BlockRubberSapling extends BlockSapling {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) {
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
list.add(new ItemStack(itemIn, 1, 0));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.common.BaseBlock;
|
||||
|
@ -52,7 +53,7 @@ public class BlockStorage extends BaseBlock implements ITexturedBlock {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.common.BaseBlock;
|
||||
|
@ -50,7 +51,7 @@ public class BlockStorage2 extends BaseBlock implements ITexturedBlock {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public class BlockSolarPanel extends BaseTileBlock implements ITexturedBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY,
|
||||
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY,
|
||||
float hitZ, int meta, EntityLivingBase placer) {
|
||||
if (!worldIn.isRemote) {
|
||||
if (worldIn.canBlockSeeSky(pos.up()) && !worldIn.isRaining() && !worldIn.isThundering() && worldIn.isDaytime()) {
|
||||
|
|
|
@ -32,7 +32,7 @@ public class BlockVacuumFreezer extends BlockMachineBase implements IAdvancedRot
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, GuiHandler.vacuumFreezerID, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
|
|
|
@ -43,7 +43,7 @@ public abstract class BlockEnergyStorage extends BaseTileBlock implements IRotat
|
|||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand,
|
||||
ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, guiID, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
|
|
|
@ -25,7 +25,7 @@ public class BlockIDSU extends BlockEnergyStorage {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY,
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY,
|
||||
float hitZ, int meta, EntityLivingBase placer) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileIDSU) {
|
||||
|
|
|
@ -119,7 +119,7 @@ public abstract class BlockTransformer extends BaseTileBlock implements IRotatio
|
|||
if (itemStack == null) {
|
||||
continue;
|
||||
}
|
||||
if (itemStack != null && itemStack.stackSize > 0) {
|
||||
if (itemStack != null && itemStack.getCount() > 0) {
|
||||
if (itemStack.getItem() instanceof ItemBlock) {
|
||||
if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid
|
||||
|
|
|
@ -8,7 +8,6 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
|||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import techreborn.parts.fluidPipes.EnumFluidPipeTypes;
|
||||
import techreborn.parts.powerCables.EnumCableType;
|
||||
|
||||
/**
|
||||
|
@ -24,11 +23,6 @@ public class ClientPartModelBakery {
|
|||
new ModelResourceLocation("techreborn:cable", "type=" + type.getName().toLowerCase()),
|
||||
new RenderCablePart(type));
|
||||
}
|
||||
for (EnumFluidPipeTypes type : EnumFluidPipeTypes.values()) {
|
||||
event.getModelRegistry().putObject(
|
||||
new ModelResourceLocation("techreborn:fluidpipe#type=" + type.getName().toLowerCase()),
|
||||
new RenderFluidPipePart(type));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -37,9 +31,6 @@ public class ClientPartModelBakery {
|
|||
for (EnumCableType type : EnumCableType.values()) {
|
||||
event.getMap().registerSprite(new ResourceLocation(type.textureName));
|
||||
}
|
||||
for (EnumFluidPipeTypes type : EnumFluidPipeTypes.values()) {
|
||||
event.getMap().registerSprite(new ResourceLocation(type.textureName));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,145 +0,0 @@
|
|||
package techreborn.client.render.parts;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.*;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import org.lwjgl.util.vector.Vector3f;
|
||||
import reborncore.client.models.BakedModelUtils;
|
||||
import reborncore.common.misc.vecmath.Vecs3dCube;
|
||||
import techreborn.parts.fluidPipes.EnumFluidPipeTypes;
|
||||
import techreborn.parts.fluidPipes.MultipartFluidPipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 09/05/2016.
|
||||
*/
|
||||
public class RenderFluidPipePart implements IBakedModel {
|
||||
|
||||
private FaceBakery faceBakery = new FaceBakery();
|
||||
private TextureAtlasSprite texture;
|
||||
EnumFluidPipeTypes type;
|
||||
|
||||
public RenderFluidPipePart(EnumFluidPipeTypes type) {
|
||||
texture = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(type.textureName);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static void addCubeToList(Vecs3dCube cube, ArrayList<BakedQuad> list, BlockPartFace face,
|
||||
ModelRotation modelRotation, TextureAtlasSprite cubeTexture, EnumFacing dir, FaceBakery faceBakery) {
|
||||
BlockFaceUV uv = new BlockFaceUV(new float[] { (float) cube.getMinX(), (float) cube.getMinY(),
|
||||
(float) cube.getMaxX(), (float) cube.getMaxY() }, 0);
|
||||
face = new BlockPartFace(null, 0, "", uv);
|
||||
list.add(faceBakery.makeBakedQuad(
|
||||
new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()),
|
||||
new Vector3f((float) cube.getMaxX(), (float) cube.getMinY(), (float) cube.getMaxZ()), face, cubeTexture,
|
||||
EnumFacing.DOWN, modelRotation, null, true, true));// down
|
||||
list.add(faceBakery.makeBakedQuad(
|
||||
new Vector3f((float) cube.getMinX(), (float) cube.getMaxY(), (float) cube.getMinZ()),
|
||||
new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture,
|
||||
EnumFacing.UP, modelRotation, null, true, true));// up
|
||||
list.add(faceBakery.makeBakedQuad(
|
||||
new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()),
|
||||
new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture,
|
||||
EnumFacing.NORTH, modelRotation, null, true, true));// north
|
||||
list.add(faceBakery.makeBakedQuad(
|
||||
new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMaxZ()),
|
||||
new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture,
|
||||
EnumFacing.SOUTH, modelRotation, null, true, true));// south
|
||||
list.add(faceBakery.makeBakedQuad(
|
||||
new Vector3f((float) cube.getMaxX(), (float) cube.getMinY(), (float) cube.getMinZ()),
|
||||
new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture,
|
||||
EnumFacing.EAST, modelRotation, null, true, true));// east
|
||||
list.add(faceBakery.makeBakedQuad(
|
||||
new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()),
|
||||
new Vector3f((float) cube.getMinX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture,
|
||||
EnumFacing.WEST, modelRotation, null, true, true));// west
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(IBlockState blockState, EnumFacing side, long rand) {
|
||||
ArrayList<BakedQuad> list = new ArrayList<>();
|
||||
BlockFaceUV uv = new BlockFaceUV(new float[] { 0.0F, 0.0F, 16.0F, 16.0F }, 0);
|
||||
BlockPartFace face = new BlockPartFace(null, 0, "", uv);
|
||||
double thickness = MultipartFluidPipe.thickness;
|
||||
double lastThickness = 16 - thickness;
|
||||
IExtendedBlockState state = (IExtendedBlockState) blockState;
|
||||
if (side != null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
boolean renderedConnection = false;
|
||||
if (state != null) {
|
||||
if (state.getValue(MultipartFluidPipe.UP)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, lastThickness, thickness, lastThickness, 16.0, lastThickness),
|
||||
list, face, ModelRotation.X0_Y0, texture, EnumFacing.UP, faceBakery);
|
||||
renderedConnection = true;
|
||||
}
|
||||
if (state.getValue(MultipartFluidPipe.DOWN)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, 0.0, thickness, lastThickness, thickness, lastThickness), list,
|
||||
face, ModelRotation.X0_Y0, texture, EnumFacing.DOWN, faceBakery);
|
||||
renderedConnection = true;
|
||||
}
|
||||
if (state.getValue(MultipartFluidPipe.NORTH)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, thickness, 0.0, lastThickness, lastThickness, lastThickness), list,
|
||||
face, ModelRotation.X0_Y0, texture, EnumFacing.NORTH, faceBakery);
|
||||
renderedConnection = true;
|
||||
}
|
||||
if (state.getValue(MultipartFluidPipe.SOUTH)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, thickness, thickness, lastThickness, lastThickness, 16.0),
|
||||
list, face, ModelRotation.X0_Y0, texture, EnumFacing.SOUTH, faceBakery);
|
||||
renderedConnection = false;
|
||||
}
|
||||
if (state.getValue(MultipartFluidPipe.EAST)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, thickness, thickness, 16, lastThickness, lastThickness),
|
||||
list, face, ModelRotation.X0_Y0, texture, EnumFacing.EAST, faceBakery);
|
||||
renderedConnection = false;
|
||||
}
|
||||
if (state.getValue(MultipartFluidPipe.WEST)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(0.0, thickness, thickness, thickness, lastThickness, lastThickness), list,
|
||||
face, ModelRotation.X0_Y0, texture, EnumFacing.WEST, faceBakery);
|
||||
renderedConnection = true;
|
||||
}
|
||||
if (!renderedConnection) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, thickness, thickness, lastThickness, lastThickness, lastThickness),
|
||||
list, face, ModelRotation.X0_Y0, texture, null, faceBakery);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAmbientOcclusion() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGui3d() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBuiltInRenderer() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture() {
|
||||
return texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemCameraTransforms getItemCameraTransforms() {
|
||||
return ItemCameraTransforms.DEFAULT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemOverrideList getOverrides() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.*;
|
||||
|
||||
public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecipeWrapper {
|
||||
protected final T baseRecipe;
|
||||
@Nonnull
|
||||
private final List<List<ItemStack>> inputs;
|
||||
|
||||
public BaseRecipeWrapper(T baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
|
||||
inputs = new ArrayList<>();
|
||||
for (ItemStack input : baseRecipe.getInputs()) {
|
||||
if (baseRecipe.useOreDic()) {
|
||||
List<ItemStack> oreDictInputs = expandOreDict(input);
|
||||
inputs.add(oreDictInputs);
|
||||
} else {
|
||||
inputs.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.stackSize != itemStack.stackSize) {
|
||||
ItemStack oreCopy = ore.copy();
|
||||
oreCopy.stackSize = itemStack.stackSize;
|
||||
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
|
||||
@Override
|
||||
public List<List<ItemStack>> getInputs() {
|
||||
return inputs;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return baseRecipe.getOutputs();
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
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";
|
||||
|
||||
private RecipeCategoryUids() {
|
||||
}
|
||||
}
|
|
@ -1,160 +0,0 @@
|
|||
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.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.*;
|
||||
import java.text.NumberFormat;
|
||||
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 fontRendererObj = minecraft.fontRendererObj;
|
||||
int lineSpacing = fontRendererObj.FONT_HEIGHT + 1;
|
||||
|
||||
NumberFormat formatter = NumberFormat.getInstance();
|
||||
String startCostEU = formatter.format(startCost);
|
||||
String startCostString = I18n.translateToLocalFormatted("techreborn.jei.recipe.start.cost", startCostEU);
|
||||
fontRendererObj.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 fontRendererObj = minecraft.fontRendererObj;
|
||||
int lineSpacing = fontRendererObj.FONT_HEIGHT + 1;
|
||||
|
||||
String runningCostString = I18n.translateToLocalFormatted("techreborn.jei.recipe.running.cost", euPerTick);
|
||||
fontRendererObj.drawString(runningCostString, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
String processingTimeString1 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.1",
|
||||
tickTime);
|
||||
fontRendererObj.drawString(processingTimeString1, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
int seconds = tickTime / 20;
|
||||
String processingTimeString2 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.2",
|
||||
seconds);
|
||||
fontRendererObj.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));
|
||||
}
|
||||
}
|
||||
|
||||
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<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<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,260 +0,0 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
import mezz.jei.api.BlankModPlugin;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferRegistry;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import techreborn.Core;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.client.container.*;
|
||||
import techreborn.client.gui.*;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.compat.jei.alloySmelter.AlloySmelterRecipeCategory;
|
||||
import techreborn.compat.jei.alloySmelter.AlloySmelterRecipeHandler;
|
||||
import techreborn.compat.jei.assemblingMachine.AssemblingMachineRecipeCategory;
|
||||
import techreborn.compat.jei.assemblingMachine.AssemblingMachineRecipeHandler;
|
||||
import techreborn.compat.jei.blastFurnace.BlastFurnaceRecipeCategory;
|
||||
import techreborn.compat.jei.blastFurnace.BlastFurnaceRecipeHandler;
|
||||
import techreborn.compat.jei.centrifuge.CentrifugeRecipeCategory;
|
||||
import techreborn.compat.jei.centrifuge.CentrifugeRecipeHandler;
|
||||
import techreborn.compat.jei.chemicalReactor.ChemicalReactorRecipeCategory;
|
||||
import techreborn.compat.jei.chemicalReactor.ChemicalReactorRecipeHandler;
|
||||
import techreborn.compat.jei.compressor.CompressorRecipeCategory;
|
||||
import techreborn.compat.jei.compressor.CompressorRecipeHandler;
|
||||
import techreborn.compat.jei.extractor.ExtractorRecipeCategory;
|
||||
import techreborn.compat.jei.extractor.ExtractorRecipeHandler;
|
||||
import techreborn.compat.jei.fusionReactor.FusionReactorRecipeCategory;
|
||||
import techreborn.compat.jei.fusionReactor.FusionReactorRecipeHandler;
|
||||
import techreborn.compat.jei.grinder.GrinderRecipeCategory;
|
||||
import techreborn.compat.jei.grinder.GrinderRecipeHandler;
|
||||
import techreborn.compat.jei.implosionCompressor.ImplosionCompressorRecipeCategory;
|
||||
import techreborn.compat.jei.implosionCompressor.ImplosionCompressorRecipeHandler;
|
||||
import techreborn.compat.jei.industrialElectrolyzer.IndustrialElectrolyzerRecipeCategory;
|
||||
import techreborn.compat.jei.industrialElectrolyzer.IndustrialElectrolyzerRecipeHandler;
|
||||
import techreborn.compat.jei.industrialGrinder.IndustrialGrinderRecipeCategory;
|
||||
import techreborn.compat.jei.industrialGrinder.IndustrialGrinderRecipeHandler;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeCategory;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeHandler;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeMaker;
|
||||
import techreborn.compat.jei.scrapbox.ScrapboxRecipeCategory;
|
||||
import techreborn.compat.jei.scrapbox.ScrapboxRecipeHandler;
|
||||
import techreborn.compat.jei.vacuumFreezer.VacuumFreezerRecipeCategory;
|
||||
import techreborn.compat.jei.vacuumFreezer.VacuumFreezerRecipeHandler;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModFluids;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.ItemParts;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@mezz.jei.api.JEIPlugin
|
||||
public class TechRebornJeiPlugin extends BlankModPlugin {
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(
|
||||
@Nonnull
|
||||
IModRegistry registry) {
|
||||
IJeiHelpers jeiHelpers = registry.getJeiHelpers();
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidBerylium));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidCalcium));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidCalciumCarbonate));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidChlorite));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidDeuterium));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidGlyceryl));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidHelium));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidHelium3));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidHeliumplasma));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidHydrogen));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidLithium));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidMercury));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidMethane));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitrocoalfuel));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitrofuel));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitrogen));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitrogendioxide));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidPotassium));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSilicon));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSodium));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSodiumpersulfate));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidTritium));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidWolframium));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSulfur));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSulfuricAcid));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidCarbon));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidCarbonFiber));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitroCarbon));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSodiumSulfide));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidDiesel));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitroDiesel));
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidOil));
|
||||
|
||||
registry.addRecipeCategories(new AlloySmelterRecipeCategory(guiHelper),
|
||||
new AssemblingMachineRecipeCategory(guiHelper), new BlastFurnaceRecipeCategory(guiHelper),
|
||||
new CentrifugeRecipeCategory(guiHelper), new ChemicalReactorRecipeCategory(guiHelper),
|
||||
new FusionReactorRecipeCategory(guiHelper), new IndustrialGrinderRecipeCategory(guiHelper),
|
||||
new ImplosionCompressorRecipeCategory(guiHelper), new IndustrialElectrolyzerRecipeCategory(guiHelper),
|
||||
new RollingMachineRecipeCategory(guiHelper),
|
||||
new VacuumFreezerRecipeCategory(guiHelper), new GrinderRecipeCategory(guiHelper),
|
||||
new ExtractorRecipeCategory(guiHelper), new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper));
|
||||
|
||||
registry.addRecipeHandlers(new AlloySmelterRecipeHandler(jeiHelpers),
|
||||
new AssemblingMachineRecipeHandler(jeiHelpers), new BlastFurnaceRecipeHandler(jeiHelpers),
|
||||
new CentrifugeRecipeHandler(jeiHelpers), new ChemicalReactorRecipeHandler(jeiHelpers),
|
||||
new FusionReactorRecipeHandler(), new IndustrialGrinderRecipeHandler(jeiHelpers),
|
||||
new ImplosionCompressorRecipeHandler(jeiHelpers), new IndustrialElectrolyzerRecipeHandler(jeiHelpers),
|
||||
new RollingMachineRecipeHandler(),
|
||||
new VacuumFreezerRecipeHandler(jeiHelpers), new GrinderRecipeHandler(jeiHelpers),
|
||||
new ExtractorRecipeHandler(jeiHelpers), new CompressorRecipeHandler(jeiHelpers),
|
||||
new ScrapboxRecipeHandler(jeiHelpers));
|
||||
|
||||
registry.addRecipes(RecipeHandler.recipeList);
|
||||
registry.addRecipes(FusionReactorRecipeHelper.reactorRecipes);
|
||||
|
||||
try {
|
||||
registry.addRecipes(RollingMachineRecipeMaker.getRecipes(jeiHelpers));
|
||||
} catch (RuntimeException e) {
|
||||
Core.logHelper
|
||||
.error("Could not register rolling machine recipes. JEI may have changed its internal recipe wrapper locations.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (mezz.jei.config.Config.isDebugModeEnabled()) {
|
||||
addDebugRecipes(registry);
|
||||
}
|
||||
|
||||
registry.addDescription(ItemParts.getPartByName("rubberSap"),
|
||||
I18n.translateToLocal("techreborn.desc.rubberSap"));
|
||||
if (!ConfigTechReborn.ScrapboxDispenser) {
|
||||
registry.addDescription(new ItemStack(ModItems.scrapBox),
|
||||
I18n.translateToLocal("techreborn.desc.scrapBoxNoDispenser"));
|
||||
} else {
|
||||
registry.addDescription(new ItemStack(ModItems.scrapBox),
|
||||
I18n.translateToLocal("techreborn.desc.scrapBox"));
|
||||
}
|
||||
|
||||
registry.addRecipeClickArea(GuiAlloyFurnace.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER,
|
||||
VanillaRecipeCategoryUid.FUEL);
|
||||
registry.addRecipeClickArea(GuiAlloySmelter.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER);
|
||||
registry.addRecipeClickArea(GuiAssemblingMachine.class, 85, 34, 24, 20, RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
registry.addRecipeClickArea(GuiBlastFurnace.class, 63, 36, 24, 15, RecipeCategoryUids.BLAST_FURNACE);
|
||||
registry.addRecipeClickArea(GuiCentrifuge.class, 98, 37, 9, 12, RecipeCategoryUids.CENTRIFUGE);
|
||||
registry.addRecipeClickArea(GuiCentrifuge.class, 68, 37, 9, 12, RecipeCategoryUids.CENTRIFUGE);
|
||||
registry.addRecipeClickArea(GuiCentrifuge.class, 83, 23, 12, 9, RecipeCategoryUids.CENTRIFUGE);
|
||||
registry.addRecipeClickArea(GuiCentrifuge.class, 83, 53, 12, 9, RecipeCategoryUids.CENTRIFUGE);
|
||||
registry.addRecipeClickArea(GuiChemicalReactor.class, 73, 39, 32, 12, RecipeCategoryUids.CHEMICAL_REACTOR);
|
||||
registry.addRecipeClickArea(GuiFusionReactor.class, 111, 34, 27, 19, RecipeCategoryUids.FUSION_REACTOR);
|
||||
registry.addRecipeClickArea(GuiIndustrialGrinder.class, 50, 35, 25, 16, RecipeCategoryUids.INDUSTRIAL_GRINDER);
|
||||
registry.addRecipeClickArea(GuiImplosionCompressor.class, 60, 37, 24, 15,
|
||||
RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
registry.addRecipeClickArea(GuiIndustrialElectrolyzer.class, 72, 37, 33, 14,
|
||||
RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
registry.addRecipeClickArea(GuiRollingMachine.class, 89, 32, 26, 25, RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.addRecipeClickArea(GuiVacuumFreezer.class, 78, 36, 24, 16, RecipeCategoryUids.VACUUM_FREEZER);
|
||||
registry.addRecipeClickArea(GuiGrinder.class, 78, 36, 24, 16, RecipeCategoryUids.GRINDER);
|
||||
registry.addRecipeClickArea(GuiExtractor.class, 78, 36, 24, 16, RecipeCategoryUids.EXTRACTOR);
|
||||
registry.addRecipeClickArea(GuiCompressor.class, 78, 36, 24, 16, RecipeCategoryUids.COMPRESSOR);
|
||||
registry.addRecipeClickArea(GuiIronFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING,
|
||||
VanillaRecipeCategoryUid.FUEL);
|
||||
registry.addRecipeClickArea(GuiElectricFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING);
|
||||
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.Compressor), RecipeCategoryUids.COMPRESSOR);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.AlloyFurnace), RecipeCategoryUids.ALLOY_SMELTER);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.AlloySmelter), RecipeCategoryUids.ALLOY_SMELTER);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.AssemblyMachine),
|
||||
RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.BlastFurnace), RecipeCategoryUids.BLAST_FURNACE);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.centrifuge), RecipeCategoryUids.CENTRIFUGE);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ChemicalReactor),
|
||||
RecipeCategoryUids.CHEMICAL_REACTOR);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.Extractor), RecipeCategoryUids.EXTRACTOR);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.FusionControlComputer),
|
||||
RecipeCategoryUids.FUSION_REACTOR);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.Grinder), RecipeCategoryUids.GRINDER);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ImplosionCompressor),
|
||||
RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.IndustrialElectrolyzer),
|
||||
RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.IndustrialGrinder),
|
||||
RecipeCategoryUids.INDUSTRIAL_GRINDER);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.RollingMachine),
|
||||
RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModItems.scrapBox), RecipeCategoryUids.SCRAPBOX);
|
||||
|
||||
IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerAlloyFurnace.class, RecipeCategoryUids.ALLOY_SMELTER, 0, 2, 4, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerAlloySmelter.class, RecipeCategoryUids.ALLOY_SMELTER, 0, 2, 8, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerAlloyFurnace.class, VanillaRecipeCategoryUid.FUEL, 3, 1, 4, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerAssemblingMachine.class, RecipeCategoryUids.ASSEMBLING_MACHINE, 0, 2,
|
||||
8, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerBlastFurnace.class, RecipeCategoryUids.BLAST_FURNACE, 0, 2, 4, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerCentrifuge.class, RecipeCategoryUids.CENTRIFUGE, 0, 2, 11, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerChemicalReactor.class, RecipeCategoryUids.CHEMICAL_REACTOR, 0, 2, 8,
|
||||
36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerFusionReactor.class, RecipeCategoryUids.FUSION_REACTOR, 0, 2, 3, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerIndustrialGrinder.class, RecipeCategoryUids.GRINDER, 0, 2, 6, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerImplosionCompressor.class, RecipeCategoryUids.IMPLOSION_COMPRESSOR,
|
||||
0, 2, 4, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerIndustrialElectrolyzer.class,
|
||||
RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER, 0, 2, 7, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerRollingMachine.class, RecipeCategoryUids.ROLLING_MACHINE, 0, 9, 11,
|
||||
36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerVacuumFreezer.class, RecipeCategoryUids.VACUUM_FREEZER, 0, 1, 2, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerGrinder.class, RecipeCategoryUids.GRINDER, 0, 1, 2, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerExtractor.class, RecipeCategoryUids.EXTRACTOR, 0, 1, 2, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerCompressor.class, RecipeCategoryUids.COMPRESSOR, 0, 1, 2, 36);
|
||||
|
||||
registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.pump));
|
||||
|
||||
if (CompatManager.isQuantumStorageLoaded) {
|
||||
registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.quantumChest));
|
||||
registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.quantumTank));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
package techreborn.compat.jei.alloySmelter;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.*;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlloySmelterRecipeCategory extends BlankRecipeCategory<AlloySmelterRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final IDrawableAnimated electricity;
|
||||
private final String title;
|
||||
|
||||
public AlloySmelterRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiAlloySmelter.texture, 46, 16, 91, 54);
|
||||
IDrawableStatic electricityDrawable = guiHelper.createDrawable(GuiAlloySmelter.texture, 176, 0, 14, 14);
|
||||
electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP,
|
||||
true);
|
||||
title = I18n.translateToLocal("techreborn.jei.category.alloy.furnace");
|
||||
}
|
||||
|
||||
@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 drawExtras(
|
||||
@Nonnull
|
||||
Minecraft minecraft) {
|
||||
electricity.draw(minecraft, 10, 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
AlloySmelterRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 18);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
AlloySmelterRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 18);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package techreborn.compat.jei.alloySmelter;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlloySmelterRecipeHandler implements IRecipeHandler<AlloySmelterRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public AlloySmelterRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AlloySmelterRecipe> getRecipeClass() {
|
||||
return AlloySmelterRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.ALLOY_SMELTER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
AlloySmelterRecipe recipe) {
|
||||
return RecipeCategoryUids.ALLOY_SMELTER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
AlloySmelterRecipe recipe) {
|
||||
return new AlloySmelterRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
AlloySmelterRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
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 techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlloySmelterRecipeWrapper extends BaseRecipeWrapper<AlloySmelterRecipe> {
|
||||
private final IDrawableAnimated arrow;
|
||||
|
||||
public AlloySmelterRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
AlloySmelterRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic arrowStatic = guiHelper.createDrawable(GuiAlloySmelter.texture, 176, 14, 24, 17);
|
||||
this.arrow = guiHelper.createAnimatedDrawable(arrowStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
arrow.draw(minecraft, 33, 19);
|
||||
|
||||
int x = recipeWidth / 2;
|
||||
int y = recipeHeight - recipeHeight / 4;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + (baseRecipe.tickTime / 20) + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiAssemblingMachine;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AssemblingMachineRecipeCategory extends BlankRecipeCategory<AssemblingMachineRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final IDrawableAnimated electricity;
|
||||
private final String title;
|
||||
|
||||
public AssemblingMachineRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiAssemblingMachine.texture, 46, 16, 91, 54);
|
||||
IDrawableStatic electricityDrawable = guiHelper.createDrawable(GuiAssemblingMachine.texture, 176, 0, 14, 14);
|
||||
electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP,
|
||||
true);
|
||||
title = I18n.translateToLocal("tile.techreborn.assemblingmachine.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 drawExtras(
|
||||
@Nonnull
|
||||
Minecraft minecraft) {
|
||||
electricity.draw(minecraft, 10, 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
AssemblingMachineRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 18);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
AssemblingMachineRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 18);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package techreborn.compat.jei.assemblingMachine;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AssemblingMachineRecipeHandler implements IRecipeHandler<AssemblingMachineRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public AssemblingMachineRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AssemblingMachineRecipe> getRecipeClass() {
|
||||
return AssemblingMachineRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.ASSEMBLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
AssemblingMachineRecipe recipe) {
|
||||
return RecipeCategoryUids.ASSEMBLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
AssemblingMachineRecipe recipe) {
|
||||
return new AssemblingMachineRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
AssemblingMachineRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
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.GuiAssemblingMachine;
|
||||
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(GuiAssemblingMachine.texture, 176, 14, 20, 18);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 40, 18);
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlastFurnaceRecipeCategory extends BlankRecipeCategory<BlastFurnaceRecipeWrapper> {
|
||||
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(GuiBlastFurnace.texture, 39, 24, 90, 60);
|
||||
title = I18n.translateToLocal("tile.techreborn.blastfurnace.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) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 18);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 10);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 78, 10);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
BlastFurnaceRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 18);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 10);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 78, 10);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package techreborn.compat.jei.blastFurnace;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlastFurnaceRecipeHandler implements IRecipeHandler<BlastFurnaceRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public BlastFurnaceRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<BlastFurnaceRecipe> getRecipeClass() {
|
||||
return BlastFurnaceRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.BLAST_FURNACE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
BlastFurnaceRecipe recipe) {
|
||||
return RecipeCategoryUids.BLAST_FURNACE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
BlastFurnaceRecipe recipe) {
|
||||
return new BlastFurnaceRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
BlastFurnaceRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package techreborn.compat.jei.blastFurnace;
|
||||
|
||||
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.BlastFurnaceRecipe;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlastFurnaceRecipeWrapper extends BaseRecipeWrapper<BlastFurnaceRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public BlastFurnaceRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
BlastFurnaceRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiBlastFurnace.texture, 176, 14, 20, 11);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 54 - 29, 13);
|
||||
|
||||
int x = recipeWidth / 3;
|
||||
int y = (int) (recipeHeight - recipeHeight / 2.2F);
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Heat capacity: " + baseRecipe.neededHeat, x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiCentrifuge;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CentrifugeRecipeCategory extends BlankRecipeCategory<CentrifugeRecipeWrapper> {
|
||||
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(GuiCentrifuge.texture, 49, 4, 78, 78);
|
||||
title = I18n.translateToLocal("tile.techreborn.centrifuge.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) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 30, 30);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 0);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 30, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 60, 30);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 30, 60);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 0, 30);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
CentrifugeRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 30, 30);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 0);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 30, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 60, 30);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 30, 60);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 0, 30);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package techreborn.compat.jei.centrifuge;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CentrifugeRecipeHandler implements IRecipeHandler<CentrifugeRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public CentrifugeRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<CentrifugeRecipe> getRecipeClass() {
|
||||
return CentrifugeRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.CENTRIFUGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
CentrifugeRecipe recipe) {
|
||||
return RecipeCategoryUids.CENTRIFUGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
CentrifugeRecipe recipe) {
|
||||
return new CentrifugeRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
CentrifugeRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
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 techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
import techreborn.client.gui.GuiCentrifuge;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CentrifugeRecipeWrapper extends BaseRecipeWrapper<CentrifugeRecipe> {
|
||||
private final IDrawableAnimated progressUp;
|
||||
private final IDrawableAnimated progressLeft;
|
||||
private final IDrawableAnimated progressDown;
|
||||
private final IDrawableAnimated progressRight;
|
||||
|
||||
public CentrifugeRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
CentrifugeRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressUpStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 14, 12, 12);
|
||||
IDrawableStatic progressLeftStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 26, 12, 12);
|
||||
IDrawableStatic progressDownStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 38, 12, 12);
|
||||
IDrawableStatic progressRightStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 50, 12, 12);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation
|
||||
// a bit
|
||||
this.progressUp = guiHelper.createAnimatedDrawable(progressUpStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.BOTTOM, false);
|
||||
this.progressLeft = guiHelper.createAnimatedDrawable(progressLeftStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.RIGHT, false);
|
||||
this.progressDown = guiHelper.createAnimatedDrawable(progressDownStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.TOP, false);
|
||||
this.progressRight = guiHelper.createAnimatedDrawable(progressRightStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progressUp.draw(minecraft, 33, 18);
|
||||
progressLeft.draw(minecraft, 18, 33);
|
||||
progressDown.draw(minecraft, 33, 48);
|
||||
progressRight.draw(minecraft, 48, 33);
|
||||
|
||||
int x = -45;
|
||||
int y = 60;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiChemicalReactor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ChemicalReactorRecipeCategory extends BlankRecipeCategory<ChemicalReactorRecipeWrapper> {
|
||||
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(GuiChemicalReactor.texture, 69, 20, 38, 48);
|
||||
title = I18n.translateToLocal("tile.techreborn.chemicalreactor.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) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 20, 0);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 10, 30);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ChemicalReactorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 20, 0);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 10, 30);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package techreborn.compat.jei.chemicalReactor;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ChemicalReactorRecipeHandler implements IRecipeHandler<ChemicalReactorRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public ChemicalReactorRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ChemicalReactorRecipe> getRecipeClass() {
|
||||
return ChemicalReactorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.CHEMICAL_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
ChemicalReactorRecipe recipe) {
|
||||
return RecipeCategoryUids.CHEMICAL_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
ChemicalReactorRecipe recipe) {
|
||||
return new ChemicalReactorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
ChemicalReactorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
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 techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
import techreborn.client.gui.GuiChemicalReactor;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper<ChemicalReactorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ChemicalReactorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ChemicalReactorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiChemicalReactor.texture, 176, 14, 32, 12);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.TOP, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 3, 18);
|
||||
|
||||
int x = (int) (-recipeWidth * 1.6f);
|
||||
int y = (int) (recipeHeight - recipeHeight / 3F);
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiCompressor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompressorRecipeCategory extends BlankRecipeCategory<CompressorRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public CompressorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiCompressor.texture, 55, 30, 82, 26);
|
||||
title = I18n.translateToLocal("tile.techreborn.compressor.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) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
CompressorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package techreborn.compat.jei.compressor;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.CompressorRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompressorRecipeHandler implements IRecipeHandler<CompressorRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public CompressorRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<CompressorRecipe> getRecipeClass() {
|
||||
return CompressorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
CompressorRecipe recipe) {
|
||||
return RecipeCategoryUids.COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
CompressorRecipe recipe) {
|
||||
return new CompressorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
CompressorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
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.GuiCompressor;
|
||||
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(GuiCompressor.texture, 176, 14, 20, 11);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 25, 7);
|
||||
|
||||
int x = -45;
|
||||
int y = 4;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiExtractor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ExtractorRecipeCategory extends BlankRecipeCategory<ExtractorRecipeWrapper> {
|
||||
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(GuiExtractor.texture, 55, 30, 82, 26);
|
||||
title = I18n.translateToLocal("tile.techreborn.extractor.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) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ExtractorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package techreborn.compat.jei.extractor;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.ExtractorRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ExtractorRecipeHandler implements IRecipeHandler<ExtractorRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public ExtractorRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ExtractorRecipe> getRecipeClass() {
|
||||
return ExtractorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.EXTRACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
ExtractorRecipe recipe) {
|
||||
return RecipeCategoryUids.EXTRACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
ExtractorRecipe recipe) {
|
||||
return new ExtractorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
ExtractorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
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.GuiExtractor;
|
||||
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(GuiExtractor.texture, 176, 17, 22, 11);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 25, 7);
|
||||
|
||||
int x = -45;
|
||||
int y = 4;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiFusionReactor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class FusionReactorRecipeCategory extends BlankRecipeCategory<FusionReactorRecipeWrapper> {
|
||||
|
||||
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(GuiFusionReactor.texture, 86, 16, 85, 64, 0, 40, 20, 20);
|
||||
title = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.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) {
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
itemStacks.init(inputSlotTop, true, 21, 0);
|
||||
itemStacks.init(inputSlotBottom, true, 21, 36);
|
||||
itemStacks.init(outputSlot, false, 81, 18);
|
||||
|
||||
itemStacks.set(inputSlotTop, recipeWrapper.getTopInput());
|
||||
itemStacks.set(inputSlotBottom, recipeWrapper.getBottomInput());
|
||||
itemStacks.set(outputSlot, recipeWrapper.getOutputs());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
FusionReactorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
itemStacks.init(inputSlotTop, true, 21, 0);
|
||||
itemStacks.init(inputSlotBottom, true, 21, 36);
|
||||
itemStacks.init(outputSlot, false, 81, 18);
|
||||
|
||||
itemStacks.set(inputSlotTop, recipeWrapper.getTopInput());
|
||||
itemStacks.set(inputSlotBottom, recipeWrapper.getBottomInput());
|
||||
itemStacks.set(outputSlot, ingredients.getOutputs(ItemStack.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
package techreborn.compat.jei.fusionReactor;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class FusionReactorRecipeHandler implements IRecipeHandler<FusionReactorRecipe> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<FusionReactorRecipe> getRecipeClass() {
|
||||
return FusionReactorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.FUSION_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
FusionReactorRecipe recipe) {
|
||||
return RecipeCategoryUids.FUSION_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
FusionReactorRecipe recipe) {
|
||||
return new FusionReactorRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
FusionReactorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
package techreborn.compat.jei.fusionReactor;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
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;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class FusionReactorRecipeWrapper extends BlankRecipeWrapper {
|
||||
private final FusionReactorRecipe baseRecipe;
|
||||
|
||||
public FusionReactorRecipeWrapper(FusionReactorRecipe baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
ingredients.setOutputs(ItemStack.class, Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput()));
|
||||
ingredients.setInput(ItemStack.class, baseRecipe.getOutput());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getInputs() {
|
||||
return Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs() {
|
||||
return Collections.singletonList(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,75 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiGrinder;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class GrinderRecipeCategory extends BlankRecipeCategory<GrinderRecipeWrapper> {
|
||||
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(GuiGrinder.texture, 55, 30, 82, 26);
|
||||
title = I18n.translateToLocal("tile.techreborn.grinder.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) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
GrinderRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package techreborn.compat.jei.grinder;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class GrinderRecipeHandler implements IRecipeHandler<GrinderRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public GrinderRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<GrinderRecipe> getRecipeClass() {
|
||||
return GrinderRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
GrinderRecipe recipe) {
|
||||
return RecipeCategoryUids.GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
GrinderRecipe recipe) {
|
||||
return new GrinderRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
GrinderRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
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.GuiGrinder;
|
||||
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(GuiGrinder.texture, 176, 14, 20, 11);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 25, 7);
|
||||
|
||||
int x = -45;
|
||||
int y = 4;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
package techreborn.compat.jei.implosionCompressor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.*;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiImplosionCompressor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ImplosionCompressorRecipeCategory extends BlankRecipeCategory<ImplosionCompressorRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final IDrawable electricity;
|
||||
private final String title;
|
||||
|
||||
public ImplosionCompressorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiImplosionCompressor.texture, 16, 25, 116, 36);
|
||||
IDrawableStatic electricityDrawable = guiHelper.createDrawable(GuiImplosionCompressor.texture, 176, 0, 14, 14);
|
||||
electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP,
|
||||
true);
|
||||
title = I18n.translateToLocal("tile.techreborn.implosioncompressor.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 drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft) {
|
||||
electricity.draw(minecraft, 0, 12);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 20, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 20, 18);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 9);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 9);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 20, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 20, 18);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 9);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 9);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package techreborn.compat.jei.implosionCompressor;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ImplosionCompressorRecipeHandler implements IRecipeHandler<ImplosionCompressorRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public ImplosionCompressorRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ImplosionCompressorRecipe> getRecipeClass() {
|
||||
return ImplosionCompressorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.IMPLOSION_COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipe recipe) {
|
||||
return RecipeCategoryUids.IMPLOSION_COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipe recipe) {
|
||||
return new ImplosionCompressorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
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.GuiImplosionCompressor;
|
||||
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(GuiImplosionCompressor.texture, 176, 14, 21, 11);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 44, 13);
|
||||
|
||||
int x = -45;
|
||||
int y = 4;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiIndustrialElectrolyzer;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeCategory extends BlankRecipeCategory<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;
|
||||
|
||||
public IndustrialElectrolyzerRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiIndustrialElectrolyzer.texture, 49, 18, 78, 50);
|
||||
title = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.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) {
|
||||
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, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@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,55 +0,0 @@
|
|||
package techreborn.compat.jei.industrialElectrolyzer;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeHandler implements IRecipeHandler<IndustrialElectrolyzerRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public IndustrialElectrolyzerRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<IndustrialElectrolyzerRecipe> getRecipeClass() {
|
||||
return IndustrialElectrolyzerRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipe recipe) {
|
||||
return RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipe recipe) {
|
||||
return new IndustrialElectrolyzerRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
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 techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
||||
import techreborn.client.gui.GuiIndustrialElectrolyzer;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeWrapper extends BaseRecipeWrapper<IndustrialElectrolyzerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public IndustrialElectrolyzerRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiIndustrialElectrolyzer.texture, 176, 14, 30, 10);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.BOTTOM, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 24, 20);
|
||||
|
||||
int x = 60;
|
||||
int y = 30;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,105 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiIndustrialGrinder;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.tiles.multiblock.TileIndustrialGrinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialGrinderRecipeCategory extends BlankRecipeCategory<IndustrialGrinderRecipeWrapper> {
|
||||
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;
|
||||
private final IDrawable blankArea; // for covering the lightning power
|
||||
// symbol
|
||||
private final IDrawable tankOverlay;
|
||||
private final String title;
|
||||
|
||||
public IndustrialGrinderRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 7, 15, 141, 55);
|
||||
blankArea = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 50, 45, 6, 6);
|
||||
tankOverlay = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 176, 86, 12, 47);
|
||||
title = I18n.translateToLocal("tile.techreborn.industrialgrinder.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) {
|
||||
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, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
|
||||
}
|
||||
|
||||
@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,55 +0,0 @@
|
|||
package techreborn.compat.jei.industrialGrinder;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialGrinderRecipeHandler implements IRecipeHandler<IndustrialGrinderRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public IndustrialGrinderRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<IndustrialGrinderRecipe> getRecipeClass() {
|
||||
return IndustrialGrinderRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipe recipe) {
|
||||
return RecipeCategoryUids.INDUSTRIAL_GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipe recipe) {
|
||||
return new IndustrialGrinderRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
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 net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
||||
import techreborn.client.gui.GuiIndustrialGrinder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class IndustrialGrinderRecipeWrapper extends BaseRecipeWrapper<IndustrialGrinderRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public IndustrialGrinderRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 176, 14, 24, 17);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
if (baseRecipe.fluidStack != null) {
|
||||
return Collections.singletonList(baseRecipe.fluidStack);
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 44, 20);
|
||||
|
||||
int x = 70;
|
||||
int y = 40;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiRollingMachine;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RollingMachineRecipeCategory extends BlankRecipeCategory<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 RollingMachineRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiRollingMachine.texture, 29, 16, 116, 54);
|
||||
title = I18n.translateToLocal("tile.techreborn.rollingmachine.name");
|
||||
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiRollingMachine.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;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft) {
|
||||
progress.draw(minecraft, 62, 18);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
RollingMachineRecipeWrapper recipeWrapper) {
|
||||
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.setInput(guiItemStacks, recipeWrapper.getInputs());
|
||||
craftingGridHelper.setOutput(guiItemStacks, recipeWrapper.getOutputs());
|
||||
}
|
||||
|
||||
@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.setInputStacks(guiItemStacks, ingredients.getInputs(ItemStack.class));
|
||||
craftingGridHelper.setOutput(guiItemStacks, ingredients.getOutputs(ItemStack.class));
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RollingMachineRecipeHandler implements IRecipeHandler<RollingMachineRecipeWrapper> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RollingMachineRecipeWrapper> getRecipeClass() {
|
||||
return RollingMachineRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.ROLLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
RollingMachineRecipeWrapper recipe) {
|
||||
return RecipeCategoryUids.ROLLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
RollingMachineRecipeWrapper recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
RollingMachineRecipeWrapper recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RollingMachineRecipeMaker {
|
||||
private RollingMachineRecipeMaker() {
|
||||
|
||||
}
|
||||
|
||||
public static List<Object> getRecipes(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
List<Object> recipes = new ArrayList<>();
|
||||
for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList()) {
|
||||
RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(jeiHelpers, recipe);
|
||||
if (recipeWrapper != null) {
|
||||
recipes.add(recipeWrapper);
|
||||
}
|
||||
}
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapedOreRecipeWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapedRecipesWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapelessOreRecipeWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapelessRecipesWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements ICraftingRecipeWrapper {
|
||||
private final ICraftingRecipeWrapper baseRecipe;
|
||||
|
||||
public RollingMachineRecipeWrapper(ICraftingRecipeWrapper baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static RollingMachineRecipeWrapper create(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers, IRecipe baseRecipe) {
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
ICraftingRecipeWrapper recipeWrapper;
|
||||
if (baseRecipe instanceof ShapelessRecipes) {
|
||||
recipeWrapper = new ShapelessRecipesWrapper(guiHelper, (ShapelessRecipes) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedRecipes) {
|
||||
recipeWrapper = new ShapedRecipesWrapper((ShapedRecipes) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedOreRecipe) {
|
||||
recipeWrapper = new ShapedOreRecipeWrapper(jeiHelpers, (ShapedOreRecipe) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapelessOreRecipe) {
|
||||
recipeWrapper = new ShapelessOreRecipeWrapper(jeiHelpers, (ShapelessOreRecipe) baseRecipe);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new RollingMachineRecipeWrapper(recipeWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
baseRecipe.getIngredients(ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List getInputs() {
|
||||
return baseRecipe.getInputs();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs() {
|
||||
return baseRecipe.getOutputs();
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiCompressor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ScrapboxRecipeCategory extends BlankRecipeCategory<ScrapboxRecipeWrapper> {
|
||||
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(GuiCompressor.texture, 55, 30, 82, 26);
|
||||
title = I18n.translateToLocal("jei.techreborn.scrapbox.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) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ScrapboxRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package techreborn.compat.jei.scrapbox;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.ScrapboxRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ScrapboxRecipeHandler implements IRecipeHandler<ScrapboxRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public ScrapboxRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ScrapboxRecipe> getRecipeClass() {
|
||||
return ScrapboxRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.SCRAPBOX;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
ScrapboxRecipe recipe) {
|
||||
return RecipeCategoryUids.SCRAPBOX;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
ScrapboxRecipe recipe) {
|
||||
return new ScrapboxRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
ScrapboxRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package techreborn.compat.jei.scrapbox;
|
||||
|
||||
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.ScrapboxRecipe;
|
||||
import techreborn.client.gui.GuiCompressor;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ScrapboxRecipeWrapper extends BaseRecipeWrapper<ScrapboxRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ScrapboxRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ScrapboxRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiCompressor.texture, 176, 14, 20, 11);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 25, 7);
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
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.BlankRecipeCategory;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiVacuumFreezer;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class VacuumFreezerRecipeCategory extends BlankRecipeCategory<VacuumFreezerRecipeWrapper> {
|
||||
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(GuiVacuumFreezer.texture, 55, 30, 82, 26);
|
||||
title = I18n.translateToLocal("tile.techreborn.vacuumfreezer.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) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
VacuumFreezerRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package techreborn.compat.jei.vacuumFreezer;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class VacuumFreezerRecipeHandler implements IRecipeHandler<VacuumFreezerRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public VacuumFreezerRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<VacuumFreezerRecipe> getRecipeClass() {
|
||||
return VacuumFreezerRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.VACUUM_FREEZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
VacuumFreezerRecipe recipe) {
|
||||
return RecipeCategoryUids.VACUUM_FREEZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
VacuumFreezerRecipe recipe) {
|
||||
return new VacuumFreezerRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
VacuumFreezerRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
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.GuiVacuumFreezer;
|
||||
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(GuiVacuumFreezer.texture, 176, 14, 20, 11);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 25, 7);
|
||||
}
|
||||
}
|
|
@ -1,16 +1,6 @@
|
|||
package techreborn.init;
|
||||
|
||||
import ic2.core.block.BlockIC2Fence;
|
||||
import ic2.core.block.BlockTexGlass;
|
||||
import ic2.core.block.type.ResourceBlock;
|
||||
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 net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import techreborn.Core;
|
||||
|
||||
/**
|
||||
|
@ -18,54 +8,55 @@ import techreborn.Core;
|
|||
*/
|
||||
public class IC2Dict {
|
||||
|
||||
//TODO IC2
|
||||
public static void init() {
|
||||
try {
|
||||
CraftingItemType.circuit.getName();
|
||||
|
||||
OreDictionary.registerOre("reBattery", ItemName.re_battery.getItemStack());
|
||||
|
||||
OreDictionary.registerOre("circuitBasic", ItemName.crafting.getItemStack(CraftingItemType.circuit));
|
||||
OreDictionary.registerOre("circuitAdvanced", ItemName.crafting.getItemStack(CraftingItemType.advanced_circuit));
|
||||
|
||||
OreDictionary.registerOre("machineBlockBasic", BlockName.resource.getItemStack(ResourceBlock.machine));
|
||||
OreDictionary.registerOre("machineBlockAdvanced", BlockName.resource.getItemStack(ResourceBlock.advanced_machine));
|
||||
|
||||
OreDictionary.registerOre("lapotronCrystal", ItemName.lapotron_crystal.getItemStack());
|
||||
OreDictionary.registerOre("energyCrystal", ItemName.lapotron_crystal.getItemStack());
|
||||
|
||||
OreDictionary.registerOre("drillBasic", ItemName.drill.getItemStack());
|
||||
OreDictionary.registerOre("drillDiamond", ItemName.diamond_drill.getItemStack());
|
||||
OreDictionary.registerOre("drillAdvanced", ItemName.iridium_drill.getItemStack());
|
||||
|
||||
ItemStack industrialTnt = BlockName.te.getItemStack(TeBlock.itnt);
|
||||
industrialTnt.setItemDamage(1);
|
||||
OreDictionary.registerOre("industrialTnt", industrialTnt);
|
||||
|
||||
OreDictionary.registerOre("craftingIndustrialDiamond", ItemName.crafting.getItemStack(CraftingItemType.industrial_diamond));
|
||||
OreDictionary.registerOre("fertilizer", ItemName.crafting.getItemStack(CraftingItemType.bio_chaff));
|
||||
OreDictionary.registerOre("hvTransformer", BlockName.te.getItemStack(TeBlock.hv_transformer));
|
||||
|
||||
//TODO:
|
||||
|
||||
//OreDictionary.registerOre("insulatedGoldCableItem", BlockName.te.getItemStack(CableType.gold));
|
||||
|
||||
//OreDictionary.registerOre("ic2Generator", ModBlocks.Generator);
|
||||
//OreDictionary.registerOre("ic2SolarPanel", ModBlocks.solarPanel);
|
||||
//OreDictionary.registerOre("ic2Macerator", ModBlocks.Grinder);
|
||||
//OreDictionary.registerOre("ic2Extractor", ModBlocks.Extractor);
|
||||
//OreDictionary.registerOre("ic2Windmill", ModBlocks.windMill);
|
||||
//OreDictionary.registerOre("ic2Watermill", ModBlocks.waterMill);
|
||||
|
||||
OreDictionary.registerOre("uran235", ItemName.nuclear.getItemStack(NuclearResourceType.uranium_235));
|
||||
OreDictionary.registerOre("uran238", ItemName.nuclear.getItemStack(NuclearResourceType.uranium_238));
|
||||
OreDictionary.registerOre("smallUran238", ItemName.nuclear.getItemStack(NuclearResourceType.small_uranium_238));
|
||||
OreDictionary.registerOre("smallUran235", ItemName.nuclear.getItemStack(NuclearResourceType.small_uranium_235));
|
||||
|
||||
OreDictionary.registerOre("fenceIron", BlockName.fence.getItemStack(BlockIC2Fence.IC2FenceType.iron));
|
||||
OreDictionary.registerOre("rubberWood", BlockName.rubber_wood.getItemStack());
|
||||
OreDictionary.registerOre("glassReinforced", BlockName.glass.getItemStack(BlockTexGlass.GlassType.reinforced));
|
||||
|
||||
OreDictionary.registerOre("oreIridium", ItemName.misc_resource.getItemStack(MiscResourceType.iridium_ore));
|
||||
// CraftingItemType.circuit.getName();
|
||||
//
|
||||
// OreDictionary.registerOre("reBattery", ItemName.re_battery.getItemStack());
|
||||
//
|
||||
// OreDictionary.registerOre("circuitBasic", ItemName.crafting.getItemStack(CraftingItemType.circuit));
|
||||
// OreDictionary.registerOre("circuitAdvanced", ItemName.crafting.getItemStack(CraftingItemType.advanced_circuit));
|
||||
//
|
||||
// OreDictionary.registerOre("machineBlockBasic", BlockName.resource.getItemStack(ResourceBlock.machine));
|
||||
// OreDictionary.registerOre("machineBlockAdvanced", BlockName.resource.getItemStack(ResourceBlock.advanced_machine));
|
||||
//
|
||||
// OreDictionary.registerOre("lapotronCrystal", ItemName.lapotron_crystal.getItemStack());
|
||||
// OreDictionary.registerOre("energyCrystal", ItemName.lapotron_crystal.getItemStack());
|
||||
//
|
||||
// OreDictionary.registerOre("drillBasic", ItemName.drill.getItemStack());
|
||||
// OreDictionary.registerOre("drillDiamond", ItemName.diamond_drill.getItemStack());
|
||||
// OreDictionary.registerOre("drillAdvanced", ItemName.iridium_drill.getItemStack());
|
||||
//
|
||||
// ItemStack industrialTnt = BlockName.te.getItemStack(TeBlock.itnt);
|
||||
// industrialTnt.setItemDamage(1);
|
||||
// OreDictionary.registerOre("industrialTnt", industrialTnt);
|
||||
//
|
||||
// OreDictionary.registerOre("craftingIndustrialDiamond", ItemName.crafting.getItemStack(CraftingItemType.industrial_diamond));
|
||||
// OreDictionary.registerOre("fertilizer", ItemName.crafting.getItemStack(CraftingItemType.bio_chaff));
|
||||
// OreDictionary.registerOre("hvTransformer", BlockName.te.getItemStack(TeBlock.hv_transformer));
|
||||
//
|
||||
// //TODO:
|
||||
//
|
||||
// //OreDictionary.registerOre("insulatedGoldCableItem", BlockName.te.getItemStack(CableType.gold));
|
||||
//
|
||||
// //OreDictionary.registerOre("ic2Generator", ModBlocks.Generator);
|
||||
// //OreDictionary.registerOre("ic2SolarPanel", ModBlocks.solarPanel);
|
||||
// //OreDictionary.registerOre("ic2Macerator", ModBlocks.Grinder);
|
||||
// //OreDictionary.registerOre("ic2Extractor", ModBlocks.Extractor);
|
||||
// //OreDictionary.registerOre("ic2Windmill", ModBlocks.windMill);
|
||||
// //OreDictionary.registerOre("ic2Watermill", ModBlocks.waterMill);
|
||||
//
|
||||
// OreDictionary.registerOre("uran235", ItemName.nuclear.getItemStack(NuclearResourceType.uranium_235));
|
||||
// OreDictionary.registerOre("uran238", ItemName.nuclear.getItemStack(NuclearResourceType.uranium_238));
|
||||
// OreDictionary.registerOre("smallUran238", ItemName.nuclear.getItemStack(NuclearResourceType.small_uranium_238));
|
||||
// OreDictionary.registerOre("smallUran235", ItemName.nuclear.getItemStack(NuclearResourceType.small_uranium_235));
|
||||
//
|
||||
// OreDictionary.registerOre("fenceIron", BlockName.fence.getItemStack(BlockIC2Fence.IC2FenceType.iron));
|
||||
// OreDictionary.registerOre("rubberWood", BlockName.rubber_wood.getItemStack());
|
||||
// OreDictionary.registerOre("glassReinforced", BlockName.glass.getItemStack(BlockTexGlass.GlassType.reinforced));
|
||||
//
|
||||
// OreDictionary.registerOre("oreIridium", ItemName.misc_resource.getItemStack(MiscResourceType.iridium_ore));
|
||||
} catch (NoClassDefFoundError notFound) {
|
||||
Core.logHelper.warn(
|
||||
"Can't enable integration: IC2 installed but cannot be hooked\n" +
|
||||
|
|
|
@ -6,7 +6,7 @@ public class ModInfo implements IModInfo {
|
|||
public static final String MOD_NAME = "TechReborn";
|
||||
public static final String MOD_ID = "techreborn";
|
||||
public static final String MOD_VERSION = "@MODVERSION@";
|
||||
public static final String MOD_DEPENDENCIES = "required-after:Forge@[11.15.0.1609,);required-after:reborncore;after:JEI@[3.13,);after:IC2";
|
||||
public static final String MOD_DEPENDENCIES = "required-after:forge;required-after:reborncore;after:jei@[3.13,);after:ic2";
|
||||
public static final String SERVER_PROXY_CLASS = "techreborn.proxies.CommonProxy";
|
||||
public static final String CLIENT_PROXY_CLASS = "techreborn.proxies.ClientProxy";
|
||||
public static final String GUI_FACTORY_CLASS = "techreborn.config.TechRebornGUIFactory";
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
|||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.parts.powerCables.ItemStandaloneCables;
|
||||
|
||||
/**
|
||||
|
@ -23,7 +24,7 @@ public class StandalonePartCompact implements ICompatModule {
|
|||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
itemStandaloneCable = new ItemStandaloneCables();
|
||||
GameRegistry.registerItem(itemStandaloneCable, "cables");
|
||||
ModItems.registerItem(itemStandaloneCable, "cables");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package techreborn.parts.fluidPipes;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 12/05/2016.
|
||||
*/
|
||||
public class EmptyFluidPipe extends MultipartFluidPipe {
|
||||
@Override
|
||||
public EnumFluidPipeTypes getPipeType() {
|
||||
return EnumFluidPipeTypes.EMPTY;
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package techreborn.parts.fluidPipes;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 09/05/2016.
|
||||
*/
|
||||
public enum EnumFluidPipeTypes implements IStringSerializable {
|
||||
|
||||
EMPTY("empty", "techreborn:blocks/fluidPipes/fluidpipe", false, false, TextFormatting.DARK_GRAY),
|
||||
INSERT("insert", "techreborn:blocks/fluidPipes/fluidpipe_insert", false, true, TextFormatting.BLUE),
|
||||
EXTRACT("extract", "techreborn:blocks/fluidPipes/fluidpipe_extract", true, false, TextFormatting.GOLD);
|
||||
|
||||
public String textureName = "minecraft:blocks/iron_block";
|
||||
public boolean extract = false;
|
||||
public boolean insert = false;
|
||||
public TextFormatting colour = TextFormatting.WHITE;
|
||||
private String name;
|
||||
|
||||
EnumFluidPipeTypes(String name, String textureName, boolean extract, boolean insert, TextFormatting colour) {
|
||||
this.name = name;
|
||||
this.textureName = textureName;
|
||||
this.extract = extract;
|
||||
this.insert = insert;
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package techreborn.parts.fluidPipes;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 12/05/2016.
|
||||
*/
|
||||
public class ExtractingFluidPipe extends MultipartFluidPipe {
|
||||
@Override
|
||||
public EnumFluidPipeTypes getPipeType() {
|
||||
return EnumFluidPipeTypes.EXTRACT;
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package techreborn.parts.fluidPipes;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 12/05/2016.
|
||||
*/
|
||||
public interface IPartType {
|
||||
|
||||
EnumFluidPipeTypes getPipeType();
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package techreborn.parts.fluidPipes;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 12/05/2016.
|
||||
*/
|
||||
public class InsertingFluidPipe extends MultipartFluidPipe {
|
||||
@Override
|
||||
public EnumFluidPipeTypes getPipeType() {
|
||||
return EnumFluidPipeTypes.INSERT;
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package techreborn.parts.fluidPipes;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.RebornCore;
|
||||
import reborncore.mcmultipart.item.ItemMultiPart;
|
||||
import reborncore.mcmultipart.multipart.IMultipart;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 09/05/2016.
|
||||
*/
|
||||
public class ItemFluidPipe extends ItemMultiPart {
|
||||
|
||||
public ItemFluidPipe() {
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setUnlocalizedName("techreborn.fluidpipe");
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMultipart createPart(World world, BlockPos pos, EnumFacing side, Vec3d hit, ItemStack stack, EntityPlayer player) {
|
||||
return new EmptyFluidPipe();
|
||||
}
|
||||
}
|
|
@ -1,430 +0,0 @@
|
|||
package techreborn.parts.fluidPipes;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import net.minecraftforge.common.property.Properties;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import reborncore.common.misc.Functions;
|
||||
import reborncore.common.misc.vecmath.Vecs3dCube;
|
||||
import reborncore.common.util.ChatUtils;
|
||||
import reborncore.common.util.Tank;
|
||||
import reborncore.common.util.WorldUtils;
|
||||
import reborncore.mcmultipart.MCMultiPartMod;
|
||||
import reborncore.mcmultipart.microblock.IMicroblock;
|
||||
import reborncore.mcmultipart.multipart.*;
|
||||
import reborncore.mcmultipart.raytrace.PartMOP;
|
||||
import techreborn.lib.MessageIDs;
|
||||
import techreborn.parts.TechRebornParts;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 09/05/2016.
|
||||
*/
|
||||
public abstract class MultipartFluidPipe extends Multipart implements INormallyOccludingPart, ISlottedPart, ITickable, IPartType {
|
||||
|
||||
public static final IUnlistedProperty<Boolean> UP = Properties.toUnlisted(PropertyBool.create("up"));
|
||||
public static final IUnlistedProperty<Boolean> DOWN = Properties.toUnlisted(PropertyBool.create("down"));
|
||||
public static final IUnlistedProperty<Boolean> NORTH = Properties.toUnlisted(PropertyBool.create("north"));
|
||||
public static final IUnlistedProperty<Boolean> EAST = Properties.toUnlisted(PropertyBool.create("east"));
|
||||
public static final IUnlistedProperty<Boolean> SOUTH = Properties.toUnlisted(PropertyBool.create("south"));
|
||||
public static final IUnlistedProperty<Boolean> WEST = Properties.toUnlisted(PropertyBool.create("west"));
|
||||
public static final IProperty<EnumFluidPipeTypes> TYPE = PropertyEnum.create("type", EnumFluidPipeTypes.class);
|
||||
public static final double thickness = 11;
|
||||
public static int mbt = 20;
|
||||
public Vecs3dCube[] boundingBoxes = new Vecs3dCube[14];
|
||||
public float center = 0.6F;
|
||||
public float offset = 0.10F;
|
||||
public Map<EnumFacing, BlockPos> connectedSides;
|
||||
Tank tank = new Tank("MultipartFluidPipe", 1000, null);
|
||||
|
||||
public MultipartFluidPipe() {
|
||||
connectedSides = new HashMap<>();
|
||||
refreshBounding();
|
||||
}
|
||||
|
||||
public static MultipartFluidPipe getPartFromWorld(World world, BlockPos pos, EnumFacing side) {
|
||||
if (world == null || pos == null) {
|
||||
return null;
|
||||
}
|
||||
IMultipartContainer container = MultipartHelper.getPartContainer(world, pos);
|
||||
if (side != null && container != null) {
|
||||
ISlottedPart slottedPart = container.getPartInSlot(PartSlot.getFaceSlot(side));
|
||||
if (slottedPart instanceof IMicroblock.IFaceMicroblock && !((IMicroblock.IFaceMicroblock) slottedPart)
|
||||
.isFaceHollow()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (container == null) {
|
||||
return null;
|
||||
}
|
||||
ISlottedPart part = container.getPartInSlot(PartSlot.CENTER);
|
||||
if (part instanceof MultipartFluidPipe) {
|
||||
return (MultipartFluidPipe) part;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void refreshBounding() {
|
||||
float centerFirst = center - offset;
|
||||
double w = (thickness / 16) - 0.5;
|
||||
boundingBoxes[6] = new Vecs3dCube(centerFirst - w, centerFirst - w, centerFirst - w, centerFirst + w,
|
||||
centerFirst + w, centerFirst + w);
|
||||
|
||||
int i = 0;
|
||||
for (EnumFacing dir : EnumFacing.VALUES) {
|
||||
double xMin1 = (dir.getFrontOffsetX() < 0 ?
|
||||
0.0 :
|
||||
(dir.getFrontOffsetX() == 0 ? centerFirst - w : centerFirst + w));
|
||||
double xMax1 = (dir.getFrontOffsetX() > 0 ?
|
||||
1.0 :
|
||||
(dir.getFrontOffsetX() == 0 ? centerFirst + w : centerFirst - w));
|
||||
|
||||
double yMin1 = (dir.getFrontOffsetY() < 0 ?
|
||||
0.0 :
|
||||
(dir.getFrontOffsetY() == 0 ? centerFirst - w : centerFirst + w));
|
||||
double yMax1 = (dir.getFrontOffsetY() > 0 ?
|
||||
1.0 :
|
||||
(dir.getFrontOffsetY() == 0 ? centerFirst + w : centerFirst - w));
|
||||
|
||||
double zMin1 = (dir.getFrontOffsetZ() < 0 ?
|
||||
0.0 :
|
||||
(dir.getFrontOffsetZ() == 0 ? centerFirst - w : centerFirst + w));
|
||||
double zMax1 = (dir.getFrontOffsetZ() > 0 ?
|
||||
1.0 :
|
||||
(dir.getFrontOffsetZ() == 0 ? centerFirst + w : centerFirst - w));
|
||||
|
||||
boundingBoxes[i] = new Vecs3dCube(xMin1, yMin1, zMin1, xMax1, yMax1, zMax1);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxes(AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity) {
|
||||
|
||||
for (EnumFacing dir : EnumFacing.VALUES) {
|
||||
if (connectedSides.containsKey(dir) && mask
|
||||
.intersectsWith(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB()))
|
||||
list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB());
|
||||
}
|
||||
if (mask.intersectsWith(boundingBoxes[6].toAABB())) {
|
||||
list.add(boundingBoxes[6].toAABB());
|
||||
}
|
||||
super.addCollisionBoxes(mask, list, collidingEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSelectionBoxes(List<AxisAlignedBB> list) {
|
||||
|
||||
for (EnumFacing dir : EnumFacing.VALUES) {
|
||||
if (connectedSides.containsKey(dir))
|
||||
list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB());
|
||||
}
|
||||
list.add(boundingBoxes[6].toAABB());
|
||||
super.addSelectionBoxes(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoved() {
|
||||
super.onRemoved();
|
||||
for (EnumFacing dir : EnumFacing.VALUES) {
|
||||
MultipartFluidPipe multipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir);
|
||||
if (multipart != null) {
|
||||
multipart.nearByChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addOcclusionBoxes(List<AxisAlignedBB> list) {
|
||||
for (EnumFacing dir : EnumFacing.VALUES) {
|
||||
if (connectedSides.containsKey(dir))
|
||||
list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB());
|
||||
}
|
||||
list.add(boundingBoxes[6].toAABB());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(Block block) {
|
||||
super.onNeighborBlockChange(block);
|
||||
nearByChange();
|
||||
|
||||
}
|
||||
|
||||
public void nearByChange() {
|
||||
checkConnectedSides();
|
||||
for (EnumFacing direction : EnumFacing.VALUES) {
|
||||
BlockPos blockPos = getPos().offset(direction);
|
||||
WorldUtils.updateBlock(getWorld(), blockPos);
|
||||
MultipartFluidPipe part = getPartFromWorld(getWorld(), blockPos, direction);
|
||||
if (part != null) {
|
||||
part.checkConnectedSides();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdded() {
|
||||
nearByChange();
|
||||
}
|
||||
|
||||
public boolean shouldConnectTo(EnumFacing dir) {
|
||||
if (dir != null) {
|
||||
if (internalShouldConnectTo(dir)) {
|
||||
MultipartFluidPipe multipartFluidPipe = getPartFromWorld(getWorld(), getPos().offset(dir), dir);
|
||||
if (multipartFluidPipe != null && multipartFluidPipe.internalShouldConnectTo(dir.getOpposite())) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
TileEntity tile = getNeighbourTile(dir);
|
||||
|
||||
if (tile instanceof IFluidHandler && (getPipeType() == EnumFluidPipeTypes.EXTRACT
|
||||
|| getPipeType() == EnumFluidPipeTypes.INSERT)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean internalShouldConnectTo(EnumFacing dir) {
|
||||
ISlottedPart part = getContainer().getPartInSlot(PartSlot.getFaceSlot(dir));
|
||||
if (part instanceof IMicroblock.IFaceMicroblock) {
|
||||
if (!((IMicroblock.IFaceMicroblock) part).isFaceHollow()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!OcclusionHelper.occlusionTest(getContainer().getParts(), p -> p == this,
|
||||
boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MultipartFluidPipe multipartFluidPipe = getPartFromWorld(getWorld(), getPos().offset(dir), dir.getOpposite());
|
||||
|
||||
return multipartFluidPipe != null;
|
||||
}
|
||||
|
||||
public TileEntity getNeighbourTile(EnumFacing side) {
|
||||
return side != null ? getWorld().getTileEntity(getPos().offset(side)) : null;
|
||||
}
|
||||
|
||||
public void checkConnectedSides() {
|
||||
refreshBounding();
|
||||
connectedSides = new HashMap<>();
|
||||
for (EnumFacing dir : EnumFacing.values()) {
|
||||
int d = Functions.getIntDirFromDirection(dir);
|
||||
if (getWorld() == null) {
|
||||
return;
|
||||
}
|
||||
TileEntity te = getNeighbourTile(dir);
|
||||
if (shouldConnectTo(dir)) {
|
||||
connectedSides.put(dir, te.getPos());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<PartSlot> getSlotMask() {
|
||||
return EnumSet.of(PartSlot.CENTER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state) {
|
||||
IExtendedBlockState extendedBlockState = (IExtendedBlockState) state;
|
||||
return extendedBlockState.withProperty(DOWN, shouldConnectTo(EnumFacing.DOWN))
|
||||
.withProperty(UP, shouldConnectTo(EnumFacing.UP)).withProperty(NORTH, shouldConnectTo(EnumFacing.NORTH))
|
||||
.withProperty(SOUTH, shouldConnectTo(EnumFacing.SOUTH))
|
||||
.withProperty(WEST, shouldConnectTo(EnumFacing.WEST))
|
||||
.withProperty(EAST, shouldConnectTo(EnumFacing.EAST)).withProperty(TYPE, getPipeType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new ExtendedBlockState(MCMultiPartMod.multipart, new IProperty[] { TYPE },
|
||||
new IUnlistedProperty[] { DOWN, UP, NORTH, SOUTH, WEST, EAST });
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getHardness(PartMOP hit) {
|
||||
return 0.5F;
|
||||
}
|
||||
|
||||
public Material getMaterial() {
|
||||
return Material.CLOTH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops() {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(TechRebornParts.fluidPipe, 1, 0));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getModelPath() {
|
||||
return new ResourceLocation("techreborn:fluidpipe");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(BlockRenderLayer layer) {
|
||||
return layer == BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!getWorld().isRemote) {
|
||||
for (EnumFacing dir : EnumFacing.VALUES) {
|
||||
//if (connectedSides.containsKey(dir)) {
|
||||
MultipartFluidPipe fluidPipe = getPartFromWorld(getWorld(), getPos().offset(dir), dir);
|
||||
if (fluidPipe != null) {
|
||||
if (!tank.isEmpty()) {
|
||||
if (fluidPipe.tank.isEmpty() || fluidPipe.tank.getFluid().getFluid() == tank.getFluid()
|
||||
.getFluid()) {
|
||||
if (fluidPipe.tank.getFluidAmount() < tank.getFluidAmount()) {
|
||||
int freeSpace = fluidPipe.tank.getCapacity();
|
||||
if (!fluidPipe.tank.isEmpty()) {
|
||||
freeSpace = fluidPipe.tank.getCapacity() - fluidPipe.tank.getFluidAmount();
|
||||
}
|
||||
int difference = tank.getFluidAmount() - freeSpace;
|
||||
int amountToChange = difference / 2;
|
||||
fluidPipe.tank.setFluid(tank.getFluid());
|
||||
fluidPipe.tank.setFluidAmount(fluidPipe.tank.getFluidAmount() + amountToChange);
|
||||
tank.setFluidAmount(tank.getFluidAmount() - amountToChange);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
TileEntity tileEntity = getNeighbourTile(dir);
|
||||
if (tileEntity != null) {
|
||||
if (tileEntity instanceof IFluidHandler) {
|
||||
IFluidHandler handler = (IFluidHandler) tileEntity;
|
||||
if (getPipeType() == EnumFluidPipeTypes.EXTRACT) {
|
||||
if (!tank.isFull()) {
|
||||
FluidTankInfo[] fluidTankInfos = handler.getTankInfo(dir.getOpposite());
|
||||
if (fluidTankInfos.length != 0) {
|
||||
FluidTankInfo info = fluidTankInfos[0];
|
||||
if (info != null & info.fluid != null) {
|
||||
if (tank.isEmpty() || info.fluid.getFluid() == tank.getFluid().getFluid()) {
|
||||
if (handler.canDrain(dir.getOpposite(), info.fluid.getFluid())) {
|
||||
int amountToMove = Math
|
||||
.min(mbt, tank.getCapacity() - tank.getFluidAmount());
|
||||
int fluidAmount = tank.getFluidAmount();
|
||||
FluidStack fluidStack = handler
|
||||
.drain(dir.getOpposite(), amountToMove, true);
|
||||
tank.fill(fluidStack, true);
|
||||
tank.setFluid(fluidStack);
|
||||
tank.setFluidAmount(fluidAmount + amountToMove);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (getPipeType() == EnumFluidPipeTypes.INSERT) {
|
||||
if (!tank.isEmpty()) {
|
||||
FluidTankInfo[] fluidTankInfos = handler.getTankInfo(dir.getOpposite());
|
||||
if (fluidTankInfos.length != 0) {
|
||||
FluidTankInfo info = fluidTankInfos[0];
|
||||
if (info.fluid == null || info.fluid.getFluid() == null
|
||||
|| info.fluid.getFluid() == tank.getFluid().getFluid() && handler
|
||||
.canFill(dir.getOpposite(), tank.getFluid().getFluid())) {
|
||||
int infoSpace = info.capacity;
|
||||
if (info.fluid != null) {
|
||||
infoSpace = info.capacity - info.fluid.amount;
|
||||
}
|
||||
int amountToMove = Math.min(mbt, infoSpace);
|
||||
FluidStack fluidStack = tank.drain(amountToMove, true);
|
||||
handler.fill(dir.getOpposite(), fluidStack, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(EntityPlayer player, EnumHand hand, PartMOP hit) {
|
||||
//TODO make only wrench able to change mode, shift-click with wrench picks up pipe, and click with empty hand displays current mode in chat (doesn't change it)
|
||||
|
||||
System.out.println(getWorld().isRemote);
|
||||
|
||||
if (!getWorld().isRemote) {
|
||||
if (getPipeType() == EnumFluidPipeTypes.EMPTY) {
|
||||
setPartType(EnumFluidPipeTypes.EXTRACT, this);
|
||||
} else if (getPipeType() == EnumFluidPipeTypes.EXTRACT) {
|
||||
setPartType(EnumFluidPipeTypes.INSERT, this);
|
||||
} else if (getPipeType() == EnumFluidPipeTypes.INSERT) {
|
||||
setPartType(EnumFluidPipeTypes.EMPTY, this);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setPartType(EnumFluidPipeTypes type, MultipartFluidPipe pipe) {
|
||||
World world = pipe.getWorld();
|
||||
BlockPos pos = pipe.getPos();
|
||||
Tank tank = pipe.tank;
|
||||
pipe.getContainer().removePart(pipe);
|
||||
MultipartFluidPipe newPipe = null;
|
||||
switch (type) {
|
||||
case EMPTY:
|
||||
newPipe = new EmptyFluidPipe();
|
||||
break;
|
||||
case INSERT:
|
||||
newPipe = new InsertingFluidPipe();
|
||||
break;
|
||||
case EXTRACT:
|
||||
newPipe = new ExtractingFluidPipe();
|
||||
break;
|
||||
}
|
||||
newPipe.tank = tank;
|
||||
MultipartHelper.addPart(world, pos, newPipe);
|
||||
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.fluidPipeID, new TextComponentString(
|
||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " " +
|
||||
type.colour + reborncore.common.util.StringUtils.toFirstCapital(type.getName())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
tank.writeToNBT(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
tank.readFromNBT(tag);
|
||||
}
|
||||
|
||||
}
|
|
@ -23,7 +23,7 @@ public class TileDigitalChest extends TileLegacyMachineBase implements IInventor
|
|||
// Slot 1 = Output
|
||||
// Slot 2 = Fake Item
|
||||
|
||||
public ItemStack storedItem;
|
||||
public ItemStack storedItem = ItemStack.EMPTY;
|
||||
// TODO use long so we can have 9,223,372,036,854,775,807 items instead of
|
||||
// 2,147,483,647
|
||||
int storage = 32767;
|
||||
|
@ -34,11 +34,11 @@ public class TileDigitalChest extends TileLegacyMachineBase implements IInventor
|
|||
if (!world.isRemote) {
|
||||
if (storedItem != null) {
|
||||
ItemStack fakeStack = storedItem.copy();
|
||||
fakeStack.getCount() = 1;
|
||||
fakeStack.setCount(1);
|
||||
setInventorySlotContents(2, fakeStack);
|
||||
} else if (storedItem == null && getStackInSlot(1) != null) {
|
||||
} else if (storedItem == ItemStack.EMPTY && getStackInSlot(1) != ItemStack.EMPTY) {
|
||||
ItemStack fakeStack = getStackInSlot(1).copy();
|
||||
fakeStack.getCount() = 1;
|
||||
fakeStack.setCount(1);
|
||||
setInventorySlotContents(2, fakeStack);
|
||||
} else {
|
||||
setInventorySlotContents(2, null);
|
||||
|
@ -47,10 +47,10 @@ public class TileDigitalChest extends TileLegacyMachineBase implements IInventor
|
|||
if (getStackInSlot(0) != null) {
|
||||
if (storedItem == null) {
|
||||
storedItem = getStackInSlot(0);
|
||||
setInventorySlotContents(0, null);
|
||||
setInventorySlotContents(0, ItemStack.EMPTY);
|
||||
} else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), true, true)) {
|
||||
if (storedItem.getCount() <= storage - getStackInSlot(0).getCount()) {
|
||||
storedItem.getCount() += getStackInSlot(0).getCount();
|
||||
storedItem.grow(getStackInSlot(0).getCount());
|
||||
decrStackSize(0, getStackInSlot(0).getCount());
|
||||
}
|
||||
}
|
||||
|
@ -58,14 +58,14 @@ public class TileDigitalChest extends TileLegacyMachineBase implements IInventor
|
|||
|
||||
if (storedItem != null && getStackInSlot(1) == null) {
|
||||
ItemStack itemStack = storedItem.copy();
|
||||
itemStack.getCount() = itemStack.getMaxStackSize();
|
||||
itemStack.setCount(itemStack.getMaxStackSize());
|
||||
setInventorySlotContents(1, itemStack);
|
||||
storedItem.getCount() -= itemStack.getMaxStackSize();
|
||||
storedItem.shrink(itemStack.getMaxStackSize());
|
||||
} else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true)) {
|
||||
int wanted = getStackInSlot(1).getMaxStackSize() - getStackInSlot(1).getCount();
|
||||
if (storedItem.getCount() >= wanted) {
|
||||
decrStackSize(1, -wanted);
|
||||
storedItem.getCount() -= wanted;
|
||||
storedItem.shrink(wanted);
|
||||
} else {
|
||||
decrStackSize(1, -storedItem.getCount());
|
||||
storedItem = null;
|
||||
|
@ -92,11 +92,11 @@ public class TileDigitalChest extends TileLegacyMachineBase implements IInventor
|
|||
storedItem = null;
|
||||
|
||||
if (tagCompound.hasKey("storedStack")) {
|
||||
storedItem = ItemStack.loadItemStackFromNBT((NBTTagCompound) tagCompound.getTag("storedStack"));
|
||||
storedItem = new ItemStack((NBTTagCompound) tagCompound.getTag("storedStack"));
|
||||
}
|
||||
|
||||
if (storedItem != null) {
|
||||
storedItem.getCount() = tagCompound.getInteger("storedQuantity");
|
||||
storedItem.setCount(tagCompound.getInteger("storedQuantity"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ public class TileIronFurnace extends TileLegacyMachineBase implements IInventory
|
|||
if (getStackInSlot(output) == null) {
|
||||
setInventorySlotContents(output, itemstack.copy());
|
||||
} else if (getStackInSlot(output).isItemEqual(itemstack)) {
|
||||
getStackInSlot(output).getCount() += itemstack.getCount();
|
||||
getStackInSlot(output).grow(itemstack.getCount());
|
||||
}
|
||||
if (getStackInSlot(input1).getCount() > 1) {
|
||||
this.decrStackSize(input1, 1);
|
||||
|
|
|
@ -130,7 +130,7 @@ public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchab
|
|||
if (inventory.getStackInSlot(6) == null) {
|
||||
inventory.setInventorySlotContents(6, new ItemStack(ModItems.uuMatter));
|
||||
} else if (ItemUtils.isItemEqual(inventory.getStackInSlot(6), new ItemStack(ModItems.uuMatter), true, true)) {
|
||||
inventory.getStackInSlot(6).getCount() = Math.min(64, 1 + inventory.getStackInSlot(6).getCount());
|
||||
inventory.getStackInSlot(6).setCount(Math.min(64, 1 + inventory.getStackInSlot(6).getCount()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ public class TilePlayerDectector extends TilePowerAcceptor {
|
|||
}
|
||||
if (lastRedstone != redstone) {
|
||||
WorldUtils.updateBlock(world, getPos());
|
||||
world.notifyNeighborsOfStateChange(getPos(), world.getBlockState(getPos()).getBlock());
|
||||
world.notifyNeighborsOfStateChange(getPos(), world.getBlockState(getPos()).getBlock(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,9 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
|
@ -20,7 +22,7 @@ import java.util.List;
|
|||
/**
|
||||
* Created by modmuss50 on 08/05/2016.
|
||||
*/
|
||||
public class TilePump extends TilePowerAcceptor implements IFluidHandler {
|
||||
public class TilePump extends TilePowerAcceptor {
|
||||
|
||||
public Tank tank = new Tank("TilePump", 10000, this);
|
||||
|
||||
|
@ -130,40 +132,19 @@ public class TilePump extends TilePowerAcceptor implements IFluidHandler {
|
|||
return tagCompound;
|
||||
}
|
||||
|
||||
// IFluidHandler
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill) {
|
||||
int fill = tank.fill(resource, doFill);
|
||||
tank.compareAndUpdate();
|
||||
return fill;
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return true;
|
||||
}
|
||||
return super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) {
|
||||
FluidStack drain = tank.drain(resource.amount, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) {
|
||||
FluidStack drain = tank.drain(maxDrain, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid) {
|
||||
return tank.getFluid() == null || tank.getFluid().getFluid() == fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from) {
|
||||
return new FluidTankInfo[] { tank.getInfo() };
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return (T) tank;
|
||||
}
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,11 +36,11 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
if (!world.isRemote) {
|
||||
if (storedItem != null) {
|
||||
ItemStack fakeStack = storedItem.copy();
|
||||
fakeStack.getCount() = 1;
|
||||
fakeStack.setCount(1);
|
||||
setInventorySlotContents(2, fakeStack);
|
||||
} else if (storedItem == null && getStackInSlot(1) != null) {
|
||||
} else if (storedItem == ItemStack.EMPTY && getStackInSlot(1) != ItemStack.EMPTY) {
|
||||
ItemStack fakeStack = getStackInSlot(1).copy();
|
||||
fakeStack.getCount() = 1;
|
||||
fakeStack.setCount(1);
|
||||
setInventorySlotContents(2, fakeStack);
|
||||
} else {
|
||||
setInventorySlotContents(2, null);
|
||||
|
@ -49,10 +49,10 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
if (getStackInSlot(0) != null) {
|
||||
if (storedItem == null) {
|
||||
storedItem = getStackInSlot(0);
|
||||
setInventorySlotContents(0, null);
|
||||
setInventorySlotContents(0, ItemStack.EMPTY);
|
||||
} else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), true, true)) {
|
||||
if (storedItem.getCount() <= storage - getStackInSlot(0).getCount()) {
|
||||
storedItem.getCount() += getStackInSlot(0).getCount();
|
||||
storedItem.grow(getStackInSlot(0).getCount());
|
||||
decrStackSize(0, getStackInSlot(0).getCount());
|
||||
}
|
||||
}
|
||||
|
@ -60,14 +60,14 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
|
||||
if (storedItem != null && getStackInSlot(1) == null) {
|
||||
ItemStack itemStack = storedItem.copy();
|
||||
itemStack.getCount() = itemStack.getMaxStackSize();
|
||||
itemStack.setCount(itemStack.getMaxStackSize());
|
||||
setInventorySlotContents(1, itemStack);
|
||||
storedItem.getCount() -= itemStack.getMaxStackSize();
|
||||
storedItem.shrink(itemStack.getMaxStackSize());
|
||||
} else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true)) {
|
||||
int wanted = getStackInSlot(1).getMaxStackSize() - getStackInSlot(1).getCount();
|
||||
if (storedItem.getCount() >= wanted) {
|
||||
decrStackSize(1, -wanted);
|
||||
storedItem.getCount() -= wanted;
|
||||
storedItem.shrink(wanted);
|
||||
} else {
|
||||
decrStackSize(1, -storedItem.getCount());
|
||||
storedItem = null;
|
||||
|
@ -94,11 +94,11 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
storedItem = null;
|
||||
|
||||
if (tagCompound.hasKey("storedStack")) {
|
||||
storedItem = ItemStack.loadItemStackFromNBT((NBTTagCompound) tagCompound.getTag("storedStack"));
|
||||
storedItem = new ItemStack((NBTTagCompound) tagCompound.getTag("storedStack"));
|
||||
}
|
||||
|
||||
if (storedItem != null) {
|
||||
storedItem.getCount() = tagCompound.getInteger("storedQuantity");
|
||||
storedItem.setCount(tagCompound.getInteger("storedQuantity"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,15 +161,14 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
|
||||
@Override
|
||||
public void setStoredItemCount(int amount) {
|
||||
this.storedItem.getCount() = 0;
|
||||
this.storedItem.getCount() += (amount);
|
||||
storedItem.grow(amount);
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStoredItemType(ItemStack type, int amount) {
|
||||
this.storedItem = type;
|
||||
this.storedItem.getCount() = amount;
|
||||
storedItem.setCount(amount);
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,10 +6,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.IWrenchable;
|
||||
|
@ -23,7 +21,7 @@ import techreborn.init.ModBlocks;
|
|||
import java.util.List;
|
||||
|
||||
public class TileQuantumTank extends TileLegacyMachineBase
|
||||
implements IFluidHandler, IInventoryProvider, IWrenchable, IListInfoProvider {
|
||||
implements IInventoryProvider, IWrenchable, IListInfoProvider {
|
||||
|
||||
public Tank tank = new Tank("TileQuantumTank", Integer.MAX_VALUE, this);
|
||||
public Inventory inventory = new Inventory(3, "TileQuantumTank", 64, this);
|
||||
|
@ -61,8 +59,8 @@ public class TileQuantumTank extends TileLegacyMachineBase
|
|||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!world.isRemote) {
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType());
|
||||
FluidUtils.drainContainers(tank, inventory, 0, 1);
|
||||
FluidUtils.fillContainers(tank, inventory, 0, 1, tank.getFluidType());
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
|
||||
// inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
|
||||
|
@ -72,41 +70,20 @@ public class TileQuantumTank extends TileLegacyMachineBase
|
|||
}
|
||||
}
|
||||
|
||||
// IFluidHandler
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill) {
|
||||
int fill = tank.fill(resource, doFill);
|
||||
tank.compareAndUpdate();
|
||||
return fill;
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return true;
|
||||
}
|
||||
return super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) {
|
||||
FluidStack drain = tank.drain(resource.amount, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) {
|
||||
FluidStack drain = tank.drain(maxDrain, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid) {
|
||||
return tank.getFluid() == null || tank.getFluid().getFluid() == fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid) {
|
||||
return tank.getFluid() == null || tank.getFluid().getFluid() == fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from) {
|
||||
return new FluidTankInfo[] { tank.getInfo() };
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return (T) tank;
|
||||
}
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -80,7 +80,7 @@ public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable
|
|||
if (inventory.getStackInSlot(0).getCount() + currentRecipe.getCount() <= currentRecipe
|
||||
.getMaxStackSize()) {
|
||||
ItemStack stack = inventory.getStackInSlot(0);
|
||||
stack.getCount() = stack.getCount() + currentRecipe.getCount();
|
||||
stack.setCount(stack.getCount() + currentRecipe.getCount());
|
||||
inventory.setInventorySlotContents(0, stack);
|
||||
tickTime = -1;
|
||||
hasCrafted = true;
|
||||
|
|
|
@ -6,7 +6,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import reborncore.api.fuel.FluidPowerManager;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
|
@ -18,10 +20,10 @@ import reborncore.common.util.Tank;
|
|||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventoryProvider {
|
||||
public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchable, IInventoryProvider {
|
||||
|
||||
public static final int euTick = ConfigTechReborn.ThermalGeneratorOutput;
|
||||
public Tank tank = new Tank("TileDieselGenerator", FluidContainerRegistry.BUCKET_VOLUME * 10, this);
|
||||
public Tank tank = new Tank("TileDieselGenerator", 1000 * 10, this);
|
||||
public Inventory inventory = new Inventory(3, "TileDieselGenerator", 64, this);
|
||||
|
||||
public TileDieselGenerator() {
|
||||
|
@ -54,42 +56,19 @@ public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchabl
|
|||
}
|
||||
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill) {
|
||||
int filled = tank.fill(resource, doFill);
|
||||
tank.compareAndUpdate();
|
||||
return filled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) {
|
||||
if (resource == null || !resource.isFluidEqual(tank.getFluid())) {
|
||||
return null;
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return true;
|
||||
}
|
||||
FluidStack fluidStack = tank.drain(resource.amount, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return fluidStack;
|
||||
return super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) {
|
||||
FluidStack drained = tank.drain(maxDrain, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drained;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid) {
|
||||
return FluidPowerManager.fluidPowerValues.containsKey(fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid) {
|
||||
return tank.getFluid() == null || tank.getFluid().getFluid() == fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from) {
|
||||
return new FluidTankInfo[] { tank.getInfo() };
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return (T) tank;
|
||||
}
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -116,8 +95,8 @@ public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchabl
|
|||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!world.isRemote) {
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType());
|
||||
FluidUtils.drainContainers(tank, inventory, 0, 1);
|
||||
FluidUtils.fillContainers(tank, inventory, 0, 1, tank.getFluidType());
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
|
||||
inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
|
||||
syncWithAll();
|
||||
|
|
|
@ -6,7 +6,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.IWrenchable;
|
||||
|
@ -20,11 +22,11 @@ import techreborn.init.ModBlocks;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventoryProvider {
|
||||
public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, IInventoryProvider {
|
||||
|
||||
// TODO: run this off config
|
||||
public static final int euTick = 16;
|
||||
public Tank tank = new Tank("TileGasTurbine", FluidContainerRegistry.BUCKET_VOLUME * 10, this);
|
||||
public Tank tank = new Tank("TileGasTurbine", 1000 * 10, this);
|
||||
public Inventory inventory = new Inventory(3, "TileGasTurbine", 64, this);
|
||||
Map<String, Integer> fluids = new HashMap<>();
|
||||
|
||||
|
@ -67,42 +69,19 @@ public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, IF
|
|||
}
|
||||
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill) {
|
||||
int fill = tank.fill(resource, doFill);
|
||||
tank.compareAndUpdate();
|
||||
return fill;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) {
|
||||
FluidStack drain = tank.drain(resource.amount, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) {
|
||||
FluidStack drain = tank.drain(maxDrain, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid) {
|
||||
if (fluid != null) {
|
||||
return fluids.containsKey(FluidRegistry.getFluidName(fluid));
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid) {
|
||||
return tank.getFluid() == null || tank.getFluid().getFluid() == fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from) {
|
||||
return new FluidTankInfo[] { tank.getInfo() };
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return (T) tank;
|
||||
}
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -129,7 +108,7 @@ public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, IF
|
|||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!world.isRemote) {
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
FluidUtils.drainContainers(tank, inventory, 0, 1);
|
||||
tank.compareAndUpdate();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.IWrenchable;
|
||||
|
@ -20,11 +22,11 @@ import techreborn.init.ModBlocks;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventoryProvider {
|
||||
public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrenchable, IInventoryProvider {
|
||||
|
||||
// TODO: run this off config
|
||||
public static final int euTick = 8;
|
||||
public Tank tank = new Tank("TileSemifluidGenerator", FluidContainerRegistry.BUCKET_VOLUME * 10, this);
|
||||
public Tank tank = new Tank("TileSemifluidGenerator", 1000 * 10, this);
|
||||
public Inventory inventory = new Inventory(3, "TileSemifluidGenerator", 64, this);
|
||||
Map<String, Integer> fluids = new HashMap<>();
|
||||
|
||||
|
@ -73,42 +75,19 @@ public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrench
|
|||
}
|
||||
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill) {
|
||||
int fill = tank.fill(resource, doFill);
|
||||
tank.compareAndUpdate();
|
||||
return fill;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) {
|
||||
FluidStack drain = tank.drain(resource.amount, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) {
|
||||
FluidStack drain = tank.drain(maxDrain, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid) {
|
||||
if (fluid != null) {
|
||||
return fluids.containsKey(FluidRegistry.getFluidName(fluid));
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid) {
|
||||
return tank.getFluid() == null || tank.getFluid().getFluid() == fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from) {
|
||||
return new FluidTankInfo[] { tank.getInfo() };
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return (T) tank;
|
||||
}
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -135,7 +114,7 @@ public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrench
|
|||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!world.isRemote)
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
FluidUtils.drainContainers(tank, inventory, 0, 1);
|
||||
|
||||
if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick && tank.getFluidType() != null && fluids.containsKey(tank.getFluidType().getName())) {
|
||||
Integer euPerBucket = fluids.get(tank.getFluidType().getName());
|
||||
|
|
|
@ -8,7 +8,9 @@ import net.minecraft.network.NetworkManager;
|
|||
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.IWrenchable;
|
||||
|
@ -20,10 +22,10 @@ import reborncore.common.util.Tank;
|
|||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventoryProvider {
|
||||
public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchable, IInventoryProvider {
|
||||
|
||||
public static final int euTick = ConfigTechReborn.ThermalGeneratorOutput;
|
||||
public Tank tank = new Tank("TileThermalGenerator", FluidContainerRegistry.BUCKET_VOLUME * 10, this);
|
||||
public Tank tank = new Tank("TileThermalGenerator", 1000 * 10, this);
|
||||
public Inventory inventory = new Inventory(3, "TileThermalGenerator", 64, this);
|
||||
|
||||
public TileThermalGenerator() {
|
||||
|
@ -56,44 +58,19 @@ public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchab
|
|||
}
|
||||
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill) {
|
||||
int fill = tank.fill(resource, doFill);
|
||||
tank.compareAndUpdate();
|
||||
return fill;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) {
|
||||
FluidStack drain = tank.drain(resource.amount, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) {
|
||||
FluidStack drain = tank.drain(maxDrain, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid) {
|
||||
if (fluid != null) {
|
||||
if (fluid == FluidRegistry.LAVA) {
|
||||
return true;
|
||||
}
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid) {
|
||||
return tank.getFluid() == null || tank.getFluid().getFluid() == fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from) {
|
||||
return new FluidTankInfo[] { tank.getInfo() };
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return (T) tank;
|
||||
}
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -121,7 +98,7 @@ public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchab
|
|||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!world.isRemote) {
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
FluidUtils.drainContainers(tank, inventory, 0, 1);
|
||||
for (EnumFacing direction : EnumFacing.values()) {
|
||||
if (world.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),
|
||||
getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ()))
|
||||
|
|
|
@ -9,7 +9,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
|
@ -31,7 +33,7 @@ import static techreborn.tiles.multiblock.MultiblockChecker.CASING_REINFORCED;
|
|||
import static techreborn.tiles.multiblock.MultiblockChecker.ZERO_OFFSET;
|
||||
|
||||
public class TileIndustrialGrinder extends TilePowerAcceptor
|
||||
implements IWrenchable, IFluidHandler, IInventoryProvider, ISidedInventory, ITileRecipeHandler<IndustrialGrinderRecipe>, IRecipeCrafterProvider {
|
||||
implements IWrenchable, IInventoryProvider, ISidedInventory, ITileRecipeHandler<IndustrialGrinderRecipe>, IRecipeCrafterProvider {
|
||||
public static final int TANK_CAPACITY = 16000;
|
||||
|
||||
public Inventory inventory = new Inventory(6, "TileGrinder", 64, this);
|
||||
|
@ -100,7 +102,7 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
if (getMutliBlock()) {
|
||||
crafter.updateEntity();
|
||||
}
|
||||
FluidUtils.drainContainers(this, inventory, 1, 5);
|
||||
FluidUtils.drainContainers(tank, inventory, 1, 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -128,48 +130,20 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
super.onChunkUnload();
|
||||
}
|
||||
|
||||
/* IFluidHandler */
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill) {
|
||||
if (resource.getFluid() == FluidRegistry.WATER || resource.getFluid() == ModFluids.fluidMercury
|
||||
|| resource.getFluid() == ModFluids.fluidSodiumpersulfate) {
|
||||
int filled = tank.fill(resource, doFill);
|
||||
tank.compareAndUpdate();
|
||||
return filled;
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return true;
|
||||
}
|
||||
return 0;
|
||||
return super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) {
|
||||
if (resource == null || !resource.isFluidEqual(tank.getFluid())) {
|
||||
return null;
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return (T) tank;
|
||||
}
|
||||
FluidStack fluidStack = tank.drain(resource.amount, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return fluidStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) {
|
||||
FluidStack drained = tank.drain(maxDrain, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drained;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid) {
|
||||
return fluid == FluidRegistry.WATER || fluid == ModFluids.fluidMercury || fluid == ModFluids.fluidSodiumpersulfate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from) {
|
||||
return new FluidTankInfo[] { tank.getInfo() };
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
// ISidedInventory
|
||||
|
|
|
@ -9,7 +9,9 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
|
@ -29,7 +31,7 @@ import static techreborn.tiles.multiblock.MultiblockChecker.CASING_NORMAL;
|
|||
import static techreborn.tiles.multiblock.MultiblockChecker.CASING_REINFORCED;
|
||||
import static techreborn.tiles.multiblock.MultiblockChecker.ZERO_OFFSET;
|
||||
|
||||
public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventoryProvider, ISidedInventory, IListInfoProvider {
|
||||
public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrenchable, IInventoryProvider, ISidedInventory, IListInfoProvider {
|
||||
|
||||
public Inventory inventory = new Inventory(5, "Sawmill", 64, this);
|
||||
public Tank tank = new Tank("Sawmill", 16000, this);
|
||||
|
@ -57,8 +59,9 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
canUseEnergy(128.0F) &&
|
||||
!tank.isEmpty() &&
|
||||
tank.getFluid().amount >= 1000) {
|
||||
if (--wood.getCount() == 0)
|
||||
setInventorySlotContents(0, null);
|
||||
wood.shrink(1);
|
||||
if (wood.getCount() == 0)
|
||||
setInventorySlotContents(0, ItemStack.EMPTY);
|
||||
tank.drain(1000, true);
|
||||
useEnergy(128.0F);
|
||||
tickTime = 1;
|
||||
|
@ -79,13 +82,13 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
tickTime = 0;
|
||||
}
|
||||
}
|
||||
FluidUtils.drainContainers(this, inventory, 1, 4);
|
||||
FluidUtils.drainContainers(tank, inventory, 1, 4);
|
||||
}
|
||||
|
||||
public void addOutput(int slot, ItemStack stack) {
|
||||
if (getStackInSlot(slot) == null)
|
||||
setInventorySlotContents(slot, stack);
|
||||
getStackInSlot(slot).getCount() += stack.getCount();
|
||||
getStackInSlot(slot).grow(stack.getCount());
|
||||
}
|
||||
|
||||
public boolean canAddOutput(int slot, int amount) {
|
||||
|
@ -148,48 +151,20 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
return tagCompound;
|
||||
}
|
||||
|
||||
/* IFluidHandler */
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill) {
|
||||
if (resource.getFluid() == FluidRegistry.WATER || resource.getFluid() == ModFluids.fluidMercury
|
||||
|| resource.getFluid() == ModFluids.fluidSodiumpersulfate) {
|
||||
int filled = tank.fill(resource, doFill);
|
||||
tank.compareAndUpdate();
|
||||
return filled;
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return true;
|
||||
}
|
||||
return 0;
|
||||
return super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) {
|
||||
if (resource == null || !resource.isFluidEqual(tank.getFluid())) {
|
||||
return null;
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
return (T) tank;
|
||||
}
|
||||
FluidStack fluidStack = tank.drain(resource.amount, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return fluidStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) {
|
||||
FluidStack drained = tank.drain(maxDrain, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drained;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid) {
|
||||
return fluid == FluidRegistry.WATER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from) {
|
||||
return new FluidTankInfo[] { tank.getInfo() };
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -80,7 +80,7 @@ public class TileRecycler extends TilePowerAcceptor implements IWrenchable, IInv
|
|||
} else if (getStackInSlot(output).isItemEqual(itemstack)) {
|
||||
useEnergy(cost);
|
||||
if (randomchance == 1) {
|
||||
getStackInSlot(output).getCount() += itemstack.getCount();
|
||||
getStackInSlot(output).setCount(itemstack.getCount());
|
||||
}
|
||||
}
|
||||
if (getStackInSlot(input1).getCount() > 1) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package techreborn.utils;
|
||||
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.core.item.tool.ItemToolWrench;
|
||||
//import ic2.core.item.tool.ItemToolWrench;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
|
@ -10,22 +10,25 @@ import net.minecraft.util.EnumHand;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
//TODO IC2
|
||||
public class IC2WrenchHelper {
|
||||
|
||||
static ItemToolWrench wrench;
|
||||
//static ItemToolWrench wrench;
|
||||
|
||||
public static EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos,
|
||||
EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) {
|
||||
if (wrench == null) {
|
||||
wrench = (ItemToolWrench) IC2Items.getItem("wrench").getItem();
|
||||
}
|
||||
return wrench.onItemUseFirst(stack, player, world, pos, side, hitX, hitY, hitZ, hand);
|
||||
// if (wrench == null) {
|
||||
// wrench = (ItemToolWrench) IC2Items.getItem("wrench").getItem();
|
||||
// }
|
||||
// return wrench.onItemUseFirst(stack, player, world, pos, side, hitX, hitY, hitZ, hand);
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
public static EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||
if (wrench == null) {
|
||||
wrench = (ItemToolWrench) IC2Items.getItem("wrench").getItem();
|
||||
}
|
||||
return wrench.onItemUse(stack, playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ);
|
||||
// if (wrench == null) {
|
||||
// wrench = (ItemToolWrench) IC2Items.getItem("wrench").getItem();
|
||||
// }
|
||||
// return wrench.onItemUse(stack, playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ);
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue