Now comes the grind, 244 errors left
This commit is contained in:
parent
7f920b282f
commit
9a40abbe78
220 changed files with 2053 additions and 2052 deletions
421
ToAddBack/1.9/CableMultipart.java
Normal file
421
ToAddBack/1.9/CableMultipart.java
Normal file
|
@ -0,0 +1,421 @@
|
|||
package techreborn.parts;
|
||||
|
||||
import mcmultipart.MCMultiPartMod;
|
||||
import mcmultipart.microblock.IMicroblock;
|
||||
import mcmultipart.multipart.ICollidableMultipart;
|
||||
import mcmultipart.multipart.IMultipartContainer;
|
||||
import mcmultipart.multipart.IOccludingPart;
|
||||
import mcmultipart.multipart.ISlottedPart;
|
||||
import mcmultipart.multipart.Multipart;
|
||||
import mcmultipart.multipart.MultipartHelper;
|
||||
import mcmultipart.multipart.OcclusionHelper;
|
||||
import mcmultipart.multipart.PartSlot;
|
||||
import mcmultipart.raytrace.PartMOP;
|
||||
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.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.util.ITickable;
|
||||
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 reborncore.api.power.IEnergyInterfaceTile;
|
||||
import reborncore.common.misc.Functions;
|
||||
import reborncore.common.misc.vecmath.Vecs3dCube;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.parts.walia.IPartWaliaProvider;
|
||||
import techreborn.power.TRPowerNet;
|
||||
import techreborn.utils.damageSources.ElectrialShockSource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 02/03/2016.
|
||||
*/
|
||||
public abstract class CableMultipart extends Multipart implements IOccludingPart, ISlottedPart, ITickable, ICableType, ICollidableMultipart, IPartWaliaProvider {
|
||||
|
||||
public Vecs3dCube[] boundingBoxes = new Vecs3dCube[14];
|
||||
public float center = 0.6F;
|
||||
public float offset = 0.10F;
|
||||
public Map<EnumFacing, BlockPos> connectedSides;
|
||||
public int ticks = 0;
|
||||
public ItemStack stack;
|
||||
|
||||
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<EnumCableType> TYPE = PropertyEnum.create("type", EnumCableType.class);
|
||||
|
||||
public CableMultipart() {
|
||||
connectedSides = new HashMap<>();
|
||||
refreshBounding();
|
||||
}
|
||||
|
||||
public void refreshBounding() {
|
||||
float centerFirst = center - offset;
|
||||
double w = (getCableType().cableThickness / 16) - 0.5;
|
||||
boundingBoxes[6] = new Vecs3dCube(centerFirst - w - 0.03, centerFirst
|
||||
- w - 0.08, centerFirst - w - 0.03, centerFirst + w + 0.08,
|
||||
centerFirst + w + 0.04, centerFirst + w + 0.08);
|
||||
|
||||
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) {
|
||||
super.addCollisionBoxes(mask, list, 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());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSelectionBoxes(List<AxisAlignedBB> list) {
|
||||
super.addSelectionBoxes(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 onRemoved() {
|
||||
super.onRemoved();
|
||||
removeFromNetwork();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnloaded() {
|
||||
super.onUnloaded();
|
||||
removeFromNetwork();
|
||||
}
|
||||
|
||||
@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();
|
||||
findAndJoinNetwork(getWorld(), getPos());
|
||||
}
|
||||
|
||||
public void nearByChange() {
|
||||
checkConnectedSides();
|
||||
for (EnumFacing direction : EnumFacing.VALUES) {
|
||||
BlockPos blockPos = getPos().offset(direction);
|
||||
getWorld().markBlockForUpdate(blockPos);
|
||||
CableMultipart part = getPartFromWorld(getWorld(), blockPos, direction);
|
||||
if (part != null) {
|
||||
part.checkConnectedSides();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CableMultipart 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 CableMultipart) {
|
||||
return (CableMultipart) part;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdded() {
|
||||
nearByChange();
|
||||
}
|
||||
|
||||
public boolean shouldConnectTo(EnumFacing dir) {
|
||||
if (dir != null) {
|
||||
if (internalShouldConnectTo(dir)) {
|
||||
CableMultipart cableMultipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir);
|
||||
if (cableMultipart != null && cableMultipart.internalShouldConnectTo(dir.getOpposite())) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
TileEntity tile = getNeighbourTile(dir);
|
||||
|
||||
if (tile instanceof IEnergyInterfaceTile) {
|
||||
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(), this, boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
CableMultipart cableMultipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir.getOpposite());
|
||||
|
||||
if (cableMultipart != null && cableMultipart.getCableType() == getCableType()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
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 void update() {
|
||||
if (getWorld() != null) {
|
||||
if (getWorld().getTotalWorldTime() % 80 == 0) {
|
||||
checkConnectedSides();
|
||||
}
|
||||
}
|
||||
if (network == null) {
|
||||
this.findAndJoinNetwork(getWorld(), getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@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, getCableType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new ExtendedBlockState(MCMultiPartMod.multipart,
|
||||
new IProperty[]{
|
||||
TYPE
|
||||
},
|
||||
new IUnlistedProperty[]{
|
||||
DOWN,
|
||||
UP,
|
||||
NORTH,
|
||||
SOUTH,
|
||||
WEST,
|
||||
EAST});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getModelPath() {
|
||||
return "techreborn:cable";
|
||||
}
|
||||
|
||||
@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.cables, 1, getCableType().ordinal()));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onEntityCollided(Entity entity) {
|
||||
if (getCableType().canKill && entity instanceof EntityLivingBase) {
|
||||
if(ConfigTechReborn.UninsulatedElectocutionDamage){
|
||||
entity.attackEntityFrom(new ElectrialShockSource(), 1F);
|
||||
}
|
||||
if(ConfigTechReborn.UninsulatedElectocutionSound){
|
||||
getWorld().playSoundAtEntity(entity, "techreborn:cable_shock", 0.6F, 1F);
|
||||
}
|
||||
if(ConfigTechReborn.UninsulatedElectocutionParticle){
|
||||
getWorld().spawnParticle(EnumParticleTypes.CRIT, entity.posX, entity.posY, entity.posZ, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityStanding(Entity entity) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(EntityPlayer player, PartMOP hit) {
|
||||
return new ItemStack(TechRebornParts.cables, 1, getCableType().ordinal());
|
||||
}
|
||||
|
||||
private TRPowerNet network;
|
||||
|
||||
public final void findAndJoinNetwork(World world, BlockPos pos) {
|
||||
for (EnumFacing dir : EnumFacing.VALUES) {
|
||||
CableMultipart cableMultipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir);
|
||||
if (cableMultipart != null && cableMultipart.getCableType() == getCableType()) {
|
||||
TRPowerNet net = cableMultipart.getNetwork();
|
||||
if (net != null) {
|
||||
network = net;
|
||||
network.addElement(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(network == null){
|
||||
network = new TRPowerNet(getCableType());
|
||||
network.addElement(this);
|
||||
}
|
||||
network.endpoints.clear();
|
||||
for (EnumFacing dir : EnumFacing.VALUES) {
|
||||
TileEntity te = getNeighbourTile(dir);
|
||||
if (te != null && te instanceof IEnergyInterfaceTile) {
|
||||
network.addConnection((IEnergyInterfaceTile) te, dir.getOpposite());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final TRPowerNet getNetwork() {
|
||||
return network;
|
||||
}
|
||||
|
||||
public final void setNetwork(TRPowerNet n) {
|
||||
if (n == null) {
|
||||
} else {
|
||||
network = n;
|
||||
network.addElement(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final void removeFromNetwork() {
|
||||
if (network == null) {
|
||||
} else
|
||||
network.removeElement(this);
|
||||
}
|
||||
|
||||
public final void rebuildNetwork() {
|
||||
this.removeFromNetwork();
|
||||
this.resetNetwork();
|
||||
this.findAndJoinNetwork(getWorld(), getPos());
|
||||
}
|
||||
|
||||
public final void resetNetwork() {
|
||||
if(network != null){
|
||||
network.removeElement(this);
|
||||
}
|
||||
|
||||
network = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInfo(List<String> info) {
|
||||
info.add(EnumChatFormatting.GREEN + "EU Transfer: " + EnumChatFormatting.LIGHT_PURPLE + getCableType().transferRate);
|
||||
if (getCableType().canKill) {
|
||||
info.add(EnumChatFormatting.RED + "Damages entity's!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(EnumWorldBlockLayer layer) {
|
||||
return layer == EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
}
|
35
ToAddBack/1.9/ClientPartModelBakery.java
Normal file
35
ToAddBack/1.9/ClientPartModelBakery.java
Normal file
|
@ -0,0 +1,35 @@
|
|||
package techreborn.client.render.parts;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
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.EnumCableType;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 04/03/2016.
|
||||
*/
|
||||
public class ClientPartModelBakery {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onModelBake(ModelBakeEvent event){
|
||||
for(EnumCableType type : EnumCableType.values()){
|
||||
event.modelRegistry.putObject(new ModelResourceLocation("techreborn:cable#type=" + type.getName().toLowerCase()), new RenderCablePart(type));
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void textureStichEvent(TextureStitchEvent event){
|
||||
for(EnumCableType type : EnumCableType.values()){
|
||||
event.map.registerSprite(new ResourceLocation(type.textureName));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
89
ToAddBack/1.9/ItemCables.java
Normal file
89
ToAddBack/1.9/ItemCables.java
Normal file
|
@ -0,0 +1,89 @@
|
|||
package techreborn.parts;
|
||||
|
||||
import mcmultipart.item.ItemMultiPart;
|
||||
import mcmultipart.multipart.IMultipart;
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.RebornCore;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 27/02/2016.
|
||||
*/
|
||||
public class ItemCables extends ItemMultiPart implements ITexturedItem {
|
||||
|
||||
public ItemCables() {
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setHasSubtypes(true);
|
||||
setUnlocalizedName("techreborn.cable");
|
||||
setNoRepair();
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
ItemStandaloneCables.mcPartCable = this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMultipart createPart(World world, BlockPos pos, EnumFacing side, Vec3 hit, ItemStack stack, EntityPlayer player) {
|
||||
try {
|
||||
return TechRebornParts.multipartHashMap.get(EnumCableType.values()[stack.getItemDamage()]).newInstance();
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
// gets Unlocalized Name depending on meta data
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
int meta = itemStack.getItemDamage();
|
||||
if (meta < 0 || meta >= EnumCableType.values().length) {
|
||||
meta = 0;
|
||||
}
|
||||
|
||||
return super.getUnlocalizedName() + "." + EnumCableType.values()[meta];
|
||||
}
|
||||
|
||||
// Adds Dusts SubItems To Creative Tab
|
||||
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
|
||||
for (int meta = 0; meta < EnumCableType.values().length; ++meta) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return ModInfo.MOD_ID + ":items/cables/" + EnumCableType.values()[damage];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return EnumCableType.values().length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
|
||||
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
EnumCableType type = EnumCableType.values()[stack.getItemDamage()];
|
||||
tooltip.add(EnumChatFormatting.GREEN + "EU Transfer: " + EnumChatFormatting.LIGHT_PURPLE + type.transferRate);
|
||||
if (type.canKill) {
|
||||
tooltip.add(EnumChatFormatting.RED + "Damages entity's!");
|
||||
}
|
||||
tooltip.add(EnumChatFormatting.GREEN + "Tier: " + EnumChatFormatting.LIGHT_PURPLE + type.tier);
|
||||
}
|
||||
}
|
119
ToAddBack/1.9/RenderCablePart.java
Normal file
119
ToAddBack/1.9/RenderCablePart.java
Normal file
|
@ -0,0 +1,119 @@
|
|||
package techreborn.client.render.parts;
|
||||
|
||||
import mcmultipart.client.multipart.ISmartMultipartModel;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.BlockFaceUV;
|
||||
import net.minecraft.client.renderer.block.model.BlockPartFace;
|
||||
import net.minecraft.client.renderer.block.model.FaceBakery;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.client.resources.model.ModelRotation;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import org.lwjgl.util.vector.Vector3f;
|
||||
import reborncore.common.misc.vecmath.Vecs3dCube;
|
||||
import techreborn.parts.CableMultipart;
|
||||
import techreborn.parts.EnumCableType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class RenderCablePart implements ISmartMultipartModel {
|
||||
|
||||
private FaceBakery faceBakery = new FaceBakery();
|
||||
|
||||
private TextureAtlasSprite texture;
|
||||
|
||||
EnumCableType type;
|
||||
|
||||
IExtendedBlockState state;
|
||||
|
||||
public RenderCablePart(IExtendedBlockState state, EnumCableType type) {
|
||||
this(type);
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public RenderCablePart(EnumCableType type) {
|
||||
texture = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(type.textureName);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBakedModel handlePartState(IBlockState state) {
|
||||
return new RenderCablePart((IExtendedBlockState) state, type);
|
||||
}
|
||||
|
||||
public void addCubeToList(Vecs3dCube cube, ArrayList<BakedQuad> list, BlockPartFace face, ModelRotation modelRotation, TextureAtlasSprite cubeTexture) {
|
||||
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> getFaceQuads(EnumFacing p_177551_1_) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getGeneralQuads() {
|
||||
ArrayList<BakedQuad> list = new ArrayList<BakedQuad>();
|
||||
BlockFaceUV uv = new BlockFaceUV(new float[]{0.0F, 0.0F, 16.0F, 16.0F}, 0);
|
||||
BlockPartFace face = new BlockPartFace(null, 0, "", uv);
|
||||
double thickness = type.cableThickness;
|
||||
double lastThickness = 16 - thickness;
|
||||
addCubeToList(new Vecs3dCube(thickness, thickness, thickness, lastThickness, lastThickness, lastThickness), list, face, ModelRotation.X0_Y0, texture);
|
||||
if (state != null) {
|
||||
if (state.getValue(CableMultipart.UP)) {
|
||||
addCubeToList(new Vecs3dCube(thickness, lastThickness, thickness, lastThickness, 16.0, lastThickness), list, face, ModelRotation.X0_Y0, texture);
|
||||
}
|
||||
if (state.getValue(CableMultipart.DOWN)) {
|
||||
addCubeToList(new Vecs3dCube(thickness, 0.0, thickness, lastThickness, thickness, lastThickness), list, face, ModelRotation.X0_Y0, texture);
|
||||
}
|
||||
if (state.getValue(CableMultipart.NORTH)) {
|
||||
addCubeToList(new Vecs3dCube(thickness, thickness, 0.0, lastThickness, lastThickness, lastThickness), list, face, ModelRotation.X0_Y0, texture);
|
||||
}
|
||||
if (state.getValue(CableMultipart.SOUTH)) {
|
||||
addCubeToList(new Vecs3dCube(thickness, thickness, thickness, lastThickness, lastThickness, 16.0), list, face, ModelRotation.X0_Y0, texture);
|
||||
}
|
||||
if (state.getValue(CableMultipart.EAST)) {
|
||||
addCubeToList(new Vecs3dCube(thickness, thickness, thickness, 16.0, lastThickness, lastThickness), list, face, ModelRotation.X0_Y0, texture);
|
||||
}
|
||||
if (state.getValue(CableMultipart.WEST)) {
|
||||
addCubeToList(new Vecs3dCube(0.0, thickness, thickness, lastThickness, lastThickness, lastThickness), list, face, ModelRotation.X0_Y0, texture);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAmbientOcclusion() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
50
ToAddBack/1.9/TechRebornParts.java
Normal file
50
ToAddBack/1.9/TechRebornParts.java
Normal file
|
@ -0,0 +1,50 @@
|
|||
package techreborn.parts;
|
||||
|
||||
import mcmultipart.multipart.MultipartRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 02/03/2016.
|
||||
*/
|
||||
public class TechRebornParts implements ICompatModule {
|
||||
|
||||
@Nullable
|
||||
public static Item cables;
|
||||
|
||||
public static HashMap<EnumCableType, Class<? extends CableMultipart>> multipartHashMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
for (EnumCableType cableType : EnumCableType.values()) {
|
||||
multipartHashMap.put(cableType, cableType.cableClass);
|
||||
MultipartRegistry.registerPart(cableType.cableClass, "techreborn:cable." + cableType.name());
|
||||
}
|
||||
cables = new ItemCables();
|
||||
GameRegistry.registerItem(cables, "cables");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
68
ToAddBack/1.9/jei/BaseRecipeWrapper.java
Normal file
68
ToAddBack/1.9/jei/BaseRecipeWrapper.java
Normal file
|
@ -0,0 +1,68 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
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.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<List<ItemStack>> getInputs() {
|
||||
return inputs;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return baseRecipe.getOutputs();
|
||||
}
|
||||
}
|
24
ToAddBack/1.9/jei/RecipeCategoryUids.java
Normal file
24
ToAddBack/1.9/jei/RecipeCategoryUids.java
Normal file
|
@ -0,0 +1,24 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
public class RecipeCategoryUids {
|
||||
private 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 INDUSTRIAL_SAWMILL = "TechReborn.IndustrialSawmill";
|
||||
public static final String ROLLING_MACHINE = "TechReborn.RollingMachine";
|
||||
public static final String VACUUM_FREEZER = "TechReborn.VacuumFreezer";
|
||||
public static final String GRINDER = "TechReborn.Grinder";
|
||||
public static final String EXTRACTOR = "TechReborn.Extractor";
|
||||
public static final String COMPRESSOR = "TechReborn.Compressor";
|
||||
public static final String SCRAPBOX = "TechReborn.Scrapbox";
|
||||
public static final String RECYCLER = "TechReborn.Recycler";
|
||||
}
|
90
ToAddBack/1.9/jei/RecipeUtil.java
Normal file
90
ToAddBack/1.9/jei/RecipeUtil.java
Normal file
|
@ -0,0 +1,90 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
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 = StatCollector.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 = StatCollector.translateToLocalFormatted("techreborn.jei.recipe.running.cost", euPerTick);
|
||||
fontRendererObj.drawString(runningCostString, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
String processingTimeString1 = StatCollector.translateToLocalFormatted("techreborn.jei.recipe.processing.time.1", tickTime);
|
||||
fontRendererObj.drawString(processingTimeString1, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
int seconds = tickTime / 20;
|
||||
String processingTimeString2 = StatCollector.translateToLocalFormatted("techreborn.jei.recipe.processing.time.2", seconds);
|
||||
fontRendererObj.drawString(processingTimeString2, x + 10, y, color);
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
224
ToAddBack/1.9/jei/TechRebornJeiPlugin.java
Normal file
224
ToAddBack/1.9/jei/TechRebornJeiPlugin.java
Normal file
|
@ -0,0 +1,224 @@
|
|||
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.StatCollector;
|
||||
import techreborn.Core;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.client.container.ContainerAlloyFurnace;
|
||||
import techreborn.client.container.ContainerAlloySmelter;
|
||||
import techreborn.client.container.ContainerAssemblingMachine;
|
||||
import techreborn.client.container.ContainerBlastFurnace;
|
||||
import techreborn.client.container.ContainerCentrifuge;
|
||||
import techreborn.client.container.ContainerChemicalReactor;
|
||||
import techreborn.client.container.ContainerCompressor;
|
||||
import techreborn.client.container.ContainerExtractor;
|
||||
import techreborn.client.container.ContainerFusionReactor;
|
||||
import techreborn.client.container.ContainerGrinder;
|
||||
import techreborn.client.container.ContainerImplosionCompressor;
|
||||
import techreborn.client.container.ContainerIndustrialElectrolyzer;
|
||||
import techreborn.client.container.ContainerIndustrialGrinder;
|
||||
import techreborn.client.container.ContainerIndustrialSawmill;
|
||||
import techreborn.client.container.ContainerRollingMachine;
|
||||
import techreborn.client.container.ContainerVacuumFreezer;
|
||||
import techreborn.client.gui.GuiAlloyFurnace;
|
||||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.client.gui.GuiAssemblingMachine;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
import techreborn.client.gui.GuiCentrifuge;
|
||||
import techreborn.client.gui.GuiChemicalReactor;
|
||||
import techreborn.client.gui.GuiCompressor;
|
||||
import techreborn.client.gui.GuiElectricFurnace;
|
||||
import techreborn.client.gui.GuiExtractor;
|
||||
import techreborn.client.gui.GuiFusionReactor;
|
||||
import techreborn.client.gui.GuiGrinder;
|
||||
import techreborn.client.gui.GuiImplosionCompressor;
|
||||
import techreborn.client.gui.GuiIndustrialElectrolyzer;
|
||||
import techreborn.client.gui.GuiIndustrialGrinder;
|
||||
import techreborn.client.gui.GuiIndustrialSawmill;
|
||||
import techreborn.client.gui.GuiIronFurnace;
|
||||
import techreborn.client.gui.GuiRecycler;
|
||||
import techreborn.client.gui.GuiRollingMachine;
|
||||
import techreborn.client.gui.GuiVacuumFreezer;
|
||||
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.industrialSawmill.IndustrialSawmillRecipeCategory;
|
||||
import techreborn.compat.jei.industrialSawmill.IndustrialSawmillRecipeHandler;
|
||||
import techreborn.compat.jei.recycler.RecyclerRecipeCategory;
|
||||
import techreborn.compat.jei.recycler.RecyclerRecipeHandler;
|
||||
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.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 {
|
||||
@Override
|
||||
public void register(@Nonnull IModRegistry registry) {
|
||||
IJeiHelpers jeiHelpers = registry.getJeiHelpers();
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
|
||||
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 IndustrialSawmillRecipeCategory(guiHelper),
|
||||
new RollingMachineRecipeCategory(guiHelper),
|
||||
new VacuumFreezerRecipeCategory(guiHelper),
|
||||
new GrinderRecipeCategory(guiHelper),
|
||||
new ExtractorRecipeCategory(guiHelper),
|
||||
new CompressorRecipeCategory(guiHelper),
|
||||
new ScrapboxRecipeCategory(guiHelper),
|
||||
new RecyclerRecipeCategory(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 IndustrialSawmillRecipeHandler(jeiHelpers),
|
||||
new RollingMachineRecipeHandler(),
|
||||
new VacuumFreezerRecipeHandler(jeiHelpers),
|
||||
new GrinderRecipeHandler(jeiHelpers),
|
||||
new ExtractorRecipeHandler(jeiHelpers),
|
||||
new CompressorRecipeHandler(jeiHelpers),
|
||||
new ScrapboxRecipeHandler(jeiHelpers),
|
||||
new RecyclerRecipeHandler(jeiHelpers)
|
||||
);
|
||||
|
||||
registry.addRecipes(RecipeHandler.recipeList);
|
||||
registry.addRecipes(FusionReactorRecipeHelper.reactorRecipes);
|
||||
|
||||
try {
|
||||
registry.addRecipes(RollingMachineRecipeMaker.getRecipes());
|
||||
} 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"), StatCollector.translateToLocal("techreborn.desc.rubberSap"));
|
||||
if(!ConfigTechReborn.scrapboxDispenser){
|
||||
registry.addDescription(new ItemStack(ModItems.scrapBox), StatCollector.translateToLocal("techreborn.desc.scrapBoxNoDispenser"));
|
||||
} else {
|
||||
registry.addDescription(new ItemStack(ModItems.scrapBox), StatCollector.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(GuiIndustrialSawmill.class, 55, 36, 24, 16, RecipeCategoryUids.INDUSTRIAL_SAWMILL);
|
||||
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, VanillaRecipeCategoryUid.FUEL);
|
||||
registry.addRecipeClickArea(GuiRecycler.class, 78, 36, 24, 16, RecipeCategoryUids.RECYCLER);
|
||||
|
||||
|
||||
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(ContainerIndustrialSawmill.class, RecipeCategoryUids.INDUSTRIAL_SAWMILL, 0, 2, 5, 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);
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package techreborn.compat.jei.alloySmelter;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlloySmelterRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 drawAnimations(@Nonnull Minecraft minecraft) {
|
||||
electricity.draw(minecraft, 10, 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper 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);
|
||||
|
||||
if (recipeWrapper instanceof AlloySmelterRecipeWrapper) {
|
||||
AlloySmelterRecipeWrapper recipe = (AlloySmelterRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull AlloySmelterRecipe recipe) {
|
||||
return new AlloySmelterRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AlloySmelterRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package techreborn.compat.jei.assemblingMachine;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiAssemblingMachine;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AssemblingMachineRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 drawAnimations(@Nonnull Minecraft minecraft) {
|
||||
electricity.draw(minecraft, 10, 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper 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);
|
||||
|
||||
if (recipeWrapper instanceof AssemblingMachineRecipeWrapper) {
|
||||
AssemblingMachineRecipeWrapper recipe = (AssemblingMachineRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull AssemblingMachineRecipe recipe) {
|
||||
return new AssemblingMachineRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AssemblingMachineRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlastFurnaceRecipeCategory extends BlankRecipeCategory {
|
||||
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, 100, 36);
|
||||
title = StatCollector.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 IRecipeWrapper 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);
|
||||
|
||||
if (recipeWrapper instanceof BlastFurnaceRecipeWrapper) {
|
||||
BlastFurnaceRecipeWrapper recipe = (BlastFurnaceRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull BlastFurnaceRecipe recipe) {
|
||||
return new BlastFurnaceRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull BlastFurnaceRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
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);
|
||||
}
|
||||
}
|
62
ToAddBack/1.9/jei/centrifuge/CentrifugeRecipeCategory.java
Normal file
62
ToAddBack/1.9/jei/centrifuge/CentrifugeRecipeCategory.java
Normal file
|
@ -0,0 +1,62 @@
|
|||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiCentrifuge;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CentrifugeRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 IRecipeWrapper 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);
|
||||
|
||||
if (recipeWrapper instanceof CentrifugeRecipeWrapper) {
|
||||
CentrifugeRecipeWrapper recipe = (CentrifugeRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
41
ToAddBack/1.9/jei/centrifuge/CentrifugeRecipeHandler.java
Normal file
41
ToAddBack/1.9/jei/centrifuge/CentrifugeRecipeHandler.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull CentrifugeRecipe recipe) {
|
||||
return new CentrifugeRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull CentrifugeRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
43
ToAddBack/1.9/jei/centrifuge/CentrifugeRecipeWrapper.java
Normal file
43
ToAddBack/1.9/jei/centrifuge/CentrifugeRecipeWrapper.java
Normal file
|
@ -0,0 +1,43 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiChemicalReactor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ChemicalReactorRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 IRecipeWrapper 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);
|
||||
|
||||
if (recipeWrapper instanceof ChemicalReactorRecipeWrapper) {
|
||||
ChemicalReactorRecipeWrapper recipe = (ChemicalReactorRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull ChemicalReactorRecipe recipe) {
|
||||
return new ChemicalReactorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ChemicalReactorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
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);
|
||||
}
|
||||
}
|
58
ToAddBack/1.9/jei/compressor/CompressorRecipeCategory.java
Normal file
58
ToAddBack/1.9/jei/compressor/CompressorRecipeCategory.java
Normal file
|
@ -0,0 +1,58 @@
|
|||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiCompressor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompressorRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
if (recipeWrapper instanceof CompressorRecipeWrapper) {
|
||||
CompressorRecipeWrapper recipe = (CompressorRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
41
ToAddBack/1.9/jei/compressor/CompressorRecipeHandler.java
Normal file
41
ToAddBack/1.9/jei/compressor/CompressorRecipeHandler.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull CompressorRecipe recipe) {
|
||||
return new CompressorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull CompressorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
31
ToAddBack/1.9/jei/compressor/CompressorRecipeWrapper.java
Normal file
31
ToAddBack/1.9/jei/compressor/CompressorRecipeWrapper.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
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);
|
||||
}
|
||||
}
|
58
ToAddBack/1.9/jei/extractor/ExtractorRecipeCategory.java
Normal file
58
ToAddBack/1.9/jei/extractor/ExtractorRecipeCategory.java
Normal file
|
@ -0,0 +1,58 @@
|
|||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiExtractor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ExtractorRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
if (recipeWrapper instanceof ExtractorRecipeWrapper) {
|
||||
ExtractorRecipeWrapper recipe = (ExtractorRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
41
ToAddBack/1.9/jei/extractor/ExtractorRecipeHandler.java
Normal file
41
ToAddBack/1.9/jei/extractor/ExtractorRecipeHandler.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull ExtractorRecipe recipe) {
|
||||
return new ExtractorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ExtractorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
31
ToAddBack/1.9/jei/extractor/ExtractorRecipeWrapper.java
Normal file
31
ToAddBack/1.9/jei/extractor/ExtractorRecipeWrapper.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiFusionReactor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class FusionReactorRecipeCategory extends BlankRecipeCategory {
|
||||
|
||||
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 = StatCollector.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 IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
itemStacks.init(inputSlotTop, true, 21, 0);
|
||||
itemStacks.init(inputSlotBottom, true, 21, 36);
|
||||
itemStacks.init(outputSlot, false, 81, 18);
|
||||
|
||||
if (recipeWrapper instanceof FusionReactorRecipeWrapper) {
|
||||
FusionReactorRecipeWrapper fusionRecipe = (FusionReactorRecipeWrapper) recipeWrapper;
|
||||
itemStacks.set(inputSlotTop, fusionRecipe.getTopInput());
|
||||
itemStacks.set(inputSlotBottom, fusionRecipe.getBottomInput());
|
||||
itemStacks.set(outputSlot, fusionRecipe.getOutputs());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull FusionReactorRecipe recipe) {
|
||||
return new FusionReactorRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull FusionReactorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package techreborn.compat.jei.fusionReactor;
|
||||
|
||||
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
|
||||
@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());
|
||||
}
|
||||
}
|
58
ToAddBack/1.9/jei/grinder/GrinderRecipeCategory.java
Normal file
58
ToAddBack/1.9/jei/grinder/GrinderRecipeCategory.java
Normal file
|
@ -0,0 +1,58 @@
|
|||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiGrinder;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class GrinderRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
if (recipeWrapper instanceof GrinderRecipeWrapper) {
|
||||
GrinderRecipeWrapper recipe = (GrinderRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
41
ToAddBack/1.9/jei/grinder/GrinderRecipeHandler.java
Normal file
41
ToAddBack/1.9/jei/grinder/GrinderRecipeHandler.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull GrinderRecipe recipe) {
|
||||
return new GrinderRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull GrinderRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
31
ToAddBack/1.9/jei/grinder/GrinderRecipeWrapper.java
Normal file
31
ToAddBack/1.9/jei/grinder/GrinderRecipeWrapper.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package techreborn.compat.jei.implosionCompressor;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiImplosionCompressor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ImplosionCompressorRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 IRecipeWrapper 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);
|
||||
|
||||
if (recipeWrapper instanceof ImplosionCompressorRecipeWrapper) {
|
||||
ImplosionCompressorRecipeWrapper recipe = (ImplosionCompressorRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull ImplosionCompressorRecipe recipe) {
|
||||
return new ImplosionCompressorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ImplosionCompressorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiIndustrialElectrolyzer;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 IRecipeWrapper 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);
|
||||
|
||||
if (recipeWrapper instanceof IndustrialElectrolyzerRecipeWrapper) {
|
||||
IndustrialElectrolyzerRecipeWrapper recipe = (IndustrialElectrolyzerRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialElectrolyzerRecipe recipe) {
|
||||
return new IndustrialElectrolyzerRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull IndustrialElectrolyzerRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiIndustrialGrinder;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.tiles.TileIndustrialGrinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialGrinderRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 IRecipeWrapper 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);
|
||||
|
||||
if (recipeWrapper instanceof IndustrialGrinderRecipeWrapper) {
|
||||
IndustrialGrinderRecipeWrapper recipe = (IndustrialGrinderRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialGrinderRecipe recipe) {
|
||||
return new IndustrialGrinderRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull IndustrialGrinderRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package techreborn.compat.jei.industrialSawmill;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiIndustrialSawmill;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.tiles.TileIndustrialSawmill;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory {
|
||||
private static final int[] INPUT_SLOTS = {0, 1};
|
||||
private static final int[] OUTPUT_SLOTS = {2, 3, 4};
|
||||
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 IndustrialSawmillRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 7, 15, 141, 55);
|
||||
blankArea = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 50, 45, 6, 6);
|
||||
tankOverlay = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 176, 83, 12, 47);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.industrialsawmill.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(@Nonnull Minecraft minecraft) {
|
||||
blankArea.draw(minecraft, 31, 51);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper 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, 76, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 112, 19);
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialSawmill.TANK_CAPACITY, true, tankOverlay);
|
||||
|
||||
if (recipeWrapper instanceof IndustrialSawmillRecipeWrapper) {
|
||||
IndustrialSawmillRecipeWrapper recipe = (IndustrialSawmillRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package techreborn.compat.jei.industrialSawmill;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialSawmillRecipeHandler implements IRecipeHandler<IndustrialSawmillRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public IndustrialSawmillRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<IndustrialSawmillRecipe> getRecipeClass() {
|
||||
return IndustrialSawmillRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialSawmillRecipe recipe) {
|
||||
return new IndustrialSawmillRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull IndustrialSawmillRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package techreborn.compat.jei.industrialSawmill;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.client.gui.GuiIndustrialSawmill;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper<IndustrialSawmillRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public IndustrialSawmillRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull IndustrialSawmillRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 176, 14, 20, 12);
|
||||
|
||||
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, 49, 23);
|
||||
}
|
||||
}
|
58
ToAddBack/1.9/jei/recycler/RecyclerRecipeCategory.java
Normal file
58
ToAddBack/1.9/jei/recycler/RecyclerRecipeCategory.java
Normal file
|
@ -0,0 +1,58 @@
|
|||
package techreborn.compat.jei.recycler;
|
||||
|
||||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiRecycler;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RecyclerRecipeCategory extends BlankRecipeCategory {
|
||||
private static final int[] INPUT_SLOTS = {0};
|
||||
private static final int[] OUTPUT_SLOTS = {1};
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public RecyclerRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiRecycler.texture, 55, 30, 82, 26);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.recycler.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.RECYCLER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
if (recipeWrapper instanceof RecyclerRecipeWrapper) {
|
||||
RecyclerRecipeWrapper recipe = (RecyclerRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
41
ToAddBack/1.9/jei/recycler/RecyclerRecipeHandler.java
Normal file
41
ToAddBack/1.9/jei/recycler/RecyclerRecipeHandler.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
package techreborn.compat.jei.recycler;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.RecyclerRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RecyclerRecipeHandler implements IRecipeHandler<RecyclerRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public RecyclerRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecyclerRecipe> getRecipeClass() {
|
||||
return RecyclerRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.RECYCLER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull RecyclerRecipe recipe) {
|
||||
return new RecyclerRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull RecyclerRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
31
ToAddBack/1.9/jei/recycler/RecyclerRecipeWrapper.java
Normal file
31
ToAddBack/1.9/jei/recycler/RecyclerRecipeWrapper.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
package techreborn.compat.jei.recycler;
|
||||
|
||||
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.RecyclerRecipe;
|
||||
import techreborn.client.gui.GuiRecycler;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RecyclerRecipeWrapper extends BaseRecipeWrapper<RecyclerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public RecyclerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull RecyclerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiRecycler.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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiRollingMachine;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RollingMachineRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 IRecipeWrapper 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);
|
||||
|
||||
if (recipeWrapper instanceof RollingMachineRecipeWrapper) {
|
||||
RollingMachineRecipeWrapper recipe = (RollingMachineRecipeWrapper) recipeWrapper;
|
||||
craftingGridHelper.setInput(guiItemStacks, recipe.getInputs());
|
||||
craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull RollingMachineRecipeWrapper recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull RollingMachineRecipeWrapper recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RollingMachineRecipeMaker {
|
||||
private RollingMachineRecipeMaker() {
|
||||
|
||||
}
|
||||
|
||||
public static List<Object> getRecipes() {
|
||||
List<Object> recipes = new ArrayList<>();
|
||||
for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList()) {
|
||||
RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(recipe);
|
||||
if (recipeWrapper != null) {
|
||||
recipes.add(recipeWrapper);
|
||||
}
|
||||
}
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
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;
|
||||
|
||||
@Nullable
|
||||
public static RollingMachineRecipeWrapper create(IRecipe baseRecipe) {
|
||||
ICraftingRecipeWrapper recipeWrapper;
|
||||
if (baseRecipe instanceof ShapelessRecipes) {
|
||||
recipeWrapper = new ShapelessRecipesWrapper((ShapelessRecipes) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedRecipes) {
|
||||
recipeWrapper = new ShapedRecipesWrapper((ShapedRecipes) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedOreRecipe) {
|
||||
recipeWrapper = new ShapedOreRecipeWrapper((ShapedOreRecipe) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapelessOreRecipe) {
|
||||
recipeWrapper = new ShapelessOreRecipeWrapper((ShapelessOreRecipe) baseRecipe);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new RollingMachineRecipeWrapper(recipeWrapper);
|
||||
}
|
||||
|
||||
public RollingMachineRecipeWrapper(ICraftingRecipeWrapper baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List getInputs() {
|
||||
return baseRecipe.getInputs();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs() {
|
||||
return baseRecipe.getOutputs();
|
||||
}
|
||||
}
|
58
ToAddBack/1.9/jei/scrapbox/ScrapboxRecipeCategory.java
Normal file
58
ToAddBack/1.9/jei/scrapbox/ScrapboxRecipeCategory.java
Normal file
|
@ -0,0 +1,58 @@
|
|||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiCompressor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ScrapboxRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
if (recipeWrapper instanceof ScrapboxRecipeWrapper) {
|
||||
ScrapboxRecipeWrapper recipe = (ScrapboxRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
41
ToAddBack/1.9/jei/scrapbox/ScrapboxRecipeHandler.java
Normal file
41
ToAddBack/1.9/jei/scrapbox/ScrapboxRecipeHandler.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull ScrapboxRecipe recipe) {
|
||||
return new ScrapboxRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ScrapboxRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
31
ToAddBack/1.9/jei/scrapbox/ScrapboxRecipeWrapper.java
Normal file
31
ToAddBack/1.9/jei/scrapbox/ScrapboxRecipeWrapper.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
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.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.gui.GuiVacuumFreezer;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class VacuumFreezerRecipeCategory extends BlankRecipeCategory {
|
||||
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 = StatCollector.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 IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
if (recipeWrapper instanceof VacuumFreezerRecipeWrapper) {
|
||||
VacuumFreezerRecipeWrapper recipe = (VacuumFreezerRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
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 IRecipeWrapper getRecipeWrapper(@Nonnull VacuumFreezerRecipe recipe) {
|
||||
return new VacuumFreezerRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull VacuumFreezerRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
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);
|
||||
}
|
||||
}
|
43
ToAddBack/1.9/minetweaker/MTAlloySmelter.java
Normal file
43
ToAddBack/1.9/minetweaker/MTAlloySmelter.java
Normal file
|
@ -0,0 +1,43 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
/**
|
||||
* mods.techreborn.alloySmelter.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, <minecraft:diamond>, 20, 100);
|
||||
*/
|
||||
|
||||
@ZenClass("mods.techreborn.alloySmelter")
|
||||
public class MTAlloySmelter extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
AlloySmelterRecipe r = new AlloySmelterRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.alloySmelteRecipe;
|
||||
}
|
||||
}
|
42
ToAddBack/1.9/minetweaker/MTAssemblingMachine.java
Normal file
42
ToAddBack/1.9/minetweaker/MTAssemblingMachine.java
Normal file
|
@ -0,0 +1,42 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
|
||||
@ZenClass("mods.techreborn.assemblingMachine")
|
||||
public class MTAssemblingMachine extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
AssemblingMachineRecipe r = new AssemblingMachineRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.assemblingMachineRecipe;
|
||||
}
|
||||
|
||||
|
||||
}
|
38
ToAddBack/1.9/minetweaker/MTBlastFurnace.java
Normal file
38
ToAddBack/1.9/minetweaker/MTBlastFurnace.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.blastFurnace")
|
||||
public class MTBlastFurnace extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
BlastFurnaceRecipe r = new BlastFurnaceRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), ticktime, euTick, neededHeat);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.blastFurnaceRecipe;
|
||||
}
|
||||
}
|
38
ToAddBack/1.9/minetweaker/MTCentrifuge.java
Normal file
38
ToAddBack/1.9/minetweaker/MTCentrifuge.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.centrifuge")
|
||||
public class MTCentrifuge extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
CentrifugeRecipe r = new CentrifugeRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), MinetweakerCompat.toStack(output3), MinetweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.centrifugeRecipe;
|
||||
}
|
||||
}
|
38
ToAddBack/1.9/minetweaker/MTChemicalReactor.java
Normal file
38
ToAddBack/1.9/minetweaker/MTChemicalReactor.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.chemicalReactorRecipe")
|
||||
public class MTChemicalReactor extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
ChemicalReactorRecipe r = new ChemicalReactorRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.chemicalReactorRecipe;
|
||||
}
|
||||
}
|
237
ToAddBack/1.9/minetweaker/MTFusionReactor.java
Normal file
237
ToAddBack/1.9/minetweaker/MTFusionReactor.java
Normal file
|
@ -0,0 +1,237 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ZenClass("mods.techreborn.fusionReactor")
|
||||
public class MTFusionReactor {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime) {
|
||||
FusionReactorRecipe reactorRecipe = new FusionReactorRecipe((ItemStack) MinetweakerCompat.toObject(topInput), (ItemStack) MinetweakerCompat.toObject(bottomInput), MinetweakerCompat.toStack(output), startEU, euTick, tickTime);
|
||||
MineTweakerAPI.apply(new Add(reactorRecipe));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeTopInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveTopInput(iIngredient));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeBottomInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveTopInput(iIngredient));
|
||||
}
|
||||
|
||||
private static class Add implements IUndoableAction {
|
||||
private final FusionReactorRecipe recipe;
|
||||
|
||||
public Add(FusionReactorRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
FusionReactorRecipeHelper.registerRecipe(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding Fusion Reactor recipe for " + recipe.getOutput().getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Removing Fusion Reactor recipe for " + recipe.getOutput().getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output)));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
if (ItemUtils.isItemEqual(recipeType.getOutput(), output, true, false)) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if (removedRecipes != null) {
|
||||
for (FusionReactorRecipe recipe : removedRecipes) {
|
||||
if (recipe != null) {
|
||||
FusionReactorRecipeHelper.registerRecipe(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Fusion Reactor recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class RemoveTopInput implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
|
||||
|
||||
public RemoveTopInput(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(recipeType.getTopInput()))) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if (removedRecipes != null) {
|
||||
for (FusionReactorRecipe recipe : removedRecipes) {
|
||||
if (recipe != null) {
|
||||
FusionReactorRecipeHelper.registerRecipe(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Fusion Reactor recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static class RemoveBottomInput implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
|
||||
|
||||
public RemoveBottomInput(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(recipeType.getBottomInput()))) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if (removedRecipes != null) {
|
||||
for (FusionReactorRecipe recipe : removedRecipes) {
|
||||
if (recipe != null) {
|
||||
FusionReactorRecipeHelper.registerRecipe(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Fusion Reactor recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
13
ToAddBack/1.9/minetweaker/MTGenerator.java
Normal file
13
ToAddBack/1.9/minetweaker/MTGenerator.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import reborncore.api.fuel.FluidPowerManager;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
@ZenClass("mods.techreborn.generator")
|
||||
public class MTGenerator {
|
||||
public static void addFluidPower(ILiquidStack fluid, double value){
|
||||
FluidPowerManager.fluidPowerValues.put(MinetweakerCompat.toFluidStack(fluid).getFluid(), value);
|
||||
}
|
||||
|
||||
}
|
175
ToAddBack/1.9/minetweaker/MTGeneric.java
Normal file
175
ToAddBack/1.9/minetweaker/MTGeneric.java
Normal file
|
@ -0,0 +1,175 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MTGeneric {
|
||||
public static String getMachineName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void addRecipe(BaseRecipe recipe) {
|
||||
MineTweakerAPI.apply(new Add(recipe));
|
||||
}
|
||||
|
||||
private static class Add implements IUndoableAction {
|
||||
private final BaseRecipe recipe;
|
||||
|
||||
public Add(BaseRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
RecipeHandler.addRecipe(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
RecipeHandler.recipeList.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding " + recipe.getRecipeName() + " recipe for " + recipe.getOutput(0).getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Removing " + recipe.getRecipeName() + " recipe for " + recipe.getOutput(0).getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
|
||||
private final String name;
|
||||
|
||||
public Remove(ItemStack output, String machineName) {
|
||||
this.output = output;
|
||||
this.name = machineName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if (removedRecipes != null) {
|
||||
for (BaseRecipe recipe : removedRecipes) {
|
||||
if (recipe != null) {
|
||||
RecipeHandler.addRecipe(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + name + " recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding " + name + " recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class RemoveInput implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
|
||||
private final String name;
|
||||
|
||||
public RemoveInput(IIngredient output, String machineName) {
|
||||
this.output = output;
|
||||
this.name = machineName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
|
||||
for (ItemStack stack : recipeType.getInputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if (removedRecipes != null) {
|
||||
for (BaseRecipe recipe : removedRecipes) {
|
||||
if (recipe != null) {
|
||||
RecipeHandler.addRecipe(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + name + " recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding " + name + " recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
39
ToAddBack/1.9/minetweaker/MTImplosionCompressor.java
Normal file
39
ToAddBack/1.9/minetweaker/MTImplosionCompressor.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.implosionCompressor")
|
||||
public class MTImplosionCompressor extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
|
||||
ImplosionCompressorRecipe r = new ImplosionCompressorRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.implosionCompressorRecipe;
|
||||
}
|
||||
}
|
39
ToAddBack/1.9/minetweaker/MTIndustrialElectrolyzer.java
Normal file
39
ToAddBack/1.9/minetweaker/MTIndustrialElectrolyzer.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.industrialElectrolyzer")
|
||||
public class MTIndustrialElectrolyzer extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(cells);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
IndustrialElectrolyzerRecipe r = new IndustrialElectrolyzerRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), MinetweakerCompat.toStack(output3), MinetweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.industrialElectrolyzerRecipe;
|
||||
}
|
||||
}
|
52
ToAddBack/1.9/minetweaker/MTIndustrialGrinder.java
Normal file
52
ToAddBack/1.9/minetweaker/MTIndustrialGrinder.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.grinder")
|
||||
public class MTIndustrialGrinder extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
addRecipe(output1, output2, output3, output4, input1, input2, null, ticktime, euTick);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
FluidStack fluidStack = null;
|
||||
if (fluid != null) {
|
||||
fluidStack = MinetweakerCompat.toFluidStack(fluid);
|
||||
}
|
||||
|
||||
IndustrialGrinderRecipe r = new IndustrialGrinderRecipe(oInput1, oInput2, fluidStack, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), MinetweakerCompat.toStack(output3), MinetweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.industrialGrinderRecipe;
|
||||
}
|
||||
}
|
62
ToAddBack/1.9/minetweaker/MTIndustrialSawmill.java
Normal file
62
ToAddBack/1.9/minetweaker/MTIndustrialSawmill.java
Normal file
|
@ -0,0 +1,62 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.industrialSawmill")
|
||||
public class MTIndustrialSawmill extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) {
|
||||
addRecipe(output1, output2, output3, input1, input2, fluid, ticktime, euTick, true);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
addRecipe(output1, output2, output3, input1, input2, null, ticktime, euTick, true);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, IIngredient input2, int ticktime, int euTick, boolean useOreDic) {
|
||||
addRecipe(output1, output2, output3, input1, input2, null, ticktime, euTick, useOreDic);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
FluidStack fluidStack = null;
|
||||
if (fluid != null) {
|
||||
fluidStack = MinetweakerCompat.toFluidStack(fluid);
|
||||
}
|
||||
|
||||
IndustrialSawmillRecipe r = new IndustrialSawmillRecipe(oInput1, oInput2, fluidStack, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), MinetweakerCompat.toStack(output3), ticktime, euTick, useOreDic);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.industrialSawmillRecipe;
|
||||
}
|
||||
}
|
36
ToAddBack/1.9/minetweaker/MTPlateCuttingMachine.java
Normal file
36
ToAddBack/1.9/minetweaker/MTPlateCuttingMachine.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.PlateCuttingMachineRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.plateCuttingMachine")
|
||||
public class MTPlateCuttingMachine extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
PlateCuttingMachineRecipe r = new PlateCuttingMachineRecipe(oInput1, MinetweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.plateCuttingMachineRecipe;
|
||||
}
|
||||
}
|
116
ToAddBack/1.9/minetweaker/MTRollingMachine.java
Normal file
116
ToAddBack/1.9/minetweaker/MTRollingMachine.java
Normal file
|
@ -0,0 +1,116 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.oredict.IOreDictEntry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
import techreborn.api.TechRebornAPI;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ZenClass("mods.techreborn.rollingMachine")
|
||||
public class MTRollingMachine {
|
||||
|
||||
@ZenMethod
|
||||
public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
|
||||
TechRebornAPI.addRollingOreMachinceRecipe(toStack(output), toShapedObjects(ingredients));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
|
||||
TechRebornAPI.addShapelessOreRollingMachinceRecipe(toStack(output), toObjects(ingredients));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
List<IRecipe> toRemove = new ArrayList<>();
|
||||
for(IRecipe recipe : RollingMachineRecipe.instance.getRecipeList()){
|
||||
if(ItemUtils.isItemEqual(recipe.getRecipeOutput(), MinetweakerCompat.toStack(output), true, false)){
|
||||
toRemove.add(recipe);
|
||||
}
|
||||
}
|
||||
RollingMachineRecipe.instance.getRecipeList().removeAll(toRemove);
|
||||
}
|
||||
|
||||
public static ItemStack toStack(IItemStack iStack) {
|
||||
if (iStack == null) return null;
|
||||
else {
|
||||
Object internal = iStack.getInternal();
|
||||
if (internal == null || !(internal instanceof ItemStack)) {
|
||||
MineTweakerAPI.getLogger().logError("Not a valid item stack: " + iStack);
|
||||
}
|
||||
|
||||
return (ItemStack) internal;
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack[] toStacks(IItemStack[] iStack) {
|
||||
if (iStack == null) return null;
|
||||
else {
|
||||
ItemStack[] output = new ItemStack[iStack.length];
|
||||
for (int i = 0; i < iStack.length; i++) {
|
||||
output[i] = toStack(iStack[i]);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
public static Object toObject(IIngredient iStack) {
|
||||
if (iStack == null) return null;
|
||||
else {
|
||||
if (iStack instanceof IOreDictEntry) {
|
||||
return toString((IOreDictEntry) iStack);
|
||||
} else if (iStack instanceof IItemStack) {
|
||||
return toStack((IItemStack) iStack);
|
||||
} else return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Object[] toObjects(IIngredient[] ingredient) {
|
||||
if (ingredient == null) return null;
|
||||
else {
|
||||
Object[] output = new Object[ingredient.length];
|
||||
for (int i = 0; i < ingredient.length; i++) {
|
||||
if (ingredient[i] != null) {
|
||||
output[i] = toObject(ingredient[i]);
|
||||
} else output[i] = "";
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
public static Object[] toShapedObjects(IIngredient[][] ingredients) {
|
||||
if (ingredients == null) return null;
|
||||
else {
|
||||
ArrayList prep = new ArrayList();
|
||||
prep.add("abc");
|
||||
prep.add("def");
|
||||
prep.add("ghi");
|
||||
char[][] map = new char[][] { { 'a', 'b', 'c' }, { 'd', 'e', 'f' }, { 'g', 'h', 'i' } };
|
||||
for (int x = 0; x < ingredients.length; x++) {
|
||||
if (ingredients[x] != null) {
|
||||
for (int y = 0; y < ingredients[x].length; y++) {
|
||||
if (ingredients[x][y] != null && x < map.length && y < map[x].length) {
|
||||
prep.add(map[x][y]);
|
||||
prep.add(toObject(ingredients[x][y]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return prep.toArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static String toString(IOreDictEntry entry) {
|
||||
return ((IOreDictEntry) entry).getName();
|
||||
}
|
||||
}
|
36
ToAddBack/1.9/minetweaker/MTVacuumFreezer.java
Normal file
36
ToAddBack/1.9/minetweaker/MTVacuumFreezer.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.vacuumFreezer")
|
||||
public class MTVacuumFreezer extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient input, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input);
|
||||
|
||||
VacuumFreezerRecipe r = new VacuumFreezerRecipe(oInput1, MinetweakerCompat.toStack(output), ticktime, euTick);
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.vacuumFreezerRecipe;
|
||||
}
|
||||
}
|
80
ToAddBack/1.9/minetweaker/MinetweakerCompat.java
Normal file
80
ToAddBack/1.9/minetweaker/MinetweakerCompat.java
Normal file
|
@ -0,0 +1,80 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.item.IngredientStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import minetweaker.api.oredict.IOreDictEntry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
import static minetweaker.api.minecraft.MineTweakerMC.getItemStack;
|
||||
import static minetweaker.api.minecraft.MineTweakerMC.getLiquidStack;
|
||||
|
||||
|
||||
public class MinetweakerCompat implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
MineTweakerAPI.registerClass(MTAlloySmelter.class);
|
||||
MineTweakerAPI.registerClass(MTAssemblingMachine.class);
|
||||
MineTweakerAPI.registerClass(MTBlastFurnace.class);
|
||||
MineTweakerAPI.registerClass(MTCentrifuge.class);
|
||||
MineTweakerAPI.registerClass(MTChemicalReactor.class);
|
||||
MineTweakerAPI.registerClass(MTIndustrialGrinder.class);
|
||||
MineTweakerAPI.registerClass(MTImplosionCompressor.class);
|
||||
MineTweakerAPI.registerClass(MTIndustrialElectrolyzer.class);
|
||||
MineTweakerAPI.registerClass(MTIndustrialSawmill.class);
|
||||
MineTweakerAPI.registerClass(MTPlateCuttingMachine.class);
|
||||
MineTweakerAPI.registerClass(MTFusionReactor.class);
|
||||
MineTweakerAPI.registerClass(MTVacuumFreezer.class);
|
||||
MineTweakerAPI.registerClass(MTGenerator.class);
|
||||
MineTweakerAPI.registerClass(MTRollingMachine.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
public static ItemStack toStack(IItemStack iStack) {
|
||||
return getItemStack(iStack);
|
||||
}
|
||||
|
||||
public static Object toObject(IIngredient iStack) {
|
||||
if (iStack == null)
|
||||
return null;
|
||||
else {
|
||||
if (iStack instanceof IOreDictEntry)
|
||||
return ((IOreDictEntry) iStack).getName();
|
||||
else if (iStack instanceof IItemStack)
|
||||
return getItemStack((IItemStack) iStack);
|
||||
else if (iStack instanceof IngredientStack) {
|
||||
IIngredient ingr = ReflectionHelper.getPrivateValue(IngredientStack.class, (IngredientStack) iStack, "ingredient");
|
||||
return toObject(ingr);
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static FluidStack toFluidStack(ILiquidStack iStack) {
|
||||
return getLiquidStack(iStack);
|
||||
}
|
||||
|
||||
}
|
82
ToAddBack/1.9/recipes/RecipesBiomesOPlenty.java
Normal file
82
ToAddBack/1.9/recipes/RecipesBiomesOPlenty.java
Normal file
|
@ -0,0 +1,82 @@
|
|||
package techreborn.compat.recipes;
|
||||
|
||||
|
||||
import biomesoplenty.api.block.BOPBlocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
|
||||
public class RecipesBiomesOPlenty implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
if (ConfigTechReborn.AllowBOPRecipes) {
|
||||
ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0);
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 0), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 0), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 1), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 1), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 2), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 2), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 3), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 3), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 4), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 4), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 5), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 5), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 6), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 6), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 7), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 7), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 8), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 8), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 9), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 9), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 11), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 11), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 12), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 12), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 13), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 13), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 14), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 14), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
71
ToAddBack/1.9/recipes/RecipesBuildcraft.java
Normal file
71
ToAddBack/1.9/recipes/RecipesBuildcraft.java
Normal file
|
@ -0,0 +1,71 @@
|
|||
package techreborn.compat.recipes;
|
||||
|
||||
import buildcraft.BuildCraftBuilders;
|
||||
import buildcraft.api.fuels.IFuel;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.api.fuel.FluidPowerManager;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.util.CraftingHelper;
|
||||
import reborncore.common.util.RecipeRemover;
|
||||
import techreborn.Core;
|
||||
import techreborn.api.TechRebornAPI;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
public class RecipesBuildcraft implements ICompatModule {
|
||||
|
||||
public static Block quarryBlock;
|
||||
|
||||
public static void removeRecipes() {
|
||||
RecipeRemover.removeAnyRecipe(new ItemStack(
|
||||
quarryBlock));
|
||||
}
|
||||
|
||||
public static void addRecipies() {
|
||||
Item drill = TechRebornAPI.recipeCompact.getItem("diamondDrill").getItem();
|
||||
ItemStack drillStack = new ItemStack(drill, 1, OreDictionary.WILDCARD_VALUE);
|
||||
//Quarry
|
||||
CraftingHelper.addShapedOreRecipe(new ItemStack(quarryBlock), new Object[]
|
||||
{
|
||||
"IAI", "GIG", "DED",
|
||||
'I', "gearIron",
|
||||
'G', "gearGold",
|
||||
'D', "gearDiamond",
|
||||
'A', TechRebornAPI.recipeCompact.getItem("advancedCircuit"),
|
||||
'E', drillStack
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
Core.logHelper.info("Trying to change the quarry recipe");
|
||||
quarryBlock = BuildCraftBuilders.quarryBlock;
|
||||
removeRecipes();
|
||||
addRecipies();
|
||||
for (IFuel fuel : buildcraft.energy.fuels.FuelManager.INSTANCE.getFuels()) {
|
||||
FluidPowerManager.fluidPowerValues.put(fuel.getFluid(), (double) fuel.getPowerPerCycle() / PowerSystem.euPerRF);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
53
ToAddBack/1.9/recipes/RecipesThaumcraft.java
Normal file
53
ToAddBack/1.9/recipes/RecipesThaumcraft.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
package techreborn.compat.recipes;
|
||||
|
||||
import ic2.api.item.IC2Items;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import thaumcraft.api.blocks.BlocksTC;
|
||||
|
||||
public class RecipesThaumcraft implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0);
|
||||
//ItemStack greatWoodStack = BlocksTC.getBlock("blockWoodenDevice", 6);
|
||||
ItemStack greatWoodStack = null;
|
||||
//SOMEONE WHO KNOWS TC FIX THIS
|
||||
// greatWoodStack.stackSize = 6;
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BlocksTC.log), null, new FluidStack(FluidRegistry.WATER, 1000), greatWoodStack, pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BlocksTC.log), IC2Items.getItem("waterCell"), null, greatWoodStack, pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BlocksTC.log), new ItemStack(Items.water_bucket), null, greatWoodStack, pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
//ItemStack silverWoodStack = ItemApi.getBlock("blockWoodenDevice", 7);
|
||||
ItemStack silverWoodStack = null;
|
||||
//silverWoodStack.stackSize = 6;
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BlocksTC.log, 1), null, new FluidStack(FluidRegistry.WATER, 1000), silverWoodStack, pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BlocksTC.log, 1), IC2Items.getItem("waterCell"), null, silverWoodStack, pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BlocksTC.log, 1), new ItemStack(Items.water_bucket), null, silverWoodStack, pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
14
ToAddBack/1.9/types/CopperCable.java
Normal file
14
ToAddBack/1.9/types/CopperCable.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package techreborn.parts.types;
|
||||
|
||||
import techreborn.parts.CableMultipart;
|
||||
import techreborn.parts.EnumCableType;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 05/03/2016.
|
||||
*/
|
||||
public class CopperCable extends CableMultipart {
|
||||
@Override
|
||||
public EnumCableType getCableType() {
|
||||
return EnumCableType.COPPER;
|
||||
}
|
||||
}
|
14
ToAddBack/1.9/types/GlassFiberCable.java
Normal file
14
ToAddBack/1.9/types/GlassFiberCable.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package techreborn.parts.types;
|
||||
|
||||
import techreborn.parts.CableMultipart;
|
||||
import techreborn.parts.EnumCableType;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 05/03/2016.
|
||||
*/
|
||||
public class GlassFiberCable extends CableMultipart {
|
||||
@Override
|
||||
public EnumCableType getCableType() {
|
||||
return EnumCableType.GLASSFIBER;
|
||||
}
|
||||
}
|
14
ToAddBack/1.9/types/GoldCable.java
Normal file
14
ToAddBack/1.9/types/GoldCable.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package techreborn.parts.types;
|
||||
|
||||
import techreborn.parts.CableMultipart;
|
||||
import techreborn.parts.EnumCableType;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 05/03/2016.
|
||||
*/
|
||||
public class GoldCable extends CableMultipart {
|
||||
@Override
|
||||
public EnumCableType getCableType() {
|
||||
return EnumCableType.GOLD;
|
||||
}
|
||||
}
|
14
ToAddBack/1.9/types/HVCable.java
Normal file
14
ToAddBack/1.9/types/HVCable.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package techreborn.parts.types;
|
||||
|
||||
import techreborn.parts.CableMultipart;
|
||||
import techreborn.parts.EnumCableType;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 05/03/2016.
|
||||
*/
|
||||
public class HVCable extends CableMultipart {
|
||||
@Override
|
||||
public EnumCableType getCableType() {
|
||||
return EnumCableType.HV;
|
||||
}
|
||||
}
|
14
ToAddBack/1.9/types/InsulatedCopperCable.java
Normal file
14
ToAddBack/1.9/types/InsulatedCopperCable.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package techreborn.parts.types;
|
||||
|
||||
import techreborn.parts.CableMultipart;
|
||||
import techreborn.parts.EnumCableType;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 05/03/2016.
|
||||
*/
|
||||
public class InsulatedCopperCable extends CableMultipart {
|
||||
@Override
|
||||
public EnumCableType getCableType() {
|
||||
return EnumCableType.ICOPPER;
|
||||
}
|
||||
}
|
14
ToAddBack/1.9/types/InsulatedGoldCable.java
Normal file
14
ToAddBack/1.9/types/InsulatedGoldCable.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package techreborn.parts.types;
|
||||
|
||||
import techreborn.parts.CableMultipart;
|
||||
import techreborn.parts.EnumCableType;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 05/03/2016.
|
||||
*/
|
||||
public class InsulatedGoldCable extends CableMultipart {
|
||||
@Override
|
||||
public EnumCableType getCableType() {
|
||||
return EnumCableType.IGOLD;
|
||||
}
|
||||
}
|
14
ToAddBack/1.9/types/InsulatedHVCable.java
Normal file
14
ToAddBack/1.9/types/InsulatedHVCable.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package techreborn.parts.types;
|
||||
|
||||
import techreborn.parts.CableMultipart;
|
||||
import techreborn.parts.EnumCableType;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 05/03/2016.
|
||||
*/
|
||||
public class InsulatedHVCable extends CableMultipart {
|
||||
@Override
|
||||
public EnumCableType getCableType() {
|
||||
return EnumCableType.IHV;
|
||||
}
|
||||
}
|
14
ToAddBack/1.9/types/TinCable.java
Normal file
14
ToAddBack/1.9/types/TinCable.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package techreborn.parts.types;
|
||||
|
||||
import techreborn.parts.CableMultipart;
|
||||
import techreborn.parts.EnumCableType;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 05/03/2016.
|
||||
*/
|
||||
public class TinCable extends CableMultipart {
|
||||
@Override
|
||||
public EnumCableType getCableType() {
|
||||
return EnumCableType.COPPER;
|
||||
}
|
||||
}
|
38
ToAddBack/1.9/waila/CompatModuleWaila.java
Normal file
38
ToAddBack/1.9/waila/CompatModuleWaila.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package techreborn.compat.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
public class CompatModuleWaila implements ICompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
public void init(FMLInitializationEvent event) {
|
||||
FMLInterModComms.sendMessage("Waila", "register", getClass().getName()
|
||||
+ ".callbackRegister");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
public static void callbackRegister(IWailaRegistrar registrar) {
|
||||
registrar.registerBodyProvider(new WailaProviderMachines(),
|
||||
TileMachineBase.class);
|
||||
}
|
||||
}
|
60
ToAddBack/1.9/waila/WailaProviderMachines.java
Normal file
60
ToAddBack/1.9/waila/WailaProviderMachines.java
Normal file
|
@ -0,0 +1,60 @@
|
|||
package techreborn.compat.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class WailaProviderMachines implements IWailaDataProvider {
|
||||
|
||||
private List<String> info = new ArrayList<String>();
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack item, List<String> tip,
|
||||
IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (accessor.getTileEntity() instanceof IListInfoProvider) {
|
||||
((IListInfoProvider) accessor.getTileEntity()).addInfo(info, true);
|
||||
}
|
||||
tip.addAll(info);
|
||||
info.clear();
|
||||
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack item, List<String> tip,
|
||||
IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack item, List<String> tip,
|
||||
IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
return tip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te,
|
||||
NBTTagCompound tag, World w, BlockPos pos) {
|
||||
|
||||
return tag;
|
||||
}
|
||||
}
|
11
ToAddBack/1.9/walia/IPartWaliaProvider.java
Normal file
11
ToAddBack/1.9/walia/IPartWaliaProvider.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
package techreborn.parts.walia;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 07/03/2016.
|
||||
*/
|
||||
public interface IPartWaliaProvider {
|
||||
|
||||
void addInfo(List<String> info);
|
||||
}
|
41
ToAddBack/1.9/walia/WailaMcMultiPartCompact.java
Normal file
41
ToAddBack/1.9/walia/WailaMcMultiPartCompact.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
package techreborn.parts.walia;
|
||||
|
||||
import mcmultipart.block.TileMultipart;
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 07/03/2016.
|
||||
*/
|
||||
public class WailaMcMultiPartCompact implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
FMLInterModComms.sendMessage("Waila", "register", getClass().getName()
|
||||
+ ".callbackRegister");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
public static void callbackRegister(IWailaRegistrar registrar) {
|
||||
registrar.registerBodyProvider(new WaliaPartProvider(),
|
||||
TileMultipart.class);
|
||||
}
|
||||
}
|
78
ToAddBack/1.9/walia/WaliaPartProvider.java
Normal file
78
ToAddBack/1.9/walia/WaliaPartProvider.java
Normal file
|
@ -0,0 +1,78 @@
|
|||
package techreborn.parts.walia;
|
||||
|
||||
import mcmultipart.block.TileMultipart;
|
||||
import mcmultipart.raytrace.PartMOP;
|
||||
import mcmultipart.raytrace.RayTraceUtils;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.parts.CableMultipart;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 07/03/2016.
|
||||
*/
|
||||
public class WaliaPartProvider implements IWailaDataProvider {
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
PartMOP mop = reTrace(accessor.getWorld(), accessor.getPosition(), accessor.getPlayer());
|
||||
if (mop != null) {
|
||||
if (mop.partHit instanceof CableMultipart) {
|
||||
return mop.partHit.getDrops().get(0);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
PartMOP mop = reTrace(accessor.getWorld(), accessor.getPosition(), accessor.getPlayer());
|
||||
List<String> data = new ArrayList<>();
|
||||
if (mop != null) {
|
||||
if (mop.partHit instanceof IPartWaliaProvider) {
|
||||
((IPartWaliaProvider) mop.partHit).addInfo(data);
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) {
|
||||
return null;
|
||||
}
|
||||
|
||||
//Stolen from https://github.com/amadornes/MCMultiPart/blob/master/src/main/java/mcmultipart/block/BlockMultipart.java
|
||||
private PartMOP reTrace(World world, BlockPos pos, EntityPlayer player) {
|
||||
Vec3 start = RayTraceUtils.getStart(player);
|
||||
Vec3 end = RayTraceUtils.getEnd(player);
|
||||
RayTraceUtils.RayTraceResultPart result = getMultipartTile(world, pos).getPartContainer().collisionRayTrace(start, end);
|
||||
return result == null ? null : result.hit;
|
||||
}
|
||||
|
||||
//Stolen from https://github.com/amadornes/MCMultiPart/blob/master/src/main/java/mcmultipart/block/BlockMultipart.java
|
||||
private TileMultipart getMultipartTile(IBlockAccess world, BlockPos pos) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
return tile instanceof TileMultipart ? (TileMultipart) tile : null;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue