mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-28 07:35:47 +00:00
Move mail items to PluginMail.items
This commit is contained in:
1 parent
317dd0dbf9
commit
7e50c57ba9
12 files changed
+195
-142
No files matched your search
@@ -18,56 +18,8 @@ import forestry.core.CreativeTabForestry;
|
||||
import forestry.core.items.ItemOverlay;
|
||||
|
||||
public class ItemStamps extends ItemOverlay implements IStamps {
|
||||
|
||||
public static class StampInfo implements IOverlayInfo {
|
||||
private final String name;
|
||||
private final int primaryColor;
|
||||
private final int secondaryColor;
|
||||
private final Object craftingIngredient;
|
||||
private final EnumPostage postage;
|
||||
|
||||
public StampInfo(String name, EnumPostage postage, Object crafting, int primaryColor, int secondaryColor) {
|
||||
this.name = name;
|
||||
this.primaryColor = primaryColor;
|
||||
this.secondaryColor = secondaryColor;
|
||||
this.craftingIngredient = crafting;
|
||||
this.postage = postage;
|
||||
}
|
||||
|
||||
public EnumPostage getPostage() {
|
||||
return this.postage;
|
||||
}
|
||||
|
||||
public Object getCraftingIngredient() {
|
||||
return this.craftingIngredient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPrimaryColor() {
|
||||
return primaryColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSecondaryColor() {
|
||||
return secondaryColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private final StampInfo[] stampInfo;
|
||||
|
||||
public ItemStamps(StampInfo[] overlays) {
|
||||
super(CreativeTabForestry.tabForestry, overlays);
|
||||
this.stampInfo = overlays;
|
||||
public ItemStamps() {
|
||||
super(CreativeTabForestry.tabForestry, EnumStampDefinition.VALUES);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -76,21 +28,14 @@ public class ItemStamps extends ItemOverlay implements IStamps {
|
||||
return EnumPostage.P_0;
|
||||
}
|
||||
|
||||
if (itemstack.getItemDamage() < 0 || itemstack.getItemDamage() >= stampInfo.length) {
|
||||
if (itemstack.getItemDamage() < 0 || itemstack.getItemDamage() >= EnumStampDefinition.VALUES.length) {
|
||||
return EnumPostage.P_0;
|
||||
}
|
||||
|
||||
return stampInfo[itemstack.getItemDamage()].getPostage();
|
||||
return EnumStampDefinition.VALUES[itemstack.getItemDamage()].getPostage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
if (itemstack.getItemDamage() < 0 || itemstack.getItemDamage() >= stampInfo.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return super.getUnlocalizedName(itemstack);
|
||||
public ItemStack get(EnumStampDefinition stampInfo, int amount) {
|
||||
return new ItemStack(this, amount, stampInfo.ordinal());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user