Full Imports and Code Format Optimization

This commit is contained in:
Kam committed 2025-03-12 20:12:01 -04:00
1 parent 250edf099c
commit 6815f579a7
1192 files changed
+60344 -62167

No files matched your search

@@ -4,76 +4,75 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
public class ModelPartData {
public int color = 0xFFFFFF;
public String texture;
public byte type = 0;
public int color = 0xFFFFFF;
public String texture;
public byte type = 0;
public byte pattern = 0;
public boolean playerTexture;
public boolean playerTexture;
private ResourceLocation location;
private ResourceLocation location;
public ModelPartData(){
playerTexture = true;
}
public ModelPartData() {
playerTexture = true;
}
public ModelPartData(String texture) {
this.texture = texture;
playerTexture = false;
}
public ModelPartData(String texture) {
this.texture = texture;
playerTexture = false;
}
public NBTTagCompound writeToNBT(){
NBTTagCompound compound = new NBTTagCompound();
compound.setByte("Type", type);
compound.setInteger("Color", color);
public NBTTagCompound writeToNBT() {
NBTTagCompound compound = new NBTTagCompound();
compound.setByte("Type", type);
compound.setInteger("Color", color);
compound.setByte("Pattern", pattern);
if(texture != null && !texture.isEmpty()) {
compound.setString("Texture", texture);
}
compound.setBoolean("PlayerTexture", playerTexture);
return compound;
}
if (texture != null && !texture.isEmpty()) {
compound.setString("Texture", texture);
}
compound.setBoolean("PlayerTexture", playerTexture);
return compound;
}
public void readFromNBT(NBTTagCompound compound){
type = compound.getByte("Type");
color = compound.getInteger("Color");
texture = compound.getString("Texture");
public void readFromNBT(NBTTagCompound compound) {
type = compound.getByte("Type");
color = compound.getInteger("Color");
texture = compound.getString("Texture");
pattern = compound.getByte("Pattern");
playerTexture = compound.getBoolean("PlayerTexture");
location = null;
}
playerTexture = compound.getBoolean("PlayerTexture");
location = null;
}
public ResourceLocation getResource(){
if(texture.isEmpty())
return null;
if(location != null)
return location;
location = new ResourceLocation(texture);
return location;
}
public ResourceLocation getResource() {
if (texture.isEmpty())
return null;
if (location != null)
return location;
location = new ResourceLocation(texture);
return location;
}
public void setTexture(String texture, int type) {
this.type = (byte) type;
this.location = null;
if(texture.isEmpty()){
playerTexture = true;
this.texture = texture;
}
else{
this.texture = "customnpcs:textures/parts/"+ texture + ".png";
playerTexture = false;
}
}
public void setTexture(String texture, int type) {
this.type = (byte) type;
this.location = null;
if (texture.isEmpty()) {
playerTexture = true;
this.texture = texture;
} else {
this.texture = "customnpcs:textures/parts/" + texture + ".png";
playerTexture = false;
}
}
public String toString(){
return "Color: " + color + " Type: " + type;
}
public String toString() {
return "Color: " + color + " Type: " + type;
}
public String getColor() {
String str = Integer.toHexString(color);
public String getColor() {
String str = Integer.toHexString(color);
while(str.length() < 6)
str = "0" + str;
while (str.length() < 6)
str = "0" + str;
return str;
}
return str;
}
}