Now comes the grind, 244 errors left

This commit is contained in:
modmuss50 2016-03-13 16:08:30 +00:00
parent 7f920b282f
commit 9a40abbe78
220 changed files with 2053 additions and 2052 deletions

View file

@ -19,7 +19,7 @@ public class BlockFusionCoil extends BlockMachineBase {
private final String prefix = "techreborn:blocks/machine/";
@Override
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
return prefix + "fusion_coil";
}
}

View file

@ -4,7 +4,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;

View file

@ -18,7 +18,7 @@ public class BlockHighlyAdvancedMachine extends BlockMachineBase {
@Override
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
return prefix + "highlyadvancedmachine";
}

View file

@ -4,7 +4,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.IBlockAccess;

View file

@ -4,13 +4,13 @@ import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@ -33,7 +33,7 @@ public class BlockMachineCasing extends BlockMultiblockBase implements ITextured
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.machineCasing");
setHardness(2F);
this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0));
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
}
public PropertyInteger METADATA;
@ -48,10 +48,10 @@ public class BlockMachineCasing extends BlockMultiblockBase implements ITextured
return (Integer) state.getValue(METADATA);
}
protected BlockState createBlockState() {
protected BlockStateContainer createBlockStateContainer() {
METADATA = PropertyInteger.create("Type", 0, types.length);
return new BlockState(this, METADATA);
return new BlockStateContainer(this, METADATA);
}
public int getHeatFromState(IBlockState state) {
@ -90,9 +90,9 @@ public class BlockMachineCasing extends BlockMultiblockBase implements ITextured
}
@Override
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) {
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess worldIn, BlockPos pos, EnumFacing side) {
Block b = worldIn.getBlockState(pos).getBlock();
return b == (Block) this ? false : super.shouldSideBeRendered(worldIn, pos, side);
return b == (Block) this ? false : super.shouldSideBeRendered(blockState, worldIn, pos, side);
}
public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) {
@ -100,8 +100,8 @@ public class BlockMachineCasing extends BlockMultiblockBase implements ITextured
}
@Override
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
return "techreborn:blocks/machine/casing" + types[getMetaFromState(blockState)] + "_full";
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
return "techreborn:blocks/machine/casing" + types[getMetaFromState(BlockStateContainer)] + "_full";
}
@Override

View file

@ -3,7 +3,7 @@ package techreborn.blocks;
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@ -39,7 +39,7 @@ public class BlockMachineFrame extends BaseBlock implements ITexturedBlock {
setUnlocalizedName("techreborn.machineFrame");
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(1f);
this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0));
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
}
@Override
@ -57,8 +57,8 @@ public class BlockMachineFrame extends BaseBlock implements ITexturedBlock {
}
@Override
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
return "techreborn:blocks/machine/" + types[getMetaFromState(blockState)] + "_machine_block";
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
return "techreborn:blocks/machine/" + types[getMetaFromState(BlockStateContainer)] + "_machine_block";
}
@Override
@ -71,10 +71,10 @@ public class BlockMachineFrame extends BaseBlock implements ITexturedBlock {
return state.getValue(METADATA);
}
protected BlockState createBlockState() {
protected BlockStateContainer createBlockStateContainer() {
METADATA = PropertyInteger.create("Type", 0, types.length -1);
return new BlockState(this, METADATA);
return new BlockStateContainer(this, METADATA);
}
@Override

View file

@ -5,7 +5,9 @@ import net.minecraft.block.BlockTNT;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.BlockPos;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
@ -45,12 +47,12 @@ public class BlockNuke extends BlockTNT implements ITexturedBlock {
}
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) {
return false; //No flint and steel
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
return false
}
@Override
public String getTextureNameFromState(IBlockState iBlockState, EnumFacing enumFacing) {
public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing) {
return "techreborn:blocks/machine/machine_bottom";
}

View file

@ -3,16 +3,16 @@ package techreborn.blocks;
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@ -74,7 +74,7 @@ public class BlockOre extends BaseBlock implements ITexturedBlock, IOreNameProvi
setCreativeTab(TechRebornCreativeTabMisc.instance);
setHardness(2.0f);
setHarvestLevel("pickaxe", 2);
this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0));
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
}
@ -149,8 +149,8 @@ public class BlockOre extends BaseBlock implements ITexturedBlock, IOreNameProvi
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player) {
return super.getPickBlock(target, world, pos, player);
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
return super.getPickBlock(state, target, world, pos, player);
}
@Override
@ -167,8 +167,8 @@ public class BlockOre extends BaseBlock implements ITexturedBlock, IOreNameProvi
}
@Override
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
return "techreborn:blocks/ore/ore" + types[getMetaFromState(blockState)];
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
return "techreborn:blocks/ore/ore" + types[getMetaFromState(BlockStateContainer)];
}
@Override
@ -186,10 +186,10 @@ public class BlockOre extends BaseBlock implements ITexturedBlock, IOreNameProvi
return state.getValue(METADATA);
}
protected BlockState createBlockState() {
protected BlockStateContainer createBlockStateContainer() {
METADATA = PropertyInteger.create("Type", 0, types.length -1);
return new BlockState(this, METADATA);
return new BlockStateContainer(this, METADATA);
}
@Override

View file

@ -3,15 +3,15 @@ package techreborn.blocks;
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
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.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -63,7 +63,7 @@ public class BlockOre2 extends BaseBlock implements ITexturedBlock, IOreNameProv
setCreativeTab(TechRebornCreativeTabMisc.instance);
setHardness(2.0f);
setHarvestLevel("pickaxe", 2);
this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0));
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
}
@Override
@ -80,8 +80,8 @@ public class BlockOre2 extends BaseBlock implements ITexturedBlock, IOreNameProv
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player) {
return super.getPickBlock(target, world, pos, player);
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
return super.getPickBlock(state, target, world, pos, player);
}
@Override
@ -91,8 +91,8 @@ public class BlockOre2 extends BaseBlock implements ITexturedBlock, IOreNameProv
}
@Override
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
return "techreborn:blocks/ore/ore" + types[getMetaFromState(blockState)];
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
return "techreborn:blocks/ore/ore" + types[getMetaFromState(BlockStateContainer)];
}
@Override
@ -110,10 +110,10 @@ public class BlockOre2 extends BaseBlock implements ITexturedBlock, IOreNameProv
return state.getValue(METADATA);
}
protected BlockState createBlockState() {
protected BlockStateContainer createBlockStateContainer() {
METADATA = PropertyInteger.create("Type", 0, types.length -1);
return new BlockState(this, METADATA);
return new BlockStateContainer(this, METADATA);
}
@Override

View file

@ -4,7 +4,8 @@ package techreborn.blocks;
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
@ -12,9 +13,10 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@ -36,7 +38,7 @@ public class BlockPlayerDetector extends BaseTileBlock implements ITexturedBlock
setUnlocalizedName("techreborn.playerDetector");
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(2f);
this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0));
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
}
public static final String[] types = new String[]
@ -107,24 +109,24 @@ public class BlockPlayerDetector extends BaseTileBlock implements ITexturedBlock
String message = "";
switch (newMeta) {
case 0:
message = EnumChatFormatting.GREEN + "Detects all Players";
message = TextFormatting.GREEN + "Detects all Players";
break;
case 1:
message = EnumChatFormatting.RED + "Detects only other Players";
message = TextFormatting.RED + "Detects only other Players";
break;
case 2:
message = EnumChatFormatting.BLUE + "Detects only you";
message = TextFormatting.BLUE + "Detects only you";
}
if(!world.isRemote){
entityplayer.addChatComponentMessage(new ChatComponentText(message));
entityplayer.addChatComponentMessage(new TextComponentString(message));
//world.setBlockMetadataWithNotify(x, y, z, newMeta, 2);
}
return true;
}
@Override
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
return "techreborn:blocks/machine/player_detector_" + types[getMetaFromState(blockState)];
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
return "techreborn:blocks/machine/player_detector_" + types[getMetaFromState(BlockStateContainer)];
}
@Override
@ -137,10 +139,10 @@ public class BlockPlayerDetector extends BaseTileBlock implements ITexturedBlock
return (Integer) state.getValue(METADATA);
}
protected BlockState createBlockState() {
protected BlockStateContainer createBlockStateContainer() {
METADATA = PropertyInteger.create("Type", 0, types.length -1);
return new BlockState(this, METADATA);
return new BlockStateContainer(this, METADATA);
}
@Override

View file

@ -3,7 +3,7 @@ package techreborn.blocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;

View file

@ -2,7 +2,7 @@ package techreborn.blocks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;

View file

@ -3,8 +3,8 @@ package techreborn.blocks;
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.BaseBlock;
@ -25,9 +25,9 @@ public class BlockReinforcedGlass extends BaseBlock implements ITexturedBlock {
}
@SideOnly(Side.CLIENT)
public EnumWorldBlockLayer getBlockLayer()
public BlockRenderLayer getBlockLayer()
{
return EnumWorldBlockLayer.CUTOUT;
return BlockRenderLayer.CUTOUT;
}
public boolean isFullCube()

View file

@ -5,12 +5,12 @@ import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
import net.minecraft.block.BlockLeaves;
import net.minecraft.block.BlockPlanks;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraft.world.IBlockAccess;
@ -33,7 +33,7 @@ public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IO
setUnlocalizedName("techreborn.rubberleaves");
setCreativeTab(TechRebornCreativeTabMisc.instance);
RebornCore.jsonDestroyer.registerObject(this);
this.setDefaultState(this.blockState.getBaseState().withProperty(CHECK_DECAY, Boolean.valueOf(true)).withProperty(DECAYABLE, Boolean.valueOf(true)));
this.setDefaultState(this.getDefaultState().withProperty(CHECK_DECAY, Boolean.valueOf(true)).withProperty(DECAYABLE, Boolean.valueOf(true)));
}
@Override
@ -77,7 +77,7 @@ public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IO
}
@Override
public String getTextureNameFromState(IBlockState iBlockState, EnumFacing enumFacing) {
public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing) {
return "techreborn:blocks/rubber_leaves";
}
@ -87,9 +87,9 @@ public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IO
}
@Override
protected BlockState createBlockState()
protected BlockStateContainer createBlockStateContainer()
{
return new BlockState(this, new IProperty[] { CHECK_DECAY, DECAYABLE});
return new BlockStateContainer(this, new IProperty[] { CHECK_DECAY, DECAYABLE});
}
@Override

View file

@ -5,12 +5,12 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@ -38,12 +38,12 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
this.setHardness(2.0F);
this.setStepSound(soundTypeWood);
RebornCore.jsonDestroyer.registerObject(this);
this.setDefaultState(this.blockState.getBaseState().withProperty(SAP_SIDE, EnumFacing.NORTH).withProperty(HAS_SAP, false));
this.setDefaultState(this.getDefaultState().withProperty(SAP_SIDE, EnumFacing.NORTH).withProperty(HAS_SAP, false));
this.setTickRandomly(true);
}
protected BlockState createBlockState() {
return new BlockState(this, SAP_SIDE, HAS_SAP);
protected BlockStateContainer createBlockStateContainer() {
return new BlockStateContainer(this, SAP_SIDE, HAS_SAP);
}
@Override
@ -82,12 +82,12 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
}
@Override
public String getTextureNameFromState(IBlockState iBlockState, EnumFacing enumFacing) {
public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing) {
if(enumFacing == EnumFacing.DOWN || enumFacing == EnumFacing.UP){
return "techreborn:blocks/rubber_log_top";
}
if(iBlockState.getValue(HAS_SAP)){
if(iBlockState.getValue(SAP_SIDE) == enumFacing){
if(IBlockState.getValue(HAS_SAP)){
if(IBlockState.getValue(SAP_SIDE) == enumFacing){
return "techreborn:blocks/rubber_log_sap";
}
}
@ -114,9 +114,9 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
int j = i + 1;
if (worldIn.isAreaLoaded(pos.add(-j, -j, -j), pos.add(j, j, j))) {
for (BlockPos blockpos : BlockPos.getAllInBox(pos.add(-i, -i, -i), pos.add(i, i, i))) {
IBlockState iblockstate = worldIn.getBlockState(blockpos);
if (iblockstate.getBlock().isLeaves(worldIn, blockpos)) {
iblockstate.getBlock().beginLeavesDecay(worldIn, blockpos);
IBlockState IBlockState = worldIn.getBlockState(blockpos);
if (IBlockState.getBlock().isLeaves(worldIn, blockpos)) {
IBlockState.getBlock().beginLeavesDecay(worldIn, blockpos);
}
}
}

View file

@ -5,7 +5,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.world.RubberTreeGenerator;
@ -22,7 +22,7 @@ public class BlockRubberSapling extends BlockSapling {
setUnlocalizedName("techreborn.rubbersapling");
setCreativeTab(TechRebornCreativeTabMisc.instance);
setStepSound(soundTypeGrass);
this.setDefaultState(this.blockState.getBaseState().withProperty(STAGE, Integer.valueOf(0)));
this.setDefaultState(this.getDefaultState().withProperty(STAGE, Integer.valueOf(0)));
}
@Override

View file

@ -3,7 +3,7 @@ package techreborn.blocks;
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@ -46,7 +46,7 @@ public class BlockStorage extends BaseBlock implements ITexturedBlock {
setUnlocalizedName("techreborn.storage");
setCreativeTab(TechRebornCreativeTabMisc.instance);
setHardness(2f);
this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0));
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
}
@Override
@ -67,8 +67,8 @@ public class BlockStorage extends BaseBlock implements ITexturedBlock {
return getMetaFromState(state);
}
@Override
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
return "techreborn:blocks/storage/" + types[getMetaFromState(blockState)] + "_block";
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
return "techreborn:blocks/storage/" + types[getMetaFromState(BlockStateContainer)] + "_block";
}
@Override
@ -86,10 +86,10 @@ public class BlockStorage extends BaseBlock implements ITexturedBlock {
return state.getValue(METADATA);
}
protected BlockState createBlockState() {
protected BlockStateContainer createBlockStateContainer() {
METADATA = PropertyInteger.create("Type", 0, types.length -1);
return new BlockState(this, METADATA);
return new BlockStateContainer(this, METADATA);
}
}

View file

@ -3,7 +3,7 @@ package techreborn.blocks;
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@ -39,7 +39,7 @@ public class BlockStorage2 extends BaseBlock implements ITexturedBlock {
setUnlocalizedName("techreborn.storage2");
setCreativeTab(TechRebornCreativeTabMisc.instance);
setHardness(2f);
this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0));
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
}
public PropertyInteger METADATA;
@ -65,8 +65,8 @@ public class BlockStorage2 extends BaseBlock implements ITexturedBlock {
}
@Override
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
return "techreborn:blocks/storage/" + types[getMetaFromState(blockState)] + "_block";
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
return "techreborn:blocks/storage/" + types[getMetaFromState(BlockStateContainer)] + "_block";
}
@Override
@ -84,10 +84,10 @@ public class BlockStorage2 extends BaseBlock implements ITexturedBlock {
return (Integer) state.getValue(METADATA);
}
protected BlockState createBlockState() {
protected BlockStateContainer createBlockStateContainer() {
METADATA = PropertyInteger.create("Type", 0, types.length -1);
return new BlockState(this, METADATA);
return new BlockStateContainer(this, METADATA);
}
}

View file

@ -1,7 +1,7 @@
package techreborn.blocks.fluid;
import net.minecraft.block.material.Material;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidClassic;
@ -18,14 +18,14 @@ public class BlockFluidBase extends BlockFluidClassic {
@Override
public boolean canDisplace(IBlockAccess world, BlockPos pos) {
if(world.getBlockState(pos).getBlock().getMaterial().isLiquid())
if(world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid())
return false;
return super.canDisplace(world, pos);
}
@Override
public boolean displaceIfPossible(World world, BlockPos pos) {
if(world.getBlockState(pos).getBlock().getMaterial().isLiquid())
if(world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid())
return false;
return super.displaceIfPossible(world, pos);
}

View file

@ -3,7 +3,7 @@ package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;

View file

@ -3,7 +3,7 @@ package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;

View file

@ -3,7 +3,7 @@ package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;

View file

@ -3,7 +3,7 @@ package techreborn.blocks.generator;
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
@ -23,12 +23,12 @@ public class BlockSolarPanel extends BaseTileBlock implements ITexturedBlock {
super(Material.iron);
setUnlocalizedName("techreborn.solarpanel");
setCreativeTab(TechRebornCreativeTab.instance);
this.setDefaultState(this.blockState.getBaseState().withProperty(ACTIVE, false));
this.setDefaultState(this.getDefaultState().withProperty(ACTIVE, false));
}
protected BlockState createBlockState() {
protected BlockStateContainer createBlockStateContainer() {
ACTIVE = PropertyBool.create("active");
return new BlockState(this, ACTIVE);
return new BlockStateContainer(this, ACTIVE);
}
@Override

View file

@ -2,7 +2,7 @@ package techreborn.blocks.generator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;

View file

@ -5,7 +5,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;

View file

@ -3,7 +3,7 @@ package techreborn.blocks.machine;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;

View file

@ -3,7 +3,7 @@ package techreborn.blocks.machine;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;

View file

@ -3,7 +3,7 @@ package techreborn.blocks.machine;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;

View file

@ -5,7 +5,7 @@ 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.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;

View file

@ -5,7 +5,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;

View file

@ -1,7 +1,7 @@
package techreborn.client;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
import techreborn.client.container.ContainerAesu;

View file

@ -1,7 +1,7 @@
package techreborn.client;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import techreborn.init.ModBlocks;

View file

@ -15,7 +15,7 @@ public class ContainerImplosionCompressor extends ContainerCrafting {
TileImplosionCompressor tile;
public int tickTime;
public int multiblockstate = 0;
public int multIBlockState = 0;
public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor,
EntityPlayer player) {
@ -56,8 +56,8 @@ public class ContainerImplosionCompressor extends ContainerCrafting {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.multiblockstate != getMultiblockstateint()) {
icrafting.sendProgressBarUpdate(this, 3, getMultiblockstateint());
if (this.multIBlockState != getMultIBlockStateint()) {
icrafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
}
}
}
@ -65,18 +65,18 @@ public class ContainerImplosionCompressor extends ContainerCrafting {
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 3, getMultiblockstateint());
crafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 3) {
this.multiblockstate = value;
this.multIBlockState = value;
}
}
public int getMultiblockstateint(){
public int getMultIBlockStateint(){
return tile.getMutliBlock() ? 1 : 0;
}

View file

@ -5,7 +5,8 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.packets.PacketHandler;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerAesu;
@ -57,7 +58,7 @@ public class GuiAesu extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
this.fontRendererObj.drawString(StatCollector.translateToLocal("tile.techreborn.aesu.name"), 40, 10, Color.WHITE.getRGB());
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.aesu.name"), 40, 10, Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euOut) + " /tick", 10, 20, Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.storedEu) + " ", 10, 30, Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euChange) + " change", 10, 40, Color.WHITE.getRGB());

View file

@ -2,10 +2,9 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerAlloyFurnace;
import techreborn.tiles.TileAlloyFurnace;
@ -54,10 +53,10 @@ public class GuiAlloyFurnace extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.alloyfurnace.name");
String name = I18n.translateToLocal("tile.techreborn.alloyfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
}

View file

@ -2,10 +2,9 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerAlloySmelter;
import techreborn.tiles.TileAlloySmelter;
@ -51,8 +50,8 @@ public class GuiAlloySmelter extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.alloysmelter.name");
String name = I18n.translateToLocal("tile.techreborn.alloysmelter.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -2,10 +2,9 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerAssemblingMachine;
import techreborn.tiles.TileAssemblingMachine;
@ -53,8 +52,8 @@ public class GuiAssemblingMachine extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.assemblinmachine.name");
String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -3,11 +3,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import reborncore.client.gui.GuiUtil;
import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockSet;
@ -63,7 +62,7 @@ public class GuiBlastFurnace extends GuiContainer {
if (containerBlastFurnace.heat == 0) {
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
this.fontRendererObj.drawString(StatCollector.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
}
int j = 0;
@ -82,12 +81,12 @@ public class GuiBlastFurnace extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
super.drawGuiContainerForegroundLayer(p_146979_1_, p_146979_2_);
String name = StatCollector.translateToLocal("tile.techreborn.blastfurnace.name");
String name = I18n.translateToLocal("tile.techreborn.blastfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
if (containerBlastFurnace.heat != 0) {
this.fontRendererObj.drawString("Current Heat: " + containerBlastFurnace.heat, 40, 60, 4210752);
}
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
@Override

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerCentrifuge;
import techreborn.tiles.TileCentrifuge;
@ -55,11 +55,11 @@ public class GuiCentrifuge extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String namePt1 = StatCollector.translateToLocal("tile.techreborn.industrialBlock.name");
String namePt2 = StatCollector.translateToLocal("tile.techreborn.centrifuge.name").replace(namePt1 + " ", "");
String namePt1 = I18n.translateToLocal("tile.techreborn.industrialBlock.name");
String namePt2 = I18n.translateToLocal("tile.techreborn.centrifuge.name").replace(namePt1 + " ", "");
this.fontRendererObj.drawString(namePt1, 98, 6, 4210752);
this.fontRendererObj.drawString(namePt2, 98, 14, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerChargeBench;
import techreborn.tiles.TileChargeBench;
@ -46,8 +46,8 @@ public class GuiChargeBench extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.chargebench.name");
String name = I18n.translateToLocal("tile.techreborn.chargebench.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerChemicalReactor;
import techreborn.tiles.TileChemicalReactor;
@ -54,8 +54,8 @@ public class GuiChemicalReactor extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.chemicalreactor.name");
String name = I18n.translateToLocal("tile.techreborn.chemicalreactor.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -3,10 +3,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerChunkloader;
import techreborn.tiles.TileChunkLoader;
@ -58,10 +58,10 @@ public class GuiChunkLoader extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.chunkloader.name");
String name = I18n.translateToLocal("tile.techreborn.chunkloader.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
}

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerCompressor;
import techreborn.tiles.teir1.TileCompressor;
@ -47,9 +47,9 @@ public class GuiCompressor extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.compressor.name");
String name = I18n.translateToLocal("tile.techreborn.compressor.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -3,10 +3,10 @@ package techreborn.client.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
public class GuiDestructoPack extends GuiContainer {
@ -28,9 +28,9 @@ public class GuiDestructoPack extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int arg0, int arg1) {
String name = StatCollector.translateToLocal("item.techreborn.part.destructoPack.name");
String name = I18n.translateToLocal("item.techreborn.part.destructoPack.name");
fontRendererObj.drawString(name, xSize / 2 - fontRendererObj.getStringWidth(name) / 2, 5, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8,
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), 8,
this.ySize - 96 + 2, 4210752);
super.drawGuiContainerForegroundLayer(arg0, arg1);
}

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerDieselGenerator;
import techreborn.tiles.generator.TileDieselGenerator;
@ -39,10 +39,10 @@ public class GuiDieselGenerator extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.dieselgenerator.name");
String name = I18n.translateToLocal("tile.techreborn.dieselgenerator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(containerDieselGenerator.fluid + "", 10,

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerDigitalChest;
import techreborn.tiles.TileDigitalChest;
@ -34,10 +34,10 @@ public class GuiDigitalChest extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.digitalChest.name");
String name = I18n.translateToLocal("tile.techreborn.digitalChest.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
if (tile.storedItem != null && tile.getStackInSlot(1) != null)

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerElectricFurnace;
import techreborn.tiles.teir1.TileElectricFurnace;
@ -46,9 +46,9 @@ public class GuiElectricFurnace extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.electricfurnace.name");
String name = I18n.translateToLocal("tile.techreborn.electricfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerExtractor;
import techreborn.tiles.teir1.TileExtractor;
@ -46,9 +46,9 @@ public class GuiExtractor extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.extractor.name");
String name = I18n.translateToLocal("tile.techreborn.extractor.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -3,10 +3,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerFusionReactor;
import techreborn.tiles.fusionReactor.TileEntityFusionController;
@ -29,9 +29,9 @@ public class GuiFusionReactor extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
this.fontRendererObj.drawString(name, 87, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerFusionReactor.energy), 11, 8, 16448255);
this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.coilStatus == 1 ? "Yes" : "No"), 11, 16, 16448255);

View file

@ -2,7 +2,7 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import techreborn.client.container.ContainerGasTurbine;
@ -37,7 +37,7 @@ public class GuiGasTurbine extends GuiContainer {
String name = "Gas Turbine";
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10,

View file

@ -1,10 +1,10 @@
package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerGenerator;
import techreborn.tiles.generator.TileGenerator;
@ -54,9 +54,9 @@ public class GuiGenerator extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.generator.name");
String name = I18n.translateToLocal("tile.techreborn.generator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize- 150, 4210752);
}

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerGrinder;
import techreborn.tiles.teir1.TileGrinder;
@ -46,9 +46,9 @@ public class GuiGrinder extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.grinder.name");
String name = I18n.translateToLocal("tile.techreborn.grinder.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -5,7 +5,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.packets.PacketHandler;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerIDSU;
@ -59,7 +59,7 @@ public class GuiIDSU extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
this.fontRendererObj.drawString(StatCollector.translateToLocal("tile.techreborn.idsu.name"), 40, 10, Color.WHITE.getRGB());
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.idsu.name"), 40, 10, Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euOut) + "/tick", 10, 20, Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.storedEu), 10, 30, Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euChange) + " change", 10, 40, Color.WHITE.getRGB());

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerImplosionCompressor;
import techreborn.tiles.TileImplosionCompressor;
@ -39,9 +39,9 @@ public class GuiImplosionCompressor extends GuiContainer {
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
if (containerImplosionCompressor.multiblockstate == 0) {
if (containerImplosionCompressor.multIBlockState == 0) {
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
this.fontRendererObj.drawString(StatCollector.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
}
int j = 0;
@ -58,9 +58,9 @@ public class GuiImplosionCompressor extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.implosioncompressor.name");
String name = I18n.translateToLocal("tile.techreborn.implosioncompressor.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerIndustrialElectrolyzer;
import techreborn.tiles.TileIndustrialElectrolyzer;
@ -54,9 +54,9 @@ public class GuiIndustrialElectrolyzer extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.industrialelectrolyzer.name");
String name = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.name");
this.fontRendererObj.drawString(name, (this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2), 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerIndustrialGrinder;
import techreborn.tiles.TileIndustrialGrinder;
@ -46,7 +46,7 @@ public class GuiIndustrialGrinder extends GuiContainer {
if (containerGrinder.connectionStatus != 1) {
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - j, 114, 10);
this.fontRendererObj.drawString(StatCollector.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - j, -1);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - j, -1);
}
//TODO 1.8 nope
@ -71,9 +71,9 @@ public class GuiIndustrialGrinder extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.industrialgrinder.name");
String name = I18n.translateToLocal("tile.techreborn.industrialgrinder.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import reborncore.client.gui.GuiUtil;
import techreborn.client.container.ContainerIndustrialSawmill;
import techreborn.tiles.TileIndustrialSawmill;
@ -74,16 +74,16 @@ public class GuiIndustrialSawmill extends GuiContainer {
drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47);
if (sawmill.getMutliBlock() != true) {
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
this.fontRendererObj.drawString(StatCollector.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.industrialsawmill.name");
String name = I18n.translateToLocal("tile.techreborn.industrialsawmill.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 58,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 58,
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerIronFurnace;
import techreborn.tiles.TileIronFurnace;
@ -46,9 +46,9 @@ public class GuiIronFurnace extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.ironfurnace.name");
String name = I18n.translateToLocal("tile.techreborn.ironfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -4,7 +4,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerLesu;
import techreborn.tiles.lesu.TileLesu;
@ -41,7 +41,7 @@ public class GuiLesu extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
this.fontRendererObj.drawString(StatCollector.translateToLocal("tile.techreborn.lesu.name"), 40, 10, Color.WHITE.getRGB());
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.lesu.name"), 40, 10, Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euOut) + "/t", 10, 20, Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.storedEu), 10, 30, Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euChange) + " change", 10, 40, Color.WHITE.getRGB());

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerMatterFabricator;
import techreborn.tiles.TileMatterFabricator;
@ -45,10 +45,10 @@ public class GuiMatterFabricator extends GuiContainer {
int p_146979_2_) {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
String name = StatCollector.translateToLocal("tile.techreborn.matterfabricator.name");
String name = I18n.translateToLocal("tile.techreborn.matterfabricator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(containerMatterFabricator.getProgressScaled(100) + "%", 80, 50, 4210752);
}

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerQuantumChest;
import techreborn.tiles.TileQuantumChest;
@ -35,10 +35,10 @@ public class GuiQuantumChest extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.quantumChest.name");
String name = I18n.translateToLocal("tile.techreborn.quantumChest.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
if (tile.storedItem != null && tile.getStackInSlot(1) != null)

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerQuantumTank;
import techreborn.tiles.TileQuantumTank;
@ -35,10 +35,10 @@ public class GuiQuantumTank extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.quantumTank.name");
String name = I18n.translateToLocal("tile.techreborn.quantumTank.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10,

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerRecycler;
import techreborn.tiles.teir1.TileRecycler;
@ -47,8 +47,8 @@ public class GuiRecycler extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.recycler.name");
String name = I18n.translateToLocal("tile.techreborn.recycler.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -3,10 +3,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerRollingMachine;
import techreborn.tiles.TileRollingMachine;
@ -44,10 +44,10 @@ public class GuiRollingMachine extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.rollingmachine.name");
String name = I18n.translateToLocal("tile.techreborn.rollingmachine.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
}

View file

@ -2,7 +2,7 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import techreborn.client.container.ContainerSemifluidGenerator;
@ -37,7 +37,7 @@ public class GuiSemifluidGenerator extends GuiContainer {
String name = "Semifluid Generator";
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10,

View file

@ -2,10 +2,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerThermalGenerator;
import techreborn.tiles.generator.TileThermalGenerator;
@ -35,10 +35,10 @@ public class GuiThermalGenerator extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.thermalGenerator.name");
String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);

View file

@ -3,10 +3,10 @@ package techreborn.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.text.translation.I18n;
import reborncore.client.gui.GuiUtil;
import reborncore.client.multiblock.MultiblockSet;
import reborncore.common.misc.Location;
@ -71,14 +71,14 @@ public class GuiVacuumFreezer extends GuiContainer {
if (containerVacuumFreezer.machineStatus == 0) {
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
this.fontRendererObj.drawString(StatCollector.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.vacuumfreezer.name");
String name = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
@Override

View file

@ -7,8 +7,8 @@ import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import techreborn.entitys.EntityNukePrimed;
import techreborn.init.ModBlocks;

View file

@ -14,7 +14,7 @@ public class ClientPartLoader implements ICompatModule {
@Override
public void preInit(FMLPreInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(new ClientPartModelBakery());
// MinecraftForge.EVENT_BUS.register(new ClientPartModelBakery());
}
@Override

View file

@ -1,35 +0,0 @@
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));
}
}
}

View file

@ -1,119 +0,0 @@
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;
}
}

View file

@ -3,11 +3,13 @@ package techreborn.command;
import net.minecraft.block.Block;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentText;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.fluids.Fluid;
import reborncore.api.fuel.FluidPowerManager;
import reborncore.common.explosion.RebornExplosion;
@ -34,21 +36,21 @@ public class TechRebornDevCommand extends CommandBase {
}
@Override
public void processCommand(ICommandSender sender, String[] args) {
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
if (args.length == 0) {
sender.addChatMessage(new ChatComponentText("You need to use arguments, see /trdev help"));
sender.addChatMessage(new TextComponentString("You need to use arguments, see /trdev help"));
} else if ("help".equals(args[0])) {
sender.addChatMessage(new ChatComponentText("recipes - Shows size of the recipe array"));
sender.addChatMessage(new ChatComponentText("fluid - Lists the fluid power values"));
sender.addChatMessage(new TextComponentString("recipes - Shows size of the recipe array"));
sender.addChatMessage(new TextComponentString("fluid - Lists the fluid power values"));
} else if ("recipes".equals(args[0])) {
sender.addChatMessage(new ChatComponentText(RecipeHandler.recipeList.size() + " recipes loaded"));
sender.addChatMessage(new TextComponentString(RecipeHandler.recipeList.size() + " recipes loaded"));
} else if ("fluid".equals(args[0])) {
for (Object object : FluidPowerManager.fluidPowerValues.keySet().toArray()) {
if (object instanceof Fluid) {
Fluid fluid = (Fluid) object;
sender.addChatMessage(new ChatComponentText(fluid.getUnlocalizedName() + " : " + FluidPowerManager.fluidPowerValues.get(fluid)));
sender.addChatMessage(new TextComponentString(fluid.getUnlocalizedName() + " : " + FluidPowerManager.fluidPowerValues.get(fluid)));
} else {
sender.addChatMessage(new ChatComponentText("Found invalid fluid entry"));
sender.addChatMessage(new TextComponentString("Found invalid fluid entry"));
}
}
} else if ("clear".equals(args[0])) {

View file

@ -4,15 +4,8 @@ import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.relauncher.Side;
import techreborn.client.render.parts.ClientPartLoader;
import techreborn.compat.minetweaker.MinetweakerCompat;
import techreborn.compat.recipes.RecipesBiomesOPlenty;
import techreborn.compat.recipes.RecipesBuildcraft;
import techreborn.compat.recipes.RecipesThaumcraft;
import techreborn.compat.waila.CompatModuleWaila;
import techreborn.config.ConfigTechReborn;
import techreborn.parts.StandalonePartCompact;
import techreborn.parts.TechRebornParts;
import techreborn.parts.walia.WailaMcMultiPartCompact;
import java.util.ArrayList;
@ -39,15 +32,15 @@ public class CompatManager {
if (Loader.isModLoaded("gregtech")) {
isGregTechLoaded = true;
}
registerCompact(CompatModuleWaila.class, "Waila");
registerCompact(MinetweakerCompat.class, "MineTweaker3");
registerCompact(RecipesBiomesOPlenty.class, "BiomesOPlenty");
registerCompact(RecipesBuildcraft.class, "BuildCraft|Builders");
registerCompact(RecipesThaumcraft.class, "Thaumcraft");
registerCompact(TechRebornParts.class, "mcmultipart");
// registerCompact(CompatModuleWaila.class, "Waila");
// registerCompact(MinetweakerCompat.class, "MineTweaker3");
// registerCompact(RecipesBiomesOPlenty.class, "BiomesOPlenty");
// registerCompact(RecipesBuildcraft.class, "BuildCraft|Builders");
// registerCompact(RecipesThaumcraft.class, "Thaumcraft");
// registerCompact(TechRebornParts.class, "mcmultipart");
registerCompact(ClientPartLoader.class, "mcmultipart", "@client");
registerCompact(StandalonePartCompact.class, "!mcmultipart");
registerCompact(WailaMcMultiPartCompact.class, "mcmultipart", "Waila");
//registerCompact(WailaMcMultiPartCompact.class, "mcmultipart", "Waila");
}
public void registerCompact(Class<? extends ICompatModule> moduleClass, Object... objs) {

View file

@ -1,68 +0,0 @@
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();
}
}

View file

@ -1,24 +0,0 @@
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";
}

View file

@ -1,90 +0,0 @@
package techreborn.compat.jei;
import mezz.jei.api.gui.IGuiFluidStackGroup;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import 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));
}
}
}
}

View file

@ -1,224 +0,0 @@
package techreborn.compat.jei;
import mezz.jei.api.BlankModPlugin;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.IModRegistry;
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
import mezz.jei.api.recipe.transfer.IRecipeTransferRegistry;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.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);
}
}

View file

@ -1,69 +0,0 @@
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);
}
}
}

View file

@ -1,41 +0,0 @@
package techreborn.compat.jei.alloySmelter;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.api.recipe.machines.AlloySmelterRecipe;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class AlloySmelterRecipeHandler implements IRecipeHandler<AlloySmelterRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public AlloySmelterRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}
@Nonnull
@Override
public Class<AlloySmelterRecipe> getRecipeClass() {
return AlloySmelterRecipe.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return RecipeCategoryUids.ALLOY_SMELTER;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull AlloySmelterRecipe recipe) {
return new AlloySmelterRecipeWrapper(jeiHelpers, recipe);
}
@Override
public boolean isRecipeValid(@Nonnull AlloySmelterRecipe recipe) {
return true;
}
}

View file

@ -1,29 +0,0 @@
package techreborn.compat.jei.alloySmelter;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import net.minecraft.client.Minecraft;
import techreborn.api.recipe.machines.AlloySmelterRecipe;
import techreborn.client.gui.GuiAlloySmelter;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
public class AlloySmelterRecipeWrapper extends BaseRecipeWrapper<AlloySmelterRecipe> {
private final IDrawableAnimated arrow;
public AlloySmelterRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull AlloySmelterRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic arrowStatic = guiHelper.createDrawable(GuiAlloySmelter.texture, 176, 14, 24, 17);
this.arrow = guiHelper.createAnimatedDrawable(arrowStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.LEFT, false);
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
arrow.draw(minecraft, 33, 19);
}
}

View file

@ -1,69 +0,0 @@
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);
}
}
}

View file

@ -1,41 +0,0 @@
package techreborn.compat.jei.assemblingMachine;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class AssemblingMachineRecipeHandler implements IRecipeHandler<AssemblingMachineRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public AssemblingMachineRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}
@Nonnull
@Override
public Class<AssemblingMachineRecipe> getRecipeClass() {
return AssemblingMachineRecipe.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return RecipeCategoryUids.ASSEMBLING_MACHINE;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull AssemblingMachineRecipe recipe) {
return new AssemblingMachineRecipeWrapper(jeiHelpers, recipe);
}
@Override
public boolean isRecipeValid(@Nonnull AssemblingMachineRecipe recipe) {
return true;
}
}

View file

@ -1,29 +0,0 @@
package techreborn.compat.jei.assemblingMachine;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import net.minecraft.client.Minecraft;
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
import techreborn.client.gui.GuiAssemblingMachine;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
public class AssemblingMachineRecipeWrapper extends BaseRecipeWrapper<AssemblingMachineRecipe> {
private final IDrawableAnimated progress;
public AssemblingMachineRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull AssemblingMachineRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiAssemblingMachine.texture, 176, 14, 20, 18);
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.LEFT, false);
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
progress.draw(minecraft, 40, 18);
}
}

View file

@ -1,59 +0,0 @@
package techreborn.compat.jei.blastFurnace;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.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);
}
}
}

View file

@ -1,41 +0,0 @@
package techreborn.compat.jei.blastFurnace;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class BlastFurnaceRecipeHandler implements IRecipeHandler<BlastFurnaceRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public BlastFurnaceRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}
@Nonnull
@Override
public Class<BlastFurnaceRecipe> getRecipeClass() {
return BlastFurnaceRecipe.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return RecipeCategoryUids.BLAST_FURNACE;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull BlastFurnaceRecipe recipe) {
return new BlastFurnaceRecipeWrapper(jeiHelpers, recipe);
}
@Override
public boolean isRecipeValid(@Nonnull BlastFurnaceRecipe recipe) {
return true;
}
}

View file

@ -1,29 +0,0 @@
package techreborn.compat.jei.blastFurnace;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import net.minecraft.client.Minecraft;
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
import techreborn.client.gui.GuiBlastFurnace;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
public class BlastFurnaceRecipeWrapper extends BaseRecipeWrapper<BlastFurnaceRecipe> {
private final IDrawableAnimated progress;
public BlastFurnaceRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull BlastFurnaceRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiBlastFurnace.texture, 176, 14, 20, 11);
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.LEFT, false);
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
progress.draw(minecraft, 54-29, 13);
}
}

View file

@ -1,62 +0,0 @@
package techreborn.compat.jei.centrifuge;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.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);
}
}
}

View file

@ -1,41 +0,0 @@
package techreborn.compat.jei.centrifuge;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.api.recipe.machines.CentrifugeRecipe;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class CentrifugeRecipeHandler implements IRecipeHandler<CentrifugeRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public CentrifugeRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}
@Nonnull
@Override
public Class<CentrifugeRecipe> getRecipeClass() {
return CentrifugeRecipe.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return RecipeCategoryUids.CENTRIFUGE;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull CentrifugeRecipe recipe) {
return new CentrifugeRecipeWrapper(jeiHelpers, recipe);
}
@Override
public boolean isRecipeValid(@Nonnull CentrifugeRecipe recipe) {
return true;
}
}

