Enough to get the game running

This commit is contained in:
modmuss50 2019-02-23 23:51:37 +00:00
parent b8f09d29b7
commit db3a6f2c7e
7 changed files with 76 additions and 26 deletions

View file

@ -32,6 +32,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.state.AbstractProperty;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
@ -40,6 +41,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
import net.minecraft.world.chunk.BlockStateContainer;
import reborncore.api.ToolManager;
import reborncore.common.blocks.BlockWrenchEventHandler;
import reborncore.common.registration.RebornRegister;
@ -78,7 +80,7 @@ public class BlockCable extends BlockContainer {
public BlockCable(TRContent.Cables type) {
super(Block.Properties.create(Material.ROCK).hardnessAndResistance(1f, 8f));
this.type = type;
setDefaultState(getDefaultState().with(EAST, false).with(WEST, false).with(NORTH, false).with(SOUTH, false).with(UP, false).with(DOWN, false));
setDefaultState(this.stateContainer.getBaseState().with(EAST, false).with(WEST, false).with(NORTH, false).with(SOUTH, false).with(UP, false).with(DOWN, false));
BlockWrenchEventHandler.wrenableBlocks.add(this);
}
@ -141,6 +143,11 @@ public class BlockCable extends BlockContainer {
return super.onBlockActivated(state, worldIn, pos, playerIn, hand, side, hitX, hitY, hitZ);
}
@Override
protected void fillStateContainer(StateContainer.Builder<Block, IBlockState> builder) {
builder.add(EAST, WEST, NORTH, SOUTH, UP, DOWN);
}
/*
@Override
@ -166,11 +173,6 @@ public class BlockCable extends BlockContainer {
return false;
}
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, EAST, WEST, NORTH, SOUTH, UP, DOWN);
}
@Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
return getStateFromMeta(meta);

View file

@ -26,6 +26,7 @@ package techreborn.blocks.tier1;
import com.google.common.collect.Lists;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
@ -65,7 +66,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
public static PropertyString TYPE;
public BlockPlayerDetector() {
super();
super(Block.Properties.create(Material.IRON), true);
this.setDefaultState(this.stateContainer.getBaseState().with(TYPE, types[0]));
for (int i = 0; i < types.length; i++) {
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, i, "machines/tier1_machines").setInvVariant("type=" + types[i]));