Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
part 1 of converting to using MultiItemBlock where appropriate
- Loading branch information
Showing
9 changed files
with
40 additions
and
118 deletions.
There are no files selected for viewing
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,6 +1,6 @@ | ||
minecraft_version=1.6.4 | ||
forge_version=9.11.1.964 | ||
mantle_version=40158a | ||
mantle_version=a2891a | ||
FMP_version=1.0.0.211 | ||
CCLIB_version=1.0.0.44 | ||
NEI_version=1.6.1.8 |
25 changes: 4 additions & 21 deletions
25
src/main/java/tconstruct/items/blocks/CastingChannelItem.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,33 +1,16 @@ | ||
package tconstruct.items.blocks; | ||
|
||
import java.util.List; | ||
import mantle.blocks.abstracts.MultiItemBlock; | ||
|
||
import cpw.mods.fml.relauncher.Side; | ||
import cpw.mods.fml.relauncher.SideOnly; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemBlock; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.MathHelper; | ||
|
||
public class CastingChannelItem extends ItemBlock | ||
public class CastingChannelItem extends MultiItemBlock | ||
{ | ||
public static final String blockType[] = { "Channel" }; | ||
public static final String blockTypes[] = { "Channel" }; | ||
|
||
public CastingChannelItem(int id) | ||
{ | ||
super(id); | ||
super(id, "Smeltery", blockTypes); | ||
setMaxDamage(0); | ||
setHasSubtypes(true); | ||
} | ||
|
||
public int getMetadata (int meta) | ||
{ | ||
return meta; | ||
} | ||
|
||
public String getUnlocalizedName (ItemStack itemstack) | ||
{ | ||
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); | ||
return (new StringBuilder()).append("Smeltery.").append(blockType[pos]).toString(); | ||
} | ||
} |
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
19 changes: 7 additions & 12 deletions
19
src/main/java/tconstruct/items/blocks/CraftingSlabItemBlock.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,33 +1,28 @@ | ||
package tconstruct.items.blocks; | ||
|
||
import net.minecraft.item.ItemBlock; | ||
import mantle.blocks.abstracts.MultiItemBlock; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.MathHelper; | ||
|
||
public class CraftingSlabItemBlock extends ItemBlock | ||
public class CraftingSlabItemBlock extends MultiItemBlock | ||
{ | ||
public static final String blockType[] = { "tile.CraftingStation", "Crafter", "Parts", "PatternShaper", "PatternChest", "tile.ToolForge" }; | ||
public static final String blockTypes[] = { "tile.CraftingStation", "Crafter", "Parts", "PatternShaper", "PatternChest", "tile.ToolForge" }; | ||
|
||
public CraftingSlabItemBlock(int id) | ||
{ | ||
super(id); | ||
super(id, "ToolStation", blockTypes); | ||
setMaxDamage(0); | ||
setHasSubtypes(true); | ||
} | ||
|
||
public int getMetadata (int meta) | ||
{ | ||
return meta; | ||
} | ||
|
||
@Override | ||
public String getUnlocalizedName (ItemStack itemstack) | ||
{ | ||
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); | ||
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, this.blockType.length - 1); | ||
if (pos == 0 || pos == 5) | ||
{ | ||
return blockType[pos]; | ||
return this.blockType[pos]; | ||
} | ||
return (new StringBuilder()).append("ToolStation.").append(blockType[pos]).toString(); | ||
return super.getUnlocalizedName(itemstack); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,16 @@ | ||
package tconstruct.items.blocks; | ||
|
||
import net.minecraft.item.ItemBlock; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.MathHelper; | ||
import mantle.blocks.abstracts.MultiItemBlock; | ||
|
||
public class GlassPaneItem extends ItemBlock | ||
public class GlassPaneItem extends MultiItemBlock | ||
{ | ||
public static final String blockType[] = { "glass.pure", "glass.soul", "glass.soul.pure" }; | ||
public static final String blockTypes[] = { "pure.pane", "soul.pane", "soul.pure.pane" }; | ||
|
||
public GlassPaneItem(int id) | ||
{ | ||
super(id); | ||
super(id, "block.glass", blockTypes); | ||
setMaxDamage(0); | ||
setHasSubtypes(true); | ||
} | ||
|
||
public int getMetadata (int meta) | ||
{ | ||
return meta; | ||
} | ||
|
||
public String getUnlocalizedName (ItemStack itemstack) | ||
{ | ||
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); | ||
return (new StringBuilder()).append("block.").append(blockType[pos]).append(".pane").toString(); | ||
} | ||
} |
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,28 +1,19 @@ | ||
package tconstruct.items.blocks; | ||
|
||
import mantle.blocks.abstracts.MultiItemBlock; | ||
import net.minecraft.item.ItemBlock; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.MathHelper; | ||
|
||
public class GravelOreItem extends ItemBlock | ||
public class GravelOreItem extends MultiItemBlock | ||
{ | ||
public static final String blockType[] = { "iron", "gold", "copper", "tin", "aluminum", "cobalt" }; | ||
public static final String blockTypes[] = { "iron", "gold", "copper", "tin", "aluminum", "cobalt" }; | ||
|
||
public GravelOreItem(int id) | ||
{ | ||
super(id); | ||
super(id, "block.ore.gravel", blockTypes); | ||
setMaxDamage(0); | ||
setHasSubtypes(true); | ||
} | ||
|
||
public int getMetadata (int meta) | ||
{ | ||
return meta; | ||
} | ||
|
||
public String getUnlocalizedName (ItemStack itemstack) | ||
{ | ||
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); | ||
return (new StringBuilder()).append("block.ore.gravel.").append(blockType[pos]).toString(); | ||
} | ||
} |
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