View file

@ -1,43 +0,0 @@
package techreborn.compat.jei.centrifuge;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import net.minecraft.client.Minecraft;
import techreborn.api.recipe.machines.CentrifugeRecipe;
import techreborn.client.gui.GuiCentrifuge;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
public class CentrifugeRecipeWrapper extends BaseRecipeWrapper<CentrifugeRecipe> {
private final IDrawableAnimated progressUp;
private final IDrawableAnimated progressLeft;
private final IDrawableAnimated progressDown;
private final IDrawableAnimated progressRight;
public CentrifugeRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull CentrifugeRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressUpStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 14, 12, 12);
IDrawableStatic progressLeftStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 26, 12, 12);
IDrawableStatic progressDownStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 38, 12, 12);
IDrawableStatic progressRightStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 50, 12, 12);
int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation a bit
this.progressUp = guiHelper.createAnimatedDrawable(progressUpStatic, ticksPerCycle, IDrawableAnimated.StartDirection.BOTTOM, false);
this.progressLeft = guiHelper.createAnimatedDrawable(progressLeftStatic, ticksPerCycle, IDrawableAnimated.StartDirection.RIGHT, false);
this.progressDown = guiHelper.createAnimatedDrawable(progressDownStatic, ticksPerCycle, IDrawableAnimated.StartDirection.TOP, false);
this.progressRight = guiHelper.createAnimatedDrawable(progressRightStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
progressUp.draw(minecraft, 33, 18);
progressLeft.draw(minecraft, 18, 33);
progressDown.draw(minecraft, 33, 48);
progressRight.draw(minecraft, 48, 33);
}
}

View file

@ -1,59 +0,0 @@
package techreborn.compat.jei.chemicalReactor;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.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);
}
}
}

View file

@ -1,41 +0,0 @@
package techreborn.compat.jei.chemicalReactor;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class ChemicalReactorRecipeHandler implements IRecipeHandler<ChemicalReactorRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public ChemicalReactorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}
@Nonnull
@Override
public Class<ChemicalReactorRecipe> getRecipeClass() {
return ChemicalReactorRecipe.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return RecipeCategoryUids.CHEMICAL_REACTOR;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull ChemicalReactorRecipe recipe) {
return new ChemicalReactorRecipeWrapper(jeiHelpers, recipe);
}
@Override
public boolean isRecipeValid(@Nonnull ChemicalReactorRecipe recipe) {
return true;
}
}

View file

@ -1,31 +0,0 @@
package techreborn.compat.jei.chemicalReactor;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import net.minecraft.client.Minecraft;
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
import techreborn.client.gui.GuiChemicalReactor;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper<ChemicalReactorRecipe> {
private final IDrawableAnimated progress;
public ChemicalReactorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ChemicalReactorRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiChemicalReactor.texture, 176, 14, 32, 12);
int ticksPerCycle = baseRecipe.tickTime();
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.TOP, false);
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
progress.draw(minecraft, 3, 18);
}
}

View file

@ -1,58 +0,0 @@
package techreborn.compat.jei.compressor;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.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);
}
}
}

View file

@ -1,41 +0,0 @@
package techreborn.compat.jei.compressor;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.api.recipe.machines.CompressorRecipe;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class CompressorRecipeHandler implements IRecipeHandler<CompressorRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public CompressorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}
@Nonnull
@Override
public Class<CompressorRecipe> getRecipeClass() {
return CompressorRecipe.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return RecipeCategoryUids.COMPRESSOR;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull CompressorRecipe recipe) {
return new CompressorRecipeWrapper(jeiHelpers, recipe);
}
@Override
public boolean isRecipeValid(@Nonnull CompressorRecipe recipe) {
return true;
}
}

View file

@ -1,31 +0,0 @@
package techreborn.compat.jei.compressor;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import net.minecraft.client.Minecraft;
import techreborn.api.recipe.machines.CompressorRecipe;
import techreborn.client.gui.GuiCompressor;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
public class CompressorRecipeWrapper extends BaseRecipeWrapper<CompressorRecipe> {
private final IDrawableAnimated progress;
public CompressorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull CompressorRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiCompressor.texture, 176, 14, 20, 11);
int ticksPerCycle = baseRecipe.tickTime();
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
progress.draw(minecraft, 25, 7);
}
}

View file

@ -1,58 +0,0 @@
package techreborn.compat.jei.extractor;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.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);
}
}
}

View file

@ -1,41 +0,0 @@
package techreborn.compat.jei.extractor;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.api.recipe.machines.ExtractorRecipe;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class ExtractorRecipeHandler implements IRecipeHandler<ExtractorRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public ExtractorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}
@Nonnull
@Override
public Class<ExtractorRecipe> getRecipeClass() {
return ExtractorRecipe.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return RecipeCategoryUids.EXTRACTOR;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull ExtractorRecipe recipe) {
return new ExtractorRecipeWrapper(jeiHelpers, recipe);
}
@Override
public boolean isRecipeValid(@Nonnull ExtractorRecipe recipe) {
return true;
}
}

View file

@ -1,31 +0,0 @@
package techreborn.compat.jei.extractor;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import net.minecraft.client.Minecraft;
import techreborn.api.recipe.machines.ExtractorRecipe;
import techreborn.client.gui.GuiExtractor;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
public class ExtractorRecipeWrapper extends BaseRecipeWrapper<ExtractorRecipe> {
private final IDrawableAnimated progress;
public ExtractorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ExtractorRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiExtractor.texture, 176, 17, 22, 11);
int ticksPerCycle = baseRecipe.tickTime();
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
progress.draw(minecraft, 25, 7);
}
}

View file

@ -1,64 +0,0 @@
package techreborn.compat.jei.fusionReactor;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.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());
}
}
}

View file

@ -1,34 +0,0 @@
package techreborn.compat.jei.fusionReactor;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.api.reactor.FusionReactorRecipe;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class FusionReactorRecipeHandler implements IRecipeHandler<FusionReactorRecipe> {
@Nonnull
@Override
public Class<FusionReactorRecipe> getRecipeClass() {
return FusionReactorRecipe.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return RecipeCategoryUids.FUSION_REACTOR;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull FusionReactorRecipe recipe) {
return new FusionReactorRecipeWrapper(recipe);
}
@Override
public boolean isRecipeValid(@Nonnull FusionReactorRecipe recipe) {
return true;
}
}

Some files were not shown because too many files have changed in this diff Show more