improve item categories
This commit is contained in:
parent
83dca68f11
commit
f123a599a2
43 changed files with 190 additions and 95 deletions
|
@ -16,6 +16,7 @@ import java.nio.ByteBuffer;
|
|||
import java.nio.ByteOrder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
@ -134,6 +135,7 @@ import common.init.SoundEvent;
|
|||
import common.item.Item;
|
||||
import common.item.ItemControl;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.item.material.ItemBucket;
|
||||
import common.log.Log;
|
||||
import common.log.LogLevel;
|
||||
|
@ -450,6 +452,7 @@ public class Client implements IThreadListener {
|
|||
private final List<ChunkClient> chunkListing = Lists.<ChunkClient>newArrayList();
|
||||
private final Set<Long> emptyChunkListing = Sets.<Long>newHashSet();
|
||||
private final Set<Long> nextEmptyChunkListing = Sets.<Long>newHashSet();
|
||||
private final int[] lastSelection = new int[ItemCategory.values().length];
|
||||
|
||||
private boolean primary;
|
||||
private boolean secondary;
|
||||
|
@ -468,7 +471,6 @@ public class Client implements IThreadListener {
|
|||
private boolean saving;
|
||||
private boolean drawFps;
|
||||
private boolean drawDebug;
|
||||
private boolean placeMode;
|
||||
public boolean jump;
|
||||
public boolean sneak;
|
||||
public boolean debugCamEnable;
|
||||
|
@ -573,6 +575,7 @@ public class Client implements IThreadListener {
|
|||
public String dimensionName;
|
||||
private ChunkClient emptyChunk;
|
||||
private ChunkClient outsideChunk;
|
||||
private ItemCategory itemSelection = ItemCategory.USEABLE;
|
||||
|
||||
private List<Entity> entities;
|
||||
private List<Entity> unloaded;
|
||||
|
@ -836,6 +839,8 @@ public class Client implements IThreadListener {
|
|||
this.resetWorld();
|
||||
this.player = null;
|
||||
this.serverInfo = null;
|
||||
Arrays.fill(this.lastSelection, 0);
|
||||
this.itemSelection = ItemCategory.USEABLE;
|
||||
this.lastTickTime = -1;
|
||||
this.selectedCharacter = -1;
|
||||
this.playerList.clear();
|
||||
|
@ -965,7 +970,7 @@ public class Client implements IThreadListener {
|
|||
|
||||
if (Bind.ITEMMODE.isPressed() && this.viewEntity == this.player)
|
||||
{
|
||||
this.placeMode ^= true;
|
||||
this.category(this.shift() ? -1 : 1);
|
||||
}
|
||||
|
||||
boolean hadZoom = this.zooming;
|
||||
|
@ -979,9 +984,18 @@ public class Client implements IThreadListener {
|
|||
{
|
||||
if (this.keyBindsHotbar[l].isPressed())
|
||||
{
|
||||
if(this.player.getSelectedIndex() != l)
|
||||
this.controller.resetUseCooldown();
|
||||
this.player.setSelectedIndex(l);
|
||||
int n = 0;
|
||||
for(int z = 0; z < this.player.getHotbarSize(); z++) {
|
||||
if(this.player.getStackInSlot(z) == null || this.player.getStackInSlot(z).getItem().getCategory() != this.itemSelection)
|
||||
continue;
|
||||
if(l == n) {
|
||||
if(this.player.getSelectedIndex() != z)
|
||||
this.controller.resetUseCooldown();
|
||||
this.player.setSelectedIndex(z);
|
||||
break;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1102,7 +1116,7 @@ public class Client implements IThreadListener {
|
|||
this.displayTick(ExtMath.floord(this.player.posX), ExtMath.floord(this.player.posY), ExtMath.floord(this.player.posZ));
|
||||
}
|
||||
this.effectRenderer.update();
|
||||
if(this.player != null && (this.player.getHeldItem() == null || !this.player.getHeldItem().getItem().canBeHeld() || (this.player.getHeldItem().getItem().getBlock() != null) != this.placeMode))
|
||||
if(this.player != null && (this.player.getHeldItem() == null || this.player.getHeldItem().getItem().getCategory() != this.itemSelection))
|
||||
this.select(1);
|
||||
}
|
||||
else if (this.connection != null)
|
||||
|
@ -1172,7 +1186,7 @@ public class Client implements IThreadListener {
|
|||
if(this.world != null && this.player != null && this.viewEntity == this.player) {
|
||||
total = 0;
|
||||
for(int z = 0; z < this.player.getHotbarSize(); z++) {
|
||||
if(this.player.getStackInSlot(z) != null && this.player.getStackInSlot(z).getItem().canBeHeld() && (this.player.getStackInSlot(z).getItem().getBlock() != null) == this.placeMode)
|
||||
if(this.player.getStackInSlot(z) != null && this.player.getStackInSlot(z).getItem().getCategory() == this.itemSelection)
|
||||
++total;
|
||||
}
|
||||
if(total == 0)
|
||||
|
@ -1204,7 +1218,7 @@ public class Client implements IThreadListener {
|
|||
|
||||
int x = xoff * scale;
|
||||
for(int n = 0; n < size; n++) {
|
||||
if(this.player.getStackInSlot(n) == null || !this.player.getStackInSlot(n).getItem().canBeHeld() || (this.player.getStackInSlot(n).getItem().getBlock() != null) != this.placeMode)
|
||||
if(this.player.getStackInSlot(n) == null || this.player.getStackInSlot(n).getItem().getCategory() != this.itemSelection)
|
||||
continue;
|
||||
if(selected == n)
|
||||
Drawing.drawRect(x - scale * 2, by - scale * 2, 20 * scale, 20 * scale, 0xffffffff);
|
||||
|
@ -1213,7 +1227,7 @@ public class Client implements IThreadListener {
|
|||
}
|
||||
|
||||
ItemStack itemstack = this.player.getHeldItem();
|
||||
String current = itemstack != null ? itemstack.getItem().getHotbarText(this.player, itemstack) : "";
|
||||
String current = itemstack != null && itemstack.getItem().getCategory() != null ? itemstack.getItem().getHotbarText(this.player, itemstack) : "";
|
||||
if(!current.isEmpty())
|
||||
Drawing.drawTextUpward(current, this.fbX / 2, this.fbY - 60, 0xffffffff);
|
||||
}
|
||||
|
@ -1370,7 +1384,7 @@ public class Client implements IThreadListener {
|
|||
int cnt = 0;
|
||||
for(int index = 0; index < size; ++index) {
|
||||
ItemStack itemstack = this.player.getStackInSlot(index);
|
||||
if(itemstack != null && itemstack.getItem().canBeHeld() && (itemstack.getItem().getBlock() != null) == this.placeMode) {
|
||||
if(itemstack != null && itemstack.getItem().getCategory() == this.itemSelection) {
|
||||
if(width < 20 && selected != index && selected != index + 1 && cnt != total - 1) {
|
||||
this.scissor(xPos * scale, this.fbY - (by + 16 * scale), (width - 1) * scale, 16 * scale);
|
||||
GL15.glEnable(GL15.GL_SCISSOR_TEST);
|
||||
|
@ -1414,7 +1428,7 @@ public class Client implements IThreadListener {
|
|||
int xPos = xoff * scale;
|
||||
for(int index = 0; index < size; ++index) {
|
||||
ItemStack itemstack = this.player.getStackInSlot(index);
|
||||
if(itemstack != null && itemstack.getItem().canBeHeld() && (itemstack.getItem().getBlock() != null) == this.placeMode) {
|
||||
if(itemstack != null && itemstack.getItem().getCategory() == this.itemSelection) {
|
||||
if(width >= 17 || index == selected) {
|
||||
GuiContainer.renderItemOverlay(itemstack,
|
||||
xPos, by, null, index == this.player.getSelectedIndex() ? this.controller.getUseCooldown() : 0, this.controller.getUseCooldownMax(), scale);
|
||||
|
@ -1541,6 +1555,7 @@ public class Client implements IThreadListener {
|
|||
}
|
||||
|
||||
private void select(int dir) {
|
||||
int last = this.player.getSelectedIndex();
|
||||
int n = 0;
|
||||
do {
|
||||
this.player.setSelectedIndex(this.player.getSelectedIndex() + dir);
|
||||
|
@ -1550,8 +1565,33 @@ public class Client implements IThreadListener {
|
|||
this.player.setSelectedIndex(0);
|
||||
++n;
|
||||
}
|
||||
while((this.player.getHeldItem() == null || !this.player.getHeldItem().getItem().canBeHeld() || (this.player.getHeldItem().getItem().getBlock() != null) != this.placeMode) && n < this.player.getHotbarSize());
|
||||
this.controller.resetUseCooldown();
|
||||
while((this.player.getHeldItem() == null || this.player.getHeldItem().getItem().getCategory() != this.itemSelection) && n < this.player.getHotbarSize());
|
||||
if(last != this.player.getSelectedIndex())
|
||||
this.controller.resetUseCooldown();
|
||||
else
|
||||
this.category(dir);
|
||||
}
|
||||
|
||||
private void category(int dir) {
|
||||
ItemCategory last = this.itemSelection;
|
||||
this.lastSelection[last.ordinal()] = this.player.getSelectedIndex();
|
||||
int total;
|
||||
int n = 0;
|
||||
do {
|
||||
this.itemSelection = ItemCategory.values()[(ItemCategory.values().length + this.itemSelection.ordinal() + dir) % ItemCategory.values().length];
|
||||
total = 0;
|
||||
for(int z = 0; z < this.player.getHotbarSize(); z++) {
|
||||
if(this.player.getStackInSlot(z) != null && this.player.getStackInSlot(z).getItem().getCategory() == this.itemSelection)
|
||||
++total;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
while(total <= 0 && n < ItemCategory.values().length);
|
||||
if(this.itemSelection != last) {
|
||||
if(this.player.getSelectedIndex() != this.lastSelection[this.itemSelection.ordinal()])
|
||||
this.controller.resetUseCooldown();
|
||||
this.player.setSelectedIndex(Math.min(this.lastSelection[this.itemSelection.ordinal()], this.player.getHotbarSize() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
public void moveCamera(float x, float y) {
|
||||
|
|
|
@ -179,12 +179,13 @@ public abstract class GuiContainer extends Gui
|
|||
if(stack.getRepairCost() > 0)
|
||||
list.add("Reparaturkosten: " + stack.getRepairCost() + " Mana");
|
||||
|
||||
list.add(stack.getItem().getMaxAmount() == 1 ? "Nicht stapelbar" : "Stapelbar");
|
||||
if(stack.getItem().getMaxAmount() != 1)
|
||||
list.add("Stapelbar");
|
||||
|
||||
list.add("Gewicht: " + (stack.getSize() != 1 ? stack.getSize() * stack.getItem().getWeight() + "(" + stack.getSize() + "x " + stack.getItem().getWeight() + ")" : stack.getItem().getWeight()));
|
||||
list.add("Gewicht: " + (stack.getSize() != 1 ? (stack.getSize() * stack.getItem().getWeight()) + " (" + stack.getSize() + "x " + stack.getItem().getWeight() + ")" : stack.getItem().getWeight()));
|
||||
|
||||
if(stack.getItem().canBeHeld())
|
||||
list.add("Kann gehalten werden");
|
||||
if(stack.getItem().getCategory() != null)
|
||||
list.add("Kategorie: " + stack.getItem().getCategory());
|
||||
|
||||
list.add(Color.GRAY + ItemRegistry.getName(stack.getItem()));
|
||||
|
||||
|
|
|
@ -380,7 +380,7 @@ public class ItemRenderer
|
|||
}
|
||||
else if(this.itemToRender == null || this.itemToRender.getItem().canRenderHand())
|
||||
{
|
||||
this.renderPlayerArm(clientplayer, f, f1);
|
||||
this.renderPlayerArm(clientplayer, 0.0f, f1);
|
||||
}
|
||||
|
||||
GL15.glPopMatrix();
|
||||
|
|
|
@ -17,7 +17,7 @@ public enum Bind implements Identifyable, CVar {
|
|||
DOWN(BindCategory.MOVEMENT, "down", "Abwärts, Langsam", Keysym.LEFT_CONTROL),
|
||||
FAST(BindCategory.MOVEMENT, "fast", "Schneller", Keysym.LEFT_SHIFT),
|
||||
INVENTORY(BindCategory.INTERACTION, "inventory", "Inventar", Keysym.E),
|
||||
ITEMMODE(BindCategory.INTERACTION, "itemmode", "Platziermodus", Keysym.TAB),
|
||||
ITEMMODE(BindCategory.INTERACTION, "itemmode", "Kategorie", Keysym.TAB),
|
||||
PRIMARY(BindCategory.INTERACTION, "primary", "Primäre Aktion", Button.MOUSE_LEFT),
|
||||
SECONDARY(BindCategory.INTERACTION, "secondary", "Sekundäre Aktion", Button.MOUSE_RIGHT),
|
||||
TERTIARY(BindCategory.INTERACTION, "tertiary", "Tertiäre Aktion", Button.MOUSE_MIDDLE),
|
||||
|
|
|
@ -285,8 +285,8 @@ public class Item {
|
|||
return this.block != null ? this.block.getRadiation() * (float)stack.getSize() : 0.0f;
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return this.block != null;
|
||||
public ItemCategory getCategory() {
|
||||
return this.block != null ? ItemCategory.PLACEABLE : null;
|
||||
}
|
||||
|
||||
public WieldType getWieldType() {
|
||||
|
|
17
common/src/main/java/common/item/ItemCategory.java
Normal file
17
common/src/main/java/common/item/ItemCategory.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
package common.item;
|
||||
|
||||
public enum ItemCategory {
|
||||
USEABLE("Verwendbar"),
|
||||
CONSUMABLE("Einnehmbar"),
|
||||
PLACEABLE("Platzierbar");
|
||||
|
||||
private final String name;
|
||||
|
||||
private ItemCategory(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ import common.item.CheatTab;
|
|||
import common.item.Item;
|
||||
import common.item.ItemAction;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemFood extends Item
|
||||
|
@ -28,8 +29,8 @@ public class ItemFood extends Item
|
|||
this.setTab(CheatTab.FOOD);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.CONSUMABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,6 +8,7 @@ import common.item.CheatTab;
|
|||
import common.item.Item;
|
||||
import common.item.ItemAction;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.Clientside;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -18,8 +19,8 @@ public class ItemMilkBottle extends Item {
|
|||
this.setMagnetic();
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.CONSUMABLE;
|
||||
}
|
||||
|
||||
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityNPC playerIn) {
|
||||
|
|
|
@ -15,6 +15,7 @@ import common.item.Item;
|
|||
import common.item.ItemAction;
|
||||
import common.item.ItemControl;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.item.ItemWeight;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.LocalPos;
|
||||
|
@ -80,8 +81,8 @@ public class ItemPotion extends Item
|
|||
POTIONS.add(this);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.CONSUMABLE;
|
||||
}
|
||||
|
||||
public StatusEffect getEffect()
|
||||
|
|
|
@ -6,6 +6,7 @@ import common.init.Items;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.LocalPos;
|
||||
import common.util.HitPosition;
|
||||
import common.world.World;
|
||||
|
@ -18,8 +19,8 @@ public class ItemBottle extends Item
|
|||
this.setFragile();
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,6 +23,7 @@ import common.init.SoundEvent;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.tileentity.DeviceDispenser;
|
||||
import common.util.LocalPos;
|
||||
|
@ -133,8 +134,8 @@ public class ItemBucket extends Item
|
|||
}
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public BlockDynamicLiquid getLiquid() {
|
||||
|
|
|
@ -10,6 +10,7 @@ import common.init.Blocks;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.item.ItemWeight;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Facing;
|
||||
|
@ -35,8 +36,8 @@ public class ItemDye extends Item {
|
|||
DIES[this.color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public Color getColor() {
|
||||
|
|
|
@ -6,6 +6,7 @@ import common.entity.npc.EntityNPC;
|
|||
import common.init.Blocks;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Clientside;
|
||||
|
@ -40,8 +41,8 @@ public class ItemGrindedBones extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public static boolean applyBonemeal(ItemStack stack, World worldIn, LocalPos target)
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package common.item.material;
|
||||
|
||||
import common.item.Item;
|
||||
import common.item.ItemCategory;
|
||||
|
||||
public class ItemLure extends Item {
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import common.entity.npc.EntityNPC;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Facing;
|
||||
import common.world.World;
|
||||
|
@ -22,8 +23,8 @@ public class ItemSeeds extends Item
|
|||
this.setTab(CheatTab.MATERIALS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, LocalPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
|
|
|
@ -9,6 +9,7 @@ import common.init.SoundEvent;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Facing;
|
||||
import common.util.ParticleType;
|
||||
|
@ -26,8 +27,8 @@ public class ItemChargedOrb extends Item
|
|||
this.setFragile();
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)
|
||||
|
|
|
@ -10,6 +10,7 @@ import common.init.SoundEvent;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Facing;
|
||||
|
@ -53,8 +54,8 @@ public class ItemDie extends Item
|
|||
DICE.put(sides, this);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public int getSides() {
|
||||
|
|
|
@ -6,6 +6,7 @@ import common.init.SoundEvent;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.LocalPos;
|
||||
import common.util.ExtMath;
|
||||
|
@ -31,8 +32,8 @@ public class ItemDynamite extends Item {
|
|||
DYNAMITE[power] = this;
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public int getExplosionPower() {
|
||||
|
|
|
@ -6,6 +6,7 @@ import common.init.SoundEvent;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Facing;
|
||||
|
@ -21,8 +22,8 @@ public class ItemEgg extends Item
|
|||
this.setTab(CheatTab.TOOLS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,7 @@ import common.init.SoundEvent;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Facing;
|
||||
|
@ -22,8 +23,8 @@ public class ItemFireball extends Item
|
|||
this.setTab(CheatTab.TOOLS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,6 +6,7 @@ import common.init.SoundEvent;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Facing;
|
||||
|
@ -21,8 +22,8 @@ public class ItemSnowball extends Item
|
|||
this.setTab(CheatTab.TOOLS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,6 +10,7 @@ import common.init.Blocks;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.LocalPos;
|
||||
import common.util.BoundingBox;
|
||||
|
@ -29,8 +30,8 @@ public class ItemBoat extends Item
|
|||
this.setTab(CheatTab.VEHICLES);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,6 +17,7 @@ import common.init.EntityRegistry;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Clientside;
|
||||
import common.util.ExtMath;
|
||||
|
@ -41,8 +42,8 @@ public class ItemCharTemplate extends Item
|
|||
TEMPLATES.add(this);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public void delegateSetDisplay() {
|
||||
|
|
|
@ -8,6 +8,7 @@ import common.init.Blocks;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Facing;
|
||||
|
@ -26,8 +27,8 @@ public class ItemMinecart extends Item
|
|||
this.setMagnetic();
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,6 +15,7 @@ import common.init.EntityRegistry;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Clientside;
|
||||
import common.util.ExtMath;
|
||||
|
@ -39,8 +40,8 @@ public class ItemMobTemplate extends Item
|
|||
TEMPLATES.add(this);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public void delegateSetDisplay() {
|
||||
|
|
|
@ -4,6 +4,7 @@ import common.entity.npc.EntityNPC;
|
|||
import common.item.ItemControl;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Clientside;
|
||||
import common.world.World;
|
||||
|
@ -14,8 +15,8 @@ public class ItemCamera extends Item {
|
|||
this.setMagnetic();
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, LocalPos block) {
|
||||
|
|
|
@ -5,6 +5,7 @@ import common.item.CheatTab;
|
|||
import common.item.Item;
|
||||
import common.item.ItemControl;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.LocalPos;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -14,8 +15,8 @@ public class ItemEditor extends Item {
|
|||
this.setTab(CheatTab.TOOLS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, LocalPos block) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import common.init.SoundEvent;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Facing;
|
||||
|
@ -30,8 +31,8 @@ public class ItemFire extends Item
|
|||
this.setMagnetic();
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import common.init.SoundEvent;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.item.WieldType;
|
||||
import common.util.Clientside;
|
||||
import common.world.World;
|
||||
|
@ -18,8 +19,8 @@ public class ItemFishingRod extends Item
|
|||
this.setTab(CheatTab.TOOLS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
// /**
|
||||
|
|
|
@ -6,6 +6,7 @@ import common.init.Blocks;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.item.WieldType;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Facing;
|
||||
|
@ -20,8 +21,8 @@ public class ItemHoe extends Item
|
|||
this.setTab(CheatTab.TOOLS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, LocalPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package common.item.tool;
|
||||
|
||||
import common.item.Item;
|
||||
import common.item.ItemCategory;
|
||||
|
||||
public class ItemKey extends Item {
|
||||
public ItemKey() {
|
||||
this.setMagnetic();
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import common.entity.types.EntityLiving;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.LocalPos;
|
||||
import common.util.BoundingBox;
|
||||
import common.util.Facing;
|
||||
|
@ -20,8 +21,8 @@ public class ItemLead extends Item
|
|||
this.setTab(CheatTab.TOOLS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import common.entity.npc.EntityNPC;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.item.WieldType;
|
||||
import common.util.BoundingBox;
|
||||
import common.util.Vec3;
|
||||
|
@ -24,8 +25,8 @@ public class ItemMagnet extends Item {
|
|||
this.chicken = chicken;
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
// public boolean isFull3D() {
|
||||
|
|
|
@ -5,6 +5,7 @@ import common.entity.types.EntityLiving;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
|
||||
public class ItemNameTag extends Item
|
||||
{
|
||||
|
@ -13,8 +14,8 @@ public class ItemNameTag extends Item
|
|||
this.setTab(CheatTab.TOOLS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,6 +6,7 @@ import common.entity.types.EntityLiving;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
|
||||
public class ItemSaddle extends Item
|
||||
{
|
||||
|
@ -15,8 +16,8 @@ public class ItemSaddle extends Item
|
|||
this.setTab(CheatTab.TOOLS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,6 +6,7 @@ import common.entity.npc.EntityNPC;
|
|||
import common.item.Item;
|
||||
import common.item.ItemControl;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Clientside;
|
||||
import common.util.Color;
|
||||
|
@ -23,8 +24,8 @@ public class ItemSpaceNavigator extends Item {
|
|||
this.setMagnetic();
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public void setLocalTime(String local) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import common.item.CheatTab;
|
|||
import common.item.Item;
|
||||
import common.item.ItemAction;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.item.WieldType;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Clientside;
|
||||
|
@ -34,8 +35,8 @@ public class ItemTool extends Item {
|
|||
this.setFuelAmount(200);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
@Clientside
|
||||
|
|
|
@ -7,6 +7,7 @@ import common.item.CheatTab;
|
|||
import common.item.Item;
|
||||
import common.item.ItemControl;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.item.WieldType;
|
||||
import common.util.LocalPos;
|
||||
import common.util.Clientside;
|
||||
|
@ -23,8 +24,8 @@ public abstract class ItemWand extends Item {
|
|||
this.setTab(CheatTab.TOOLS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public final boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, LocalPos block) {
|
||||
|
|
|
@ -4,6 +4,7 @@ import common.entity.npc.EntityNPC;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.Color;
|
||||
import common.world.Weather;
|
||||
import common.world.World;
|
||||
|
@ -20,8 +21,8 @@ public class ItemWeatherToken extends Item {
|
|||
this.setMagnetic();
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)
|
||||
|
|
|
@ -5,6 +5,7 @@ import common.entity.npc.EntityNPC;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.item.WieldType;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -16,8 +17,8 @@ public class ItemWhip extends Item
|
|||
this.setMaxDamage(35);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)
|
||||
|
|
|
@ -10,6 +10,7 @@ import common.item.CheatTab;
|
|||
import common.item.Item;
|
||||
import common.item.ItemAction;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.item.WieldType;
|
||||
import common.util.Clientside;
|
||||
import common.world.World;
|
||||
|
@ -22,8 +23,8 @@ public class ItemBow extends Item
|
|||
this.setTab(CheatTab.WEAPONS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,6 +6,7 @@ import common.init.SoundEvent;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.util.Color;
|
||||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
@ -18,8 +19,8 @@ public class ItemExterminator extends Item {
|
|||
this.setMagnetic();
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityNPC player) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import common.item.CheatTab;
|
|||
import common.item.Item;
|
||||
import common.item.ItemAction;
|
||||
import common.item.ItemStack;
|
||||
import common.item.ItemCategory;
|
||||
import common.item.WieldType;
|
||||
import common.rng.Random;
|
||||
import common.util.Clientside;
|
||||
|
@ -26,8 +27,8 @@ public abstract class ItemGunBase extends Item
|
|||
this.setTab(CheatTab.WEAPONS);
|
||||
}
|
||||
|
||||
public boolean canBeHeld() {
|
||||
return true;
|
||||
public ItemCategory getCategory() {
|
||||
return ItemCategory.USEABLE;
|
||||
}
|
||||
|
||||
@Clientside
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue