Skip to content

Commit

Permalink
Remove 32x textures (#3276)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Robertz <[email protected]>
  • Loading branch information
BlueHero233 and Dream-Master authored Oct 1, 2024
1 parent 49ca0b8 commit cf7a834
Show file tree
Hide file tree
Showing 219 changed files with 223 additions and 383 deletions.
2 changes: 1 addition & 1 deletion src/main/java/gregtech/common/blocks/BlockCasings8.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,6 @@ public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, in
}
}

return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
return Textures.BlockIcons.MACHINE_CASING_ADVANCEDGAS.getIcon();
}
}
35 changes: 14 additions & 21 deletions src/main/java/gtPlusPlus/core/item/chemistry/IonParticles.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import gregtech.api.enums.Materials;
import gtPlusPlus.core.item.base.misc.BaseItemParticle;
import gtPlusPlus.core.material.MaterialsElements;
import gtPlusPlus.core.util.Utils;

public class IonParticles extends BaseItemParticle {
Expand All @@ -24,16 +23,17 @@ public class IonParticles extends BaseItemParticle {
public static HashMap<Integer, String> MetaToNameMap = new HashMap<>();

public IonParticles() {
super("Ion", MaterialsElements.NAMES.length, EnumRarity.rare);
super("Ion", ions.length, EnumRarity.rare);
}

public static IIcon[] overlays = new IIcon[MaterialsElements.NAMES.length];
public static IIcon baseTexture;
public static final String[] ions = new String[] { "Hydrogen", "Helium" };

public IIcon[] texture = new IIcon[ions.length];

static {
// Generate Ions
int key = 0;
for (String s : MaterialsElements.NAMES) {
for (String s : ions) {
// Map names to Meta
NameToMetaMap.put(Utils.sanitizeString(s.toLowerCase()), key);
MetaToNameMap.put(key, Utils.sanitizeString(s.toLowerCase()));
Expand All @@ -60,7 +60,7 @@ public String getUnlocalizedName() {

@Override
public String getUnlocalizedName(final ItemStack itemStack) {
return "item.particle.ion" + "." + MaterialsElements.NAMES[itemStack.getItemDamage()];
return "item.particle.ion." + ions[itemStack.getItemDamage()];
}

private static boolean createNBT(ItemStack rStack) {
Expand All @@ -72,7 +72,7 @@ private static boolean createNBT(ItemStack rStack) {
return true;
}

public static final long getChargeState(final ItemStack aStack) {
public static long getChargeState(final ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("Ion");
Expand All @@ -85,7 +85,7 @@ public static final long getChargeState(final ItemStack aStack) {
return 0L;
}

public static final boolean setChargeState(final ItemStack aStack, final long aCharge) {
public static boolean setChargeState(final ItemStack aStack, final long aCharge) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("Ion");
Expand All @@ -102,8 +102,7 @@ public double getDurabilityForDisplay(ItemStack stack) {
if (stack.getTagCompound() == null) {
createNBT(stack);
}
double chargeState = getChargeState(stack);
return chargeState;
return (double) getChargeState(stack);
}

@Override
Expand Down Expand Up @@ -131,23 +130,21 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
+ " Ion with a "
+ aState
+ " charge state of "
+ aCharge
+ "");
+ aCharge);
}
super.addInformation(stack, player, list, bool);
}

@Override
public void registerIcons(IIconRegister reg) {
for (int i = 0; i < IonParticles.overlays.length; i++) {
IonParticles.overlays[i] = reg.registerIcon(GTPlusPlus.ID + ":" + "ion/" + i);
for (int i = 0; i < this.texture.length; i++) {
this.texture[i] = reg.registerIcon(GTPlusPlus.ID + ":ion" + i);
}
IonParticles.baseTexture = reg.registerIcon(GTPlusPlus.ID + ":" + "ion/IonBase");
}

@Override
public IIcon getIconFromDamage(int meta) {
return IonParticles.overlays[meta];
return this.texture[meta];
}

@Override
Expand All @@ -157,11 +154,7 @@ public boolean requiresMultipleRenderPasses() {

@Override
public IIcon getIconFromDamageForRenderPass(int aMeta, int aPass) {
if (aPass == 0) {
return IonParticles.baseTexture;
} else {
return IonParticles.overlays[aMeta];
}
return this.texture[aMeta];
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ public StandardBaseParticles() {
MetaToNameMap.put(key, Utils.sanitizeString(s.toLowerCase()));
for (Particle o : Particle.aMap) {
int aColour = 0;
if (o.mParticleName.toLowerCase()
.equals(s.toLowerCase())) {
if (o.mParticleName.equalsIgnoreCase(s)) {
if (o.mParticleType == ElementaryGroup.BARYON) {
aColour = Utils.rgbtoHexValue(174, 226, 156);
aColourMap.put(key++, aColour);
Expand Down Expand Up @@ -109,7 +108,6 @@ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
Particle aCharge = getParticle(stack);
EnumChatFormatting aColour = EnumChatFormatting.GRAY;
String aState = aColour + "Unknown" + EnumChatFormatting.RESET;
if (aCharge != null) {
String aGroup = aCharge.mParticleType.name()
.toLowerCase();
Expand All @@ -130,13 +128,11 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
} else if (aGroup.toLowerCase()
.contains("meson")) {
aColour = EnumChatFormatting.WHITE;
} else {
aColour = EnumChatFormatting.GRAY;
}
String aFirstLet = aGroup.substring(0, 1)
.toUpperCase();
aGroup = aGroup.replaceFirst(aGroup.substring(0, 1), aFirstLet);
aState = aColour + aGroup + EnumChatFormatting.RESET;
String aState = aColour + aGroup + EnumChatFormatting.RESET;
list.add(EnumChatFormatting.GRAY + "Type: " + aState);
}
super.addInformation(stack, player, list, bool);
Expand All @@ -145,7 +141,7 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
@Override
public void registerIcons(IIconRegister reg) {
for (int i = 0; i < this.icons.length; i++) {
this.icons[i] = reg.registerIcon(GTPlusPlus.ID + ":" + "particle/new/" + i);
this.icons[i] = reg.registerIcon(GTPlusPlus.ID + ":particle/" + i);
}
}

Expand Down
28 changes: 9 additions & 19 deletions src/main/java/gtPlusPlus/core/item/general/ItemAirFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@

import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.util.Utils;

public class ItemAirFilter extends Item {

public IIcon[] icons = new IIcon[1];
public IIcon[] icons = new IIcon[2];

public ItemAirFilter() {
super();
Expand All @@ -33,12 +32,13 @@ public ItemAirFilter() {

@Override
public void registerIcons(IIconRegister reg) {
this.icons[0] = reg.registerIcon(GTPlusPlus.ID + ":" + "itemAirFilter");
this.icons[0] = reg.registerIcon(GTPlusPlus.ID + ":itemAirFilter1");
this.icons[1] = reg.registerIcon(GTPlusPlus.ID + ":itemAirFilter2");
}

@Override
public IIcon getIconFromDamage(int meta) {
return this.icons[0];
return this.icons[meta];
}

@Override
Expand All @@ -60,7 +60,7 @@ public String getItemStackDisplayName(final ItemStack tItem) {
return "Air Filter";
}

String itemName = tItem == null ? "Air Filter" : super.getItemStackDisplayName(tItem);
String itemName = "Air Filter";
String suffixName = "";
if (tItem.getItemDamage() == 0) {
suffixName = " [Tier 1]";
Expand All @@ -70,15 +70,6 @@ public String getItemStackDisplayName(final ItemStack tItem) {
return (itemName + suffixName);
}

@Override
public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
int meta = stack.getItemDamage();
if (meta == 1) {
HEX_OxFFFFFF = Utils.rgbtoHexValue(150, 180, 35);
}
return HEX_OxFFFFFF;
}

private static boolean createNBT(ItemStack rStack) {
final NBTTagCompound tagMain = new NBTTagCompound();
final NBTTagCompound tagNBT = new NBTTagCompound();
Expand All @@ -88,11 +79,11 @@ private static boolean createNBT(ItemStack rStack) {
return true;
}

public static final long getFilterMaxDamage(final ItemStack aStack) {
public static long getFilterMaxDamage(final ItemStack aStack) {
return aStack.getItemDamage() == 0 ? 50 : 2500;
}

public static final long getFilterDamage(final ItemStack aStack) {
public static long getFilterDamage(final ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("AirFilter");
Expand All @@ -105,7 +96,7 @@ public static final long getFilterDamage(final ItemStack aStack) {
return 0L;
}

public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
public static boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("AirFilter");
Expand All @@ -124,8 +115,7 @@ public double getDurabilityForDisplay(ItemStack stack) {
}
double currentDamage = getFilterDamage(stack);
double meta = getFilterMaxDamage(stack);
double durabilitypercent = currentDamage / meta;
return durabilitypercent;
return currentDamage / meta;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@

import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.util.Utils;

public class ItemBoilerChassis extends Item {

public IIcon[] icons = new IIcon[1];
public IIcon[] icons = new IIcon[3];

public ItemBoilerChassis() {
super();
Expand All @@ -30,12 +29,14 @@ public ItemBoilerChassis() {

@Override
public void registerIcons(IIconRegister reg) {
this.icons[0] = reg.registerIcon(GTPlusPlus.ID + ":" + "itemBoilerChassis");
this.icons[0] = reg.registerIcon(GTPlusPlus.ID + ":itemBoilerChassis1");
this.icons[1] = reg.registerIcon(GTPlusPlus.ID + ":itemBoilerChassis2");
this.icons[2] = reg.registerIcon(GTPlusPlus.ID + ":itemBoilerChassis3");
}

@Override
public IIcon getIconFromDamage(int meta) {
return this.icons[0];
return this.icons[meta];
}

@Override
Expand All @@ -54,19 +55,4 @@ public String getUnlocalizedName(ItemStack stack) {
public String getItemStackDisplayName(final ItemStack tItem) {
return StatCollector.translateToLocalFormatted("item.itemBoilerChassis.name", tItem.getItemDamage());
}

@Override // TODO
public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
int meta = stack.getItemDamage();
if (meta == 0) {
HEX_OxFFFFFF = Utils.rgbtoHexValue(10, 110, 30);
} else if (meta == 1) {
HEX_OxFFFFFF = Utils.rgbtoHexValue(150, 180, 35);
} else if (meta == 2) {
HEX_OxFFFFFF = Utils.rgbtoHexValue(200, 85, 40);
} else if (meta == 3) {
HEX_OxFFFFFF = Utils.rgbtoHexValue(255, 100, 50);
}
return HEX_OxFFFFFF;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public ItemDehydratorCoil() {

@Override
public void registerIcons(IIconRegister reg) {
this.icons[0] = reg.registerIcon(GTPlusPlus.ID + ":" + "dehydrator/itemDehydratorCoil_0");
this.icons[1] = reg.registerIcon(GTPlusPlus.ID + ":" + "dehydrator/itemDehydratorCoil_1");
this.icons[2] = reg.registerIcon(GTPlusPlus.ID + ":" + "dehydrator/itemDehydratorCoil_2");
this.icons[3] = reg.registerIcon(GTPlusPlus.ID + ":" + "dehydrator/itemDehydratorCoil_3");
this.icons[0] = reg.registerIcon(GTPlusPlus.ID + ":itemDehydratorCoil_0");
this.icons[1] = reg.registerIcon(GTPlusPlus.ID + ":itemDehydratorCoil_1");
this.icons[2] = reg.registerIcon(GTPlusPlus.ID + ":itemDehydratorCoil_2");
this.icons[3] = reg.registerIcon(GTPlusPlus.ID + ":itemDehydratorCoil_3");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public ItemDehydratorCoilWire() {

@Override
public void registerIcons(IIconRegister reg) {
this.icons[0] = reg.registerIcon(GTPlusPlus.ID + ":" + "dehydrator/itemDehydratorCoilWire_0");
this.icons[1] = reg.registerIcon(GTPlusPlus.ID + ":" + "dehydrator/itemDehydratorCoilWire_1");
this.icons[2] = reg.registerIcon(GTPlusPlus.ID + ":" + "dehydrator/itemDehydratorCoilWire_2");
this.icons[3] = reg.registerIcon(GTPlusPlus.ID + ":" + "dehydrator/itemDehydratorCoilWire_3");
this.icons[0] = reg.registerIcon(GTPlusPlus.ID + ":itemDehydratorCoilWire_0");
this.icons[1] = reg.registerIcon(GTPlusPlus.ID + ":itemDehydratorCoilWire_1");
this.icons[2] = reg.registerIcon(GTPlusPlus.ID + ":itemDehydratorCoilWire_2");
this.icons[3] = reg.registerIcon(GTPlusPlus.ID + ":itemDehydratorCoilWire_3");
}

@Override
Expand All @@ -58,13 +58,4 @@ public String getItemStackDisplayName(final ItemStack tItem) {
return StatCollector
.translateToLocalFormatted("item.itemDehydratorCoilWire.name", GTValues.VN[tItem.getItemDamage() + 4]);
}

/*
* @Override public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) { int meta =
* stack.getItemDamage(); if (meta == 0){ HEX_OxFFFFFF = Utils.rgbtoHexValue(10,110,30); } else if (meta == 1){
* HEX_OxFFFFFF = Utils.rgbtoHexValue(150,180,35); } else if (meta == 2){ HEX_OxFFFFFF =
* Utils.rgbtoHexValue(200,85,40); } else if (meta == 3){ HEX_OxFFFFFF = Utils.rgbtoHexValue(255,150,50); } return
* HEX_OxFFFFFF; }
*/

}
2 changes: 0 additions & 2 deletions src/main/java/gtPlusPlus/core/material/MaterialsElements.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

public final class MaterialsElements {

public static final String[] NAMES = new String[] { "Hydrogen", "Helium" };

// First 50 Elements
public final Material HYDROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Hydrogen);
public final Material HELIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Helium);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.world.World;

import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.util.GTLog;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.plugin.agrichem.AlgaeDefinition;
import gtPlusPlus.plugin.agrichem.IAlgalItem;
Expand All @@ -25,7 +26,6 @@
public class ItemAlgaeBase extends Item implements IAlgalItem {

protected IIcon base;
protected IIcon overlay;

public ItemAlgaeBase() {
this.setHasSubtypes(true);
Expand Down Expand Up @@ -89,8 +89,8 @@ public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList
aList.add("Lifespan in days: " + mLifespan);
aList.add("Generation: " + mGeneration);
}
} catch (Throwable t) {
t.printStackTrace();
} catch (Exception e) {
e.printStackTrace(GTLog.err);
}
super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
}
Expand Down Expand Up @@ -149,16 +149,12 @@ public int getColorFromItemStack(ItemStack aStack, int aMeta) {

@Override
public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
if (pass == 0) {
return this.base;
}
return this.overlay;
return this.base;
}

@Override
public void registerIcons(final IIconRegister i) {
this.base = i.registerIcon(GTPlusPlus.ID + ":" + "bioscience/BasicAlgae");
this.overlay = i.registerIcon(GTPlusPlus.ID + ":" + "bioscience/BasicAlgae_Overlay");
this.base = i.registerIcon(GTPlusPlus.ID + ":bioscience/BasicAlgae");
}

public static ItemStack initNBT(ItemStack aFreshAlgae) {
Expand Down
Loading

0 comments on commit cf7a834

Please sign in to comment.