mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-19 12:09:12 +00:00
Clean up CarvableHelper to use defined constants
This commit is contained in:
1 parent
4cfcc874dc
commit
58270a4c96
3 files changed
+25
-24
No files matched your search
@@ -144,28 +144,28 @@ public class CarvableHelper {
|
||||
return GeneralClient.getMissingIcon();
|
||||
|
||||
switch (variation.kind) {
|
||||
case 0:
|
||||
case NORMAL:
|
||||
return variation.icon;
|
||||
case 1:
|
||||
case TOPSIDE:
|
||||
if (side == 0 || side == 1)
|
||||
return variation.iconTop;
|
||||
else
|
||||
return variation.icon;
|
||||
case 2:
|
||||
case TOPBOTSIDE:
|
||||
if (side == 1)
|
||||
return variation.iconTop;
|
||||
else if (side == 0)
|
||||
return variation.iconBot;
|
||||
else
|
||||
return variation.icon;
|
||||
case 3:
|
||||
case CTM3:
|
||||
return variation.ctm.seams[0].icons[0];
|
||||
case 4:
|
||||
case CTMV:
|
||||
if (side < 2)
|
||||
return variation.iconTop;
|
||||
else
|
||||
return variation.seamsCtmVert.icons[0];
|
||||
case 5:
|
||||
case CTMH:
|
||||
if (side < 2)
|
||||
return variation.iconTop;
|
||||
else
|
||||
@@ -192,18 +192,18 @@ public class CarvableHelper {
|
||||
return GeneralClient.getMissingIcon();
|
||||
|
||||
switch (variation.kind) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case NORMAL:
|
||||
case TOPSIDE:
|
||||
case TOPBOTSIDE:
|
||||
return getIcon(side, metadata);
|
||||
case 3:
|
||||
case CTM3:
|
||||
int tex = CTM.getTexture(world, x, y, z, side);
|
||||
|
||||
int row = tex / 16;
|
||||
int col = tex % 16;
|
||||
|
||||
return variation.ctm.seams[col / 4].icons[col % 4 + row * 4];
|
||||
case 4: {
|
||||
case CTMV: {
|
||||
if (side < 2)
|
||||
return variation.iconTop;
|
||||
|
||||
@@ -219,7 +219,7 @@ public class CarvableHelper {
|
||||
return variation.seamsCtmVert.icons[1];
|
||||
return variation.seamsCtmVert.icons[0];
|
||||
}
|
||||
case 5:
|
||||
case CTMH:
|
||||
if (side < 2)
|
||||
return variation.iconTop;
|
||||
|
||||
@@ -316,14 +316,14 @@ public class CarvableHelper {
|
||||
|
||||
} else {
|
||||
switch (variation.kind) {
|
||||
case 0:
|
||||
case NORMAL:
|
||||
variation.icon = variation.block.getIcon(2, variation.blockMeta);
|
||||
break;
|
||||
case 1:
|
||||
case TOPSIDE:
|
||||
variation.icon = variation.block.getIcon(2, variation.blockMeta);
|
||||
variation.iconTop = variation.block.getIcon(0, variation.blockMeta);
|
||||
break;
|
||||
case 2:
|
||||
case TOPBOTSIDE:
|
||||
variation.icon = variation.block.getIcon(2, variation.blockMeta);
|
||||
variation.iconTop = variation.block.getIcon(1, variation.blockMeta);
|
||||
variation.iconBot = variation.block.getIcon(0, variation.blockMeta);
|
||||
@@ -332,30 +332,30 @@ public class CarvableHelper {
|
||||
}
|
||||
} else {
|
||||
switch (variation.kind) {
|
||||
case 0:
|
||||
case NORMAL:
|
||||
variation.icon = register.registerIcon(modName + ":" + variation.texture);
|
||||
break;
|
||||
case 1:
|
||||
case TOPSIDE:
|
||||
variation.icon = register.registerIcon(modName + ":" + variation.texture + "-side");
|
||||
variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top");
|
||||
break;
|
||||
case 2:
|
||||
case TOPBOTSIDE:
|
||||
variation.icon = register.registerIcon(modName + ":" + variation.texture + "-side");
|
||||
variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top");
|
||||
variation.iconBot = register.registerIcon(modName + ":" + variation.texture + "-bottom");
|
||||
break;
|
||||
case 3:
|
||||
case CTM3:
|
||||
CarvableVariationCTM ctm = new CarvableVariationCTM();
|
||||
ctm.seams[0] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm1"), 4, 4);
|
||||
ctm.seams[1] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm2"), 4, 4);
|
||||
ctm.seams[2] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm3"), 4, 4);
|
||||
variation.ctm = ctm;
|
||||
break;
|
||||
case 4:
|
||||
case CTMV:
|
||||
variation.seamsCtmVert = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctmv"), 2, 2);
|
||||
variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top");
|
||||
break;
|
||||
case 5:
|
||||
case CTMH:
|
||||
variation.seamsCtmVert = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctmh"), 2, 2);
|
||||
variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top");
|
||||
break;
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
public class BaseItem extends Item {
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
|
||||
getWrappedDesc(list, itemStack);
|
||||
@@ -37,7 +38,7 @@ public class BaseItem extends Item {
|
||||
return new String[] { input };
|
||||
|
||||
char[] chars = input.toCharArray();
|
||||
Vector lines = new Vector();
|
||||
Vector<String> lines = new Vector<String>();
|
||||
StringBuffer line = new StringBuffer();
|
||||
StringBuffer word = new StringBuffer();
|
||||
|
||||
@@ -71,7 +72,7 @@ public class BaseItem extends Item {
|
||||
|
||||
String[] ret = new String[lines.size()];
|
||||
int c = 0; // counter
|
||||
for (Enumeration e = lines.elements(); e.hasMoreElements(); c++) {
|
||||
for (Enumeration<String> e = lines.elements(); e.hasMoreElements(); c++) {
|
||||
ret[c] = (String) e.nextElement();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ public class ItemCarvable extends ItemBlock {
|
||||
return Block.getBlockFromItem(this).getIcon(2, damage);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) {
|
||||
if (!Configurations.blockDescriptions)
|
||||
@@ -52,5 +53,4 @@ public class ItemCarvable extends ItemBlock {
|
||||
|
||||
lines.add(var.description);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user