Removed unused code, added Override annotation
This commit is contained in:
parent
14f715ff7b
commit
bf5b649fc4
39 changed files with 94 additions and 102 deletions
|
@ -70,6 +70,7 @@ public class BlockFlare extends BlockContainer {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return (state.getValue(COLOR)).getMetadata();
|
||||
}
|
||||
|
@ -81,14 +82,17 @@ public class BlockFlare extends BlockContainer {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return (state.getValue(COLOR)).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, COLOR);
|
||||
}
|
||||
|
@ -98,6 +102,7 @@ public class BlockFlare extends BlockContainer {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
|
|
|
@ -111,6 +111,7 @@ public class BlockMachineFrames extends BaseBlock {
|
|||
return typesList.indexOf(state.getValue(TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, TYPE);
|
||||
}
|
||||
|
|
|
@ -113,6 +113,7 @@ public class BlockOre extends Block implements IOreNameProvider {
|
|||
return getStateFromMeta(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
String variant = state.getValue(VARIANTS);
|
||||
|
@ -230,6 +231,7 @@ public class BlockOre extends Block implements IOreNameProvider {
|
|||
return oreNamesList.indexOf(state.getValue(VARIANTS));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, VARIANTS);
|
||||
}
|
||||
|
|
|
@ -151,6 +151,7 @@ public class BlockOre2 extends Block implements IOreNameProvider {
|
|||
return oreNamesList.indexOf(state.getValue(VARIANTS));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
VARIANTS = new PropertyString("type", oreNamesList);
|
||||
return new BlockStateContainer(this, VARIANTS);
|
||||
|
|
|
@ -163,6 +163,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
TYPE = new PropertyString("type", types);
|
||||
return new BlockStateContainer(this, TYPE);
|
||||
|
|
|
@ -49,6 +49,7 @@ public class BlockReinforcedGlass extends BlockGlass {
|
|||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random random) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -58,6 +59,7 @@ public class BlockReinforcedGlass extends BlockGlass {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
|
|
|
@ -77,6 +77,7 @@ public class BlockRubberLog extends Block {
|
|||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, SAP_SIDE, HAS_SAP);
|
||||
}
|
||||
|
@ -127,6 +128,7 @@ public class BlockRubberLog extends Block {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
|
||||
int i = 4;
|
||||
int j = i + 1;
|
||||
|
|
|
@ -109,6 +109,7 @@ public class BlockStorage extends BaseBlock {
|
|||
return typesList.indexOf(state.getValue(TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, TYPE);
|
||||
}
|
||||
|
|
|
@ -133,6 +133,7 @@ public class BlockStorage2 extends BaseBlock {
|
|||
return 30F;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, TYPE);
|
||||
}
|
||||
|
|
|
@ -193,6 +193,7 @@ public class BlockCable extends BlockContainer {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
||||
state = state.getActualState(source, pos);
|
||||
float minX = state.getValue(WEST) ? 0.0F : 0.3125F;
|
||||
|
|
|
@ -78,6 +78,7 @@ public class BlockLamp extends BaseTileBlock {
|
|||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/lighting"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
FACING = PropertyDirection.create("facing");
|
||||
ACTIVE = PropertyBool.create("active");
|
||||
|
|
|
@ -113,6 +113,7 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
|
|||
return super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
FACING = PropertyDirection.create("facing", Facings.ALL);
|
||||
return new BlockStateContainer(this, FACING);
|
||||
|
@ -220,10 +221,12 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
|
|||
return aenumfacing[rand.nextInt(aenumfacing.length)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(EnumFacing p_apply_1_) {
|
||||
return p_apply_1_ != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<EnumFacing> iterator() {
|
||||
return Iterators.forArray(this.facings());
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ public abstract class BlockTransformer extends BaseTileBlock {
|
|||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
FACING = PropertyDirection.create("facing", Facings.ALL);
|
||||
return new BlockStateContainer(this, FACING);
|
||||
|
@ -267,10 +268,12 @@ public abstract class BlockTransformer extends BaseTileBlock {
|
|||
return aenumfacing[rand.nextInt(aenumfacing.length)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(EnumFacing p_apply_1_) {
|
||||
return p_apply_1_ != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<EnumFacing> iterator() {
|
||||
return Iterators.forArray(this.facings());
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ public class RegisterItemJsons {
|
|||
register(ModItems.MANUAL, "misc/manual");
|
||||
register(ModItems.DEBUG, "misc/debug");
|
||||
register(ModBlocks.RUBBER_SAPLING, "misc/rubber_sapling");
|
||||
register(ModItems.MISSING_RECIPE_PLACEHOLDER, "misc/missing_recipe");
|
||||
|
||||
register(ModItems.STEEL_DRILL, "tool/steel_drill");
|
||||
register(ModItems.DIAMOND_DRILL, "tool/diamond_drill");
|
||||
|
|
|
@ -353,6 +353,7 @@ public class TRBuilder extends GuiBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawSlot(GuiScreen gui, int posX, int posY) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET);
|
||||
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) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET);
|
||||
gui.drawTexturedModalRect(posX, posY, 150, 18, 26, 26);
|
||||
|
|
|
@ -232,6 +232,7 @@ public class GuiAutoCrafting extends GuiBase {
|
|||
this.recipeSlector.slotClicked(slotIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed() {
|
||||
this.recipeSlector.removed();
|
||||
super.onGuiClosed();
|
||||
|
|
|
@ -329,7 +329,7 @@ public class ModItems {
|
|||
registerItem(CLOAKING_DEVICE, "cloakingdevice");
|
||||
|
||||
MISSING_RECIPE_PLACEHOLDER = new ItemMissingRecipe().setUnlocalizedName("missingRecipe");
|
||||
registerItem(MISSING_RECIPE_PLACEHOLDER, "mssingRecipe");
|
||||
registerItem(MISSING_RECIPE_PLACEHOLDER, "missingRecipe");
|
||||
|
||||
DEBUG = new ItemDebugTool();
|
||||
registerItem(DEBUG, "debug");
|
||||
|
|
|
@ -39,10 +39,12 @@ public class ItemBlockCable extends ItemBlock {
|
|||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return super.getUnlocalizedName() + "." + EnumCableType.values()[stack.getItemDamage()].getName();
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ public class ItemFrequencyTransmitter extends ItemTR {
|
|||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setMaxStackSize(1);
|
||||
this.addPropertyOverride(new ResourceLocation("techreborn:coords"), new IItemPropertyGetter() {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -182,21 +182,25 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo, IEne
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -204,21 +204,25 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo, IE
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -57,6 +57,7 @@ public class ItemBattery extends ItemTR implements IEnergyItemInfo, IEnergyInter
|
|||
this.maxEnergy = maxEnergy;
|
||||
this.maxTransfer = maxTransfer;
|
||||
this.addPropertyOverride(new ResourceLocation("techreborn:empty"), new IItemPropertyGetter() {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
|
||||
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) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -68,6 +68,7 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, IEnergyInt
|
|||
this.unpoweredSpeed = unpoweredSpeed;
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation("techreborn:animated"), new IItemPropertyGetter() {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack stack,
|
||||
@Nullable
|
||||
|
@ -205,21 +206,25 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, IEnergyInt
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -209,21 +209,25 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo,
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -193,21 +193,25 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, IEnergyIn
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -190,21 +190,25 @@ public class ItemElectricTreetap extends ItemTR implements IEnergyItemInfo, IEne
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -213,21 +213,25 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, IEne
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -69,6 +69,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy
|
|||
setMaxStackSize(1);
|
||||
setUnlocalizedName("techreborn.nanosaber");
|
||||
this.addPropertyOverride(new ResourceLocation("techreborn:active"), new IItemPropertyGetter() {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack stack,
|
||||
@Nullable
|
||||
|
@ -299,21 +300,25 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -237,21 +237,25 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo, IEnerg
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -228,21 +228,25 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, IEne
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -38,6 +38,7 @@ public class ItemTRHoe extends ItemHoe {
|
|||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
|
|
|
@ -68,6 +68,7 @@ public class ItemWrench extends ItemTR implements IToolHandler {
|
|||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
|
|
|
@ -27,16 +27,11 @@ package techreborn.proxies;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
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.statemap.DefaultStateMapper;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMap;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
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.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
@ -67,26 +62,6 @@ public class ClientProxy extends CommonProxy {
|
|||
|
||||
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
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
super.preInit(event);
|
||||
|
@ -98,12 +73,6 @@ public class ClientProxy extends CommonProxy {
|
|||
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
|
||||
public void init(FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
|
@ -117,23 +86,6 @@ public class ClientProxy extends CommonProxy {
|
|||
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
|
||||
public void registerFluidBlockRendering(Block block, String name) {
|
||||
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
|
||||
public boolean isCTMAvailable() {
|
||||
return isChiselAround;
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
package techreborn.proxies;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
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() {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase
|
|||
/**
|
||||
* Returns the number of ticks that the supplied fuel item will keep the
|
||||
* furnace burning, or 0 if the item isn't fuel
|
||||
* @return Integer Number of ticks
|
||||
*/
|
||||
public static int getItemBurnTime(ItemStack stack) {
|
||||
if (stack.isEmpty()) {
|
||||
|
@ -273,6 +274,7 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase
|
|||
|
||||
/**
|
||||
* Furnace isBurning
|
||||
* @return Boolean True if furnace is burning
|
||||
*/
|
||||
public boolean isBurning() {
|
||||
return this.burnTime > 0;
|
||||
|
|
|
@ -76,6 +76,7 @@ public class TileMachineCasing extends RectangularMultiblockTileEntityBase {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiBlockCasing getMultiblockController() {
|
||||
return (MultiBlockCasing) super.getMultiblockController();
|
||||
}
|
||||
|
|
|
@ -143,6 +143,7 @@ public class TilePump extends TilePowerAcceptor {
|
|||
readFromNBTWithoutCoords(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) {
|
||||
tank.readFromNBT(tagCompound);
|
||||
}
|
||||
|
@ -154,6 +155,7 @@ public class TilePump extends TilePowerAcceptor {
|
|||
return tagCompound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) {
|
||||
tank.writeToNBT(tagCompound);
|
||||
return tagCompound;
|
||||
|
|
|
@ -92,11 +92,13 @@ public class TileInterdimensionalSU extends TileEnergyStorage implements IContai
|
|||
return input <= IDSUManager.getData(world).getStoredPower();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.ownerUdid = nbttagcompound.getString("ownerUdid");
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/misc/missing_recipe"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue