aether-legacy/src/main/java/com/gildedgames/the_aether/api/moa/AetherMoaType.java

52 lines
1.4 KiB
Java
Raw Normal View History

2020-08-14 08:29:22 +02:00
package com.gildedgames.the_aether.api.moa;
2016-12-17 16:28:16 +01:00
2020-08-14 08:29:22 +02:00
import com.gildedgames.the_aether.api.RegistryEntry;
import net.minecraft.creativetab.CreativeTabs;
2016-12-17 16:28:16 +01:00
import net.minecraft.util.ResourceLocation;
2018-12-07 06:32:48 +01:00
public class AetherMoaType extends RegistryEntry {
2023-03-13 19:53:26 +01:00
private MoaProperties properties;
2016-12-17 16:28:16 +01:00
2023-03-13 19:53:26 +01:00
public int hexColor;
2016-12-17 16:28:16 +01:00
2023-03-13 19:53:26 +01:00
public CreativeTabs creativeTab;
2023-03-13 19:53:26 +01:00
public AetherMoaType(int hexColor, MoaProperties properties) {
this.hexColor = hexColor;
this.properties = properties;
2016-12-17 16:28:16 +01:00
2023-03-13 19:53:26 +01:00
this.creativeTab = CreativeTabs.tabMisc;
}
2016-12-17 16:28:16 +01:00
2023-03-13 19:53:26 +01:00
public AetherMoaType(
int hexColor, MoaProperties properties, CreativeTabs creativeTab
) {
this(hexColor, properties);
2016-12-17 16:28:16 +01:00
2023-03-13 19:53:26 +01:00
this.creativeTab = creativeTab;
}
2023-03-13 19:53:26 +01:00
public ResourceLocation getTexture(boolean saddled, boolean isBeingRidden) {
if (this.properties.hasCustomTexture()) {
return this.properties.getCustomTexture(saddled, isBeingRidden);
}
2016-12-17 16:28:16 +01:00
2023-03-13 19:53:26 +01:00
return new ResourceLocation(
"aether_legacy",
"textures/entities/moa/" + ("moa_")
+ this.getRegistryName().getResourcePath().toLowerCase() + ".png"
);
}
2023-03-13 19:53:26 +01:00
public MoaProperties getMoaProperties() {
return this.properties;
}
2023-03-13 19:53:26 +01:00
public CreativeTabs getCreativeTab() {
return this.creativeTab;
}
2016-12-17 16:28:16 +01:00
2023-03-13 19:53:26 +01:00
public int getMoaEggColor() {
return this.hexColor;
}
2016-12-17 16:28:16 +01:00
}