This repository has been archived by the owner on Mar 10, 2021. It is now read-only.
forked from iguanaman/IguanaTweaksTConstruct
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
129 additions
and
11 deletions.
There are no files selected for viewing
Binary file added
BIN
+363 Bytes
resources/assets/iguanatweakstconstruct/textures/items/bucket_helmet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+619 Bytes
resources/assets/iguanatweakstconstruct/textures/items/enderman_jaw.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/main/java/iguanaman/iguanatweakstconstruct/claybuckets/items/WearableBucket.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package iguanaman.iguanatweakstconstruct.claybuckets.items; | ||
|
||
import cpw.mods.fml.relauncher.Side; | ||
import cpw.mods.fml.relauncher.SideOnly; | ||
import iguanaman.iguanatweakstconstruct.claybuckets.IguanaItems; | ||
import iguanaman.iguanatweakstconstruct.reference.Reference; | ||
import net.minecraft.client.renderer.texture.IIconRegister; | ||
import net.minecraft.creativetab.CreativeTabs; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.IIcon; | ||
|
||
import java.util.List; | ||
|
||
public class WearableBucket extends Item { | ||
private static final String[] textureTypes = new String[] {"bucket_helmet", "enderman_jaw"}; | ||
private IIcon[] icons; | ||
|
||
public WearableBucket() { | ||
super(); | ||
this.setContainerItem(IguanaItems.wearableBuckets); | ||
this.setUnlocalizedName(Reference.MOD_ID + ".wearable_bucket"); | ||
|
||
this.setMaxStackSize(1); | ||
} | ||
|
||
@Override | ||
public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) { | ||
return armorType == 0; // 0 = helmet | ||
} | ||
|
||
@Override | ||
public String getUnlocalizedName(ItemStack par1ItemStack) | ||
{ | ||
int i = par1ItemStack.getItemDamage(); | ||
|
||
if (i < 0 || i >= textureTypes.length) | ||
i = 0; | ||
|
||
return Reference.resource(textureTypes[i]); | ||
} | ||
|
||
@Override | ||
@SideOnly(Side.CLIENT) | ||
@SuppressWarnings({ "unchecked", "rawtypes" }) | ||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) | ||
{ | ||
for (int j = 0; j < textureTypes.length; ++j) | ||
par3List.add(new ItemStack(par1, 1, j)); | ||
} | ||
|
||
@Override | ||
@SideOnly(Side.CLIENT) | ||
public void registerIcons(IIconRegister par1IconRegister) | ||
{ | ||
icons = new IIcon[textureTypes.length]; | ||
|
||
for (int i = 0; i < textureTypes.length; ++i) | ||
icons[i] = par1IconRegister.registerIcon(Reference.resource(textureTypes[i])); | ||
} | ||
|
||
@Override | ||
@SideOnly(Side.CLIENT) | ||
public IIcon getIconFromDamage(int par1) | ||
{ | ||
if (par1 < 0 || par1 >= textureTypes.length) | ||
par1 = 0; | ||
|
||
return icons[par1]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/iguanaman/iguanatweakstconstruct/mobheads/proxy/MobHeadClientProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
package iguanaman.iguanatweakstconstruct.mobheads.proxy; | ||
|
||
import cpw.mods.fml.client.registry.ClientRegistry; | ||
import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct; | ||
import iguanaman.iguanatweakstconstruct.claybuckets.IguanaItems; | ||
import iguanaman.iguanatweakstconstruct.mobheads.renderers.IguanaTileEntitySkullRenderer; | ||
import iguanaman.iguanatweakstconstruct.mobheads.tileentities.IguanaSkullTileEntity; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public class MobHeadClientProxy extends MobHeadCommonProxy { | ||
@Override | ||
public void initialize() { | ||
ClientRegistry.bindTileEntitySpecialRenderer(IguanaSkullTileEntity.class, IguanaTileEntitySkullRenderer.renderer); | ||
} | ||
|
||
public void postInit() { | ||
// hide secret stuff ;) | ||
if(IguanaTweaksTConstruct.isItemsActive) | ||
{ | ||
codechicken.nei.api.API.hideItem(new ItemStack(IguanaItems.wearableBuckets, 1, 0)); | ||
codechicken.nei.api.API.hideItem(new ItemStack(IguanaItems.wearableBuckets, 1, 1)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,6 @@ | |
public class MobHeadCommonProxy { | ||
|
||
public void initialize() {} | ||
|
||
public void postInit() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters