mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-18 19:39:06 +00:00
Spotless
This commit is contained in:
156 files changed
+14896
-13422
No files matched your search
@@ -1,7 +1,9 @@
|
||||
package magicbees.item;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.item.types.CapsuleType;
|
||||
import magicbees.item.types.FluidType;
|
||||
import magicbees.main.CommonProxy;
|
||||
@@ -11,91 +13,75 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemCapsule extends Item
|
||||
{
|
||||
private CapsuleType capsuleType;
|
||||
|
||||
public ItemCapsule(CapsuleType type, int maxStackSize)
|
||||
{
|
||||
super();
|
||||
this.capsuleType = type;
|
||||
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxStackSize(maxStackSize);
|
||||
this.setUnlocalizedName("capsule." + type.toString().toLowerCase());
|
||||
GameRegistry.registerItem(this, "capsule." + type.toString().toLowerCase());
|
||||
}
|
||||
|
||||
public CapsuleType getType()
|
||||
{
|
||||
return this.capsuleType;
|
||||
}
|
||||
public class ItemCapsule extends Item {
|
||||
private CapsuleType capsuleType;
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemStack)
|
||||
{
|
||||
return String.format(this.capsuleType.getLocalizedName(), FluidType.values()[itemStack.getItemDamage()].getDisplayName());
|
||||
}
|
||||
public ItemCapsule(CapsuleType type, int maxStackSize) {
|
||||
super();
|
||||
this.capsuleType = type;
|
||||
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxStackSize(maxStackSize);
|
||||
this.setUnlocalizedName("capsule." + type.toString().toLowerCase());
|
||||
GameRegistry.registerItem(this, "capsule." + type.toString().toLowerCase());
|
||||
}
|
||||
|
||||
public ItemStack getCapsuleForLiquid(FluidType l)
|
||||
{
|
||||
return new ItemStack(this, 1, l.ordinal());
|
||||
}
|
||||
public CapsuleType getType() {
|
||||
return this.capsuleType;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List itemList)
|
||||
{
|
||||
for (FluidType l : FluidType.values())
|
||||
{
|
||||
if (l.available)
|
||||
{
|
||||
itemList.add(new ItemStack(this, 1, l.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemStack) {
|
||||
return String.format(
|
||||
this.capsuleType.getLocalizedName(), FluidType.values()[itemStack.getItemDamage()].getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":capsule" + this.capsuleType.getName().substring(0, 1).toUpperCase()
|
||||
+ this.capsuleType.getName().substring(1));
|
||||
for (FluidType t : FluidType.values())
|
||||
{
|
||||
if (t != FluidType.EMPTY)
|
||||
{
|
||||
t.liquidIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":liquids/" + t.liquidID);
|
||||
}
|
||||
}
|
||||
}
|
||||
public ItemStack getCapsuleForLiquid(FluidType l) {
|
||||
return new ItemStack(this, 1, l.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(int metadata, int pass)
|
||||
{
|
||||
IIcon i = this.itemIcon;
|
||||
if (metadata != 0 && pass == 0)
|
||||
{
|
||||
i = FluidType.values()[metadata % FluidType.values().length].liquidIcon;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List itemList) {
|
||||
for (FluidType l : FluidType.values()) {
|
||||
if (l.available) {
|
||||
itemList.add(new ItemStack(this, 1, l.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderPasses(int metadata)
|
||||
{
|
||||
return (metadata == 0) ? 1 : 2;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":capsule"
|
||||
+ this.capsuleType.getName().substring(0, 1).toUpperCase()
|
||||
+ this.capsuleType.getName().substring(1));
|
||||
for (FluidType t : FluidType.values()) {
|
||||
if (t != FluidType.EMPTY) {
|
||||
t.liquidIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":liquids/" + t.liquidID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(int metadata, int pass) {
|
||||
IIcon i = this.itemIcon;
|
||||
if (metadata != 0 && pass == 0) {
|
||||
i = FluidType.values()[metadata % FluidType.values().length].liquidIcon;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderPasses(int metadata) {
|
||||
return (metadata == 0) ? 1 : 2;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user