Change all containers init to IContainerProvider + Add Enum for gui ids handling
This commit is contained in:
parent
b93fe6c5ad
commit
eb220643fc
114 changed files with 2155 additions and 2025 deletions
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
|
||||
|
@ -15,47 +17,47 @@ public class BlockAlloySmelter extends BlockMachineBase implements IRotationText
|
|||
|
||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||
|
||||
public BlockAlloySmelter(Material material) {
|
||||
public BlockAlloySmelter(final Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.alloysmelter");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setUnlocalizedName("techreborn.alloysmelter");
|
||||
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||
return new TileAlloySmelter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.alloySmelterID, world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.ALLOY_SMELTER.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "electric_alloy_furnace_front_off";
|
||||
return this.prefix + "electric_alloy_furnace_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "electric_alloy_furnace_front_on";
|
||||
return this.prefix + "electric_alloy_furnace_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "tier1_machine_side";
|
||||
return this.prefix + "tier1_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "tier1_machine_top";
|
||||
return this.prefix + "tier1_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "tier1_machine_bottom";
|
||||
return this.prefix + "tier1_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.teir1.TileCompressor;
|
||||
|
||||
|
@ -15,48 +17,48 @@ public class BlockCompressor extends BlockMachineBase implements IRotationTextur
|
|||
|
||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||
|
||||
public BlockCompressor(Material material) {
|
||||
public BlockCompressor(final Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.compressor");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setUnlocalizedName("techreborn.compressor");
|
||||
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||
return new TileCompressor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, GuiHandler.compressorID, world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.COMPRESSOR.ordinal(), world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "compressor_front_off";
|
||||
return this.prefix + "compressor_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "compressor_front_on";
|
||||
return this.prefix + "compressor_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "tier1_machine_side";
|
||||
return this.prefix + "tier1_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "tier1_machine_top";
|
||||
return this.prefix + "tier1_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "tier1_machine_bottom";
|
||||
return this.prefix + "tier1_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.teir1.TileElectricFurnace;
|
||||
|
||||
|
@ -15,48 +17,48 @@ public class BlockElectricFurnace extends BlockMachineBase implements IRotationT
|
|||
|
||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||
|
||||
public BlockElectricFurnace(Material material) {
|
||||
public BlockElectricFurnace(final Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.electricfurnace");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setUnlocalizedName("techreborn.electricfurnace");
|
||||
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||
return new TileElectricFurnace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, GuiHandler.electricFurnaceID, world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.ELECTRIC_FURNACE.ordinal(), world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "electric_furnace_front_off";
|
||||
return this.prefix + "electric_furnace_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "electric_furnace_front_on";
|
||||
return this.prefix + "electric_furnace_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "tier1_machine_side";
|
||||
return this.prefix + "tier1_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "tier1_machine_top";
|
||||
return this.prefix + "tier1_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "tier1_machine_bottom";
|
||||
return this.prefix + "tier1_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.teir1.TileExtractor;
|
||||
|
||||
|
@ -15,48 +17,48 @@ public class BlockExtractor extends BlockMachineBase implements IRotationTexture
|
|||
|
||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||
|
||||
public BlockExtractor(Material material) {
|
||||
public BlockExtractor(final Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.extractor");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setUnlocalizedName("techreborn.extractor");
|
||||
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||
return new TileExtractor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, GuiHandler.extractorID, world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.EXTRACTOR.ordinal(), world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "extractor_front_off";
|
||||
return this.prefix + "extractor_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "extractor_front_on";
|
||||
return this.prefix + "extractor_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "tier1_machine_side";
|
||||
return this.prefix + "tier1_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "tier1_machine_top";
|
||||
return this.prefix + "tier1_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "tier1_machine_bottom";
|
||||
return this.prefix + "tier1_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.teir1.TileGrinder;
|
||||
|
||||
|
@ -15,44 +17,44 @@ public class BlockGrinder extends BlockMachineBase implements IAdvancedRotationT
|
|||
|
||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||
|
||||
public BlockGrinder(Material material) {
|
||||
public BlockGrinder(final Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.grinder");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setUnlocalizedName("techreborn.grinder");
|
||||
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||
return new TileGrinder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, GuiHandler.grinderID, world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.GRINDER.ordinal(), world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return isActive ? prefix + "grinder_front_on" : prefix + "grinder_front_off";
|
||||
public String getFront(final boolean isActive) {
|
||||
return isActive ? this.prefix + "grinder_front_on" : this.prefix + "grinder_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "tier1_machine_side";
|
||||
public String getSide(final boolean isActive) {
|
||||
return this.prefix + "tier1_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return isActive ? prefix + "grinder_top_on" : prefix + "grinder_top_off";
|
||||
public String getTop(final boolean isActive) {
|
||||
return isActive ? this.prefix + "grinder_top_on" : this.prefix + "grinder_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "tier1_machine_bottom";
|
||||
public String getBottom(final boolean isActive) {
|
||||
return this.prefix + "tier1_machine_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.teir1.TileRecycler;
|
||||
|
||||
|
@ -15,48 +17,48 @@ public class BlockRecycler extends BlockMachineBase implements IRotationTexture
|
|||
|
||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||
|
||||
public BlockRecycler(Material material) {
|
||||
public BlockRecycler(final Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.recycler");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setUnlocalizedName("techreborn.recycler");
|
||||
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||
return new TileRecycler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, GuiHandler.recyclerID, world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.RECYCLER.ordinal(), world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "recycler_front_off";
|
||||
return this.prefix + "recycler_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "recycler_front_on";
|
||||
return this.prefix + "recycler_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "tier1_machine_side";
|
||||
return this.prefix + "tier1_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "tier1_machine_top";
|
||||
return this.prefix + "tier1_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "tier1_machine_bottom";
|
||||
return this.prefix + "tier1_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue