initial commit

This commit is contained in:
Sen 2025-03-11 00:23:54 +01:00 committed by Sen
parent 3c9ee26b06
commit 22186c33b9
1458 changed files with 282792 additions and 0 deletions

201
java/src/game/item/CheatTab.java Executable file
View file

@ -0,0 +1,201 @@
package game.item;
import java.util.List;
import game.enchantment.EnumEnchantmentType;
import game.init.Blocks;
import game.init.ItemRegistry;
import game.init.Items;
public abstract class CheatTab
{
public static final CheatTab[] TABS = new CheatTab[16];
public static final CheatTab tabBlocks = new CheatTab("Baumaterial")
{
public Item getTabIconItem()
{
return ItemRegistry.getItemFromBlock(Blocks.glass);
}
};
public static final CheatTab tabNature = new CheatTab("Gestein und Natur")
{
public Item getTabIconItem()
{
return ItemRegistry.getItemFromBlock(Blocks.grass);
}
};
public static final CheatTab tabWood = new CheatTab("Holz")
{
public Item getTabIconItem()
{
return ItemRegistry.getItemFromBlock(Blocks.maple_planks);
}
};
public static final CheatTab tabPlants = new CheatTab("Pflanzen")
{
public Item getTabIconItem()
{
return ItemRegistry.getItemFromBlock(Blocks.oak_leaves);
}
};
public static final CheatTab tabDeco = new CheatTab("Dekoration")
{
public Item getTabIconItem()
{
return ItemRegistry.getItemFromBlock(Blocks.hay_block);
}
};
public static final CheatTab tabTech = new CheatTab("Redstone & Technik")
{
public Item getTabIconItem()
{
return ItemRegistry.getItemFromBlock(Blocks.tnt);
}
};
public static final CheatTab tabGems = new CheatTab("Erze & Teure Blöcke")
{
public Item getTabIconItem()
{
return ItemRegistry.getItemFromBlock(Blocks.diamond_block);
}
};
public static final CheatTab tabInventory = new CheatTab("Inventar öffnen")
{
public Item getTabIconItem()
{
return ItemRegistry.getItemFromBlock(Blocks.chest);
}
};
public static final CheatTab tabSpawners = new CheatTab("Mob & Itemspawner")
{
public Item getTabIconItem()
{
return Items.minecart;
}
};
public static final CheatTab tabTools = new CheatTab("Werkzeug")
{
public Item getTabIconItem()
{
return Items.flint_and_steel;
}
};
public static final CheatTab tabCombat = new CheatTab("Kampf")
{
public Item getTabIconItem()
{
return Items.bow;
}
};
public static final CheatTab tabMagic = new CheatTab("Tränke & Verzauberungen")
{
public Item getTabIconItem()
{
return Items.potion;
}
public int getIconItemDamage()
{
return 8261;
}
};
public static final CheatTab tabMaterials = new CheatTab("Werkstoffe")
{
public Item getTabIconItem()
{
return Items.leather;
}
};
public static final CheatTab tabMetals = new CheatTab("Metalle und Juwelen")
{
public Item getTabIconItem()
{
return Items.iron_ingot;
}
};
public static final CheatTab tabMisc = new CheatTab("Verschiedenes & Nahrung")
{
public Item getTabIconItem()
{
return Items.charge_crystal;
}
};
public static final CheatTab tabEtc = new CheatTab("...")
{
public Item getTabIconItem()
{
return Items.navigator;
}
};
private static int nextTabId;
private final int tabIndex;
private final String name;
private EnumEnchantmentType[] enchantmentTypes;
private ItemStack iconItemStack;
public CheatTab(String name)
{
this.tabIndex = nextTabId++;
this.name = name;
TABS[this.tabIndex] = this;
}
public boolean isRight()
{
return this.getTabColumn() == (TABS.length + 1) / 2 - 1;
}
public boolean isLeft()
{
return this.getTabColumn() == 0;
}
public int getTabColumn()
{
return this.tabIndex % ((TABS.length + 1) / 2);
}
public boolean isTop()
{
return this.tabIndex < (TABS.length + 1) / 2;
}
public int getIndex()
{
return this.tabIndex;
}
public String getName()
{
return this.name;
}
public ItemStack getIconItemStack()
{
if (this.iconItemStack == null)
{
this.iconItemStack = new ItemStack(this.getTabIconItem(), 1, this.getIconItemDamage());
}
return this.iconItemStack;
}
public abstract Item getTabIconItem();
public int getIconItemDamage()
{
return 0;
}
public void displayAllReleventItems(List<ItemStack> list)
{
for (Item item : ItemRegistry.REGISTRY)
{
if (item != null && item.getTab() == this)
{
item.getSubItems(item, this, list);
}
}
}
}