change tabs, make ash gravity affected

This commit is contained in:
Sen 2025-07-05 15:21:18 +02:00
parent 7706c20bf5
commit 5c68feedbb
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
15 changed files with 48 additions and 27 deletions

View file

@ -11,7 +11,7 @@ import common.world.State;
public class BlockBlackenedStone extends Block { public class BlockBlackenedStone extends Block {
public BlockBlackenedStone() { public BlockBlackenedStone() {
super(Material.SOLID); super(Material.SOLID);
this.setTab(CheatTab.NATURE); this.setTab(CheatTab.ROCK);
} }
public Item getItemDropped(State state, Random rand, int fortune) { public Item getItemDropped(State state, Random rand, int fortune) {

View file

@ -20,7 +20,7 @@ public class BlockColoredClay extends Block {
public BlockColoredClay(DyeColor color) { public BlockColoredClay(DyeColor color) {
super(Material.SOLID); super(Material.SOLID);
this.color = color; this.color = color;
this.setTab(CheatTab.NATURE); this.setTab(CheatTab.ROCK);
CLAY[color.ordinal()] = this; CLAY[color.ordinal()] = this;
} }

View file

@ -9,6 +9,6 @@ public class BlockHardenedClay extends Block
public BlockHardenedClay() public BlockHardenedClay()
{ {
super(Material.SOLID); super(Material.SOLID);
this.setTab(CheatTab.NATURE); this.setTab(CheatTab.ROCK);
} }
} }

View file

@ -9,7 +9,7 @@ public class BlockHellRock extends Block
public BlockHellRock() public BlockHellRock()
{ {
super(Material.SOLID); super(Material.SOLID);
this.setTab(CheatTab.NATURE); this.setTab(CheatTab.ROCK);
} }
public boolean canKeepFire() { public boolean canKeepFire() {

View file

@ -13,7 +13,7 @@ public class BlockObsidian extends Block
public BlockObsidian() public BlockObsidian()
{ {
super(Material.SOLID); super(Material.SOLID);
this.setTab(CheatTab.NATURE); this.setTab(CheatTab.ROCK);
} }
/** /**

View file

@ -13,7 +13,7 @@ public class BlockSandStone extends Block {
public BlockSandStone(String texture) { public BlockSandStone(String texture) {
super(Material.SOLID); super(Material.SOLID);
this.texture = texture; this.texture = texture;
this.setTab(CheatTab.NATURE); this.setTab(CheatTab.ROCK);
} }
public Model getModel(ModelProvider provider, String name, State state) { public Model getModel(ModelProvider provider, String name, State state) {

View file

@ -11,7 +11,7 @@ import common.world.State;
public class BlockStone extends Block { public class BlockStone extends Block {
public BlockStone() { public BlockStone() {
super(Material.SOLID); super(Material.SOLID);
this.setTab(CheatTab.NATURE); this.setTab(CheatTab.ROCK);
} }
public Item getItemDropped(State state, Random rand, int fortune) { public Item getItemDropped(State state, Random rand, int fortune) {

View file

@ -251,19 +251,19 @@ public abstract class BlockRegistry {
Block stone = (new BlockStone()).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Stein"); Block stone = (new BlockStone()).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Stein");
register("stone", stone); register("stone", stone);
register("bedrock", (new BlockBedrock()).setHardness(1000.0F).setResistance(100000.0F).setStepSound(SoundType.STONE) register("bedrock", (new BlockBedrock()).setHardness(1000.0F).setResistance(100000.0F).setStepSound(SoundType.STONE)
.setDisplay("Grundgestein").setTab(CheatTab.NATURE).setMiningLevel(6)); .setDisplay("Grundgestein").setTab(CheatTab.ROCK).setMiningLevel(6));
register("rock", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE).setDisplay("Felsen").setTab(CheatTab.NATURE)); register("rock", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE).setDisplay("Felsen").setTab(CheatTab.ROCK));
register("smooth_rock", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE).setDisplay("Glatter Felsen").setTab(CheatTab.NATURE)); register("smooth_rock", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE).setDisplay("Glatter Felsen").setTab(CheatTab.ROCK));
register("hellrock", (new BlockHellRock()).setHardness(0.4F).setStepSound(SoundType.STONE).setDisplay("Höllenstein")); register("hellrock", (new BlockHellRock()).setHardness(0.4F).setStepSound(SoundType.STONE).setDisplay("Höllenstein"));
register("cell_rock", (new Block(Material.LOOSE)).setHardness(1.0F).setResistance(3.0F) register("cell_rock", (new Block(Material.LOOSE)).setHardness(1.0F).setResistance(3.0F)
.setStepSound(SoundType.SLIME).setDisplay("Zellstein").setTab(CheatTab.NATURE)); .setStepSound(SoundType.SLIME).setDisplay("Zellstein").setTab(CheatTab.ROCK));
register("moon_rock", (new Block(Material.SOLID)).setHardness(2.5F).setResistance(10.0F) register("moon_rock", (new Block(Material.SOLID)).setHardness(2.5F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Mondgestein").setTab(CheatTab.NATURE)); .setStepSound(SoundType.STONE).setDisplay("Mondgestein").setTab(CheatTab.ROCK));
Block cobblestone = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE) Block cobblestone = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Bruchstein").setTab(CheatTab.NATURE); .setDisplay("Bruchstein").setTab(CheatTab.ROCK);
register("cobblestone", cobblestone); register("cobblestone", cobblestone);
Block mossyCobblestone = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE) Block mossyCobblestone = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Bemooster Bruchstein").setTab(CheatTab.NATURE); .setDisplay("Bemooster Bruchstein").setTab(CheatTab.ROCK);
register("mossy_cobblestone", mossyCobblestone); register("mossy_cobblestone", mossyCobblestone);
Block sandstone = (new BlockSandStone("normal")).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Sandstein"); Block sandstone = (new BlockSandStone("normal")).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Sandstein");
register("sandstone", sandstone); register("sandstone", sandstone);
@ -282,7 +282,7 @@ public abstract class BlockRegistry {
register("sand", (new BlockFalling(Material.LOOSE)).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Sand").setShovelHarvestable().setTab(CheatTab.NATURE)); register("sand", (new BlockFalling(Material.LOOSE)).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Sand").setShovelHarvestable().setTab(CheatTab.NATURE));
register("red_sand", (new BlockFalling(Material.LOOSE)).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Roter Sand").setShovelHarvestable().setTab(CheatTab.NATURE)); register("red_sand", (new BlockFalling(Material.LOOSE)).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Roter Sand").setShovelHarvestable().setTab(CheatTab.NATURE));
register("gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Kies").setShovelHarvestable()); register("gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Kies").setShovelHarvestable());
register("ash", (new Block(Material.LOOSE)).setHardness(0.2F).setStepSound(SoundType.SAND).setDisplay("Asche") register("ash", (new BlockFalling(Material.LOOSE)).setHardness(0.2F).setStepSound(SoundType.SAND).setDisplay("Asche")
.setTab(CheatTab.NATURE).setShovelHarvestable()); .setTab(CheatTab.NATURE).setShovelHarvestable());
register("snow_layer", (new BlockSnow()).setHardness(0.1F).setStepSound(SoundType.SNOW).setDisplay("Schnee").setLightOpacity(0) register("snow_layer", (new BlockSnow()).setHardness(0.1F).setStepSound(SoundType.SNOW).setDisplay("Schnee").setLightOpacity(0)
.setShovelHarvestable()); .setShovelHarvestable());
@ -294,7 +294,7 @@ public abstract class BlockRegistry {
.setDisplay("Glowstone")); .setDisplay("Glowstone"));
register("blackened_stone", (new BlockBlackenedStone()).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Schwarzstein")); register("blackened_stone", (new BlockBlackenedStone()).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Schwarzstein"));
register("blackened_cobble", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE) register("blackened_cobble", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Schwarzbruchstein").setTab(CheatTab.NATURE)); .setDisplay("Schwarzbruchstein").setTab(CheatTab.ROCK));
registerFluid("water", "Wasser", true, LiquidType.WATER, false, 0, 5, 0.0f, TextureAnimation.WATER, TextureAnimation.WATERFLOW); registerFluid("water", "Wasser", true, LiquidType.WATER, false, 0, 5, 0.0f, TextureAnimation.WATER, TextureAnimation.WATERFLOW);

View file

@ -206,7 +206,7 @@ public abstract class ItemRegistry {
register("wand", (new ItemEditWand()).setDisplay("Bearbeitungswerkzeug")); register("wand", (new ItemEditWand()).setDisplay("Bearbeitungswerkzeug"));
register("info_wand", (new ItemInfoWand()).setDisplay("Infowerkzeug")); register("info_wand", (new ItemInfoWand()).setDisplay("Infowerkzeug"));
register("lightning_wand", (new ItemLightning()).setDisplay("Geladenes Zepter")); register("lightning_wand", (new ItemLightning()).setDisplay("Geladenes Zepter"));
register("banhammer", (new ItemBanHammer()).setDisplay("Hammer der Verbannung").setTab(CheatTab.TOOLS)); register("banhammer", (new ItemBanHammer()).setDisplay("Hammer der Verbannung"));
register("key", (new ItemKey()).setDisplay("Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(128)); register("key", (new ItemKey()).setDisplay("Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(128));
for(Pair<Integer, TextColor> sides : ItemDie.DIE_SIDES) { for(Pair<Integer, TextColor> sides : ItemDie.DIE_SIDES) {
register("die_" + sides.first(), (new ItemDie(sides.first(), sides.second())).setDisplay("Würfel").setMaxAmount(128)); register("die_" + sides.first(), (new ItemDie(sides.first(), sides.second())).setDisplay("Würfel").setMaxAmount(128));
@ -254,7 +254,7 @@ public abstract class ItemRegistry {
register("slime_ball", (new Item()).setDisplay("Schleimball").setTab(CheatTab.MATERIALS).setMaxAmount(128)); register("slime_ball", (new Item()).setDisplay("Schleimball").setTab(CheatTab.MATERIALS).setMaxAmount(128));
register("egg", (new ItemEgg()).setDisplay("Ei").setMaxAmount(128)); register("egg", (new ItemEgg()).setDisplay("Ei").setMaxAmount(128));
register("navigator", (new ItemSpaceNavigator()).setDisplay("Elektronischer Navigator").setTab(CheatTab.TOOLS)); register("navigator", (new ItemSpaceNavigator()).setDisplay("Elektronischer Navigator").setTab(CheatTab.TOOLS));
register("exterminator", (new ItemExterminator()).setDisplay("Weltenzerstörer").setTab(CheatTab.TOOLS)); register("exterminator", (new ItemExterminator()).setDisplay("Weltenzerstörer"));
register("fishing_rod", (new ItemFishingRod()).setDisplay("Angel")); register("fishing_rod", (new ItemFishingRod()).setDisplay("Angel"));
register("glowstone_dust", (new Item()).setDisplay("Glowstonestaub").setPotionEffect(PotionHelper.glowstoneEffect) register("glowstone_dust", (new Item()).setDisplay("Glowstonestaub").setPotionEffect(PotionHelper.glowstoneEffect)
.setTab(CheatTab.MATERIALS).setMaxAmount(256)); .setTab(CheatTab.MATERIALS).setMaxAmount(256));
@ -307,10 +307,10 @@ public abstract class ItemRegistry {
register("baked_potato", (new ItemFood(5, false)).setDisplay("Ofenkartoffel").setMaxAmount(128)); register("baked_potato", (new ItemFood(5, false)).setDisplay("Ofenkartoffel").setMaxAmount(128));
register("poisonous_potato", (new ItemFood(2, false)).setPotionEffect(Potion.POISON, 5, 0, 0.6F).setDisplay("Giftige Kartoffel").setMaxAmount(128)); register("poisonous_potato", (new ItemFood(2, false)).setPotionEffect(Potion.POISON, 5, 0, 0.6F).setDisplay("Giftige Kartoffel").setMaxAmount(128));
register("golden_carrot", (new ItemFood(6, false)).setDisplay("Goldene Karotte") register("golden_carrot", (new ItemFood(6, false)).setDisplay("Goldene Karotte")
.setPotionEffect(PotionHelper.goldenCarrotEffect).setTab(CheatTab.MISC)); .setPotionEffect(PotionHelper.goldenCarrotEffect));
register("carrot_on_a_stick", (new ItemCarrotOnAStick()).setDisplay("Karottenrute")); register("carrot_on_a_stick", (new ItemCarrotOnAStick()).setDisplay("Karottenrute"));
register("charge_crystal", (new ItemEffect()).setDisplay("Energiekristall").setTab(CheatTab.MISC).setColor(TextColor.DMAGENTA)); register("charge_crystal", (new ItemEffect()).setDisplay("Energiekristall").setTab(CheatTab.MISC).setColor(TextColor.DMAGENTA));
register("pumpkin_pie", (new ItemFood(8, false)).setDisplay("Kürbiskuchen").setTab(CheatTab.MISC)); register("pumpkin_pie", (new ItemFood(8, false)).setDisplay("Kürbiskuchen").setTab(CheatTab.FOOD));
register("fireworks", (new ItemFirework()).setDisplay("Feuerwerksrakete").setTab(CheatTab.TOOLS)); register("fireworks", (new ItemFirework()).setDisplay("Feuerwerksrakete").setTab(CheatTab.TOOLS));
register("firework_charge", (new ItemFireworkCharge()).setDisplay("Feuerwerksstern").setTab(CheatTab.MATERIALS)); register("firework_charge", (new ItemFireworkCharge()).setDisplay("Feuerwerksstern").setTab(CheatTab.MATERIALS));
register("enchanted_book", (new ItemEnchantedBook()).setMaxAmount(1).setDisplay("Verzaubertes Buch").setTab(CheatTab.MAGIC)); register("enchanted_book", (new ItemEnchantedBook()).setMaxAmount(1).setDisplay("Verzaubertes Buch").setTab(CheatTab.MAGIC));

View file

@ -22,7 +22,12 @@ public enum CheatTab {
return Items.glass; return Items.glass;
} }
}, },
NATURE("Gestein und Natur", true) { ROCK("Gestein", true) {
protected Item getIconItem() {
return Items.rock;
}
},
NATURE("Natur", true) {
protected Item getIconItem() { protected Item getIconItem() {
return Items.grass; return Items.grass;
} }
@ -52,7 +57,7 @@ public enum CheatTab {
return Items.diamond_block; return Items.diamond_block;
} }
}, },
VEHICLES("Fahrzeuge und Fortbewegung", false) { VEHICLES("Fahrzeuge", false) {
protected Item getIconItem() { protected Item getIconItem() {
return Items.minecart; return Items.minecart;
} }
@ -62,7 +67,7 @@ public enum CheatTab {
return Items.fox_spawner; return Items.fox_spawner;
} }
}, },
NPCS("NPC- und Charakterspawner", false) { NPCS("Charakterspawner", false) {
protected Item getIconItem() { protected Item getIconItem() {
return Items.highelf_spawner; return Items.highelf_spawner;
} }
@ -87,11 +92,16 @@ public enum CheatTab {
return Items.iron_chestplate; return Items.iron_chestplate;
} }
}, },
MAGIC("Tränke & Verzauberungen", false) { POTIONS("Tränke", false) {
protected Item getIconItem() { protected Item getIconItem() {
return Items.potion; return Items.potion;
} }
}, },
MAGIC("Verzauberungen", false) {
protected Item getIconItem() {
return Items.enchanted_book;
}
},
MATERIALS("Werkstoffe", false) { MATERIALS("Werkstoffe", false) {
protected Item getIconItem() { protected Item getIconItem() {
return Items.leather; return Items.leather;
@ -102,7 +112,12 @@ public enum CheatTab {
return Items.iron_ingot; return Items.iron_ingot;
} }
}, },
MISC("Verschiedenes & Nahrung", false) { FOOD("Nahrung", false) {
protected Item getIconItem() {
return Items.apple;
}
},
MISC("Verschiedenes", false) {
protected Item getIconItem() { protected Item getIconItem() {
return Items.charge_crystal; return Items.charge_crystal;
} }

View file

@ -6,6 +6,7 @@ import common.color.TextColor;
import common.entity.DamageSource; import common.entity.DamageSource;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving; import common.entity.types.EntityLiving;
import common.item.CheatTab;
import common.item.ItemStack; import common.item.ItemStack;
import common.util.BoundingBox; import common.util.BoundingBox;
import common.util.Vec3; import common.util.Vec3;
@ -14,6 +15,7 @@ import common.world.AWorldServer;
public class ItemBanHammer extends ItemWand { public class ItemBanHammer extends ItemWand {
public ItemBanHammer() { public ItemBanHammer() {
this.setColor(TextColor.DRED); this.setColor(TextColor.DRED);
this.setTab(CheatTab.WEAPONS);
} }
public void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec) { public void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec) {

View file

@ -4,6 +4,7 @@ import common.color.TextColor;
import common.dimension.Space; import common.dimension.Space;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.init.SoundEvent; import common.init.SoundEvent;
import common.item.CheatTab;
import common.item.ItemMagnetic; import common.item.ItemMagnetic;
import common.item.ItemStack; import common.item.ItemStack;
import common.world.World; import common.world.World;
@ -13,6 +14,7 @@ public class ItemExterminator extends ItemMagnetic {
public ItemExterminator() { public ItemExterminator() {
this.setMaxAmount(1); this.setMaxAmount(1);
this.setColor(TextColor.DRED); this.setColor(TextColor.DRED);
this.setTab(CheatTab.WEAPONS);
} }
// public final boolean canUseInAir() { // public final boolean canUseInAir() {

View file

@ -25,7 +25,7 @@ public class ItemFood extends Item
this.itemUseDuration = 32; this.itemUseDuration = 32;
this.healAmount = amount; this.healAmount = amount;
this.isWolfsFavoriteMeat = isWolfFood; this.isWolfsFavoriteMeat = isWolfFood;
this.setTab(CheatTab.MISC); this.setTab(CheatTab.FOOD);
} }
/** /**

View file

@ -2,6 +2,7 @@ package common.item.tool;
import common.color.TextColor; import common.color.TextColor;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.item.CheatTab;
import common.item.ItemStack; import common.item.ItemStack;
import common.util.Vec3; import common.util.Vec3;
import common.world.AWorldServer; import common.world.AWorldServer;
@ -9,6 +10,7 @@ import common.world.AWorldServer;
public class ItemLightning extends ItemWand { public class ItemLightning extends ItemWand {
public ItemLightning() { public ItemLightning() {
this.setColor(TextColor.NEON); this.setColor(TextColor.NEON);
this.setTab(CheatTab.WEAPONS);
} }
public void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec) public void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec)

View file

@ -47,7 +47,7 @@ public class ItemPotion extends Item
{ {
this.data = data; this.data = data;
this.setMaxAmount(1); this.setMaxAmount(1);
this.setTab(CheatTab.MAGIC); this.setTab(CheatTab.POTIONS);
this.setColor(TextColor.ORK); this.setColor(TextColor.ORK);
POTIONS.put(data, this); POTIONS.put(data, this);
} }