1696 - find + replace pass

This commit is contained in:
modmuss50 2019-01-13 16:51:50 +00:00
parent 368e2d48df
commit b6312b124a
94 changed files with 418 additions and 419 deletions

View file

@ -32,12 +32,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.MapGenStructureIO;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.*; import net.minecraftforge.fml.common.event.*;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.EntityRegistry; import net.minecraftforge.fml.common.registry.EntityRegistry;
import net.minecraftforge.fml.common.registry.ForgeRegistries; import net.minecraftforge.fml.common.registry.ForgeRegistries;

View file

@ -26,7 +26,7 @@ package techreborn.blocks;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection; 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;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
@ -55,13 +55,13 @@ import javax.annotation.Nullable;
import java.util.List; import java.util.List;
public class BlockAlarm extends BaseTileBlock { public class BlockAlarm extends BaseTileBlock {
public static PropertyDirection FACING; public static DirectionProperty FACING;
public static PropertyBool ACTIVE; public static PropertyBool ACTIVE;
private AxisAlignedBB[] bbs; private AxisAlignedBB[] bbs;
public BlockAlarm() { public BlockAlarm() {
super(Material.ROCK); super(Material.ROCK);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, false)); this.setDefaultState(this.blockState.getBaseState().with(FACING, EnumFacing.NORTH).with(ACTIVE, false));
this.bbs = GenBoundingBoxes(0.19, 0.81); this.bbs = GenBoundingBoxes(0.19, 0.81);
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/lighting")); RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/lighting"));
BlockWrenchEventHandler.wrenableBlocks.add(this); BlockWrenchEventHandler.wrenableBlocks.add(this);
@ -88,18 +88,18 @@ public class BlockAlarm extends BaseTileBlock {
} }
public static void setFacing(EnumFacing facing, World world, BlockPos pos) { public static void setFacing(EnumFacing facing, World world, BlockPos pos) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(FACING, facing)); world.setBlockState(pos, world.getBlockState(pos).with(FACING, facing));
} }
public static void setActive(boolean active, World world, BlockPos pos) { public static void setActive(boolean active, World world, BlockPos pos) {
EnumFacing facing = world.getBlockState(pos).getValue(FACING); EnumFacing facing = world.getBlockState(pos).getValue(FACING);
IBlockState state = world.getBlockState(pos).withProperty(ACTIVE, active).withProperty(FACING, facing); IBlockState state = world.getBlockState(pos).with(ACTIVE, active).with(FACING, facing);
world.setBlockState(pos, state, 3); world.setBlockState(pos, state, 3);
} }
@Override @Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
FACING = PropertyDirection.create("facing"); FACING = DirectionProperty.create("facing");
ACTIVE = PropertyBool.create("active"); ACTIVE = PropertyBool.create("active");
return new BlockStateContainer(this, FACING, ACTIVE); return new BlockStateContainer(this, FACING, ACTIVE);
} }
@ -141,7 +141,7 @@ public class BlockAlarm extends BaseTileBlock {
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
Boolean active = (meta & 8) == 8; Boolean active = (meta & 8) == 8;
EnumFacing facing = EnumFacing.byIndex(meta & 7); EnumFacing facing = EnumFacing.byIndex(meta & 7);
return this.getDefaultState().withProperty(FACING, facing).withProperty(ACTIVE, active); return this.getDefaultState().with(FACING, facing).with(ACTIVE, active);
} }
@Nullable @Nullable
@ -153,7 +153,7 @@ public class BlockAlarm extends BaseTileBlock {
@Override @Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY,
float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
return this.getDefaultState().withProperty(FACING, facing); return this.getDefaultState().with(FACING, facing);
} }
@Override @Override

View file

@ -39,8 +39,8 @@ import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import techreborn.TechReborn; import techreborn.TechReborn;
import techreborn.tiles.TileEntityFlare; import techreborn.tiles.TileEntityFlare;
import java.util.List; import java.util.List;
@ -58,7 +58,7 @@ public class BlockFlare extends BlockContainer {
super(Material.REDSTONE_LIGHT); super(Material.REDSTONE_LIGHT);
setCreativeTab(TechReborn.TAB); setCreativeTab(TechReborn.TAB);
setTranslationKey("techreborn.flare"); setTranslationKey("techreborn.flare");
this.setDefaultState(this.blockState.getBaseState().withProperty(COLOR, EnumDyeColor.WHITE)); this.setDefaultState(this.blockState.getBaseState().with(COLOR, EnumDyeColor.WHITE));
} }
@Override @Override
@ -74,7 +74,7 @@ public class BlockFlare extends BlockContainer {
return (state.getValue(COLOR)).getMetadata(); return (state.getValue(COLOR)).getMetadata();
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) { public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) {
for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) { for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) {
list.add(new ItemStack(itemIn, 1, enumdyecolor.getMetadata())); list.add(new ItemStack(itemIn, 1, enumdyecolor.getMetadata()));
@ -83,7 +83,7 @@ public class BlockFlare extends BlockContainer {
@Override @Override
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta)); return this.getDefaultState().with(COLOR, EnumDyeColor.byMetadata(meta));
} }
@Override @Override
@ -102,7 +102,7 @@ public class BlockFlare extends BlockContainer {
} }
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public BlockRenderLayer getRenderLayer() { public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT; return BlockRenderLayer.CUTOUT;
} }

View file

@ -54,7 +54,7 @@ public class BlockNuke extends BaseBlock {
public BlockNuke() { public BlockNuke() {
super(Material.TNT); super(Material.TNT);
this.setDefaultState(this.blockState.getBaseState().withProperty(OVERLAY, false)); this.setDefaultState(this.blockState.getBaseState().with(OVERLAY, false));
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this)); RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this));
} }
@ -123,7 +123,7 @@ public class BlockNuke extends BaseBlock {
@Override @Override
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(OVERLAY, (meta & 1) > 0); return this.getDefaultState().with(OVERLAY, (meta & 1) > 0);
} }
@Override @Override

View file

@ -29,8 +29,8 @@ import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.BlockRenderLayer;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.client.models.ModelCompound; import reborncore.client.models.ModelCompound;
import reborncore.client.models.RebornModelRegistry; import reborncore.client.models.RebornModelRegistry;
import techreborn.TechReborn; import techreborn.TechReborn;
@ -57,7 +57,7 @@ public class BlockReinforcedGlass extends BlockGlass {
} }
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public BlockRenderLayer getRenderLayer() { public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT; return BlockRenderLayer.CUTOUT;
} }

View file

