Slight rework of the gui system, should fix some issues with wrenching. Should fix #1264 fixes #988 + a handful of weird gui de-syncs

This commit is contained in:
modmuss50 2017-09-06 13:46:12 +01:00
parent 8588a40474
commit 094b67e050
44 changed files with 183 additions and 229 deletions

1
.gitignore vendored
View file

@ -24,3 +24,4 @@ changelog.txt
java_pid2412.hprof java_pid2412.hprof
/asmTemp/ /asmTemp/
/logs/ /logs/
/classes/

View file

@ -34,6 +34,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -71,12 +72,7 @@ public class BlockAutoCraftingTable extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.AUTO_CRAFTING_TABLE;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui( Core.INSTANCE, EGui.AUTO_CRAFTING_TABLE.ordinal(), world, pos.getX(), pos.getY(),pos.getZ());
}
return true;
} }
} }

View file

@ -31,6 +31,7 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -45,11 +46,7 @@ public class BlockComputerCube extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.MANUAL;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.MANUAL.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -39,6 +39,7 @@ import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidBase; import net.minecraftforge.fluids.BlockFluidBase;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -123,11 +124,7 @@ public class BlockDigitalChest extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.DIGITAL_CHEST;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.DIGITAL_CHEST.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -34,6 +34,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -56,9 +57,12 @@ public class BlockFusionControlComputer extends BlockMachineBase {
final float hitX, final float hitY, final float hitZ) { final float hitX, final float hitY, final float hitZ) {
final TileFusionControlComputer tileFusionControlComputer = (TileFusionControlComputer) world.getTileEntity(pos); final TileFusionControlComputer tileFusionControlComputer = (TileFusionControlComputer) world.getTileEntity(pos);
tileFusionControlComputer.checkCoils(); tileFusionControlComputer.checkCoils();
if (!player.isSneaking()) return super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ);
player.openGui(Core.INSTANCE, EGui.FUSION_CONTROLLER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); }
return true;
@Override
public IMachineGuiHandler getGui() {
return EGui.FUSION_CONTROLLER;
} }
@Override @Override

View file

@ -47,11 +47,13 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.PropertyString; import reborncore.common.blocks.PropertyString;
import reborncore.common.util.ArrayUtils; import reborncore.common.util.ArrayUtils;
import reborncore.common.util.ChatUtils; import reborncore.common.util.ChatUtils;
import reborncore.common.util.StringUtils; import reborncore.common.util.StringUtils;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
import techreborn.lib.MessageIDs; import techreborn.lib.MessageIDs;
@ -179,4 +181,9 @@ public class BlockPlayerDetector extends BlockMachineBase {
public int getMetaFromState(IBlockState state) { public int getMetaFromState(IBlockState state) {
return typeNamesList.indexOf(state.getValue(TYPE)); return typeNamesList.indexOf(state.getValue(TYPE));
} }
@Override
public IMachineGuiHandler getGui() {
return null;
}
} }

View file

@ -39,6 +39,7 @@ import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidBase; import net.minecraftforge.fluids.BlockFluidBase;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -124,10 +125,7 @@ public class BlockQuantumChest extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World worldIn, final BlockPos pos, final IBlockState state, final EntityPlayer playerIn, public IMachineGuiHandler getGui() {
final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ) { return EGui.QUANTUM_CHEST;
if (!playerIn.isSneaking())
playerIn.openGui(Core.INSTANCE, EGui.QUANTUM_CHEST.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -55,15 +56,7 @@ public class BlockQuantumTank extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.QUANTUM_TANK;
final float hitX, final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, pos, player)) {
return true;
}
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.QUANTUM_TANK.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true;
} }
} }

View file

@ -31,7 +31,9 @@ import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
public class BlockSupercondensator extends BlockMachineBase { public class BlockSupercondensator extends BlockMachineBase {
@ -47,4 +49,9 @@ public class BlockSupercondensator extends BlockMachineBase {
// TODO // TODO
// Remember to remove WIP override and imports once complete // Remember to remove WIP override and imports once complete
} }
@Override
public IMachineGuiHandler getGui() {
return null;
}
} }

