ItemBlock now implements ITextureProvider so that blocks with custom textures will showup properly when being held.
This commit is contained in:
parent
f847e37119
commit
885484f75f
1 changed files with 30 additions and 0 deletions
|
@ -0,0 +1,30 @@
|
|||
--- ../src_base/minecraft/net/minecraft/src/ItemBlock.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/ItemBlock.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,6 +1,8 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
-public class ItemBlock extends Item
|
||||
+import net.minecraft.src.forge.ITextureProvider;
|
||||
+
|
||||
+public class ItemBlock extends Item implements ITextureProvider
|
||||
{
|
||||
/** The block ID of the Block associated with this ItemBlock */
|
||||
private int blockID;
|
||||
@@ -110,4 +112,17 @@
|
||||
{
|
||||
return Block.blocksList[this.blockID].getBlockName();
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public String getTextureFile()
|
||||
+ {
|
||||
+ if (Block.blocksList[blockID] instanceof ITextureProvider)
|
||||
+ {
|
||||
+ return ((ITextureProvider)Block.blocksList[blockID]).getTextureFile();
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return "/terrain.png";
|
||||
+ }
|
||||
+ }
|
||||
}
|
Loading…
Reference in a new issue