Holy huge commit with unhelpful name batman!

-Added TRNoDestroy (for items that do not use JSONDestroyer)
-Batteries now use item overrides to display different texture when empty
-Fixed diamond nugget unity texture
-Removed new fluid sources from JEI
-Fixed empty cell lang entry
This commit is contained in:
Prospector 2016-06-05 01:33:40 -07:00
parent 0bbc088524
commit a719a1c563
21 changed files with 163 additions and 63 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 650 B

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 B

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 785 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

View file

@ -1,9 +1,11 @@
package techreborn.client;
import net.minecraft.client.Minecraft;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
public class RegisterItemJsons
{
@ -15,12 +17,35 @@ public class RegisterItemJsons
private static void registerItems()
{
register(ModItems.reBattery, "reBattery");
register(ModItems.lithiumBattery, "lithiumBattery");
register(ModItems.energyCrystal, "energyCrystal");
register(ModItems.lapotronCrystal, "lapotronCrystal");
}
private static void registerBlocks()
{
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(
Item.getItemFromBlock(ModBlocks.ironFence), 0,
new ModelResourceLocation("techreborn:ironFence", "inventory"));
register(ModBlocks.ironFence, "ironFence");
}
private static void register(Item item, int meta, String name)
{
ModelLoader.setCustomModelResourceLocation(item, meta,
new ModelResourceLocation("techreborn:" + name, "inventory"));
}
private static void register(Item item, String name)
{
register(item, 0, name);
}
private static void register(Block block, int meta, String name)
{
register(Item.getItemFromBlock(block), meta, name);
}
private static void register(Block block, String name)
{
register(Item.getItemFromBlock(block), 0, name);
}
}

View file

@ -111,6 +111,15 @@ import java.util.List;
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSodiumpersulfate));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidTritium));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidWolframium));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSulfur));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSulfuricAcid));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidCarbon));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidCarbonFiber));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitroCarbon));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSodiumSulfide));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidDiesel));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitroDiesel));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidOil));
registry.addRecipeCategories(new AlloySmelterRecipeCategory(guiHelper),
new AssemblingMachineRecipeCategory(guiHelper), new BlastFurnaceRecipeCategory(guiHelper),

View file

@ -0,0 +1,15 @@
package techreborn.items;
import net.minecraft.item.Item;
import techreborn.client.TechRebornCreativeTab;
public class ItemTRNoDestroy extends Item
{
public ItemTRNoDestroy()
{
setNoRepair();
setCreativeTab(TechRebornCreativeTab.instance);
}
}

View file

@ -1,18 +1,22 @@
package techreborn.items.battery;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PoweredItem;
import techreborn.client.TechRebornCreativeTab;
import techreborn.items.ItemTextureBase;
import techreborn.items.ItemTRNoDestroy;
public class ItemBattery extends ItemTextureBase implements IEnergyItemInfo
import javax.annotation.Nullable;
import java.util.List;
public class ItemBattery extends ItemTRNoDestroy implements IEnergyItemInfo
{
String name = "null";
@ -30,7 +34,18 @@ public class ItemBattery extends ItemTextureBase implements IEnergyItemInfo
this.maxEnergy=maxEnergy;
this.maxTransfer=maxTransfer;
this.tier=tier;
setCreativeTab(TechRebornCreativeTab.instance);
this.addPropertyOverride(new ResourceLocation("techreborn:empty"), new IItemPropertyGetter()
{
@SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn,
@Nullable EntityLivingBase entityIn)
{
if (stack != null && PoweredItem.getEnergy(stack) == 0.0)
{
return 1.0F;
}
return 0.0F;
}
});
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@ -88,16 +103,4 @@ public class ItemBattery extends ItemTextureBase implements IEnergyItemInfo
{
return tier;
}
@Override
public String getTextureName(int damage)
{
return "techreborn:items/tool/"+name;
}
@Override
public int getMaxMeta()
{
return 1;
}
}

View file

