1591 - I think ill come back to this another day

This commit is contained in:
modmuss50 2019-01-13 17:04:03 +00:00
parent b6312b124a
commit f08fd1da4d
11 changed files with 36 additions and 34 deletions

View file

@ -25,7 +25,7 @@
package techreborn.blocks; package techreborn.blocks;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.DirectionProperty; import net.minecraft.state.DirectionProperty;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@ -56,7 +56,7 @@ import java.util.List;
public class BlockAlarm extends BaseTileBlock { public class BlockAlarm extends BaseTileBlock {
public static DirectionProperty FACING; public static DirectionProperty FACING;
public static PropertyBool ACTIVE; public static BooleanProperty ACTIVE;
private AxisAlignedBB[] bbs; private AxisAlignedBB[] bbs;
public BlockAlarm() { public BlockAlarm() {
@ -100,7 +100,7 @@ public class BlockAlarm extends BaseTileBlock {
@Override @Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
FACING = DirectionProperty.create("facing"); FACING = DirectionProperty.create("facing");
ACTIVE = PropertyBool.create("active"); ACTIVE = BooleanProperty.create("active");
return new BlockStateContainer(this, FACING, ACTIVE); return new BlockStateContainer(this, FACING, ACTIVE);
} }

View file

@ -26,7 +26,7 @@ package techreborn.blocks;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool; import net.minecraft.state.BooleanProperty;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -50,7 +50,7 @@ import techreborn.entities.EntityNukePrimed;
* Created by Mark on 13/03/2016. * Created by Mark on 13/03/2016.
*/ */
public class BlockNuke extends BaseBlock { public class BlockNuke extends BaseBlock {
public static final PropertyBool OVERLAY = PropertyBool.create("overlay"); public static final BooleanProperty OVERLAY = BooleanProperty.create("overlay");
public BlockNuke() { public BlockNuke() {
super(Material.TNT); super(Material.TNT);

View file

@ -67,9 +67,10 @@ public class BlockOre extends Block {
public static int sphaleriteMaxQuantity = 2; public static int sphaleriteMaxQuantity = 2;
public BlockOre() { public BlockOre() {
super(Material.ROCK); super(Block.Builder
setHardness(2.0f); .create(Material.ROCK)
setHarvestLevel("pickaxe", 2); .hardnessAndResistance(2F)
);
} }
@Override @Override

View file

@ -27,7 +27,7 @@ package techreborn.blocks;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.DirectionProperty; import net.minecraft.state.DirectionProperty;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@ -64,7 +64,7 @@ import java.util.Random;
public class BlockRubberLog extends Block { public class BlockRubberLog extends Block {
public static DirectionProperty SAP_SIDE = DirectionProperty.create("sapside", EnumFacing.Plane.HORIZONTAL); public static DirectionProperty SAP_SIDE = DirectionProperty.create("sapside", EnumFacing.Plane.HORIZONTAL);
public static PropertyBool HAS_SAP = PropertyBool.create("hassap"); public static BooleanProperty HAS_SAP = BooleanProperty.create("hassap");
public BlockRubberLog() { public BlockRubberLog() {
super(Material.WOOD); super(Material.WOOD);

View file

@ -27,13 +27,14 @@ package techreborn.blocks.cable;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool; import net.minecraft.state.BooleanProperty;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.state.BooleanProperty;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*; import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
@ -62,12 +63,12 @@ import javax.annotation.Nullable;
@RebornRegister(modID = TechReborn.MOD_ID) @RebornRegister(modID = TechReborn.MOD_ID)
public class BlockCable extends BlockContainer { public class BlockCable extends BlockContainer {
public static final PropertyBool EAST = PropertyBool.create("east"); public static final BooleanProperty EAST = BooleanProperty.create("east");
public static final PropertyBool WEST = PropertyBool.create("west"); public static final BooleanProperty WEST = BooleanProperty.create("west");
public static final PropertyBool NORTH = PropertyBool.create("north"); public static final BooleanProperty NORTH = BooleanProperty.create("north");
public static final PropertyBool SOUTH = PropertyBool.create("south"); public static final BooleanProperty SOUTH = BooleanProperty.create("south");
public static final PropertyBool UP = PropertyBool.create("up"); public static final BooleanProperty UP = BooleanProperty.create("up");
public static final PropertyBool DOWN = PropertyBool.create("down"); public static final BooleanProperty DOWN = BooleanProperty.create("down");
@ConfigRegistry(config = "misc", category = "cable", key = "uninsulatedElectrocutionDamage", comment = "When true an uninsulated cable will cause damage to entities") @ConfigRegistry(config = "misc", category = "cable", key = "uninsulatedElectrocutionDamage", comment = "When true an uninsulated cable will cause damage to entities")
public static boolean uninsulatedElectrocutionDamage = true; public static boolean uninsulatedElectrocutionDamage = true;

View file

@ -25,7 +25,7 @@
package techreborn.blocks.lighting; package techreborn.blocks.lighting;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.DirectionProperty; import net.minecraft.state.DirectionProperty;
import net.minecraft.block.state.BlockFaceShape; import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
@ -53,7 +53,7 @@ import techreborn.tiles.lighting.TileLamp;
public class BlockLamp extends BaseTileBlock { public class BlockLamp extends BaseTileBlock {
public static DirectionProperty FACING; public static DirectionProperty FACING;
public static PropertyBool ACTIVE; public static BooleanProperty ACTIVE;
private AxisAlignedBB[] bbs; private AxisAlignedBB[] bbs;
private int cost; private int cost;
@ -116,7 +116,7 @@ public class BlockLamp extends BaseTileBlock {
@Override @Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
FACING = DirectionProperty.create("facing"); FACING = DirectionProperty.create("facing");
ACTIVE = PropertyBool.create("active"); ACTIVE = BooleanProperty.create("active");
return new BlockStateContainer(this, FACING, ACTIVE); return new BlockStateContainer(this, FACING, ACTIVE);
} }

View file

@ -26,7 +26,7 @@ package techreborn.packets;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.network.NetworkEvent;
import reborncore.common.network.ExtendedPacketBuffer; import reborncore.common.network.ExtendedPacketBuffer;
import reborncore.common.network.INetworkPacket; import reborncore.common.network.INetworkPacket;
import techreborn.tiles.storage.TileAdjustableSU; import techreborn.tiles.storage.TileAdjustableSU;
@ -57,8 +57,8 @@ public class PacketAesu implements INetworkPacket {
} }
@Override @Override
public void processData(MessageContext context) { public void processData(NetworkEvent.Context context) {
TileEntity tile = context.getServerHandler().player.world.getTileEntity(pos); TileEntity tile = context.getSender().world.getTileEntity(pos);
if (tile instanceof TileAdjustableSU){ if (tile instanceof TileAdjustableSU){
((TileAdjustableSU) tile).handleGuiInputFromClient(buttonID); ((TileAdjustableSU) tile).handleGuiInputFromClient(buttonID);
} }

View file

@ -26,7 +26,7 @@ package techreborn.packets;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.network.NetworkEvent;
import reborncore.common.network.ExtendedPacketBuffer; import reborncore.common.network.ExtendedPacketBuffer;
import reborncore.common.network.INetworkPacket; import reborncore.common.network.INetworkPacket;
import techreborn.tiles.machine.tier1.TileAutoCraftingTable; import techreborn.tiles.machine.tier1.TileAutoCraftingTable;
@ -57,8 +57,8 @@ public class PacketAutoCraftingTableLock implements INetworkPacket {
} }
@Override @Override
public void processData(MessageContext context) { public void processData(NetworkEvent.Context context) {
TileEntity tileEntity = context.getServerHandler().player.world.getTileEntity(machinePos); TileEntity tileEntity = context.getSender().world.getTileEntity(machinePos);
if(tileEntity instanceof TileAutoCraftingTable){ if(tileEntity instanceof TileAutoCraftingTable){
((TileAutoCraftingTable) tileEntity).locked = locked; ((TileAutoCraftingTable) tileEntity).locked = locked;
} }

View file

@ -26,7 +26,7 @@ package techreborn.packets;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.network.NetworkEvent;
import reborncore.common.network.ExtendedPacketBuffer; import reborncore.common.network.ExtendedPacketBuffer;
import reborncore.common.network.INetworkPacket; import reborncore.common.network.INetworkPacket;
import techreborn.tiles.fusionReactor.TileFusionControlComputer; import techreborn.tiles.fusionReactor.TileFusionControlComputer;
@ -57,8 +57,8 @@ public class PacketFusionControlSize implements INetworkPacket {
} }
@Override @Override
public void processData(MessageContext context) { public void processData(NetworkEvent.Context context) {
TileEntity tile = context.getServerHandler().player.world.getTileEntity(pos); TileEntity tile = context.getSender().world.getTileEntity(pos);
if(tile instanceof TileFusionControlComputer){ if(tile instanceof TileFusionControlComputer){
((TileFusionControlComputer) tile).changeSize(sizeDelta); ((TileFusionControlComputer) tile).changeSize(sizeDelta);
} }

View file

@ -25,7 +25,7 @@
package techreborn.packets; package techreborn.packets;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.network.NetworkEvent;
import reborncore.common.network.ExtendedPacketBuffer; import reborncore.common.network.ExtendedPacketBuffer;
import reborncore.common.network.INetworkPacket; import reborncore.common.network.INetworkPacket;
import techreborn.tiles.storage.idsu.TileInterdimensionalSU; import techreborn.tiles.storage.idsu.TileInterdimensionalSU;
@ -56,7 +56,7 @@ public class PacketIdsu implements INetworkPacket {
} }
@Override @Override
public void processData(MessageContext context) { public void processData(NetworkEvent.Context context) {
// if (!pos.getWorld().isRemote) { // if (!pos.getWorld().isRemote) {
// pos.handleGuiInputFromClient(buttonID); // pos.handleGuiInputFromClient(buttonID);
// } // }

View file

@ -26,7 +26,7 @@ package techreborn.packets;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.network.NetworkEvent;
import reborncore.common.network.ExtendedPacketBuffer; import reborncore.common.network.ExtendedPacketBuffer;
import reborncore.common.network.INetworkPacket; import reborncore.common.network.INetworkPacket;
import techreborn.tiles.machine.tier1.TileRollingMachine; import techreborn.tiles.machine.tier1.TileRollingMachine;
@ -57,8 +57,8 @@ public class PacketRollingMachineLock implements INetworkPacket {
} }
@Override @Override
public void processData(MessageContext context) { public void processData(NetworkEvent.Context context) {
TileEntity tileEntity = context.getServerHandler().player.world.getTileEntity(machinePos); TileEntity tileEntity = context.getSender().world.getTileEntity(machinePos);
if(tileEntity instanceof TileRollingMachine){ if(tileEntity instanceof TileRollingMachine){
((TileRollingMachine) tileEntity).locked = locked; ((TileRollingMachine) tileEntity).locked = locked;
} }