Removed unused code, added Override annotation

This commit is contained in:
drcrazy 2017-11-12 12:15:32 +03:00
parent 14f715ff7b
commit bf5b649fc4
39 changed files with 94 additions and 102 deletions

View file

@ -70,6 +70,7 @@ public class BlockFlare extends BlockContainer {
return null; return null;
} }
@Override
public int damageDropped(IBlockState state) { public int damageDropped(IBlockState state) {
return (state.getValue(COLOR)).getMetadata(); return (state.getValue(COLOR)).getMetadata();
} }
@ -81,14 +82,17 @@ public class BlockFlare extends BlockContainer {
} }
} }
@Override
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta)); return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta));
} }
@Override
public int getMetaFromState(IBlockState state) { public int getMetaFromState(IBlockState state) {
return (state.getValue(COLOR)).getMetadata(); return (state.getValue(COLOR)).getMetadata();
} }
@Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, COLOR); return new BlockStateContainer(this, COLOR);
} }
@ -98,6 +102,7 @@ public class BlockFlare extends BlockContainer {
return false; return false;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer() { public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.CUTOUT; return BlockRenderLayer.CUTOUT;

View file

@ -111,6 +111,7 @@ public class BlockMachineFrames extends BaseBlock {
return typesList.indexOf(state.getValue(TYPE)); return typesList.indexOf(state.getValue(TYPE));
} }
@Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, TYPE); return new BlockStateContainer(this, TYPE);
} }

View file

@ -113,6 +113,7 @@ public class BlockOre extends Block implements IOreNameProvider {
return getStateFromMeta(index); return getStateFromMeta(index);
} }
@Override
@Deprecated @Deprecated
public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
String variant = state.getValue(VARIANTS); String variant = state.getValue(VARIANTS);
@ -230,6 +231,7 @@ public class BlockOre extends Block implements IOreNameProvider {
return oreNamesList.indexOf(state.getValue(VARIANTS)); return oreNamesList.indexOf(state.getValue(VARIANTS));
} }
@Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, VARIANTS); return new BlockStateContainer(this, VARIANTS);
} }

View file

@ -151,6 +151,7 @@ public class BlockOre2 extends Block implements IOreNameProvider {
return oreNamesList.indexOf(state.getValue(VARIANTS)); return oreNamesList.indexOf(state.getValue(VARIANTS));
} }
@Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
VARIANTS = new PropertyString("type", oreNamesList); VARIANTS = new PropertyString("type", oreNamesList);
return new BlockStateContainer(this, VARIANTS); return new BlockStateContainer(this, VARIANTS);

View file

@ -163,6 +163,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
return true; return true;
} }
@Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
TYPE = new PropertyString("type", types); TYPE = new PropertyString("type", types);
return new BlockStateContainer(this, TYPE); return new BlockStateContainer(this, TYPE);

View file

@ -49,6 +49,7 @@ public class BlockReinforcedGlass extends BlockGlass {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this)); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
} }
@Override
public int quantityDropped(Random random) { public int quantityDropped(Random random) {
return 1; return 1;
} }
@ -58,6 +59,7 @@ public class BlockReinforcedGlass extends BlockGlass {
return false; return false;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer() { public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.CUTOUT; return BlockRenderLayer.CUTOUT;

View file

@ -77,6 +77,7 @@ public class BlockRubberLog extends Block {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this)); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
} }
@Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, SAP_SIDE, HAS_SAP); return new BlockStateContainer(this, SAP_SIDE, HAS_SAP);
} }
@ -127,6 +128,7 @@ public class BlockRubberLog extends Block {
return true; return true;
} }
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
int i = 4; int i = 4;
int j = i + 1; int j = i + 1;

View file

@ -109,6 +109,7 @@ public class BlockStorage extends BaseBlock {
return typesList.indexOf(state.getValue(TYPE)); return typesList.indexOf(state.getValue(TYPE));
} }
@Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, TYPE); return new BlockStateContainer(this, TYPE);
} }

View file

@ -133,6 +133,7 @@ public class BlockStorage2 extends BaseBlock {
return 30F; return 30F;
} }
@Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, TYPE); return new BlockStateContainer(this, TYPE);
} }

View file

@ -193,6 +193,7 @@ public class BlockCable extends BlockContainer {
return false; return false;
} }
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
state = state.getActualState(source, pos); state = state.getActualState(source, pos);
float minX = state.getValue(WEST) ? 0.0F : 0.3125F; float minX = state.getValue(WEST) ? 0.0F : 0.3125F;

View file

@ -78,6 +78,7 @@ public class BlockLamp extends BaseTileBlock {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/lighting")); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/lighting"));
} }
@Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
FACING = PropertyDirection.create("facing"); FACING = PropertyDirection.create("facing");
ACTIVE = PropertyBool.create("active"); ACTIVE = PropertyBool.create("active");

View file

@ -113,6 +113,7 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
return super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ); return super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ);
} }
@Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
FACING = PropertyDirection.create("facing", Facings.ALL); FACING = PropertyDirection.create("facing", Facings.ALL);
return new BlockStateContainer(this, FACING); return new BlockStateContainer(this, FACING);
@ -220,10 +221,12 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
return aenumfacing[rand.nextInt(aenumfacing.length)]; return aenumfacing[rand.nextInt(aenumfacing.length)];
} }
@Override
public boolean apply(EnumFacing p_apply_1_) { public boolean apply(EnumFacing p_apply_1_) {
return p_apply_1_ != null; return p_apply_1_ != null;
} }
@Override
public Iterator<EnumFacing> iterator() { public Iterator<EnumFacing> iterator() {
return Iterators.forArray(this.facings()); return Iterators.forArray(this.facings());
} }

View file

@ -76,6 +76,7 @@ public abstract class BlockTransformer extends BaseTileBlock {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy")); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy"));
} }
@Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
FACING = PropertyDirection.create("facing", Facings.ALL); FACING = PropertyDirection.create("facing", Facings.ALL);
return new BlockStateContainer(this, FACING); return new BlockStateContainer(this, FACING);
@ -267,10 +268,12 @@ public abstract class BlockTransformer extends BaseTileBlock {
return aenumfacing[rand.nextInt(aenumfacing.length)]; return aenumfacing[rand.nextInt(aenumfacing.length)];
} }
@Override
public boolean apply(EnumFacing p_apply_1_) { public boolean apply(EnumFacing p_apply_1_) {
return p_apply_1_ != null; return p_apply_1_ != null;
} }
@Override
public Iterator<EnumFacing> iterator() { public Iterator<EnumFacing> iterator() {
return Iterators.forArray(this.facings()); return Iterators.forArray(this.facings());
} }

View file

@ -61,6 +61,7 @@ public class RegisterItemJsons {
register(ModItems.MANUAL, "misc/manual"); register(ModItems.MANUAL, "misc/manual");
register(ModItems.DEBUG, "misc/debug"); register(ModItems.DEBUG, "misc/debug");
register(ModBlocks.RUBBER_SAPLING, "misc/rubber_sapling"); register(ModBlocks.RUBBER_SAPLING, "misc/rubber_sapling");
register(ModItems.MISSING_RECIPE_PLACEHOLDER, "misc/missing_recipe");
register(ModItems.STEEL_DRILL, "tool/steel_drill"); register(ModItems.STEEL_DRILL, "tool/steel_drill");
register(ModItems.DIAMOND_DRILL, "tool/diamond_drill"); register(ModItems.DIAMOND_DRILL, "tool/diamond_drill");

View file

@ -353,6 +353,7 @@ public class TRBuilder extends GuiBuilder {
} }
} }
@Override
public void drawSlot(GuiScreen gui, int posX, int posY) { public void drawSlot(GuiScreen gui, int posX, int posY) {
Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET); Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET);
gui.drawTexturedModalRect(posX, posY, 150, 0, 18, 18); gui.drawTexturedModalRect(posX, posY, 150, 0, 18, 18);
@ -387,6 +388,7 @@ public class TRBuilder extends GuiBuilder {
} }
} }
@Override
public void drawOutputSlot(GuiScreen gui, int posX, int posY) { public void drawOutputSlot(GuiScreen gui, int posX, int posY) {
Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET); Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET);
gui.drawTexturedModalRect(posX, posY, 150, 18, 26, 26); gui.drawTexturedModalRect(posX, posY, 150, 18, 26, 26);

View file

@ -232,6 +232,7 @@ public class GuiAutoCrafting extends GuiBase {
this.recipeSlector.slotClicked(slotIn); this.recipeSlector.slotClicked(slotIn);
} }
@Override
public void onGuiClosed() { public void onGuiClosed() {
this.recipeSlector.removed(); this.recipeSlector.removed();
super.onGuiClosed(); super.onGuiClosed();

View file

@ -329,7 +329,7 @@ public class ModItems {
registerItem(CLOAKING_DEVICE, "cloakingdevice"); registerItem(CLOAKING_DEVICE, "cloakingdevice");
MISSING_RECIPE_PLACEHOLDER = new ItemMissingRecipe().setUnlocalizedName("missingRecipe"); MISSING_RECIPE_PLACEHOLDER = new ItemMissingRecipe().setUnlocalizedName("missingRecipe");
registerItem(MISSING_RECIPE_PLACEHOLDER, "mssingRecipe"); registerItem(MISSING_RECIPE_PLACEHOLDER, "missingRecipe");
DEBUG = new ItemDebugTool(); DEBUG = new ItemDebugTool();
registerItem(DEBUG, "debug"); registerItem(DEBUG, "debug");

View file

@ -39,10 +39,12 @@ public class ItemBlockCable extends ItemBlock {
setHasSubtypes(true); setHasSubtypes(true);
} }
@Override
public int getMetadata(int damage) { public int getMetadata(int damage) {
return damage; return damage;
} }
@Override
public String getUnlocalizedName(ItemStack stack) { public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName() + "." + EnumCableType.values()[stack.getItemDamage()].getName(); return super.getUnlocalizedName() + "." + EnumCableType.values()[stack.getItemDamage()].getName();
} }

View file

@ -55,6 +55,7 @@ public class ItemFrequencyTransmitter extends ItemTR {
setCreativeTab(TechRebornCreativeTabMisc.instance); setCreativeTab(TechRebornCreativeTabMisc.instance);
setMaxStackSize(1); setMaxStackSize(1);
this.addPropertyOverride(new ResourceLocation("techreborn:coords"), new IItemPropertyGetter() { this.addPropertyOverride(new ResourceLocation("techreborn:coords"), new IItemPropertyGetter() {
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public float apply(ItemStack stack, public float apply(ItemStack stack,
@Nullable @Nullable

View file

@ -182,21 +182,25 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo, IEne
} }
@Override
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {
return true; return true;
} }
@Override
public int getRGBDurabilityForDisplay(ItemStack stack) { public int getRGBDurabilityForDisplay(ItemStack stack) {
return PowerSystem.getDisplayPower().colour; return PowerSystem.getDisplayPower().colour;
} }
@Override
@Nullable @Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable @Nullable

View file

@ -204,21 +204,25 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo, IE
} }
@Override
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {
return true; return true;
} }
@Override
public int getRGBDurabilityForDisplay(ItemStack stack) { public int getRGBDurabilityForDisplay(ItemStack stack) {
return PowerSystem.getDisplayPower().colour; return PowerSystem.getDisplayPower().colour;
} }
@Override
@Nullable @Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable @Nullable

View file

@ -57,6 +57,7 @@ public class ItemBattery extends ItemTR implements IEnergyItemInfo, IEnergyInter
this.maxEnergy = maxEnergy; this.maxEnergy = maxEnergy;
this.maxTransfer = maxTransfer; this.maxTransfer = maxTransfer;
this.addPropertyOverride(new ResourceLocation("techreborn:empty"), new IItemPropertyGetter() { this.addPropertyOverride(new ResourceLocation("techreborn:empty"), new IItemPropertyGetter() {
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.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() && PoweredItem.getEnergy(stack) == 0.0) { if (!stack.isEmpty() && PoweredItem.getEnergy(stack) == 0.0) {
@ -164,21 +165,25 @@ public class ItemBattery extends ItemTR implements IEnergyItemInfo, IEnergyInter
} }
@Override
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {
return true; return true;
} }
@Override
public int getRGBDurabilityForDisplay(ItemStack stack) { public int getRGBDurabilityForDisplay(ItemStack stack) {
return PowerSystem.getDisplayPower().colour; return PowerSystem.getDisplayPower().colour;
} }
@Override
@Nullable @Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable @Nullable

View file

@ -68,6 +68,7 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, IEnergyInt
this.unpoweredSpeed = unpoweredSpeed; this.unpoweredSpeed = unpoweredSpeed;
this.addPropertyOverride(new ResourceLocation("techreborn:animated"), new IItemPropertyGetter() { this.addPropertyOverride(new ResourceLocation("techreborn:animated"), new IItemPropertyGetter() {
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public float apply(ItemStack stack, public float apply(ItemStack stack,
@Nullable @Nullable
@ -205,21 +206,25 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, IEnergyInt
} }
@Override
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {
return true; return true;
} }
@Override
public int getRGBDurabilityForDisplay(ItemStack stack) { public int getRGBDurabilityForDisplay(ItemStack stack) {
return PowerSystem.getDisplayPower().colour; return PowerSystem.getDisplayPower().colour;
} }
@Override
@Nullable @Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable @Nullable

View file

@ -209,21 +209,25 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo,
} }
@Override
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {
return true; return true;
} }
@Override
public int getRGBDurabilityForDisplay(ItemStack stack) { public int getRGBDurabilityForDisplay(ItemStack stack) {
return PowerSystem.getDisplayPower().colour; return PowerSystem.getDisplayPower().colour;
} }
@Override
@Nullable @Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable @Nullable

View file

@ -193,21 +193,25 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, IEnergyIn
} }
@Override
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {
return true; return true;
} }
@Override
public int getRGBDurabilityForDisplay(ItemStack stack) { public int getRGBDurabilityForDisplay(ItemStack stack) {
return PowerSystem.getDisplayPower().colour; return PowerSystem.getDisplayPower().colour;
} }
@Override
@Nullable @Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable @Nullable

View file

@ -190,21 +190,25 @@ public class ItemElectricTreetap extends ItemTR implements IEnergyItemInfo, IEne
} }
@Override
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {
return true; return true;
} }
@Override
public int getRGBDurabilityForDisplay(ItemStack stack) { public int getRGBDurabilityForDisplay(ItemStack stack) {
return PowerSystem.getDisplayPower().colour; return PowerSystem.getDisplayPower().colour;
} }
@Override
@Nullable @Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable @Nullable

View file

@ -213,21 +213,25 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, IEne
} }
@Override
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {
return true; return true;
} }
@Override
public int getRGBDurabilityForDisplay(ItemStack stack) { public int getRGBDurabilityForDisplay(ItemStack stack) {
return PowerSystem.getDisplayPower().colour; return PowerSystem.getDisplayPower().colour;
} }
@Override
@Nullable @Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable @Nullable

View file

@ -69,6 +69,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy
setMaxStackSize(1); setMaxStackSize(1);
setUnlocalizedName("techreborn.nanosaber"); setUnlocalizedName("techreborn.nanosaber");
this.addPropertyOverride(new ResourceLocation("techreborn:active"), new IItemPropertyGetter() { this.addPropertyOverride(new ResourceLocation("techreborn:active"), new IItemPropertyGetter() {
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public float apply(ItemStack stack, public float apply(ItemStack stack,
@Nullable @Nullable
@ -299,21 +300,25 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy
} }
@Override
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {
return true; return true;
} }
@Override
public int getRGBDurabilityForDisplay(ItemStack stack) { public int getRGBDurabilityForDisplay(ItemStack stack) {
return PowerSystem.getDisplayPower().colour; return PowerSystem.getDisplayPower().colour;
} }
@Override
@Nullable @Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable @Nullable

View file

@ -237,21 +237,25 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo, IEnerg
} }
@Override
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {
return true; return true;
} }
@Override
public int getRGBDurabilityForDisplay(ItemStack stack) { public int getRGBDurabilityForDisplay(ItemStack stack) {
return PowerSystem.getDisplayPower().colour; return PowerSystem.getDisplayPower().colour;
} }
@Override
@Nullable @Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable @Nullable

View file

@ -228,21 +228,25 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, IEne
} }
@Override
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {
return true; return true;
} }
@Override
public int getRGBDurabilityForDisplay(ItemStack stack) { public int getRGBDurabilityForDisplay(ItemStack stack) {
return PowerSystem.getDisplayPower().colour; return PowerSystem.getDisplayPower().colour;
} }
@Override
@Nullable @Nullable
public ICapabilityProvider initCapabilities(ItemStack stack, public ICapabilityProvider initCapabilities(ItemStack stack,
@Nullable @Nullable

View file

@ -38,6 +38,7 @@ public class ItemTRHoe extends ItemHoe {
TRRecipeHandler.hideEntry(this); TRRecipeHandler.hideEntry(this);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean isFull3D() { public boolean isFull3D() {
return true; return true;

View file

@ -68,6 +68,7 @@ public class ItemWrench extends ItemTR implements IToolHandler {
return EnumActionResult.PASS; return EnumActionResult.PASS;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean isFull3D() { public boolean isFull3D() {
return true; return true;

View file

@ -27,16 +27,11 @@ package techreborn.proxies;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.DefaultStateMapper;
import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.client.renderer.block.statemap.StateMap;
import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
@ -67,26 +62,6 @@ public class ClientProxy extends CommonProxy {
public static MultiblockRenderEvent multiblockRenderEvent; public static MultiblockRenderEvent multiblockRenderEvent;
public static ResourceLocation getItemLocation(Item item) {
Object o = item.getRegistryName();
if (o == null) {
return null;
}
return (ResourceLocation) o;
}
private static ResourceLocation registerIt(Item item, final ResourceLocation location) {
ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation(location, "inventory");
}
});
ModelLoader.registerItemVariants(item, location);
return location;
}
@Override @Override
public void preInit(FMLPreInitializationEvent event) { public void preInit(FMLPreInitializationEvent event) {
super.preInit(event); super.preInit(event);
@ -98,12 +73,6 @@ public class ClientProxy extends CommonProxy {
MinecraftForge.EVENT_BUS.register(new IconSupplier()); MinecraftForge.EVENT_BUS.register(new IconSupplier());
} }
@Override
public void registerSubItemInventoryLocation(Item item, int meta, String location, String name) {
ModelResourceLocation resourceLocation = new ModelResourceLocation(location, name);
ModelLoader.setCustomModelResourceLocation(item, meta, resourceLocation);
}
@Override @Override
public void init(FMLInitializationEvent event) { public void init(FMLInitializationEvent event) {
super.init(event); super.init(event);
@ -117,23 +86,6 @@ public class ClientProxy extends CommonProxy {
ModelLoader.setCustomStateMapper(ModBlocks.RUBBER_LEAVES, rubberLeavesStateMap); ModelLoader.setCustomStateMapper(ModBlocks.RUBBER_LEAVES, rubberLeavesStateMap);
} }
protected void registerItemModel(ItemStack item, String name) {
// tell Minecraft which textures it has to load. This is resource-domain sensitive
ModelLoader.registerItemVariants(item.getItem(), new ResourceLocation(name));
// tell the game which model to use for this item-meta combination
ModelLoader.setCustomModelResourceLocation(item.getItem(), item
.getMetadata(), new ModelResourceLocation(name, "inventory"));
}
public ResourceLocation registerItemModel(Item item) {
ResourceLocation itemLocation = getItemLocation(item);
if (itemLocation == null) {
return null;
}
return registerIt(item, itemLocation);
}
@Override @Override
public void registerFluidBlockRendering(Block block, String name) { public void registerFluidBlockRendering(Block block, String name) {
name = name.toLowerCase(); name = name.toLowerCase();
@ -149,42 +101,6 @@ public class ClientProxy extends CommonProxy {
}); });
} }
@Override
public void registerCustomBlockStateLocation(Block block, String resourceLocation) {
resourceLocation = resourceLocation.toLowerCase();
super.registerCustomBlockStateLocation(block, resourceLocation);
String finalResourceLocation = resourceLocation;
ModelLoader.setCustomStateMapper(block, new DefaultStateMapper() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
String resourceDomain = Block.REGISTRY.getNameForObject(state.getBlock()).getResourceDomain();
String propertyString = getPropertyString(state.getProperties());
return new ModelResourceLocation(resourceDomain + ':' + finalResourceLocation, propertyString);
}
});
String resourceDomain = Block.REGISTRY.getNameForObject(block).getResourceDomain();
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(resourceDomain + ':' + resourceLocation, "inventory"));
}
@Override
public void registerCustomBlockStateLocation(Block block, String resourceLocation, boolean item) {
resourceLocation = resourceLocation.toLowerCase();
super.registerCustomBlockStateLocation(block, resourceLocation, item);
String finalResourceLocation = resourceLocation;
ModelLoader.setCustomStateMapper(block, new DefaultStateMapper() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
String resourceDomain = Block.REGISTRY.getNameForObject(state.getBlock()).getResourceDomain();
String propertyString = getPropertyString(state.getProperties());
return new ModelResourceLocation(resourceDomain + ':' + finalResourceLocation, propertyString);
}
});
if (item) {
String resourceDomain = Block.REGISTRY.getNameForObject(block).getResourceDomain();
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(resourceDomain + ':' + resourceLocation, "inventory"));
}
}
@Override @Override
public boolean isCTMAvailable() { public boolean isCTMAvailable() {
return isChiselAround; return isChiselAround;

View file

@ -25,7 +25,6 @@
package techreborn.proxies; package techreborn.proxies;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
@ -62,22 +61,6 @@ public class CommonProxy implements ICompatModule {
} }
public void registerCustomBlockStateLocation(Block block, String name) {
}
public void registerCustomBlockStateLocation(Block block, String name, boolean item) {
}
public void registerSubItemInventoryLocation(Item item, int meta, String location, String name) {
}
public void registerSubBlockInventoryLocation(Block block, int meta, String location, String name) {
registerSubItemInventoryLocation(Item.getItemFromBlock(block), meta, location, name);
}
public boolean isCTMAvailable() { public boolean isCTMAvailable() {
return false; return false;
} }

View file

@ -72,6 +72,7 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase
/** /**
* Returns the number of ticks that the supplied fuel item will keep the * Returns the number of ticks that the supplied fuel item will keep the
* furnace burning, or 0 if the item isn't fuel * furnace burning, or 0 if the item isn't fuel
* @return Integer Number of ticks
*/ */
public static int getItemBurnTime(ItemStack stack) { public static int getItemBurnTime(ItemStack stack) {
if (stack.isEmpty()) { if (stack.isEmpty()) {
@ -273,6 +274,7 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase
/** /**
* Furnace isBurning * Furnace isBurning
* @return Boolean True if furnace is burning
*/ */
public boolean isBurning() { public boolean isBurning() {
return this.burnTime > 0; return this.burnTime > 0;

View file

@ -76,6 +76,7 @@ public class TileMachineCasing extends RectangularMultiblockTileEntityBase {
} }
@Override
public MultiBlockCasing getMultiblockController() { public MultiBlockCasing getMultiblockController() {
return (MultiBlockCasing) super.getMultiblockController(); return (MultiBlockCasing) super.getMultiblockController();
} }

View file

@ -143,6 +143,7 @@ public class TilePump extends TilePowerAcceptor {
readFromNBTWithoutCoords(tagCompound); readFromNBTWithoutCoords(tagCompound);
} }
@Override
public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) { public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) {
tank.readFromNBT(tagCompound); tank.readFromNBT(tagCompound);
} }
@ -154,6 +155,7 @@ public class TilePump extends TilePowerAcceptor {
return tagCompound; return tagCompound;
} }
@Override
public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) { public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) {
tank.writeToNBT(tagCompound); tank.writeToNBT(tagCompound);
return tagCompound; return tagCompound;

View file

@ -92,11 +92,13 @@ public class TileInterdimensionalSU extends TileEnergyStorage implements IContai
return input <= IDSUManager.getData(world).getStoredPower(); return input <= IDSUManager.getData(world).getStoredPower();
} }
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) { public void readFromNBT(NBTTagCompound nbttagcompound) {
super.readFromNBT(nbttagcompound); super.readFromNBT(nbttagcompound);
this.ownerUdid = nbttagcompound.getString("ownerUdid"); this.ownerUdid = nbttagcompound.getString("ownerUdid");
} }
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
super.writeToNBT(nbttagcompound); super.writeToNBT(nbttagcompound);
if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) { if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {

View file

@ -0,0 +1,6 @@
{
"parent": "techreborn:item/techrebornItem",
"textures": {
"layer0": "techreborn:items/misc/missing_recipe"
}
}