@ -1,8 +1,10 @@
package techreborn.items.battery;
public class ItemReBattery extends ItemBattery {
public class ItemReBattery extends ItemBattery
{
public ItemReBattery() {
public ItemReBattery()
{
super("rebattery", 10000, 64, 1);
}
}

View file

@ -79,13 +79,13 @@ public class ClientProxy extends CommonProxy
}
});
ModelBakery.registerItemVariants(ModItems.dynamicCell, MODEL_DYNAMIC_CELL);
RegisterItemJsons.registerModels();
}
@Override
public void init(FMLInitializationEvent event)
{
super.init(event);
RegisterItemJsons.registerModels();
MinecraftForge.EVENT_BUS.register(new IconSupplier());
MinecraftForge.EVENT_BUS.register(new ChargeHud());
//MinecraftForge.EVENT_BUS.register(new VersionCheckerClient());

View file

@ -365,44 +365,7 @@ item.techreborn.dustsmall.andesite.name=Small Pile of Andesite Dust
item.techreborn.dustsmall.diorite.name=Small Pile of Diorite Dust
item.techreborn.dustsmall.granite.name=Small Pile of Granite Dust
#Cells
item.techreborn.cell.Berylium.name=Beryllium Cell
item.techreborn.cell.biomass.name=Biomass Cell
item.techreborn.cell.calciumCarbonate.name=Calcium Carbonate Cell
item.techreborn.cell.calcium.name=Calcium Cell
item.techreborn.cell.carbon.name=Carbon Cell
item.techreborn.cell.chlorine.name=Chlorine Cell
item.techreborn.cell.deuterium.name=Deuterium Cell
item.techreborn.cell.diesel.name=Diesel Cell
item.techreborn.cell.ethanol.name=Ethanol Cell
item.techreborn.cell.glyceryl.name=Glyceryl Cell
item.techreborn.cell.helium3.name=Helium3 Cell
item.techreborn.cell.helium.name=Helium Cell
item.techreborn.cell.heliumPlasma.name=Helium Plasma Cell
item.techreborn.cell.hydrogen.name=Hydrogen Cell
item.techreborn.cell.ice.name=Ice Cell
item.techreborn.cell.lithium.name=Lithium Cell
item.techreborn.cell.mercury.name=Mercury Cell
item.techreborn.cell.methane.name=Methane Cell
item.techreborn.cell.nitrocarbon.name=Nitrocarbon Cell
item.techreborn.cell.nitroCoalfuel.name=Nitro Coal Fuel Cell
item.techreborn.cell.nitroDiesel.name=Nitro Diesel Cell
item.techreborn.cell.nitrogen.name=Nitrogen Cell
item.techreborn.cell.nitrogenDioxide.name=Nitrogen Dioxide Cell
item.techreborn.cell.oil.name=Oil Cell
item.techreborn.cell.potassium.name=Potassium Cell
item.techreborn.cell.seedOil.name=Seed Oil Cell
item.techreborn.cell.silicon.name=Silicon Cell
item.techreborn.cell.sodium.name=Sodium Cell
item.techreborn.cell.sodiumPersulfate.name=Sodium Persulfate Cell
item.techreborn.cell.sodiumSulfide.name=Sodium Sulfide Cell
item.techreborn.cell.sulfur.name=Sulfur Cell
item.techreborn.cell.sulfuricAcid.name=Sulfuric Acid Cell
item.techreborn.cell.tritium.name=Tritium Cell
item.techreborn.cell.wolframium.name=Wolframium Cell
item.techreborn.cell.empty.name=Empty Cell
item.techreborn.cell.water.name=Water Cell
item.techreborn.cell.lava.name=Lava Cell
item.techreborn.cell.name=Empty Cell
item.techreborn.rebattery.name=Battery
item.techreborn.lithiumBattery.name=Lithium Battery
item.techreborn.energyCrystal.name=Energy Crystal

View file

@ -0,0 +1,14 @@
{
"parent": "techreborn:item/techrebornItem",
"textures": {
"layer0": "techreborn:items/tool/energyCrystal"
},
"overrides": [
{
"predicate": {
"techreborn:empty": 1
},
"model": "techreborn:item/energyCrystalEmpty"
}
]
}

View file

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

View file

@ -0,0 +1,14 @@
{
"parent": "techreborn:item/techrebornItem",
"textures": {
"layer0": "techreborn:items/tool/lapotronCrystal"
},
"overrides": [
{
"predicate": {
"techreborn:empty": 1
},
"model": "techreborn:item/lapotronCrystalEmpty"
}
]
}

View file

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

View file

@ -0,0 +1,14 @@
{
"parent": "techreborn:item/techrebornItem",
"textures": {
"layer0": "techreborn:items/tool/lithiumBattery"
},
"overrides": [
{
"predicate": {
"techreborn:empty": 1
},
"model": "techreborn:item/lithiumBatteryEmpty"
}
]
}

View file

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

View file

@ -0,0 +1,14 @@
{
"parent": "techreborn:item/techrebornItem",
"textures": {
"layer0": "techreborn:items/tool/reBattery"
},
"overrides": [
{
"predicate": {
"techreborn:empty": 1
},
"model": "techreborn:item/reBatteryEmpty"
}
]
}

View file

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

View file

@ -0,0 +1,3 @@
{
"parent": "item/generated"
}