@ -36,8 +36,8 @@ import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.client.models.ModelCompound; import reborncore.client.models.ModelCompound;
import reborncore.client.models.RebornModelRegistry; import reborncore.client.models.RebornModelRegistry;
import techreborn.TechReborn; import techreborn.TechReborn;
@ -49,8 +49,8 @@ public class BlockRubberLeaves extends BlockLeaves {
public BlockRubberLeaves() { public BlockRubberLeaves() {
super(); super();
this.setDefaultState(this.getDefaultState().withProperty(CHECK_DECAY, true) this.setDefaultState(this.getDefaultState().with(CHECK_DECAY, true)
.withProperty(DECAYABLE, true)); .with(DECAYABLE, true));
Blocks.FIRE.setFireInfo(this, 30, 60); Blocks.FIRE.setFireInfo(this, 30, 60);
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, CHECK_DECAY, DECAYABLE)); RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, CHECK_DECAY, DECAYABLE));
} }
@ -90,8 +90,8 @@ public class BlockRubberLeaves extends BlockLeaves {
@Override @Override
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(DECAYABLE, (meta & 1) == 0) return this.getDefaultState().with(DECAYABLE, (meta & 1) == 0)
.withProperty(CHECK_DECAY, (meta & 2) > 0); .with(CHECK_DECAY, (meta & 2) > 0);
} }
@Override @Override
@ -106,17 +106,17 @@ public class BlockRubberLeaves extends BlockLeaves {
return meta; return meta;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public int getBlockColor() { public int getBlockColor() {
return 16777215; return 16777215;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public int getRenderColor(IBlockState state) { public int getRenderColor(IBlockState state) {
return 16777215; return 16777215;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) { public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) {
return 16777215; return 16777215;
} }

View file

@ -28,7 +28,7 @@ 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.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection; 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;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -63,14 +63,14 @@ import java.util.Random;
*/ */
public class BlockRubberLog extends Block { public class BlockRubberLog extends Block {
public static PropertyDirection SAP_SIDE = PropertyDirection.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 PropertyBool HAS_SAP = PropertyBool.create("hassap");
public BlockRubberLog() { public BlockRubberLog() {
super(Material.WOOD); super(Material.WOOD);
this.setHardness(2.0F); this.setHardness(2.0F);
this.setDefaultState( this.setDefaultState(
this.getDefaultState().withProperty(SAP_SIDE, EnumFacing.NORTH).withProperty(HAS_SAP, false)); this.getDefaultState().with(SAP_SIDE, EnumFacing.NORTH).with(HAS_SAP, false));
this.setTickRandomly(true); this.setTickRandomly(true);
this.setSoundType(SoundType.WOOD); this.setSoundType(SoundType.WOOD);
Blocks.FIRE.setFireInfo(this, 5, 5); Blocks.FIRE.setFireInfo(this, 5, 5);
@ -91,7 +91,7 @@ public class BlockRubberLog extends Block {
tempMeta -= 3; tempMeta -= 3;
} }
EnumFacing facing = EnumFacing.byHorizontalIndex(tempMeta); EnumFacing facing = EnumFacing.byHorizontalIndex(tempMeta);
return this.getDefaultState().withProperty(SAP_SIDE, facing).withProperty(HAS_SAP, hasSap); return this.getDefaultState().with(SAP_SIDE, facing).with(HAS_SAP, hasSap);
} }
@Override @Override
@ -155,7 +155,7 @@ public class BlockRubberLog extends Block {
EnumFacing facing = EnumFacing.byHorizontalIndex(rand.nextInt(4)); EnumFacing facing = EnumFacing.byHorizontalIndex(rand.nextInt(4));
if (worldIn.getBlockState(pos.down()).getBlock() == this if (worldIn.getBlockState(pos.down()).getBlock() == this
&& worldIn.getBlockState(pos.up()).getBlock() == this) { && worldIn.getBlockState(pos.up()).getBlock() == this) {
worldIn.setBlockState(pos, state.withProperty(HAS_SAP, true).withProperty(SAP_SIDE, facing)); worldIn.setBlockState(pos, state.with(HAS_SAP, true).with(SAP_SIDE, facing));
} }
} }
} }
@ -176,7 +176,7 @@ public class BlockRubberLog extends Block {
if ((capEnergy != null && capEnergy.getEnergyStored() > 20) || stack.getItem() instanceof ItemTreeTap) { if ((capEnergy != null && capEnergy.getEnergyStored() > 20) || stack.getItem() instanceof ItemTreeTap) {
if (state.getValue(HAS_SAP) && state.getValue(SAP_SIDE) == side) { if (state.getValue(HAS_SAP) && state.getValue(SAP_SIDE) == side) {
worldIn.setBlockState(pos, worldIn.setBlockState(pos,
state.withProperty(HAS_SAP, false).withProperty(SAP_SIDE, EnumFacing.byHorizontalIndex(0))); state.with(HAS_SAP, false).with(SAP_SIDE, EnumFacing.byHorizontalIndex(0)));
worldIn.playSound(null, pos.getX(), pos.getY(), pos.getZ(), ModSounds.SAP_EXTRACT, SoundCategory.BLOCKS, worldIn.playSound(null, pos.getX(), pos.getY(), pos.getZ(), ModSounds.SAP_EXTRACT, SoundCategory.BLOCKS,
0.6F, 1F); 0.6F, 1F);
if (!worldIn.isRemote) { if (!worldIn.isRemote) {

View file

@ -55,14 +55,14 @@ public abstract class BlockRubberPlankSlab extends BlockSlab {
this.name = name; this.name = name;
IBlockState iblockstate = this.blockState.getBaseState(); IBlockState iblockstate = this.blockState.getBaseState();
if (!this.isDouble()) { if (!this.isDouble()) {
iblockstate = iblockstate.withProperty(HALF, EnumBlockHalf.BOTTOM); iblockstate = iblockstate.with(HALF, EnumBlockHalf.BOTTOM);
halfslab = this; halfslab = this;
} }
setHarvestLevel("axe", 0); setHarvestLevel("axe", 0);
setHardness(2.0F); setHardness(2.0F);
setResistance(15); setResistance(15);
setSoundType(SoundType.WOOD); setSoundType(SoundType.WOOD);
this.setDefaultState(iblockstate.withProperty(VARIANT, BlockRubberPlankSlab.Variant.DEFAULT)); this.setDefaultState(iblockstate.with(VARIANT, BlockRubberPlankSlab.Variant.DEFAULT));
useNeighborBrightness = true; useNeighborBrightness = true;
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this)); RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this));
} }
@ -84,10 +84,10 @@ public abstract class BlockRubberPlankSlab extends BlockSlab {
@Override @Override
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, BlockRubberPlankSlab.Variant.DEFAULT); IBlockState iblockstate = this.getDefaultState().with(VARIANT, BlockRubberPlankSlab.Variant.DEFAULT);
if (!this.isDouble()) { if (!this.isDouble()) {
iblockstate = iblockstate.withProperty(HALF, (meta & 8) == 0 ? EnumBlockHalf.BOTTOM : EnumBlockHalf.TOP); iblockstate = iblockstate.with(HALF, (meta & 8) == 0 ? EnumBlockHalf.BOTTOM : EnumBlockHalf.TOP);
} }
return iblockstate; return iblockstate;

View file

@ -42,7 +42,7 @@ import java.util.Random;
public class BlockRubberSapling extends BlockSapling { public class BlockRubberSapling extends BlockSapling {
public BlockRubberSapling() { public BlockRubberSapling() {
this.setDefaultState(this.getDefaultState().withProperty(STAGE, 0)); this.setDefaultState(this.getDefaultState().with(STAGE, 0));
setSoundType(SoundType.PLANT); setSoundType(SoundType.PLANT);
} }

View file

@ -64,7 +64,7 @@ public class BlockStorage extends BaseBlock {
// if (meta > types.length) { // if (meta > types.length) {
// meta = 0; // meta = 0;
// } // }
// return getBlockState().getBaseState().withProperty(TYPE, typesList.get(meta)); // return getBlockState().getBaseState().with(TYPE, typesList.get(meta));
// } // }
// //
// @Override // @Override

View file

@ -85,7 +85,7 @@ public class BlockCable extends BlockContainer {
this.type = type; this.type = type;
setHardness(1F); setHardness(1F);
setResistance(8F); setResistance(8F);
setDefaultState(getDefaultState().withProperty(EAST, false).withProperty(WEST, false).withProperty(NORTH, false).withProperty(SOUTH, false).withProperty(UP, false).withProperty(DOWN, false)); setDefaultState(getDefaultState().with(EAST, false).with(WEST, false).with(NORTH, false).with(SOUTH, false).with(UP, false).with(DOWN, false));
BlockWrenchEventHandler.wrenableBlocks.add(this); BlockWrenchEventHandler.wrenableBlocks.add(this);
} }
@ -226,7 +226,7 @@ public class BlockCable extends BlockContainer {
for (EnumFacing facing : EnumFacing.values()) { for (EnumFacing facing : EnumFacing.values()) {
TileEntity tileEntity = getTileEntitySafely(worldIn, pos.offset(facing)); TileEntity tileEntity = getTileEntitySafely(worldIn, pos.offset(facing));
if (tileEntity != null) { if (tileEntity != null) {
actualState = actualState.withProperty(getProperty(facing), tileEntity.hasCapability(CapabilityEnergy.ENERGY, facing.getOpposite())); actualState = actualState.with(getProperty(facing), tileEntity.hasCapability(CapabilityEnergy.ENERGY, facing.getOpposite()));
} }
} }
return actualState; return actualState;

View file

@ -37,8 +37,8 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.api.ToolManager; import reborncore.api.ToolManager;
import reborncore.client.models.ModelCompound; import reborncore.client.models.ModelCompound;
import reborncore.client.models.RebornModelRegistry; import reborncore.client.models.RebornModelRegistry;
@ -78,7 +78,7 @@ public class BlockFusionCoil extends Block {
return false; return false;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, ITooltipFlag advanced) { public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, ITooltipFlag advanced) {
super.addInformation(stack, player, tooltip, advanced); super.addInformation(stack, player, tooltip, advanced);

View file

@ -26,7 +26,7 @@ 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.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection; 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;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@ -52,7 +52,7 @@ import techreborn.tiles.lighting.TileLamp;
public class BlockLamp extends BaseTileBlock { public class BlockLamp extends BaseTileBlock {
public static PropertyDirection FACING; public static DirectionProperty FACING;
public static PropertyBool ACTIVE; public static PropertyBool ACTIVE;
private AxisAlignedBB[] bbs; private AxisAlignedBB[] bbs;
@ -61,7 +61,7 @@ public class BlockLamp extends BaseTileBlock {
public BlockLamp(int brightness, int cost, double depth, double width) { public BlockLamp(int brightness, int cost, double depth, double width) {
super(Material.REDSTONE_LIGHT); super(Material.REDSTONE_LIGHT);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, false)); this.setDefaultState(this.blockState.getBaseState().with(FACING, EnumFacing.NORTH).with(ACTIVE, false));
this.bbs = GenBoundingBoxes(depth, width); this.bbs = GenBoundingBoxes(depth, width);
this.cost = cost; this.cost = cost;
this.brightness = brightness; this.brightness = brightness;
@ -93,12 +93,12 @@ public class BlockLamp extends BaseTileBlock {
} }
public static void setFacing(EnumFacing facing, World world, BlockPos pos) { public static void setFacing(EnumFacing facing, World world, BlockPos pos) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(FACING, facing)); world.setBlockState(pos, world.getBlockState(pos).with(FACING, facing));
} }
public static void setActive(Boolean active, World world, BlockPos pos) { public static void setActive(Boolean active, World world, BlockPos pos) {
EnumFacing facing = (EnumFacing)world.getBlockState(pos).getValue(FACING); EnumFacing facing = (EnumFacing)world.getBlockState(pos).getValue(FACING);
IBlockState state = world.getBlockState(pos).withProperty(ACTIVE, active).withProperty(FACING, facing); IBlockState state = world.getBlockState(pos).with(ACTIVE, active).with(FACING, facing);
world.setBlockState(pos, state, 3); world.setBlockState(pos, state, 3);
} }
@ -115,7 +115,7 @@ public class BlockLamp extends BaseTileBlock {
// Block // Block
@Override @Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
FACING = PropertyDirection.create("facing"); FACING = DirectionProperty.create("facing");
ACTIVE = PropertyBool.create("active"); ACTIVE = PropertyBool.create("active");
return new BlockStateContainer(this, FACING, ACTIVE); return new BlockStateContainer(this, FACING, ACTIVE);
} }
@ -123,7 +123,7 @@ public class BlockLamp extends BaseTileBlock {
@Override @Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY,
float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
return this.getDefaultState().withProperty(FACING, facing); return this.getDefaultState().with(FACING, facing);
} }
@Override @Override
@ -196,6 +196,6 @@ public class BlockLamp extends BaseTileBlock {
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
Boolean active = (meta&8)==8; Boolean active = (meta&8)==8;
EnumFacing facing = EnumFacing.byIndex(meta&7); EnumFacing facing = EnumFacing.byIndex(meta&7);
return this.getDefaultState().withProperty(FACING, facing).withProperty(ACTIVE, active); return this.getDefaultState().with(FACING, facing).with(ACTIVE, active);
} }
} }

View file

@ -28,12 +28,12 @@ import com.google.common.base.Predicate;
import com.google.common.collect.Iterators; import com.google.common.collect.Iterators;
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.PropertyDirection;
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.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.DirectionProperty;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
@ -53,14 +53,14 @@ import java.util.Random;
* Created by Rushmead * Created by Rushmead
*/ */
public abstract class BlockEnergyStorage extends BaseTileBlock { public abstract class BlockEnergyStorage extends BaseTileBlock {
public static PropertyDirection FACING = PropertyDirection.create("facing", Facings.ALL); public static DirectionProperty FACING = DirectionProperty.create("facing", Facings.ALL);
public String name; public String name;
public int guiID; public int guiID;
public BlockEnergyStorage(String name, int guiID) { public BlockEnergyStorage(String name, int guiID) {
super(Material.IRON); super(Material.IRON);
setHardness(2f); setHardness(2f);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); this.setDefaultState(this.blockState.getBaseState().with(FACING, EnumFacing.NORTH));
this.name = name; this.name = name;
this.guiID = guiID; this.guiID = guiID;
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/energy")); RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/energy"));
@ -68,7 +68,7 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
} }
public void setFacing(EnumFacing facing, World world, BlockPos pos) { public void setFacing(EnumFacing facing, World world, BlockPos pos) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(FACING, facing)); world.setBlockState(pos, world.getBlockState(pos).with(FACING, facing));
} }
public EnumFacing getSideFromint(int i) { public EnumFacing getSideFromint(int i) {
@ -143,7 +143,7 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
} else { } else {
facing = side.getOpposite(); facing = side.getOpposite();
} }
world.setBlockState(pos, state.withProperty(BlockEnergyStorage.FACING, facing)); world.setBlockState(pos, state.with(BlockEnergyStorage.FACING, facing));
return true; return true;
} }
@ -177,7 +177,7 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
@Override @Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
FACING = PropertyDirection.create("facing", Facings.ALL); FACING = DirectionProperty.create("facing", Facings.ALL);
return new BlockStateContainer(this, FACING); return new BlockStateContainer(this, FACING);
} }
@ -203,7 +203,7 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
@Override @Override
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
EnumFacing facing = getSideFromint(meta); EnumFacing facing = getSideFromint(meta);
return this.getDefaultState().withProperty(FACING, facing); return this.getDefaultState().with(FACING, facing);
} }
public enum Facings implements Predicate<EnumFacing>, Iterable<EnumFacing> { public enum Facings implements Predicate<EnumFacing>, Iterable<EnumFacing> {

View file

@ -32,8 +32,8 @@ import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.api.tile.IMachineGuiHandler; import reborncore.api.tile.IMachineGuiHandler;
import reborncore.client.models.ModelCompound; import reborncore.client.models.ModelCompound;
import reborncore.client.models.RebornModelRegistry; import reborncore.client.models.RebornModelRegistry;
@ -52,7 +52,7 @@ public class BlockIronFurnace extends BlockMachineBase {
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier0_machines")); RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier0_machines"));
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@SuppressWarnings("incomplete-switch") @SuppressWarnings("incomplete-switch")
public void randomDisplayTick(final World worldIn, final BlockPos pos, final IBlockState state, final Random rand) { public void randomDisplayTick(final World worldIn, final BlockPos pos, final IBlockState state, final Random rand) {
if (this.isActive(state)) { if (this.isActive(state)) {

View file

@ -44,8 +44,8 @@ import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.api.IToolDrop; import reborncore.api.IToolDrop;
import reborncore.api.ToolManager; import reborncore.api.ToolManager;
import reborncore.api.tile.IMachineGuiHandler; import reborncore.api.tile.IMachineGuiHandler;
@ -132,7 +132,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
} else if (type.equals("you")) { } else if (type.equals("you")) {
newType = "all"; newType = "all";
} }
worldIn.setBlockState(pos, state.withProperty(TYPE, newType)); worldIn.setBlockState(pos, state.with(TYPE, newType));
} }
} }
} }
@ -156,7 +156,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
if (meta > types.length) { if (meta > types.length) {
meta = 0; meta = 0;
} }
return getBlockState().getBaseState().withProperty(TYPE, typeNamesList.get(meta)); return getBlockState().getBaseState().with(TYPE, typeNamesList.get(meta));
} }
@Override @Override
@ -181,7 +181,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
} }
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public void getSubBlocks(CreativeTabs creativeTabs, NonNullList<ItemStack> list) { public void getSubBlocks(CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
for (int meta = 0; meta < types.length; meta++) { for (int meta = 0; meta < types.length; meta++) {
list.add(new ItemStack(this, 1, meta)); list.add(new ItemStack(this, 1, meta));

View file

@ -28,7 +28,7 @@ import com.google.common.base.Predicate;
import com.google.common.collect.Iterators; import com.google.common.collect.Iterators;
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.PropertyDirection; 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;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -53,20 +53,20 @@ import java.util.Random;
* Created by Rushmead * Created by Rushmead
*/ */
public abstract class BlockTransformer extends BaseTileBlock { public abstract class BlockTransformer extends BaseTileBlock {
public static PropertyDirection FACING = PropertyDirection.create("facing", Facings.ALL); public static DirectionProperty FACING = DirectionProperty.create("facing", Facings.ALL);
public String name; public String name;
public BlockTransformer(String name) { public BlockTransformer(String name) {
super(Material.IRON); super(Material.IRON);
setHardness(2f); setHardness(2f);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); this.setDefaultState(this.blockState.getBaseState().with(FACING, EnumFacing.NORTH));
this.name = name; this.name = name;
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/energy")); RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/energy"));
BlockWrenchEventHandler.wrenableBlocks.add(this); BlockWrenchEventHandler.wrenableBlocks.add(this);
} }
public void setFacing(EnumFacing facing, World world, BlockPos pos) { public void setFacing(EnumFacing facing, World world, BlockPos pos) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(FACING, facing)); world.setBlockState(pos, world.getBlockState(pos).with(FACING, facing));
} }
public EnumFacing getFacing(IBlockState state) { public EnumFacing getFacing(IBlockState state) {
@ -125,14 +125,14 @@ public abstract class BlockTransformer extends BaseTileBlock {
enumfacing = EnumFacing.WEST; enumfacing = EnumFacing.WEST;
} }
worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); worldIn.setBlockState(pos, state.with(FACING, enumfacing), 2);
} }
} }
// Block // Block
@Override @Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
FACING = PropertyDirection.create("facing", Facings.ALL); FACING = DirectionProperty.create("facing", Facings.ALL);
return new BlockStateContainer(this, FACING); return new BlockStateContainer(this, FACING);
} }
@ -186,7 +186,7 @@ public abstract class BlockTransformer extends BaseTileBlock {
} else { } else {
facing = side.getOpposite(); facing = side.getOpposite();
} }
world.setBlockState(pos, state.withProperty(BlockTransformer.FACING, facing)); world.setBlockState(pos, state.with(BlockTransformer.FACING, facing));
return true; return true;
} }
@ -202,7 +202,7 @@ public abstract class BlockTransformer extends BaseTileBlock {
@Override @Override
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
EnumFacing facing = getSideFromint(meta); EnumFacing facing = getSideFromint(meta);
return this.getDefaultState().withProperty(FACING, facing); return this.getDefaultState().with(FACING, facing);
} }
public enum Facings implements Predicate<EnumFacing>, Iterable<EnumFacing> { public enum Facings implements Predicate<EnumFacing>, Iterable<EnumFacing> {

View file

@ -28,7 +28,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import techreborn.init.TRContent; import techreborn.init.TRContent;
public class ClientEventHandler { public class ClientEventHandler {

View file

@ -73,10 +73,10 @@ public class GuiAESU extends GuiBase {
builder.drawMultiEnergyBar(this, 81, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(this, 81, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
buttonList.add(new GuiButtonUpDown(300, 121, 79, this, layer)); buttons.add(new GuiButtonUpDown(300, 121, 79, this, layer));
buttonList.add(new GuiButtonUpDown(301, 121 + 12, 79, this, layer)); buttons.add(new GuiButtonUpDown(301, 121 + 12, 79, this, layer));
buttonList.add(new GuiButtonUpDown(302, 121 + 24, 79, this, layer)); buttons.add(new GuiButtonUpDown(302, 121 + 24, 79, this, layer));
buttonList.add(new GuiButtonUpDown(303, 121 + 36, 79, this, layer)); buttons.add(new GuiButtonUpDown(303, 121 + 36, 79, this, layer));
} }
@Override @Override

View file

@ -72,8 +72,8 @@ public class GuiAlloyFurnace extends GuiContainer {
} }
@Override @Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) { public void render(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks); super.render(mouseX, mouseY, partialTicks);
this.renderHoveredToolTip(mouseX, mouseY); this.renderHoveredToolTip(mouseX, mouseY);
} }
} }

View file

@ -62,7 +62,7 @@ public class GuiAutoCrafting extends GuiBase {
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting();
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem(); RenderItem itemRenderer = Minecraft.getInstance().getRenderItem();
itemRenderer.renderItemAndEffectIntoGUI(stack, x, y); itemRenderer.renderItemAndEffectIntoGUI(stack, x, y);
GlStateManager.disableLighting(); GlStateManager.disableLighting();

View file

@ -30,6 +30,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import reborncore.client.gui.builder.widget.GuiButtonSimple;
import techreborn.tiles.TileChunkLoader; import techreborn.tiles.TileChunkLoader;
public class GuiChunkLoader extends GuiContainer { public class GuiChunkLoader extends GuiContainer {
@ -54,16 +55,16 @@ public class GuiChunkLoader extends GuiContainer {
super.initGui(); super.initGui();
this.guiLeft = this.width / 2 - this.xSize / 2; this.guiLeft = this.width / 2 - this.xSize / 2;
this.guiTop = this.height / 2 - this.ySize / 2; this.guiTop = this.height / 2 - this.ySize / 2;
this.plusOneButton = new GuiButton(0, this.guiLeft + 5, this.guiTop + 37, 40, 20, "+1"); this.plusOneButton = new GuiButtonSimple(0, this.guiLeft + 5, this.guiTop + 37, 40, 20, "+1");
this.plusTenButton = new GuiButton(0, this.guiLeft + 45, this.guiTop + 37, 40, 20, "+10"); this.plusTenButton = new GuiButtonSimple(0, this.guiLeft + 45, this.guiTop + 37, 40, 20, "+10");
this.minusOneButton = new GuiButton(0, this.guiLeft + 90, this.guiTop + 37, 40, 20, "-1"); this.minusOneButton = new GuiButtonSimple(0, this.guiLeft + 90, this.guiTop + 37, 40, 20, "-1");
this.minusTenButton = new GuiButton(0, this.guiLeft + 130, this.guiTop + 37, 40, 20, "-10"); this.minusTenButton = new GuiButtonSimple(0, this.guiLeft + 130, this.guiTop + 37, 40, 20, "-10");
this.buttonList.add(this.plusOneButton); this.buttons.add(this.plusOneButton);
this.buttonList.add(this.plusTenButton); this.buttons.add(this.plusTenButton);
this.buttonList.add(this.minusOneButton); this.buttons.add(this.minusOneButton);
this.buttonList.add(this.minusTenButton); this.buttons.add(this.minusTenButton);
} }
@Override @Override
@ -86,8 +87,8 @@ public class GuiChunkLoader extends GuiContainer {
} }
@Override @Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) { public void render(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks); super.render(mouseX, mouseY, partialTicks);
this.renderHoveredToolTip(mouseX, mouseY); this.renderHoveredToolTip(mouseX, mouseY);
} }

View file

@ -46,7 +46,7 @@ public class GuiDestructoPack extends GuiContainer {
protected void drawGuiContainerBackgroundLayer(float arg0, int arg1, int arg2) { protected void drawGuiContainerBackgroundLayer(float arg0, int arg1, int arg2) {
this.drawDefaultBackground(); this.drawDefaultBackground();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().renderEngine.bindTexture(texture); Minecraft.getInstance().renderEngine.bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 176, 166); drawTexturedModalRect(guiLeft, guiTop, 0, 0, 176, 166);
} }
@ -60,8 +60,8 @@ public class GuiDestructoPack extends GuiContainer {
} }
@Override @Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) { public void render(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks); super.render(mouseX, mouseY, partialTicks);
this.renderHoveredToolTip(mouseX, mouseY); this.renderHoveredToolTip(mouseX, mouseY);
} }
} }

View file

@ -25,13 +25,13 @@
package techreborn.client.gui; package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder; import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.advanced.TileDieselGenerator; import techreborn.tiles.generator.advanced.TileDieselGenerator;
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public class GuiDieselGenerator extends GuiBase { public class GuiDieselGenerator extends GuiBase {
TileDieselGenerator tile; TileDieselGenerator tile;

View file

@ -104,10 +104,10 @@ public class GuiFusionReactor extends GuiBase {
drawString("Size: " + tile.size, 83, 81, 0xFFFFFF, layer); drawString("Size: " + tile.size, 83, 81, 0xFFFFFF, layer);
drawString("" + tile.getPowerMultiplier() + "x", 10, 81, 0xFFFFFF, layer); drawString("" + tile.getPowerMultiplier() + "x", 10, 81, 0xFFFFFF, layer);
buttonList.add(new GuiButtonUpDown(300, 121, 79, this, GuiBase.Layer.FOREGROUND)); buttons.add(new GuiButtonUpDown(300, 121, 79, this, GuiBase.Layer.FOREGROUND));
buttonList.add(new GuiButtonUpDown(301, 121 + 12, 79, this, GuiBase.Layer.FOREGROUND)); buttons.add(new GuiButtonUpDown(301, 121 + 12, 79, this, GuiBase.Layer.FOREGROUND));
buttonList.add(new GuiButtonUpDown(302, 121 + 24, 79, this, GuiBase.Layer.FOREGROUND)); buttons.add(new GuiButtonUpDown(302, 121 + 24, 79, this, GuiBase.Layer.FOREGROUND));
buttonList.add(new GuiButtonUpDown(303, 121 + 36, 79, this, GuiBase.Layer.FOREGROUND)); buttons.add(new GuiButtonUpDown(303, 121 + 36, 79, this, GuiBase.Layer.FOREGROUND));
builder.drawMultiEnergyBar(this, 9, 19, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(this, 9, 19, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
} }

View file

@ -80,8 +80,8 @@ public class GuiIronFurnace extends GuiBase {
} }
@Override @Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) { public void render(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks); super.render(mouseX, mouseY, partialTicks);
renderHoveredToolTip(mouseX, mouseY); renderHoveredToolTip(mouseX, mouseY);
} }

View file

@ -57,12 +57,12 @@ public class GuiManual extends GuiScreen {
@Override @Override
public void initGui() { public void initGui() {
buttonList.add(new GuiButton(1, (width / 2 - 30), (height / 2 - (guiHeight / 4)) + 17, 60, 20, I18n.format("techreborn.manual.wikibtn"))); buttons.add(new GuiButton(1, (width / 2 - 30), (height / 2 - (guiHeight / 4)) + 17, 60, 20, I18n.format("techreborn.manual.wikibtn")));
buttonList.add(new GuiButton(2, (width / 2 - 30), (height / 2) + 22, 60, 20, I18n.format("techreborn.manual.discordbtn"))); buttons.add(new GuiButton(2, (width / 2 - 30), (height / 2) + 22, 60, 20, I18n.format("techreborn.manual.discordbtn")));
} }
@Override @Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) { public void render(int mouseX, int mouseY, float partialTicks) {
drawDefaultBackground(); drawDefaultBackground();
mc.getTextureManager().bindTexture(GuiManual.texture); mc.getTextureManager().bindTexture(GuiManual.texture);
int centerX = (width / 2) - guiWidth / 2; int centerX = (width / 2) - guiWidth / 2;
@ -70,7 +70,7 @@ public class GuiManual extends GuiScreen {
drawTexturedModalRect(centerX, centerY, 0, 0, guiWidth, guiHeight); drawTexturedModalRect(centerX, centerY, 0, 0, guiWidth, guiHeight);
fontRenderer.drawString(text1, ((width / 2) - fontRenderer.getStringWidth(text1) / 2), height / 2 - (guiHeight / 4), 4210752); fontRenderer.drawString(text1, ((width / 2) - fontRenderer.getStringWidth(text1) / 2), height / 2 - (guiHeight / 4), 4210752);
fontRenderer.drawString(text2, ((width / 2) - fontRenderer.getStringWidth(text2) / 2), height / 2 + 5, 4210752); fontRenderer.drawString(text2, ((width / 2) - fontRenderer.getStringWidth(text2) / 2), height / 2 + 5, 4210752);
super.drawScreen(mouseX, mouseY, partialTicks); super.render(mouseX, mouseY, partialTicks);
} }
@Override @Override

View file

@ -25,8 +25,8 @@
package techreborn.client.gui; package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder; import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.TilePlasmaGenerator; import techreborn.tiles.generator.TilePlasmaGenerator;
@ -35,7 +35,7 @@ import techreborn.tiles.generator.TilePlasmaGenerator;
* @author drcrazy * @author drcrazy
* *
*/ */
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public class GuiPlasmaGenerator extends GuiBase { public class GuiPlasmaGenerator extends GuiBase {
/** /**

View file

@ -64,8 +64,8 @@ public class GuiQuantumTank extends GuiBase {
} }
@Override @Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) { public void render(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks); super.render(mouseX, mouseY, partialTicks);
renderHoveredToolTip(mouseX, mouseY); renderHoveredToolTip(mouseX, mouseY);
} }
} }

View file

@ -37,13 +37,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.model.*; import net.minecraftforge.client.model.*;
import net.minecraftforge.common.model.IModelState; import net.minecraftforge.common.model.IModelState;
import net.minecraftforge.common.model.TRSRTransformation; import net.minecraftforge.common.model.TRSRTransformation;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.init.TRContent; import techreborn.init.TRContent;
import techreborn.items.DynamicCell; import techreborn.items.DynamicCell;
@ -55,7 +55,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.function.Function; import java.util.function.Function;
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public class ModelDynamicCell implements IModel { public class ModelDynamicCell implements IModel {
public static final ModelDynamicCell MODEL = new ModelDynamicCell( public static final ModelDynamicCell MODEL = new ModelDynamicCell(
@ -210,7 +210,7 @@ public class ModelDynamicCell implements IModel {
private final HashMap<String, IBakedModel> modelCache = new HashMap<>(); private final HashMap<String, IBakedModel> modelCache = new HashMap<>();
private final Function<ResourceLocation, TextureAtlasSprite> textureGetter = location -> private final Function<ResourceLocation, TextureAtlasSprite> textureGetter = location ->
Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString()); Minecraft.getInstance().getTextureMapBlocks().getAtlasSprite(location.toString());
private OverrideHandler() { private OverrideHandler() {
super(ImmutableList.of()); super(ImmutableList.of());

View file

@ -30,8 +30,8 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ModelBlock; import net.minecraft.client.renderer.block.model.ModelBlock;
import net.minecraft.client.resources.IResource; import net.minecraft.client.resources.IResource;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import techreborn.TechReborn; import techreborn.TechReborn;
import java.io.BufferedReader; import java.io.BufferedReader;
@ -42,7 +42,7 @@ import java.io.Reader;
/* /*
* Credits to JsonDestroyer * Credits to JsonDestroyer
*/ */
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public class ModelHelper { public class ModelHelper {
public static final ItemCameraTransforms DEFAULT_ITEM_TRANSFORMS = loadTransformFromJson(new ResourceLocation("minecraft:models/item/generated")); public static final ItemCameraTransforms DEFAULT_ITEM_TRANSFORMS = loadTransformFromJson(new ResourceLocation("minecraft:models/item/generated"));
@ -61,7 +61,7 @@ public class ModelHelper {
public static Reader getReaderForResource(ResourceLocation location) throws IOException { public static Reader getReaderForResource(ResourceLocation location) throws IOException {
ResourceLocation file = new ResourceLocation(location.getNamespace(), location.getPath() + ".json"); ResourceLocation file = new ResourceLocation(location.getNamespace(), location.getPath() + ".json");
IResource iresource = Minecraft.getMinecraft().getResourceManager().getResource(file); IResource iresource = Minecraft.getInstance().getResourceManager().getResource(file);
return new BufferedReader(new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8)); return new BufferedReader(new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8));
} }

View file

@ -48,7 +48,7 @@ public class RenderNukePrimed extends Render<EntityNukePrimed> {
@Override @Override
public void doRender(EntityNukePrimed entity, double x, double y, double z, float entityYaw, float partialTicks) { public void doRender(EntityNukePrimed entity, double x, double y, double z, float entityYaw, float partialTicks) {
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); BlockRendererDispatcher blockrendererdispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.translate((float) x, (float) y + 0.5F, (float) z); GlStateManager.translate((float) x, (float) y + 0.5F, (float) z);
if ((float) entity.getFuse() - partialTicks + 1.0F < 10.0F) { if ((float) entity.getFuse() - partialTicks + 1.0F < 10.0F) {
@ -72,7 +72,7 @@ public class RenderNukePrimed extends Render<EntityNukePrimed> {
GlStateManager.doPolygonOffset(-3.0F, -3.0F); GlStateManager.doPolygonOffset(-3.0F, -3.0F);
GlStateManager.enablePolygonOffset(); GlStateManager.enablePolygonOffset();
blockrendererdispatcher.renderBlockBrightness( blockrendererdispatcher.renderBlockBrightness(
TRContent.NUKE.getDefaultState().withProperty(BlockNuke.OVERLAY, true), 1.0F); TRContent.NUKE.getDefaultState().with(BlockNuke.OVERLAY, true), 1.0F);
GlStateManager.doPolygonOffset(0.0F, 0.0F); GlStateManager.doPolygonOffset(0.0F, 0.0F);
GlStateManager.disablePolygonOffset(); GlStateManager.disablePolygonOffset();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -32,7 +32,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import reborncore.common.registration.RebornRegister; import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.util.OreDrop; import reborncore.common.util.OreDrop;

View file

@ -38,12 +38,12 @@ import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.models.ModelCompound; import reborncore.client.models.ModelCompound;
import reborncore.client.models.RebornModelRegistry; import reborncore.client.models.RebornModelRegistry;
import techreborn.TechReborn; import techreborn.TechReborn;
@ -69,7 +69,7 @@ import techreborn.init.TRContent.Upgrades;
* @author drcrazy * @author drcrazy
* *
*/ */
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Mod.EventBusSubscriber(modid = TechReborn.MOD_ID) @Mod.EventBusSubscriber(modid = TechReborn.MOD_ID)
public class ModelRegistryEventHandler { public class ModelRegistryEventHandler {

View file

@ -16,7 +16,7 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import reborncore.RebornRegistry; import reborncore.RebornRegistry;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.util.BucketHandler; import reborncore.common.util.BucketHandler;

View file

@ -32,12 +32,10 @@ import net.minecraft.item.Item;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.energy.IEnergyStorage; import net.minecraftforge.energy.IEnergyStorage;
import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard;
import reborncore.api.IListInfoProvider; import reborncore.api.IListInfoProvider;
import reborncore.api.power.IEnergyItemInfo; import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.RebornCoreConfig; import reborncore.common.RebornCoreConfig;
@ -49,7 +47,7 @@ import techreborn.TechReborn;
public class StackToolTipEvent { public class StackToolTipEvent {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@SubscribeEvent @SubscribeEvent
public void handleItemTooltipEvent(ItemTooltipEvent event) { public void handleItemTooltipEvent(ItemTooltipEvent event) {
if (event.getEntityPlayer() == null) { if (event.getEntityPlayer() == null) {
@ -87,12 +85,12 @@ public class StackToolTipEvent {
Block block = Block.getBlockFromItem(item); Block block = Block.getBlockFromItem(item);
if (block != null && (block instanceof BlockContainer || block instanceof ITileEntityProvider) if (block != null && (block instanceof BlockContainer || block instanceof ITileEntityProvider)
&& block.getRegistryName().getNamespace().contains("techreborn")) { && block.getRegistryName().getNamespace().contains("techreborn")) {
TileEntity tile = block.createTileEntity(Minecraft.getMinecraft().world, TileEntity tile = block.createTileEntity(Minecraft.getInstance().world,
block.getStateFromMeta(event.getItemStack().getItemDamage())); block.getStateFromMeta(event.getItemStack().getItemDamage()));
boolean hasData = false; boolean hasData = false;
if(event.getItemStack().hasTagCompound() && event.getItemStack().getTagCompound().hasKey("tile_data")){ if(event.getItemStack().hasTag() && event.getItemStack().getTag().hasKey("tile_data")){
NBTTagCompound tileData = event.getItemStack().getTagCompound().getCompoundTag("tile_data"); NBTTagCompound tileData = event.getItemStack().getTag().getCompoundTag("tile_data");
tile.readFromNBT(tileData); tile.read(tileData);
hasData = true; hasData = true;
event.getToolTip().add(TextFormatting.DARK_GREEN + "Block data contained"); event.getToolTip().add(TextFormatting.DARK_GREEN + "Block data contained");
} }

View file

@ -30,7 +30,7 @@ import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.Ingredient;
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent; import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.registries.IForgeRegistryEntry; import net.minecraftforge.registries.IForgeRegistryEntry;
import reborncore.common.util.ItemUtils; import reborncore.common.util.ItemUtils;
import techreborn.TechReborn; import techreborn.TechReborn;

View file

@ -29,7 +29,7 @@ import net.minecraft.init.MobEffects;
import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent;
import techreborn.init.TRContent; import techreborn.init.TRContent;

View file

@ -28,7 +28,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.*; import net.minecraft.world.storage.loot.*;
import net.minecraft.world.storage.loot.conditions.LootCondition; import net.minecraft.world.storage.loot.conditions.LootCondition;
import net.minecraftforge.event.LootTableLoadEvent; import net.minecraftforge.event.LootTableLoadEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import techreborn.TechReborn; import techreborn.TechReborn;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;

View file

@ -68,12 +68,12 @@ public class DynamicCell extends Item {
//Clearing tag because ItemUtils.isItemEqual doesn't handle tags ForgeCaps and display //Clearing tag because ItemUtils.isItemEqual doesn't handle tags ForgeCaps and display
//And breaks ability to use in recipes //And breaks ability to use in recipes
//TODO: Property ItemUtils.isItemEquals tags equality handling? //TODO: Property ItemUtils.isItemEquals tags equality handling?
if (stack.hasTagCompound()) { if (stack.hasTag()) {
NBTTagCompound tag = stack.getTagCompound(); NBTTagCompound tag = stack.getTag();
if (tag.getSize() != 1 || tag.hasKey("Fluid")) { if (tag.getSize() != 1 || tag.hasKey("Fluid")) {
NBTTagCompound clearTag = new NBTTagCompound(); NBTTagCompound clearTag = new NBTTagCompound();
clearTag.setTag("Fluid", tag.getCompoundTag("Fluid")); clearTag.setTag("Fluid", tag.getCompoundTag("Fluid"));
stack.setTagCompound(clearTag); stack.setTag(clearTag);
} }
} }
} }
@ -194,10 +194,10 @@ public class DynamicCell extends Item {
super(container, capacity); super(container, capacity);
//backwards compatibility //backwards compatibility
if (container.hasTagCompound() && container.getTagCompound().hasKey("FluidName")) { if (container.hasTag() && container.getTag().hasKey("FluidName")) {
FluidStack stack = FluidStack.loadFluidStackFromNBT(container.getTagCompound()); FluidStack stack = FluidStack.loadFluidStackFromNBT(container.getTag());
if (stack != null) { if (stack != null) {
container.setTagCompound(new NBTTagCompound()); container.setTag(new NBTTagCompound());
fill(stack, true); fill(stack, true);
} }
} }
@ -231,7 +231,7 @@ public class DynamicCell extends Item {
@Override @Override
public ItemStack getContainer() { public ItemStack getContainer() {
ItemStack cell; ItemStack cell;
if (container.hasTagCompound() && container.getTagCompound().hasKey(FLUID_NBT_KEY)) { if (container.hasTag() && container.getTag().hasKey(FLUID_NBT_KEY)) {
cell = super.getContainer(); cell = super.getContainer();
} }
else { else {

View file

@ -57,10 +57,10 @@ public class ItemCells {
if(stack1.isEmpty() || stack2.isEmpty()){ if(stack1.isEmpty() || stack2.isEmpty()){
return false; return false;
} }
if(stack1.getTagCompound() == null || stack2.getTagCompound() == null){ if(stack1.getTag() == null || stack2.getTag() == null){
return false; return false;
} }
return stack1.getTagCompound().equals(stack2.getTagCompound()); return stack1.getTag().equals(stack2.getTag());
} }
} }

View file

@ -37,9 +37,9 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.hud.StackInfoElement; import reborncore.client.hud.StackInfoElement;
import reborncore.common.util.ChatUtils; import reborncore.common.util.ChatUtils;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -54,13 +54,13 @@ public class ItemFrequencyTransmitter extends Item {
setMaxStackSize(1); setMaxStackSize(1);
this.addPropertyOverride(new ResourceLocation("techreborn", "coords"), new IItemPropertyGetter() { this.addPropertyOverride(new ResourceLocation("techreborn", "coords"), new IItemPropertyGetter() {
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public float apply(ItemStack stack, public float apply(ItemStack stack,
@Nullable @Nullable
World worldIn, World worldIn,
@Nullable @Nullable
EntityLivingBase entityIn) { EntityLivingBase entityIn) {
if (!stack.isEmpty() && stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) { if (!stack.isEmpty() && stack.hasTag() && stack.getTag() != null && stack.getTag().hasKey("x") && stack.getTag().hasKey("y") && stack.getTag().hasKey("z") && stack.getTag().hasKey("dim")) {
return 1.0F; return 1.0F;
} }
return 0.0F; return 0.0F;
@ -72,11 +72,11 @@ public class ItemFrequencyTransmitter extends Item {
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos,
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
ItemStack stack = player.getHeldItem(hand); ItemStack stack = player.getHeldItem(hand);
stack.setTagCompound(new NBTTagCompound()); stack.setTag(new NBTTagCompound());
stack.getTagCompound().setInteger("x", pos.getX()); stack.getTag().setInt("x", pos.getX());
stack.getTagCompound().setInteger("y", pos.getY()); stack.getTag().setInt("y", pos.getY());
stack.getTagCompound().setInteger("z", pos.getZ()); stack.getTag().setInt("z", pos.getZ());
stack.getTagCompound().setInteger("dim", world.provider.getDimension()); stack.getTag().setInt("dim", world.provider.getDimension());
if (!world.isRemote) { if (!world.isRemote) {
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString( ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
@ -98,7 +98,7 @@ public class ItemFrequencyTransmitter extends Item {
EnumHand hand) { EnumHand hand) {
ItemStack stack = player.getHeldItem(hand); ItemStack stack = player.getHeldItem(hand);
if (player.isSneaking()) { if (player.isSneaking()) {
stack.setTagCompound(null); stack.setTag(null);
if (!world.isRemote) { if (!world.isRemote) {
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString( ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
TextFormatting.GRAY + I18n.format("techreborn.message.coordsHaveBeen") + " " TextFormatting.GRAY + I18n.format("techreborn.message.coordsHaveBeen") + " "
@ -109,16 +109,16 @@ public class ItemFrequencyTransmitter extends Item {
return new ActionResult<>(EnumActionResult.SUCCESS, stack); return new ActionResult<>(EnumActionResult.SUCCESS, stack);
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void addInformation(ItemStack stack, public void addInformation(ItemStack stack,
@Nullable @Nullable
World worldIn, List<String> tooltip, ITooltipFlag flagIn) { World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
if (stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) { if (stack.hasTag() && stack.getTag() != null && stack.getTag().hasKey("x") && stack.getTag().hasKey("y") && stack.getTag().hasKey("z") && stack.getTag().hasKey("dim")) {
int x = stack.getTagCompound().getInteger("x"); int x = stack.getTag().getInt("x");
int y = stack.getTagCompound().getInteger("y"); int y = stack.getTag().getInt("y");
int z = stack.getTagCompound().getInteger("z"); int z = stack.getTag().getInt("z");
int dim = stack.getTagCompound().getInteger("dim"); int dim = stack.getTag().getInt("dim");
tooltip.add(TextFormatting.GRAY + "X: " + TextFormatting.GOLD + x); tooltip.add(TextFormatting.GRAY + "X: " + TextFormatting.GOLD + x);
tooltip.add(TextFormatting.GRAY + "Y: " + TextFormatting.GOLD + y); tooltip.add(TextFormatting.GRAY + "Y: " + TextFormatting.GOLD + y);
@ -141,11 +141,11 @@ public class ItemFrequencyTransmitter extends Item {
TextFormatting gold = TextFormatting.GOLD; TextFormatting gold = TextFormatting.GOLD;
TextFormatting grey = TextFormatting.GRAY; TextFormatting grey = TextFormatting.GRAY;
if (stack.getItem() instanceof ItemFrequencyTransmitter) { if (stack.getItem() instanceof ItemFrequencyTransmitter) {
if (stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) { if (stack.hasTag() && stack.getTag() != null && stack.getTag().hasKey("x") && stack.getTag().hasKey("y") && stack.getTag().hasKey("z") && stack.getTag().hasKey("dim")) {
int coordX = stack.getTagCompound().getInteger("x"); int coordX = stack.getTag().getInt("x");
int coordY = stack.getTagCompound().getInteger("y"); int coordY = stack.getTag().getInt("y");
int coordZ = stack.getTagCompound().getInteger("z"); int coordZ = stack.getTag().getInt("z");
int coordDim = stack.getTagCompound().getInteger("dim"); int coordDim = stack.getTag().getInt("dim");
text = grey + "X: " + gold + coordX + grey + " Y: " + gold + coordY + grey + " Z: " + gold + coordZ + grey + " Dim: " + gold + DimensionManager.getProviderType(coordDim).getName() + " (" + coordDim + ")"; text = grey + "X: " + gold + coordX + grey + " Y: " + gold + coordY + grey + " Z: " + gold + coordZ + grey + " Dim: " + gold + DimensionManager.getProviderType(coordDim).getName() + " (" + coordDim + ")";
} else { } else {
text = grey + I18n.format("techreborn.message.noCoordsSet"); text = grey + I18n.format("techreborn.message.noCoordsSet");

View file

@ -33,10 +33,10 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.energy.IEnergyStorage; import net.minecraftforge.energy.IEnergyStorage;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo; import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.powerSystem.PoweredItemContainerProvider; import reborncore.common.powerSystem.PoweredItemContainerProvider;
@ -66,7 +66,7 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo
// Item // Item
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) {
return "techreborn:" + "textures/models/cloaking.png"; return "techreborn:" + "textures/models/cloaking.png";
} }
@ -84,7 +84,7 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo
} }
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -33,9 +33,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo; import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.powerSystem.PoweredItemContainerProvider; import reborncore.common.powerSystem.PoweredItemContainerProvider;
@ -58,7 +58,7 @@ public class ItemLapotronicOrbpack extends ItemArmor implements IEnergyItemInfo
} }
// Item // Item
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {
@ -101,7 +101,7 @@ public class ItemLapotronicOrbpack extends ItemArmor implements IEnergyItemInfo
} }
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) {
return "techreborn:" + "textures/models/lapotronpack.png"; return "techreborn:" + "textures/models/lapotronpack.png";
} }

View file

@ -33,9 +33,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo; import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
@ -102,12 +102,12 @@ public class ItemLithiumIonBatpack extends ItemArmor implements IEnergyItemInfo
} }
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) {
return "techreborn:" + "textures/models/lithiumbatpack.png"; return "techreborn:" + "textures/models/lithiumbatpack.png";
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -31,9 +31,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo; import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.powerSystem.PoweredItemContainerProvider; import reborncore.common.powerSystem.PoweredItemContainerProvider;
@ -55,7 +55,7 @@ public class ItemBattery extends Item implements IEnergyItemInfo {
this.maxTransfer = maxTransfer; this.maxTransfer = maxTransfer;
this.addPropertyOverride(new ResourceLocation("techreborn:empty"), new IItemPropertyGetter() { this.addPropertyOverride(new ResourceLocation("techreborn:empty"), new IItemPropertyGetter() {
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
if (!stack.isEmpty() && new ForgePowerItemManager(stack).getEnergyStored() == 0) { if (!stack.isEmpty() && new ForgePowerItemManager(stack).getEnergyStored() == 0) {
return 1.0F; return 1.0F;

View file

@ -27,8 +27,8 @@ package techreborn.items.battery;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -40,7 +40,7 @@ public class ItemEnergyCrystal extends ItemBattery {
super(ConfigTechReborn.EnergyCrystalMaxCharge, 1_000); super(ConfigTechReborn.EnergyCrystalMaxCharge, 1_000);
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -27,8 +27,8 @@ package techreborn.items.battery;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -40,7 +40,7 @@ public class ItemLapotronCrystal extends ItemBattery {
super(ConfigTechReborn.LapotronCrystalMaxCharge, 10_000); super(ConfigTechReborn.LapotronCrystalMaxCharge, 10_000);
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -27,8 +27,8 @@ package techreborn.items.battery;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -40,7 +40,7 @@ public class ItemLapotronicOrb extends ItemBattery {
super(ConfigTechReborn.LapotronicOrbMaxCharge, 100_000); super(ConfigTechReborn.LapotronicOrbMaxCharge, 100_000);
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -27,8 +27,8 @@ package techreborn.items.battery;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -39,7 +39,7 @@ public class ItemLithiumIonBattery extends ItemBattery {
super(400_000, 1_000); super(400_000, 1_000);
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -27,8 +27,8 @@ package techreborn.items.battery;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -39,7 +39,7 @@ public class ItemRedCellBattery extends ItemBattery {
super(40_000, 100); super(40_000, 100);
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -36,9 +36,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo; import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
@ -66,7 +66,7 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo {
this.addPropertyOverride(new ResourceLocation("techreborn", "animated"), new IItemPropertyGetter() { this.addPropertyOverride(new ResourceLocation("techreborn", "animated"), new IItemPropertyGetter() {
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
if (!stack.isEmpty() && new ForgePowerItemManager(stack).getEnergyStored() >= cost if (!stack.isEmpty() && new ForgePowerItemManager(stack).getEnergyStored() >= cost
&& entityIn != null && entityIn.getHeldItemMainhand().equals(stack)) { && entityIn != null && entityIn.getHeldItemMainhand().equals(stack)) {

View file

@ -30,8 +30,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.api.IToolHandler; import reborncore.api.IToolHandler;
/** /**
@ -44,7 +44,7 @@ public class ItemWrench extends Item implements IToolHandler {
} }
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public boolean isFull3D() { public boolean isFull3D() {
return true; return true;
} }

View file

@ -29,8 +29,8 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -45,7 +45,7 @@ public class ItemAdvancedChainsaw extends ItemChainsaw {
this.transferLimit = 1000; this.transferLimit = 1000;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -29,8 +29,8 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -45,7 +45,7 @@ public class ItemAdvancedDrill extends ItemDrill {
this.transferLimit = 1000; this.transferLimit = 1000;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -27,8 +27,8 @@ package techreborn.items.tool.advanced;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -44,7 +44,7 @@ public class ItemAdvancedJackhammer extends ItemJackhammer {
this.transferLimit = 1000; this.transferLimit = 1000;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -37,9 +37,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo; import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
@ -143,7 +143,7 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo {
return !(newStack.isItemEqual(oldStack)); return !(newStack.isItemEqual(oldStack));
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -29,8 +29,8 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -43,7 +43,7 @@ public class ItemBasicChainsaw extends ItemChainsaw {
this.cost = 50; this.cost = 50;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems( public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {

View file

@ -29,8 +29,8 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -43,7 +43,7 @@ public class ItemBasicDrill extends ItemDrill {
this.cost = 50; this.cost = 50;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems( public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {

View file

@ -27,8 +27,8 @@ package techreborn.items.tool.basic;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -42,7 +42,7 @@ public class ItemBasicJackhammer extends ItemJackhammer {
this.efficiency = 12F; this.efficiency = 12F;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -36,9 +36,9 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo; import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
@ -99,7 +99,7 @@ public class ItemElectricTreetap extends Item implements IEnergyItemInfo {
return new PoweredItemContainerProvider(stack); return new PoweredItemContainerProvider(stack);
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -33,8 +33,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
@ -49,8 +49,8 @@ public class ItemIndustrialChainsaw extends ItemChainsaw {
this.cost = 250; this.cost = 250;
this.transferLimit = 1000; this.transferLimit = 1000;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -36,8 +36,8 @@ import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
@ -155,7 +155,7 @@ public class ItemIndustrialDrill extends ItemDrill {
} }
// Item // Item
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
if (!isInCreativeTab(par2CreativeTabs)) { if (!isInCreativeTab(par2CreativeTabs)) {

View file

@ -27,8 +27,8 @@ package techreborn.items.tool.industrial;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.powerSystem.forge.ForgePowerItemManager; import reborncore.common.powerSystem.forge.ForgePowerItemManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -44,7 +44,7 @@ public class ItemIndustrialJackhammer extends ItemJackhammer {
this.transferLimit = 1000; this.transferLimit = 1000;
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems( public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {

View file

@ -43,9 +43,9 @@ import net.minecraft.util.*;
import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo; import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
@ -72,7 +72,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
setMaxStackSize(1); setMaxStackSize(1);
this.addPropertyOverride(new ResourceLocation("techreborn:active"), new IItemPropertyGetter() { this.addPropertyOverride(new ResourceLocation("techreborn:active"), new IItemPropertyGetter() {
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public float apply(ItemStack stack, public float apply(ItemStack stack,
@Nullable @Nullable
World worldIn, World worldIn,
@ -132,10 +132,10 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
.format("techreborn.message.nanosaberActivate"))); .format("techreborn.message.nanosaberActivate")));
} else { } else {
if (!ItemUtils.isActive(stack)) { if (!ItemUtils.isActive(stack)) {
if (stack.getTagCompound() == null) { if (stack.getTag() == null) {
stack.setTagCompound(new NBTTagCompound()); stack.setTag(new NBTTagCompound());
} }
stack.getTagCompound().setBoolean("isActive", true); stack.getTag().setBoolean("isActive", true);
if (world.isRemote) { if (world.isRemote) {
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
TextFormatting.GRAY + I18n.format("techreborn.message.setTo") + " " TextFormatting.GRAY + I18n.format("techreborn.message.setTo") + " "
@ -143,7 +143,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
.format("techreborn.message.nanosaberActive"))); .format("techreborn.message.nanosaberActive")));
} }
} else { } else {
stack.getTagCompound().setBoolean("isActive", false); stack.getTag().setBoolean("isActive", false);
if (world.isRemote) { if (world.isRemote) {
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
TextFormatting.GRAY + I18n.format("techreborn.message.setTo") + " " TextFormatting.GRAY + I18n.format("techreborn.message.setTo") + " "
@ -166,7 +166,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
+ TextFormatting.GOLD + I18n + TextFormatting.GOLD + I18n
.format("techreborn.message.nanosaberDeactivating"))); .format("techreborn.message.nanosaberDeactivating")));
} }
stack.getTagCompound().setBoolean("isActive", false); stack.getTag().setBoolean("isActive", false);
} }
} }
@ -198,7 +198,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
return new PoweredItemContainerProvider(stack); return new PoweredItemContainerProvider(stack);
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems( public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
@ -206,18 +206,18 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
return; return;
} }
ItemStack inactiveUncharged = new ItemStack(this); ItemStack inactiveUncharged = new ItemStack(this);
inactiveUncharged.setTagCompound(new NBTTagCompound()); inactiveUncharged.setTag(new NBTTagCompound());
inactiveUncharged.getTagCompound().setBoolean("isActive", false); inactiveUncharged.getTag().setBoolean("isActive", false);
ItemStack inactiveCharged = new ItemStack(TRContent.NANOSABER); ItemStack inactiveCharged = new ItemStack(TRContent.NANOSABER);
inactiveCharged.setTagCompound(new NBTTagCompound()); inactiveCharged.setTag(new NBTTagCompound());
inactiveCharged.getTagCompound().setBoolean("isActive", false); inactiveCharged.getTag().setBoolean("isActive", false);
ForgePowerItemManager capEnergy = new ForgePowerItemManager(inactiveCharged); ForgePowerItemManager capEnergy = new ForgePowerItemManager(inactiveCharged);
capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored()); capEnergy.setEnergyStored(capEnergy.getMaxEnergyStored());
ItemStack activeCharged = new ItemStack(TRContent.NANOSABER); ItemStack activeCharged = new ItemStack(TRContent.NANOSABER);
activeCharged.setTagCompound(new NBTTagCompound()); activeCharged.setTag(new NBTTagCompound());
activeCharged.getTagCompound().setBoolean("isActive", true); activeCharged.getTag().setBoolean("isActive", true);
ForgePowerItemManager capEnergy2 = new ForgePowerItemManager(activeCharged); ForgePowerItemManager capEnergy2 = new ForgePowerItemManager(activeCharged);
capEnergy2.setEnergyStored(capEnergy2.getMaxEnergyStored()); capEnergy2.setEnergyStored(capEnergy2.getMaxEnergyStored());
@ -226,7 +226,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
itemList.add(activeCharged); itemList.add(activeCharged);
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void addInformation(ItemStack stack, public void addInformation(ItemStack stack,
@Nullable @Nullable

View file

@ -37,9 +37,9 @@ import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo; import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
@ -157,8 +157,8 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo {
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable NBTTagCompound nbt) { public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable NBTTagCompound nbt) {
return new PoweredItemContainerProvider(stack); return new PoweredItemContainerProvider(stack);
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@Override @Override
public void getSubItems( public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {

View file

@ -26,8 +26,8 @@ package techreborn.items.tool.vanilla;
import net.minecraft.item.ItemHoe; import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.api.distmarker.OnlyIn;
import reborncore.common.util.ItemUtils; import reborncore.common.util.ItemUtils;
public class ItemTRHoe extends ItemHoe { public class ItemTRHoe extends ItemHoe {
@ -44,7 +44,7 @@ public class ItemTRHoe extends ItemHoe {
} }
@Override @Override
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
public boolean isFull3D() { public boolean isFull3D() {
return true; return true;
} }

View file

@ -300,12 +300,12 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
} }
@Override @Override
public void writeToNBT(NBTTagCompound data) { public void write(NBTTagCompound data) {
} }
@Override @Override
public void readFromNBT(NBTTagCompound data) { public void read(NBTTagCompound data) {
} }

View file

@ -88,8 +88,8 @@ public class ClientProxy extends CommonProxy {
@Override @Override
public String getUpgradeConfigText() { public String getUpgradeConfigText() {
if (Minecraft.getMinecraft().currentScreen instanceof GuiBase) { if (Minecraft.getInstance().currentScreen instanceof GuiBase) {
GuiBase base = (GuiBase) Minecraft.getMinecraft().currentScreen; GuiBase base = (GuiBase) Minecraft.getInstance().currentScreen;
if (base.tile instanceof IUpgradeable) { if (base.tile instanceof IUpgradeable) {
if (((IUpgradeable) base.tile).canBeUpgraded()) { if (((IUpgradeable) base.tile).canBeUpgraded()) {
return TextFormatting.LIGHT_PURPLE + "Right click to configure"; return TextFormatting.LIGHT_PURPLE + "Right click to configure";
@ -109,7 +109,7 @@ public class ClientProxy extends CommonProxy {
@Override @Override
public boolean fancyGraphics() { public boolean fancyGraphics() {
return Minecraft.getMinecraft().gameSettings.fancyGraphics; return Minecraft.getInstance().gameSettings.fancyGraphics;
} }
@Override @Override

View file

@ -60,20 +60,20 @@ public class TileAlarm extends TileEntity
// TileEntity // TileEntity
@Override @Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) { public NBTTagCompound write(NBTTagCompound compound) {
if (compound == null) { if (compound == null) {
compound = new NBTTagCompound(); compound = new NBTTagCompound();
} }
compound.setInteger("selectedSound", this.selectedSound); compound.setInt("selectedSound", this.selectedSound);
return super.writeToNBT(compound); return super.write(compound);
} }
@Override @Override
public void readFromNBT(NBTTagCompound compound) { public void read(NBTTagCompound compound) {
if (compound != null && compound.hasKey("selectedSound")) { if (compound != null && compound.hasKey("selectedSound")) {
selectedSound = compound.getInteger("selectedSound"); selectedSound = compound.getInt("selectedSound");
} }
super.readFromNBT(compound); super.read(compound);
} }
@Override @Override

View file

@ -54,7 +54,7 @@ public class TileEntityFlare extends TileEntity implements ITickable {
} }
particleSmokeLarge.multipleParticleScaleBy(0.5F); particleSmokeLarge.multipleParticleScaleBy(0.5F);
Minecraft.getMinecraft().effectRenderer.addEffect(particleSmokeLarge); Minecraft.getInstance().effectRenderer.addEffect(particleSmokeLarge);
world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 0.3, pos.getZ() + 0.5, 0.0D, 0.0D, 0.0D); world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 0.3, pos.getZ() + 0.5, 0.0D, 0.0D, 0.0D);
} }

View file

@ -137,26 +137,26 @@ public class TilePump extends TilePowerAcceptor {
} }
@Override @Override
public void readFromNBT(NBTTagCompound tagCompound) { public void read(NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound); super.read(tagCompound);
readFromNBTWithoutCoords(tagCompound); readWithoutCoords(tagCompound);
} }
@Override @Override
public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) { public void readWithoutCoords(NBTTagCompound tagCompound) {
tank.readFromNBT(tagCompound); tank.read(tagCompound);
} }
@Override @Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { public NBTTagCompound write(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound); super.write(tagCompound);
writeToNBTWithoutCoords(tagCompound); writeWithoutCoords(tagCompound);
return tagCompound; return tagCompound;
} }
@Override @Override
public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) { public NBTTagCompound writeWithoutCoords(NBTTagCompound tagCompound) {
tank.writeToNBT(tagCompound); tank.write(tagCompound);
return tagCompound; return tagCompound;
} }

View file

@ -57,21 +57,21 @@ public class TileQuantumTank extends TileMachineBase
public Tank tank = new Tank("TileQuantumTank", maxStorage, this); public Tank tank = new Tank("TileQuantumTank", maxStorage, this);
public Inventory<TileQuantumTank> inventory = new Inventory<>(3, "TileQuantumTank", 64, this).withConfiguredAccess(); public Inventory<TileQuantumTank> inventory = new Inventory<>(3, "TileQuantumTank", 64, this).withConfiguredAccess();
public void readFromNBTWithoutCoords(final NBTTagCompound tagCompound) { public void readWithoutCoords(final NBTTagCompound tagCompound) {
tank.readFromNBT(tagCompound); tank.read(tagCompound);
} }
public NBTTagCompound writeToNBTWithoutCoords(final NBTTagCompound tagCompound) { public NBTTagCompound writeWithoutCoords(final NBTTagCompound tagCompound) {
tank.writeToNBT(tagCompound); tank.write(tagCompound);
return tagCompound; return tagCompound;
} }
public ItemStack getDropWithNBT() { public ItemStack getDropWithNBT() {
final NBTTagCompound tileEntity = new NBTTagCompound(); final NBTTagCompound tileEntity = new NBTTagCompound();
final ItemStack dropStack = TRContent.Machine.QUANTUM_TANK.getStack(); final ItemStack dropStack = TRContent.Machine.QUANTUM_TANK.getStack();
this.writeToNBTWithoutCoords(tileEntity); this.writeWithoutCoords(tileEntity);
dropStack.setTagCompound(new NBTTagCompound()); dropStack.setTag(new NBTTagCompound());
dropStack.getTagCompound().setTag("tileEntity", tileEntity); dropStack.getTag().setTag("tileEntity", tileEntity);
return dropStack; return dropStack;
} }
@ -93,22 +93,22 @@ public class TileQuantumTank extends TileMachineBase
} }
@Override @Override
public void readFromNBT(final NBTTagCompound tagCompound) { public void read(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound); super.read(tagCompound);
readFromNBTWithoutCoords(tagCompound); readWithoutCoords(tagCompound);
} }
@Override @Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) { public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound); super.write(tagCompound);
writeToNBTWithoutCoords(tagCompound); writeWithoutCoords(tagCompound);
return tagCompound; return tagCompound;
} }
@Override @Override
public void onDataPacket(final NetworkManager net, final SPacketUpdateTileEntity packet) { public void onDataPacket(final NetworkManager net, final SPacketUpdateTileEntity packet) {
world.markBlockRangeForRenderUpdate(pos.getX(), pos.getY(), pos.getZ(), pos.getX(), pos.getY(), pos.getZ()); world.markBlockRangeForRenderUpdate(pos.getX(), pos.getY(), pos.getZ(), pos.getX(), pos.getY(), pos.getZ());
readFromNBT(packet.getNbtCompound()); read(packet.getNbtCompound());
} }
// ItemHandlerProvider // ItemHandlerProvider

View file

@ -56,7 +56,7 @@ public class TileTechStorageBase extends TileMachineBase
inventory = new Inventory<>(3, name, maxCapacity, this).withConfiguredAccess(); inventory = new Inventory<>(3, name, maxCapacity, this).withConfiguredAccess();
} }
public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) { public void readWithoutCoords(NBTTagCompound tagCompound) {
storedItem = ItemStack.EMPTY; storedItem = ItemStack.EMPTY;
@ -65,33 +65,33 @@ public class TileTechStorageBase extends TileMachineBase
} }
if (!storedItem.isEmpty()) { if (!storedItem.isEmpty()) {
storedItem.setCount(Math.min(tagCompound.getInteger("storedQuantity"), this.maxCapacity)); storedItem.setCount(Math.min(tagCompound.getInt("storedQuantity"), this.maxCapacity));
} }
inventory.readFromNBT(tagCompound); inventory.read(tagCompound);
} }
public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) { public NBTTagCompound writeWithoutCoords(NBTTagCompound tagCompound) {
if (!storedItem.isEmpty()) { if (!storedItem.isEmpty()) {
ItemStack temp = storedItem.copy(); ItemStack temp = storedItem.copy();
if (storedItem.getCount() > storedItem.getMaxStackSize()) { if (storedItem.getCount() > storedItem.getMaxStackSize()) {
temp.setCount(storedItem.getMaxStackSize()); temp.setCount(storedItem.getMaxStackSize());
} }
tagCompound.setTag("storedStack", temp.writeToNBT(new NBTTagCompound())); tagCompound.setTag("storedStack", temp.write(new NBTTagCompound()));
tagCompound.setInteger("storedQuantity", Math.min(storedItem.getCount(), maxCapacity)); tagCompound.setInt("storedQuantity", Math.min(storedItem.getCount(), maxCapacity));
} else { } else {
tagCompound.setInteger("storedQuantity", 0); tagCompound.setInt("storedQuantity", 0);
} }
inventory.writeToNBT(tagCompound); inventory.write(tagCompound);
return tagCompound; return tagCompound;
} }
public ItemStack getDropWithNBT() { public ItemStack getDropWithNBT() {
NBTTagCompound tileEntity = new NBTTagCompound(); NBTTagCompound tileEntity = new NBTTagCompound();
ItemStack dropStack = new ItemStack(getBlockType(), 1); ItemStack dropStack = new ItemStack(getBlockType(), 1);
writeToNBTWithoutCoords(tileEntity); writeWithoutCoords(tileEntity);
dropStack.setTagCompound(new NBTTagCompound()); dropStack.setTag(new NBTTagCompound());
dropStack.getTagCompound().setTag("tileEntity", tileEntity); dropStack.getTag().setTag("tileEntity", tileEntity);
storedItem.setCount(0); storedItem.setCount(0);
inventory.setStackInSlot(1, ItemStack.EMPTY); inventory.setStackInSlot(1, ItemStack.EMPTY);
syncWithAll(); syncWithAll();
@ -197,19 +197,19 @@ public class TileTechStorageBase extends TileMachineBase
@Override @Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) { public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
world.markBlockRangeForRenderUpdate(pos.getX(), pos.getY(), pos.getZ(), pos.getX(), pos.getY(), pos.getZ()); world.markBlockRangeForRenderUpdate(pos.getX(), pos.getY(), pos.getZ(), pos.getX(), pos.getY(), pos.getZ());
readFromNBT(packet.getNbtCompound()); read(packet.getNbtCompound());
} }
@Override @Override
public void readFromNBT(NBTTagCompound tagCompound) { public void read(NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound); super.read(tagCompound);
readFromNBTWithoutCoords(tagCompound); readWithoutCoords(tagCompound);
} }
@Override @Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { public NBTTagCompound write(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound); super.write(tagCompound);
writeToNBTWithoutCoords(tagCompound); writeWithoutCoords(tagCompound);
return tagCompound; return tagCompound;
} }

View file

@ -96,35 +96,35 @@ public class TileCable extends TileEntity
@Override @Override
public NBTTagCompound getUpdateTag() { public NBTTagCompound getUpdateTag() {
return writeToNBT(new NBTTagCompound()); return write(new NBTTagCompound());
} }
@Override @Override
public SPacketUpdateTileEntity getUpdatePacket() { public SPacketUpdateTileEntity getUpdatePacket() {
NBTTagCompound nbtTag = new NBTTagCompound(); NBTTagCompound nbtTag = new NBTTagCompound();
writeToNBT(nbtTag); write(nbtTag);
return new SPacketUpdateTileEntity(getPos(), 1, nbtTag); return new SPacketUpdateTileEntity(getPos(), 1, nbtTag);
} }
@Override @Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) { public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
readFromNBT(packet.getNbtCompound()); read(packet.getNbtCompound());
} }
@Override @Override
public void readFromNBT(NBTTagCompound compound) { public void read(NBTTagCompound compound) {
super.readFromNBT(compound); super.read(compound);
if (compound.hasKey("TileCable")) { if (compound.hasKey("TileCable")) {
power = compound.getCompoundTag("TileCable").getInteger("power"); power = compound.getCompoundTag("TileCable").getInt("power");
} }
} }
@Override @Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) { public NBTTagCompound write(NBTTagCompound compound) {
super.writeToNBT(compound); super.write(compound);
if (power > 0) { if (power > 0) {
NBTTagCompound data = new NBTTagCompound(); NBTTagCompound data = new NBTTagCompound();
data.setInteger("power", getEnergyStored()); data.setInt("power", getEnergyStored());
compound.setTag("TileCable", data); compound.setTag("TileCable", data);
} }
return compound; return compound;

View file

@ -313,11 +313,11 @@ public class TileFusionControlComputer extends TilePowerAcceptor
} }
@Override @Override
public void readFromNBT(final NBTTagCompound tagCompound) { public void read(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound); super.read(tagCompound);
this.crafingTickTime = tagCompound.getInteger("crafingTickTime"); this.crafingTickTime = tagCompound.getInt("crafingTickTime");
this.finalTickTime = tagCompound.getInteger("finalTickTime"); this.finalTickTime = tagCompound.getInt("finalTickTime");
this.neededPower = tagCompound.getInteger("neededPower"); this.neededPower = tagCompound.getInt("neededPower");
this.hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting"); this.hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting");
if(tagCompound.hasKey("hasActiveRecipe") && tagCompound.getBoolean("hasActiveRecipe") && this.currentRecipe == null){ if(tagCompound.hasKey("hasActiveRecipe") && tagCompound.getBoolean("hasActiveRecipe") && this.currentRecipe == null){
for (final FusionReactorRecipe reactorRecipe : FusionReactorRecipeHelper.reactorRecipes) { for (final FusionReactorRecipe reactorRecipe : FusionReactorRecipeHelper.reactorRecipes) {
@ -327,20 +327,20 @@ public class TileFusionControlComputer extends TilePowerAcceptor
} }
} }
if(tagCompound.hasKey("size")){ if(tagCompound.hasKey("size")){
this.size = tagCompound.getInteger("size"); this.size = tagCompound.getInt("size");
} }
this.size = Math.min(size, maxCoilSize);//Done here to force the samller size, will be useful if people lag out on a large one. this.size = Math.min(size, maxCoilSize);//Done here to force the samller size, will be useful if people lag out on a large one.
} }
@Override @Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) { public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound); super.write(tagCompound);
tagCompound.setInteger("crafingTickTime", this.crafingTickTime); tagCompound.setInt("crafingTickTime", this.crafingTickTime);
tagCompound.setInteger("finalTickTime", this.finalTickTime); tagCompound.setInt("finalTickTime", this.finalTickTime);
tagCompound.setInteger("neededPower", this.neededPower); tagCompound.setInt("neededPower", this.neededPower);
tagCompound.setBoolean("hasStartedCrafting", this.hasStartedCrafting); tagCompound.setBoolean("hasStartedCrafting", this.hasStartedCrafting);
tagCompound.setBoolean("hasActiveRecipe", this.currentRecipe != null); tagCompound.setBoolean("hasActiveRecipe", this.currentRecipe != null);
tagCompound.setInteger("size", size); tagCompound.setInt("size", size);
return tagCompound; return tagCompound;
} }

View file

@ -108,10 +108,10 @@ public abstract class TileBaseFluidGenerator extends TilePowerAcceptor implement
} }
if (world.getTotalWorldTime() - lastOutput < 30 && !isActive()) { if (world.getTotalWorldTime() - lastOutput < 30 && !isActive()) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockMachineBase.ACTIVE, true)); world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, true));
} }
else if (world.getTotalWorldTime() - lastOutput > 30 && isActive()) { else if (world.getTotalWorldTime() - lastOutput > 30 && isActive()) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockMachineBase.ACTIVE, false)); world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, false));
} }
} }
@ -173,15 +173,15 @@ public abstract class TileBaseFluidGenerator extends TilePowerAcceptor implement
} }
@Override @Override
public void readFromNBT(NBTTagCompound tagCompound) { public void read(NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound); super.read(tagCompound);
tank.readFromNBT(tagCompound); tank.read(tagCompound);
} }
@Override @Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { public NBTTagCompound write(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound); super.write(tagCompound);
tank.writeToNBT(tagCompound); tank.write(tagCompound);
return tagCompound; return tagCompound;
} }

View file

@ -65,7 +65,7 @@ public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop {
if (world.getTotalWorldTime() % 20 == 0) { if (world.getTotalWorldTime() % 20 == 0) {
canSeeSky = world.canBlockSeeSky(pos.up()); canSeeSky = world.canBlockSeeSky(pos.up());
if (lastState != isSunOut()) { if (lastState != isSunOut()) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockSolarPanel.ACTIVE, isSunOut())); world.setBlockState(pos, world.getBlockState(pos).with(BlockSolarPanel.ACTIVE, isSunOut()));
lastState = isSunOut(); lastState = isSunOut();
} }
} }
@ -138,12 +138,12 @@ public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop {
} }
@Override @Override
public void readFromNBT(NBTTagCompound tag) { public void read(NBTTagCompound tag) {
if (world == null) { if (world == null) {
// We are in TileEntity.create method during chunk load. // We are in TileEntity.create method during chunk load.
this.checkOverfill = false; this.checkOverfill = false;
} }
super.readFromNBT(tag); super.read(tag);
} }
// TileMachineBase // TileMachineBase

View file

@ -81,9 +81,9 @@ public class TileDragonEggSyphon extends TilePowerAcceptor
} }
if (world.getTotalWorldTime() - lastOutput < 30 && !isActive()) { if (world.getTotalWorldTime() - lastOutput < 30 && !isActive()) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockMachineBase.ACTIVE, true)); world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, true));
} else if (world.getTotalWorldTime() - lastOutput > 30 && isActive()) { } else if (world.getTotalWorldTime() - lastOutput > 30 && isActive()) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockMachineBase.ACTIVE, false)); world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, false));
} }
} }
} }

View file

@ -64,10 +64,10 @@ public class TileWaterMill extends TilePowerAcceptor implements IToolDrop {
} }
if (waterblocks > 0) { if (waterblocks > 0) {
addEnergy(waterblocks * energyMultiplier); addEnergy(waterblocks * energyMultiplier);
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockWindMill.ACTIVE, true)); world.setBlockState(pos, world.getBlockState(pos).with(BlockWindMill.ACTIVE, true));
} }
else { else {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockWindMill.ACTIVE, false)); world.setBlockState(pos, world.getBlockState(pos).with(BlockWindMill.ACTIVE, false));
} }
} }

View file

@ -110,15 +110,15 @@ public class TileFluidReplicator extends TileGenericMachine implements IContaine
// TilePowerAcceptor // TilePowerAcceptor
@Override @Override
public void readFromNBT(final NBTTagCompound tagCompound) { public void read(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound); super.read(tagCompound);
tank.readFromNBT(tagCompound); tank.read(tagCompound);
} }
@Override @Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) { public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound); super.write(tagCompound);
tank.writeToNBT(tagCompound); tank.write(tagCompound);
return tagCompound; return tagCompound;
} }

View file

@ -142,7 +142,7 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
@Override @Override
public void onDataPacket(final NetworkManager net, final SPacketUpdateTileEntity packet) { public void onDataPacket(final NetworkManager net, final SPacketUpdateTileEntity packet) {
world.markBlockRangeForRenderUpdate(pos.getX(), pos.getY(), pos.getZ(), pos.getX(), pos.getY(), pos.getZ()); world.markBlockRangeForRenderUpdate(pos.getX(), pos.getY(), pos.getZ(), pos.getX(), pos.getY(), pos.getZ());
readFromNBT(packet.getNbtCompound()); read(packet.getNbtCompound());
} }
// IContainerProvider // IContainerProvider

View file

@ -125,15 +125,15 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai
} }
@Override @Override
public void readFromNBT(final NBTTagCompound tagCompound) { public void read(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound); super.read(tagCompound);
tank.readFromNBT(tagCompound); tank.read(tagCompound);
} }
@Override @Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) { public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound); super.write(tagCompound);
tank.writeToNBT(tagCompound); tank.write(tagCompound);
return tagCompound; return tagCompound;
} }

View file

@ -116,15 +116,15 @@ public class TileIndustrialSawmill extends TileGenericMachine implements IContai
// TilePowerAcceptor // TilePowerAcceptor
@Override @Override
public void readFromNBT(final NBTTagCompound tagCompound) { public void read(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound); super.read(tagCompound);
tank.readFromNBT(tagCompound); tank.read(tagCompound);
} }
@Override @Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) { public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound); super.write(tagCompound);
tank.writeToNBT(tagCompound); tank.write(tagCompound);
return tagCompound; return tagCompound;
} }

View file

@ -378,17 +378,17 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
} }
@Override @Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) { public NBTTagCompound write(NBTTagCompound tag) {
tag.setBoolean("locked", locked); tag.setBoolean("locked", locked);
return super.writeToNBT(tag); return super.write(tag);
} }
@Override @Override
public void readFromNBT(NBTTagCompound tag) { public void read(NBTTagCompound tag) {
if (tag.hasKey("locked")) { if (tag.hasKey("locked")) {
locked = tag.getBoolean("locked"); locked = tag.getBoolean("locked");
} }
super.readFromNBT(tag); super.read(tag);
} }
// TileMachineBase // TileMachineBase

View file

@ -123,14 +123,14 @@ public class TilePlayerDectector extends TilePowerAcceptor implements IToolDrop
} }
@Override @Override
public void readFromNBT(NBTTagCompound tag) { public void read(NBTTagCompound tag) {
super.readFromNBT(tag); super.read(tag);
owenerUdid = tag.getString("ownerID"); owenerUdid = tag.getString("ownerID");
} }
@Override @Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) { public NBTTagCompound write(NBTTagCompound tag) {
super.writeToNBT(tag); super.write(tag);
tag.setString("ownerID", owenerUdid); tag.setString("ownerID", owenerUdid);
return tag; return tag;
} }

View file

@ -278,18 +278,18 @@ public class TileRollingMachine extends TilePowerAcceptor
} }
@Override @Override
public void readFromNBT(final NBTTagCompound tagCompound) { public void read(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound); super.read(tagCompound);
this.isRunning = tagCompound.getBoolean("isRunning"); this.isRunning = tagCompound.getBoolean("isRunning");
this.tickTime = tagCompound.getInteger("tickTime"); this.tickTime = tagCompound.getInt("tickTime");
this.locked = tagCompound.getBoolean("locked"); this.locked = tagCompound.getBoolean("locked");
} }
@Override @Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) { public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound); super.write(tagCompound);
tagCompound.setBoolean("isRunning", this.isRunning); tagCompound.setBoolean("isRunning", this.isRunning);
tagCompound.setInteger("tickTime", this.tickTime); tagCompound.setInt("tickTime", this.tickTime);
tagCompound.setBoolean("locked", locked); tagCompound.setBoolean("locked", locked);
return tagCompound; return tagCompound;
} }

View file

@ -78,9 +78,9 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro
public ItemStack getDropWithNBT() { public ItemStack getDropWithNBT() {
NBTTagCompound tileEntity = new NBTTagCompound(); NBTTagCompound tileEntity = new NBTTagCompound();
ItemStack dropStack = TRContent.Machine.ADJUSTABLE_SU.getStack(); ItemStack dropStack = TRContent.Machine.ADJUSTABLE_SU.getStack();
writeToNBTWithoutCoords(tileEntity); writeWithoutCoords(tileEntity);
dropStack.setTagCompound(new NBTTagCompound()); dropStack.setTag(new NBTTagCompound());
dropStack.getTagCompound().setTag("tileEntity", tileEntity); dropStack.getTag().setTag("tileEntity", tileEntity);
return dropStack; return dropStack;
} }
@ -105,18 +105,18 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro
// TilePowerAcceptor // TilePowerAcceptor
@Override @Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { public NBTTagCompound write(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound); super.write(tagCompound);
tagCompound.setInteger("output", OUTPUT); tagCompound.setInt("output", OUTPUT);
inventory.writeToNBT(tagCompound); inventory.write(tagCompound);
return tagCompound; return tagCompound;
} }
@Override @Override
public void readFromNBT(NBTTagCompound nbttagcompound) { public void read(NBTTagCompound nbttagcompound) {
super.readFromNBT(nbttagcompound); super.read(nbttagcompound);
this.OUTPUT = nbttagcompound.getInteger("output"); this.OUTPUT = nbttagcompound.getInt("output");
inventory.readFromNBT(nbttagcompound); inventory.read(nbttagcompound);
} }
// IContainerProvider // IContainerProvider

View file

@ -110,7 +110,7 @@ public class TileEnergyStorage extends TilePowerAcceptor
// TileMachineBase // TileMachineBase
@Override @Override
public void setFacing(EnumFacing enumFacing) { public void setFacing(EnumFacing enumFacing) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockEnergyStorage.FACING, enumFacing)); world.setBlockState(pos, world.getBlockState(pos).with(BlockEnergyStorage.FACING, enumFacing));
} }
@Override @Override

View file

@ -37,12 +37,12 @@ public class IDSUSaveManger extends WorldSavedData implements IDataIDSU {
} }
@Override @Override
public void readFromNBT(NBTTagCompound nbt) { public void read(NBTTagCompound nbt) {
power = nbt.getDouble("power"); power = nbt.getDouble("power");
} }
@Override @Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) { public NBTTagCompound write(NBTTagCompound compound) {
compound.setDouble("power", power); compound.setDouble("power", power);
return compound; return compound;
} }

View file

@ -93,14 +93,14 @@ public class TileInterdimensionalSU extends TileEnergyStorage implements IContai
} }
@Override @Override
public void readFromNBT(NBTTagCompound nbttagcompound) { public void read(NBTTagCompound nbttagcompound) {
super.readFromNBT(nbttagcompound); super.read(nbttagcompound);
this.ownerUdid = nbttagcompound.getString("ownerUdid"); this.ownerUdid = nbttagcompound.getString("ownerUdid");
} }
@Override @Override
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { public NBTTagCompound write(NBTTagCompound nbttagcompound) {
super.writeToNBT(nbttagcompound); super.write(nbttagcompound);
if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) { if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
return nbttagcompound; return nbttagcompound;
} }

View file

@ -30,10 +30,10 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagString; import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.init.TRContent; import techreborn.init.TRContent;
import reborncore.common.util.StringUtils; import reborncore.common.util.StringUtils;
@ -59,12 +59,12 @@ public class StackWIPHandler {
private void addHead(String name) { private void addHead(String name) {
ItemStack head = new ItemStack(Items.SKULL, 1, 3); ItemStack head = new ItemStack(Items.SKULL, 1, 3);
head.setTagCompound(new NBTTagCompound()); head.setTag(new NBTTagCompound());
head.getTagCompound().setTag("SkullOwner", new NBTTagString(name)); head.getTag().setTag("SkullOwner", new NBTTagString(name));
devHeads.add(head); devHeads.add(head);
} }
@SideOnly(Side.CLIENT) @OnlyIn(Dist.CLIENT)
@SubscribeEvent @SubscribeEvent
public void toolTip(ItemTooltipEvent event) { public void toolTip(ItemTooltipEvent event) {
Block block = Block.getBlockFromItem(event.getItemStack().getItem()); Block block = Block.getBlockFromItem(event.getItemStack().getItem());

View file

@ -130,7 +130,7 @@ public class RubberTreeGenerator extends WorldGenerator {
|| block.canBeReplacedByLeaves(state1, world, || block.canBeReplacedByLeaves(state1, world,
new BlockPos(xOffset, yOffset, zOffset)))) { new BlockPos(xOffset, yOffset, zOffset)))) {
this.setBlockAndNotifyAdequately(world, new BlockPos(xOffset, yOffset, zOffset), this.setBlockAndNotifyAdequately(world, new BlockPos(xOffset, yOffset, zOffset),
TRContent.RUBBER_LEAVES.getDefaultState().withProperty(BlockRubberLeaves.DECAYABLE, true).withProperty(BlockRubberLeaves.CHECK_DECAY, false)); TRContent.RUBBER_LEAVES.getDefaultState().with(BlockRubberLeaves.DECAYABLE, true).with(BlockRubberLeaves.CHECK_DECAY, false));
hasPlacedBlock = true; hasPlacedBlock = true;
} }
} }
@ -147,8 +147,8 @@ public class RubberTreeGenerator extends WorldGenerator {
IBlockState newState = TRContent.RUBBER_LOG.getDefaultState(); IBlockState newState = TRContent.RUBBER_LOG.getDefaultState();
boolean isAddingSap = false; boolean isAddingSap = false;
if (rand.nextInt(TechReborn.worldGen.config.rubberTreeConfig.sapRarity) == 0) { if (rand.nextInt(TechReborn.worldGen.config.rubberTreeConfig.sapRarity) == 0) {
newState = newState.withProperty(BlockRubberLog.HAS_SAP, true) newState = newState.with(BlockRubberLog.HAS_SAP, true)
.withProperty(BlockRubberLog.SAP_SIDE, EnumFacing.byHorizontalIndex(rand.nextInt(4))); .with(BlockRubberLog.SAP_SIDE, EnumFacing.byHorizontalIndex(rand.nextInt(4)));
isAddingSap = true; isAddingSap = true;
} }
if (isAddingSap) { if (isAddingSap) {
@ -164,7 +164,7 @@ public class RubberTreeGenerator extends WorldGenerator {
for (int i = 0; i < TechReborn.worldGen.config.rubberTreeConfig.spireHeight; i++) { for (int i = 0; i < TechReborn.worldGen.config.rubberTreeConfig.spireHeight; i++) {
BlockPos spikePos = topLogPos.up(i); BlockPos spikePos = topLogPos.up(i);
this.setBlockAndNotifyAdequately(world, spikePos, TRContent.RUBBER_LEAVES.getDefaultState() this.setBlockAndNotifyAdequately(world, spikePos, TRContent.RUBBER_LEAVES.getDefaultState()
.withProperty(BlockRubberLeaves.DECAYABLE, true).withProperty(BlockRubberLeaves.CHECK_DECAY, false)); .with(BlockRubberLeaves.DECAYABLE, true).with(BlockRubberLeaves.CHECK_DECAY, false));
} }
} }
} }

View file

@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.event.world.ChunkDataEvent; import net.minecraftforge.event.world.ChunkDataEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import reborncore.common.misc.ChunkCoord; import reborncore.common.misc.ChunkCoord;