further cheat improvements, change some tabs

This commit is contained in:
Sen 2025-07-05 14:17:57 +02:00
parent 7e9673dc25
commit 0c7459d371
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
10 changed files with 18 additions and 12 deletions

View file

@ -710,7 +710,7 @@ public abstract class GuiContainer extends Gui
}
public void dropItem() {
if (this.gm != null && this.gm.player != null && this.theSlot != null && this.theSlot.getHasStack())
if (!this.clickSide(this.gm.mouse_x, this.gm.mouse_y, -100, this.gm.shift(), this.gm.ctrl()) && this.gm != null && this.gm.player != null && this.theSlot != null && this.theSlot.getHasStack())
{
this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, this.gm.ctrl() ? 1 : 0, 4);
}
@ -872,7 +872,7 @@ public abstract class GuiContainer extends Gui
int idx = sx + (sy + off) * this.cheatWidth;
if(idx >= 0 && idx < ITEM_LIST.size()) {
if(slot >= 0 || instant) {
if(slot != -1 || instant) {
this.gm.player.client.addToSendQueue(new CPacketCheat(ITEM_LIST.get(idx), slot < 0 ? slot : -2 - slot, full));
}
else {

View file

@ -226,7 +226,7 @@ public abstract class ItemRegistry {
register("bow", (new ItemBow()).setDisplay("Bogen"));
register("boltgun", (new ItemBoltgun()).setDisplay("Bolter"));
register("bolt", (new ItemAmmo(5, 1.0f, 128)).setDisplay("Bolter-Munition"));
register("arrow", (new ItemArrow()).setDisplay("Pfeil").setTab(CheatTab.COMBAT).setMaxAmount(128));
register("arrow", (new ItemArrow()).setDisplay("Pfeil").setTab(CheatTab.WEAPONS).setMaxAmount(128));
Item coal = (new Item()).setDisplay("Kohle").setTab(CheatTab.METALS);
register("coal", coal);
register("charcoal", (new Item()).setDisplay("Holzkohle").setTab(CheatTab.METALS));

View file

@ -77,11 +77,16 @@ public enum CheatTab {
return Items.water_bucket;
}
},
COMBAT("Kampf", false) {
WEAPONS("Waffen", false) {
protected Item getIconItem() {
return Items.bow;
}
},
ARMOR("Rüstung", false) {
protected Item getIconItem() {
return Items.iron_chestplate;
}
},
MAGIC("Tränke & Verzauberungen", false) {
protected Item getIconItem() {
return Items.potion;

View file

@ -10,7 +10,7 @@ public class ItemAmmo extends ItemMagnetic {
public ItemAmmo(int damage, float explosion, int stack) {
this.setMaxAmount(stack);
this.setTab(CheatTab.COMBAT);
this.setTab(CheatTab.WEAPONS);
this.damage = damage;
this.explosion = explosion;
}

View file

@ -53,7 +53,7 @@ public class ItemArmor extends Item
// this.renderIndex = renderIndex;
this.damageReduceAmount = material.getDamageReduction(armorType);
this.setMaxDamage(material.getDurability(armorType));
this.setTab(CheatTab.COMBAT);
this.setTab(CheatTab.ARMOR);
}
public int getColorFromItemStack(ItemStack stack, int renderPass)

View file

@ -18,7 +18,7 @@ public class ItemBow extends Item
public ItemBow()
{
this.setMaxDamage(384);
this.setTab(CheatTab.COMBAT);
this.setTab(CheatTab.WEAPONS);
}
/**

View file

@ -20,7 +20,7 @@ public abstract class ItemGunBase extends Item
public ItemGunBase(int durability)
{
this.setMaxDamage(durability);
this.setTab(CheatTab.COMBAT);
this.setTab(CheatTab.WEAPONS);
}
public ItemAction getItemPosition(ItemStack stack)

View file

@ -12,7 +12,7 @@ public class ItemHorseArmor extends Item {
this.material = material;
this.texture = texture;
this.setMaxAmount(1);
this.setTab(CheatTab.COMBAT);
this.setTab(CheatTab.ARMOR);
}
public boolean isMagnetic() {

View file

@ -23,7 +23,7 @@ public class ItemSword extends Item
{
this.material = material;
this.setMaxDamage(material.getDurability());
this.setTab(CheatTab.COMBAT);
this.setTab(CheatTab.WEAPONS);
this.attackDamage = 4 + material.getDamage();
}

View file

@ -2888,9 +2888,10 @@ public class Player extends User implements ICrafting, Executor, IPlayer
if(amount <= 0)
return;
}
else if(packet.getSlot() <= -2 - 9) {
this.entity.dropItem(stack, false, true);
}
else {
if(packet.getSlot() <= -2 - 9)
return;
Slot slot = packet.getSlot() < 0 ? this.entity.inventoryContainer.getSlot(36 + -2 - packet.getSlot()) : this.entity.openContainer.getSlot(packet.getSlot());
if(slot == null || !slot.canCheatItem())
return;