View file

@ -26,7 +26,9 @@ package techreborn.blocks.advanced_machine;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
@ -37,4 +39,9 @@ public class BlockDistillationTower extends BlockMachineBase {
setCreativeTab(TechRebornCreativeTab.instance); setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines")); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines"));
} }
@Override
public IMachineGuiHandler getGui() {
return null;
}
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockImplosionCompressor extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.IMPLOSION_COMPRESSOR;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui( Core.INSTANCE, EGui.IMPLOSION_COMPRESSOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,12 +55,8 @@ public class BlockIndustrialBlastFurnace extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.BLAST_FURNACE;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.BLAST_FURNACE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
@Override @Override

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,12 +55,7 @@ public class BlockIndustrialCentrifuge extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.CENTRIFUGE;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.CENTRIFUGE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockIndustrialElectrolyzer extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.INDUSTRIAL_ELECTROLYZER;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui( Core.INSTANCE, EGui.INDUSTRIAL_ELECTROLYZER.ordinal(), world, pos.getX(), pos.getY(),pos.getZ());
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,14 +55,7 @@ public class BlockIndustrialGrinder extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.INDUSTRIAL_GRINDER;
final float hitX, final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, pos, player)) {
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.INDUSTRIAL_GRINDER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,14 +55,7 @@ public class BlockIndustrialSawmill extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.SAWMILL;
final float hitX, final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, pos, player)) {
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.SAWMILL.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -60,15 +61,7 @@ public class BlockDieselGenerator extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.DIESEL_GENERATOR;
final float hitX, final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, pos, player)) {
return true;
}
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.DIESEL_GENERATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true;
} }
} }

View file

@ -31,7 +31,9 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileDragonEggSyphon; import techreborn.tiles.generator.TileDragonEggSyphon;
@ -58,4 +60,9 @@ public class BlockDragonEggSyphon extends BlockMachineBase {
//Remember to remove WIP override and imports once complete //Remember to remove WIP override and imports once complete
} }
@Override
public IMachineGuiHandler getGui() {
return null;
}
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,15 +55,8 @@ public class BlockGasTurbine extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.GAS_TURBINE;
final float hitX, final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, pos, player)) {
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.GAS_TURBINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -28,7 +28,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileLightningRod; import techreborn.tiles.generator.TileLightningRod;
@ -46,4 +48,9 @@ public class BlockLightningRod extends BlockMachineBase {
return new TileLightningRod(); return new TileLightningRod();
} }
@Override
public IMachineGuiHandler getGui() {
return null;
}
} }

View file

@ -32,7 +32,9 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
@ -51,4 +53,9 @@ public class BlockMagicEnergyAbsorber extends BlockMachineBase {
// Remember to remove WIP override and imports once complete // Remember to remove WIP override and imports once complete
} }
@Override
public IMachineGuiHandler getGui() {
return null;
}
} }

View file

@ -32,7 +32,9 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
@ -50,4 +52,9 @@ public class BlockMagicEnergyConverter extends BlockMachineBase {
//TODO //TODO
//Remember to remove WIP override and imports once complete //Remember to remove WIP override and imports once complete
} }
@Override
public IMachineGuiHandler getGui() {
return null;
}
} }

View file

@ -31,7 +31,9 @@ import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
public class BlockPlasmaGenerator extends BlockMachineBase { public class BlockPlasmaGenerator extends BlockMachineBase {
@ -48,4 +50,9 @@ public class BlockPlasmaGenerator extends BlockMachineBase {
// TODO // TODO
// Remember to remove WIP override and imports once complete // Remember to remove WIP override and imports once complete
} }
@Override
public IMachineGuiHandler getGui() {
return null;
}
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,14 +55,7 @@ public class BlockSemiFluidGenerator extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.SEMIFLUID_GENERATOR;
final float hitX, final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, pos, player)) {
return true;
}
if (!player.isSneaking())
player.openGui( Core.INSTANCE, EGui.SEMIFLUID_GENERATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,12 +55,7 @@ public class BlockSolidFuelGenerator extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.GENERATOR;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.GENERATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,14 +55,7 @@ public class BlockThermalGenerator extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.THERMAL_GENERATOR;
final float hitX, final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, pos, player)) {
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.THERMAL_GENERATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -28,7 +28,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileWindMill; import techreborn.tiles.generator.TileWindMill;
@ -50,4 +52,9 @@ public class BlockWindMill extends BlockMachineBase {
return new TileWindMill(); return new TileWindMill();
} }
@Override
public IMachineGuiHandler getGui() {
return null;
}
} }

View file

@ -35,6 +35,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -59,12 +60,8 @@ public class BlockIronAlloyFurnace extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.ALLOY_FURNACE;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.ALLOY_FURNACE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
@Override @Override

View file

@ -38,6 +38,7 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -63,12 +64,8 @@ public class BlockIronFurnace extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.IRON_FURNACE;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.IRON_FURNACE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
@Override @Override

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockAssemblingMachine extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.ASSEMBLING_MACHINE;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.ASSEMBLING_MACHINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockChargeOMat extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.CHARGEBENCH;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.CHARGEBENCH.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockChemicalReactor extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.CHEMICAL_REACTOR;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.CHEMICAL_REACTOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockChunkLoader extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.CHUNK_LOADER;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.CHUNK_LOADER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,12 +55,8 @@ public class BlockMatterFabricator extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.MATTER_FABRICATOR;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.MATTER_FABRICATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
@Override @Override

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockRollingMachine extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.ROLLING_MACHINE;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.ROLLING_MACHINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -36,6 +36,7 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -59,13 +60,8 @@ public class BlockScrapboxinator extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.SCRAPBOXINATOR;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.SCRAPBOXINATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true;
} }
@Override @Override

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,13 +55,7 @@ public class BlockVacuumFreezer extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.VACUUM_FREEZER;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.VACUUM_FREEZER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
}
return false;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockAlloySmelter extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.ALLOY_SMELTER;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.ALLOY_SMELTER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,12 +55,7 @@ public class BlockCompressor extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.COMPRESSOR;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.COMPRESSOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,12 +55,7 @@ public class BlockElectricFurnace extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.ELECTRIC_FURNACE;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.ELECTRIC_FURNACE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,12 +55,7 @@ public class BlockExtractor extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.EXTRACTOR;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.EXTRACTOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,12 +55,7 @@ public class BlockGrinder extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.GRINDER;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.GRINDER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true;
} }
} }

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound; import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -54,12 +55,8 @@ public class BlockRecycler extends BlockMachineBase {
} }
@Override @Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, public IMachineGuiHandler getGui() {
final EntityPlayer player, final EnumHand hand, final EnumFacing side, return EGui.RECYCLER;
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.RECYCLER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true;
} }
} }

View file

@ -24,7 +24,13 @@
package techreborn.client; package techreborn.client;
public enum EGui { import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.api.tile.IMachineGuiHandler;
import techreborn.Core;
public enum EGui implements IMachineGuiHandler {
THERMAL_GENERATOR(true), THERMAL_GENERATOR(true),
QUANTUM_TANK(true), QUANTUM_TANK(true),
@ -76,4 +82,12 @@ public enum EGui {
public boolean useContainerBuilder() { public boolean useContainerBuilder() {
return this.containerBuilder; return this.containerBuilder;
} }
@Override
public void open(EntityPlayer player, BlockPos pos, World world) {
if(!world.isRemote){
player.openGui(Core.INSTANCE, this.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
}
} }