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:
parent
0bbc088524
commit
a719a1c563
21 changed files with 163 additions and 63 deletions
15
src/main/java/techreborn/items/ItemTRNoDestroy.java
Normal file
15
src/main/java/techreborn/items/ItemTRNoDestroy.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue