item texture rework temp 2

This commit is contained in:
Sen 2025-07-26 16:59:10 +02:00
parent 28b26d4881
commit 22b73973c4
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
113 changed files with 136 additions and 191 deletions

View file

@ -174,16 +174,9 @@ public class EntityAIControlledByPlayer extends EntityAIBase
{
ItemStack itemstack = entityplayer.getHeldItem();
if (itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick)
if (itemstack != null && itemstack.getItem() == Items.whip)
{
itemstack.damage(1, entityplayer);
if (itemstack.isEmpty())
{
ItemStack itemstack1 = new ItemStack(Items.fishing_rod);
itemstack1.copyData(itemstack);
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = itemstack1;
}
}
}

View file

@ -31,7 +31,7 @@ public class BlockPotato extends BlockCrops
{
if (((Integer)state.getValue(AGE)).intValue() >= 7 && worldIn.rand.chance(50))
{
dropItem(worldIn, pos, new ItemStack(Items.poisonous_potato));
dropItem(worldIn, pos, new ItemStack(Items.stick));
}
}
}

View file

@ -80,7 +80,7 @@ public class BlockWart extends BlockBush
for (int j = 0; j < i; ++j)
{
dropItem(worldIn, pos, new ItemStack(Items.soul_wart));
dropItem(worldIn, pos, new ItemStack(Items.soul_seed));
}
}
}

View file

@ -20,7 +20,7 @@ public enum DyeColor implements Identifyable, Displayable {
PURPLE("purple", "Violett", "Violettes", "Violetter", "Violette", null, "Violetter Farbstoff", 8339378, TextColor.DMAGENTA),
BLUE("blue", "Blau", "Blaues", "Blauer", "Blaue", "lapis_lazuli", "Lapislazuli", 3361970, TextColor.MIDNIGHT),
BROWN("brown", "Braun", "Braunes", "Brauner", "Braune", "cocoa_powder", "Gemahlene Kakaobohnen", 6704179, TextColor.BROWN),
GREEN("green", "Grün", "Grünes", "Grüner", "Grüne", "cactus_green", "Kaktusgrün", 6717235, TextColor.DGREEN),
GREEN("green", "Grün", "Grünes", "Grüner", "Grüne", null, "Kaktusgrün", 6717235, TextColor.DGREEN),
RED("red", "Rot", "Rotes", "Roter", "Rote", null, "Roter Farbstoff", 10040115, TextColor.DRED),
BLACK("black", "Schwarz", "Schwarzes", "Schwarzer", "Schwarze", "ink_sack", "Tintenbeutel", 1644825, TextColor.BLACK);

View file

@ -830,7 +830,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic {
j = 60;
k = 3;
}
else if (itemstack.getItem() == Items.golden_carrot)
else if (itemstack.getItem() == Items.carrot)
{
hp = 4;
j = 60;

View file

@ -34,7 +34,6 @@ public class EntityPig extends EntityAnimal
this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
this.tasks.addTask(2, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.3F));
this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot_on_a_stick, false));
this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot, false));
this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D));
this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
@ -56,7 +55,7 @@ public class EntityPig extends EntityAnimal
public boolean canBeSteered()
{
ItemStack itemstack = ((EntityNPC)this.passenger).getHeldItem();
return itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick;
return itemstack != null && itemstack.getItem() == Items.whip;
}
protected void entityInit()

View file

@ -63,7 +63,7 @@ public class EntityRabbit extends EntityAnimal {
this.navigator.setHeightRequirement(2.5F);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityRabbit.AIPanic(this, 1.33D));
this.tasks.addTask(2, new EntityAITempt(this, 1.0D, stack -> stack.getItem() == Items.carrot || stack.getItem() == Items.golden_carrot || stack.getItem().getBlock() instanceof BlockFlower, false));
this.tasks.addTask(2, new EntityAITempt(this, 1.0D, stack -> stack.getItem() == Items.carrot || stack.getItem().getBlock() instanceof BlockFlower, false));
this.tasks.addTask(3, new EntityAIMate(this, 0.8D) {
protected int getMatingCooldown() {
return EntityRabbit.this.rand.excl(50, 200);
@ -265,7 +265,7 @@ public class EntityRabbit extends EntityAnimal {
}
private boolean isRabbitBreedingItem(Item itemIn) {
return itemIn == Items.carrot || itemIn == Items.golden_carrot || itemIn.getBlock() instanceof BlockFlower;
return itemIn == Items.carrot || itemIn.getBlock() instanceof BlockFlower;
}
public EntityRabbit createChild(EntityLiving ageable) {

View file

@ -302,6 +302,7 @@ public abstract class BlockRegistry {
registerFluid("blood", "Blut", false, LiquidType.COLD, false, 0, 10, 0.0f, 2, 1);
registerFluid("spring_water", "Klares Wasser", true, LiquidType.COLD, false, 0, 5, 0.0f, 1, 1);
registerFluid("swamp_water", "Sumpfwasser", true, LiquidType.COLD, false, 0, 5, 0.0f, TextureAnimation.SWAMP_WATER_STILL, TextureAnimation.SWAMP_WATER_FLOW);
registerFluid("milk", "Milch", false, LiquidType.COLD, true, 0, 5, 0.0f, 1, 1);
register("coal_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setSound(SoundType.STONE).setDisplay("Steinkohle"));
@ -471,7 +472,7 @@ public abstract class BlockRegistry {
register("wheats", (new BlockCrops()).setDisplay("Getreide"));
register("carrots", (new BlockCarrot()).setDisplay("Karotten"));
register("potatoes", (new BlockPotato()).setDisplay("Kartoffeln"));
register("soul_warts", (new BlockWart()).setDisplay("Seelenwarze"));
register("soul_grass", (new BlockWart()).setDisplay("Seelenwarze"));

View file

@ -459,7 +459,7 @@ public abstract class Blocks {
public static final BlockMetalOre sodium_ore = get("sodium_ore");
public static final BlockSoulFire soul_fire = get("soul_fire");
public static final BlockSoulSand soul_sand = get("soul_sand");
public static final BlockWart soul_warts = get("soul_warts");
public static final BlockWart soul_grass = get("soul_grass");
public static final Block sponge = get("sponge");
public static final BlockStaticLiquid spring_water = get("spring_water");
public static final BlockDoor spruce_door = get("spruce_door");
@ -615,6 +615,8 @@ public abstract class Blocks {
public static final BlockPortal light_portal = get("light_portal");
public static final BlockPortal radiating_portal = get("radiating_portal");
public static final BlockPortal shining_portal = get("shining_portal");
public static final BlockStaticLiquid milk = get("milk");
public static final BlockDynamicLiquid flowing_milk = get("flowing_milk");
private static <T extends Block> T get(String id) {
T block = (T)BlockRegistry.byNameExact(id);

View file

@ -195,6 +195,7 @@ public abstract class CraftingRegistry
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA), 2), Items.syringa);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED), 2), Items.rose_bush);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.PINK), 2), Items.paeonia);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.GREEN)), Items.cactus);
for (DyeColor color : DyeColor.values())
{
@ -262,7 +263,7 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.iron_door, 3), "##", "##", "##", '#', Items.iron_ingot);
add(new ItemStack(Items.iron_trapdoor, 1), "##", "##", '#', Items.iron_ingot);
add(new ItemStack(Items.cake, 1), "AAA", "BEB", "CCC", 'A', Items.milk_bucket, 'B', Items.sugar, 'C', Items.wheat, 'E', Items.egg);
add(new ItemStack(Items.cake, 1), "AAA", "BEB", "CCC", 'A', Items.milk_bottle, 'B', Items.sugar, 'C', Items.wheat, 'E', Items.egg);
add(new ItemStack(Items.sugar, 1), "#", '#', Items.reeds);
add(new ItemStack(Items.torch, 4), "X", "#", 'X', Items.coal, '#', Items.stick);
@ -278,7 +279,7 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.bread, 1), "###", '#', Items.wheat);
add(new ItemStack(Items.fishing_rod, 1), " #", " #X", "# X", '#', Items.stick, 'X', Items.string);
add(new ItemStack(Items.carrot_on_a_stick, 1), "# ", " X", '#', Items.fishing_rod, 'X', Items.carrot);
add(new ItemStack(Items.whip, 1), "# ", " X", '#', Items.stick, 'X', Items.string);
add(new ItemStack(Items.cobblestone_stairs, 4), "# ", "## ", "###", '#', Items.cobblestone);
add(new ItemStack(Items.brick_stairs, 4), "# ", "## ", "###", '#', Items.brick_block);
add(new ItemStack(Items.stonebrick_stairs, 4), "# ", "## ", "###", '#', Items.stonebrick);
@ -287,7 +288,6 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.quartz_stairs, 4), "# ", "## ", "###", '#', Items.quartz_block);
add(new ItemStack(Items.golden_apple, 1), "###", "#X#", "###", '#', Items.gold_ingot, 'X', Items.apple);
add(new ItemStack(Items.charged_apple, 1), "###", "#X#", "###", '#', Items.gold_block, 'X', Items.apple);
add(new ItemStack(Items.golden_carrot, 1), "###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.carrot);
add(new ItemStack(Items.lever, 1), "X", "#", '#', Items.cobblestone, 'X', Items.stick);
add(new ItemStack(Items.navigator, 1), " # ", "#X#", " # ", '#', Items.iron_ingot, 'X', Items.charged_powder);
add(new ItemStack(Items.stone_button, 1), "#", '#', Items.stone);

View file

@ -27,7 +27,7 @@ import common.item.Item;
import common.item.ItemStack;
import common.item.StackSize;
import common.item.consumable.ItemAppleGold;
import common.item.consumable.ItemBucketMilk;
import common.item.consumable.ItemMilkBottle;
import common.item.consumable.ItemFishFood;
import common.item.consumable.ItemFood;
import common.item.consumable.ItemPotion;
@ -54,7 +54,7 @@ import common.item.spawner.ItemMobTemplate;
import common.item.spawner.ItemCharTemplate;
import common.item.tool.ItemAxe;
import common.item.tool.ItemCamera;
import common.item.tool.ItemCarrotOnAStick;
import common.item.tool.ItemWhip;
import common.item.tool.ItemEditor;
import common.item.tool.ItemFishingRod;
import common.item.tool.ItemFire;
@ -177,7 +177,6 @@ public abstract class ItemRegistry {
register("recursive_" + BlockRegistry.getName(liquid.first()) +
"_bucket", new ItemBucket(liquid.second(), true));
}
register("milk_bucket", (new ItemBucketMilk()).setDisplay("Milch").setContainerItem(bucket));
register("boat", (new ItemBoat()).setDisplay("Boot"));
register("minecart", (new ItemMinecart()).setDisplay("Lore"));
@ -280,13 +279,15 @@ public abstract class ItemRegistry {
register("demon_rod", (new Item()).setDisplay("Dämonenrute").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XL));
register("gold_coin", (new Item()).setDisplay("Goldmünze").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XL));
register("gold_nugget", (new Item()).setDisplay("Goldnugget").setTab(CheatTab.METALS).setMaxAmount(StackSize.XL));
register("bottle", (new ItemBottle()).setDisplay("Flasche"));
Item bottle;
register("bottle", (bottle = new ItemBottle()).setDisplay("Flasche"));
for(Pair<String, Effect> pot : ItemPotion.getBasePotions()) {
register(pot.first(), new ItemPotion(pot.second(), null));
}
for(Pair<String, StatusEffect> pot : ItemPotion.getBrewedPotions()) {
register(pot.first(), new ItemPotion(pot.second().getPotion(), pot.second()));
}
register("milk_bottle", (new ItemMilkBottle()).setDisplay("Flasche mit Milch").setContainerItem(bottle));
register("eye", (new ItemFood(2, false)).setPotionEffect(Effect.POISON, 5, 0, 1.0F).setDisplay("Auge")
.setMaxAmount(StackSize.L));
register("blazing_powder", (new Item()).setDisplay("Schillernder Staub")
@ -300,14 +301,11 @@ public abstract class ItemRegistry {
register("carrot", new ItemSeedFood(3, Blocks.carrots, Blocks.farmland).setDisplay("Karotte").setMaxAmount(StackSize.L));
register("potato", new ItemSeedFood(1, Blocks.potatoes, Blocks.farmland).setDisplay("Kartoffel").setMaxAmount(StackSize.L));
register("wheat_seed", new ItemSeeds(Blocks.wheats, Blocks.farmland).setDisplay("Weizenkörner").setMaxAmount(StackSize.XL));
register("soul_wart", new ItemSeeds(Blocks.soul_warts, Blocks.soul_sand).setDisplay("Seelenwarze").setMaxAmount(StackSize.L));
register("soul_seed", new ItemSeeds(Blocks.soul_grass, Blocks.soul_sand).setDisplay("Seelenwarze").setMaxAmount(StackSize.L));
register("pumpkin_seed", new ItemSeeds(Blocks.pumpkin_stem, Blocks.farmland).setDisplay("Kürbiskerne").setMaxAmount(StackSize.XL));
register("melon_seed", new ItemSeeds(Blocks.melon_stem, Blocks.farmland).setDisplay("Melonenkerne").setMaxAmount(StackSize.XL));
register("baked_potato", (new ItemFood(5, false)).setDisplay("Ofenkartoffel").setMaxAmount(StackSize.L));
register("poisonous_potato", (new ItemFood(2, false)).setPotionEffect(Effect.POISON, 5, 0, 0.6F).setDisplay("Giftige Kartoffel").setMaxAmount(StackSize.L));
register("golden_carrot", (new ItemFood(6, false)).setDisplay("Goldene Karotte"));
register("carrot_on_a_stick", (new ItemCarrotOnAStick()).setDisplay("Karottenrute"));
register("whip", (new ItemWhip()).setDisplay("Peitsche"));
register("charge_crystal", (new Item()).setDisplay("Energiekristall").setTab(CheatTab.MISC).setColor(TextColor.DMAGENTA).setGleaming());
for(Enchantment ench : Enchantment.values()) {
register("enchanted_book_" + ench.getName(), (new ItemEnchantedBook(ench, 1)).setUnstackable().setDisplay("Verzaubertes Buch mit " + ench.getFormattedName(1)).setTab(CheatTab.ENCHANTMENTS));

View file

@ -12,7 +12,7 @@ import common.collect.Lists;
import common.collect.Sets;
import common.item.*;
import common.item.consumable.ItemAppleGold;
import common.item.consumable.ItemBucketMilk;
import common.item.consumable.ItemMilkBottle;
import common.item.consumable.ItemFishFood;
import common.item.consumable.ItemFood;
import common.item.consumable.ItemPotion;
@ -39,7 +39,7 @@ import common.item.spawner.ItemMobTemplate;
import common.item.spawner.ItemCharTemplate;
import common.item.tool.ItemAxe;
import common.item.tool.ItemCamera;
import common.item.tool.ItemCarrotOnAStick;
import common.item.tool.ItemWhip;
import common.item.tool.ItemEditor;
import common.item.tool.ItemFishingRod;
import common.item.tool.ItemFire;
@ -109,7 +109,6 @@ public abstract class Items {
public static final ItemMetal arsenic_powder = get("arsenic_powder");
public static final Item ash = get("ash");
public static final Item assembly_unit = get("assembly_unit");
public static final ItemFood baked_potato = get("baked_potato");
public static final ItemBanHammer banhammer = get("banhammer");
public static final Item effect_generator = get("effect_generator");
public static final Item bedrock = get("bedrock");
@ -208,14 +207,14 @@ public abstract class Items {
public static final ItemBucket bucket = get("bucket");
public static final ItemFire burning_soul = get("burning_soul");
public static final Item cactus = get("cactus");
public static final ItemDye cactus_green = get("cactus_green");
public static final ItemDye green_dye = get("green_dye");
public static final Item cake = get("cake");
public static final Item calcium_block = get("calcium_block");
public static final Item calcium_ore = get("calcium_ore");
public static final ItemMetal calcium_powder = get("calcium_powder");
public static final ItemCamera camera = get("camera");
public static final ItemSeedFood carrot = get("carrot");
public static final ItemCarrotOnAStick carrot_on_a_stick = get("carrot_on_a_stick");
public static final ItemWhip whip = get("whip");
public static final Item carved_sandstone = get("carved_sandstone");
public static final Item carved_stonebrick = get("carved_stonebrick");
public static final Item cauldron = get("cauldron");
@ -377,7 +376,6 @@ public abstract class Items {
public static final ItemSword gold_sword = get("gold_sword");
public static final ItemAppleGold golden_apple = get("golden_apple");
public static final ItemAppleGold charged_apple = get("charged_apple");
public static final ItemFood golden_carrot = get("golden_carrot");
public static final ItemBucket goo_bucket = get("goo_bucket");
public static final Item grass = get("grass");
public static final Item gravel = get("gravel");
@ -507,7 +505,7 @@ public abstract class Items {
public static final Item melon_block = get("melon_block");
public static final ItemSeeds melon_seed = get("melon_seed");
public static final ItemBucket mercury_bucket = get("mercury_bucket");
public static final ItemBucketMilk milk_bucket = get("milk_bucket");
public static final ItemMilkBottle milk_bottle = get("milk_bottle");
public static final ItemMinecart minecart = get("minecart");
public static final Item mob_spawner = get("mob_spawner");
public static final Item moon_cheese = get("moon_cheese");
@ -588,7 +586,6 @@ public abstract class Items {
public static final ItemMetal plutonium_ingot = get("plutonium_ingot");
public static final Item plutonium_ore = get("plutonium_ore");
public static final Item podzol = get("podzol");
public static final ItemFood poisonous_potato = get("poisonous_potato");
public static final Item poppy = get("poppy");
public static final ItemFood porkchop = get("porkchop");
public static final Item portal_frame = get("portal_frame");
@ -699,7 +696,7 @@ public abstract class Items {
public static final Item sodium_ore = get("sodium_ore");
public static final ItemMetal sodium_powder = get("sodium_powder");
public static final Item soul_sand = get("soul_sand");
public static final ItemSeeds soul_wart = get("soul_wart");
public static final ItemSeeds soul_seed = get("soul_seed");
public static final ItemFood eye = get("eye");
public static final Item sponge = get("sponge");
public static final ItemBucket spring_water_bucket = get("spring_water_bucket");
@ -995,6 +992,8 @@ public abstract class Items {
public static final Item swamp_oak_stairs = get("swamp_oak_stairs");
public static final Item swamp_vine = get("swamp_vine");
public static final Item swamp = get("swamp");
public static final ItemBucket milk_bucket = get("milk_bucket");
public static final ItemBucket recursive_milk_bucket = get("recursive_milk_bucket");
private static <T extends Item> T get(String id) {
T item = (T)ItemRegistry.byName(id);

View file

@ -31,8 +31,6 @@ public abstract class SmeltingRegistry
add(Items.stonebrick, new ItemStack(Items.cracked_stonebrick), 0.1F);
add(Items.clay_lump, new ItemStack(Items.brick), 0.3F);
add(Items.clay, new ItemStack(Items.hardened_clay), 0.35F);
add(Items.cactus, new ItemStack(Items.cactus_green), 0.2F);
add(Items.potato, new ItemStack(Items.baked_potato), 0.35F);
add(Items.hellrock, new ItemStack(Items.bloodbrick), 0.1F);
for (ItemFishFood.FishType fish : ItemFishFood.FishType.values())

View file

@ -1,73 +0,0 @@
package common.item.consumable;
import java.util.Map;
import common.attributes.Attribute;
import common.attributes.UsageSlot;
import common.entity.npc.EntityNPC;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemAction;
import common.item.ItemStack;
import common.world.World;
public class ItemBucketMilk extends Item
{
public ItemBucketMilk()
{
this.setUnstackable();
this.setTab(CheatTab.TOOLS);
this.setMagnetic();
}
/**
* Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using
* the Item before the action is complete.
*/
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityNPC playerIn)
{
// if (!playerIn.creative)
// {
stack.decrSize();
// }
if (!worldIn.client)
{
playerIn.clearEffects(false);
}
// playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]);
return stack.isEmpty() ? new ItemStack(Items.bucket) : stack;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack stack)
{
return 32;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
public ItemAction getItemUseAction()
{
return ItemAction.DRINK;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)
{
playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn));
return itemStackIn;
}
public void getModifiers(Map<Attribute, Float> map, UsageSlot slot)
{
if(slot == null || slot == UsageSlot.INVENTORY)
map.put(Attribute.RADIATION, -5.0f);
}
}

View file

@ -0,0 +1,50 @@
package common.item.consumable;
import java.util.Map;
import common.attributes.Attribute;
import common.attributes.UsageSlot;
import common.entity.npc.EntityNPC;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemAction;
import common.item.ItemStack;
import common.util.Clientside;
import common.world.World;
public class ItemMilkBottle extends Item {
public ItemMilkBottle() {
this.setUnstackable();
this.setTab(CheatTab.FOOD);
this.setMagnetic();
}
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityNPC playerIn) {
stack.decrSize();
if(!worldIn.client)
playerIn.clearEffects(false);
return stack;
}
public int getMaxItemUseDuration(ItemStack stack) {
return 32;
}
public ItemAction getItemUseAction() {
return ItemAction.DRINK;
}
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn) {
playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn));
return itemStackIn;
}
public void getModifiers(Map<Attribute, Float> map, UsageSlot slot) {
if(slot == null || slot == UsageSlot.INVENTORY)
map.put(Attribute.RADIATION, -2.0f);
}
@Clientside
public String[] getTextures(String name) {
return new String[] {"potion_overlay", "bottle"};
}
}

View file

@ -8,6 +8,8 @@ import java.util.Map;
import java.util.Queue;
import java.util.Set;
import common.attributes.Attribute;
import common.attributes.UsageSlot;
import common.block.Block;
import common.block.Material;
import common.block.liquid.BlockDynamicLiquid;
@ -134,6 +136,11 @@ public class ItemBucket extends Item
return this.liquid;
}
public void getModifiers(Map<Attribute, Float> map, UsageSlot slot) {
if(this.liquid == Blocks.flowing_milk && (slot == null || slot == UsageSlot.INVENTORY))
map.put(Attribute.RADIATION, -5.0f);
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
@ -321,7 +328,7 @@ public class ItemBucket extends Item
@Clientside
public String[] getTextures(String name) {
return super.getTextures(this.recursive ? name.substring("recursive_".length()) : name);
return this.liquid == null ? new String[] {"bucket"} : new String[] {"bucket", name.substring(this.recursive ? "recursive_".length() : 0, name.length() - "_bucket".length())};
}
@Serverside

View file

@ -1,67 +0,0 @@
package common.item.tool;
import common.entity.animal.EntityPig;
import common.entity.npc.EntityNPC;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemStack;
import common.item.WieldType;
import common.world.World;
public class ItemCarrotOnAStick extends Item
{
public ItemCarrotOnAStick()
{
this.setTab(CheatTab.TOOLS);
this.setMaxDamage(25);
}
// /**
// * Returns True is the item is renderer in full 3D when hold.
// */
// public boolean isFull3D()
// {
// return true;
// }
// /**
// * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities
// * hands.
// */
// public boolean shouldRotateAroundWhenRendering()
// {
// return true;
// }
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)
{
if (playerIn.isRiding() && playerIn.vehicle instanceof EntityPig)
{
EntityPig entitypig = (EntityPig)playerIn.vehicle;
if (entitypig.getAIControlledByPlayer().isControlledByPlayer() && itemStackIn.getMaxDamage() - itemStackIn.getItemDamage() >= 7)
{
entitypig.getAIControlledByPlayer().boostSpeed();
itemStackIn.damage(7, playerIn);
if (itemStackIn.isEmpty())
{
ItemStack itemstack = new ItemStack(Items.fishing_rod);
itemstack.copyData(itemStackIn);
return itemstack;
}
}
}
// playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]);
return itemStackIn;
}
public WieldType getWieldType() {
return WieldType.TOOL_FLIP;
}
}

View file

@ -0,0 +1,38 @@
package common.item.tool;
import common.entity.animal.EntityPig;
import common.entity.npc.EntityNPC;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemStack;
import common.item.WieldType;
import common.world.World;
public class ItemWhip extends Item
{
public ItemWhip()
{
this.setTab(CheatTab.TOOLS);
this.setMaxDamage(35);
}
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)
{
if (playerIn.isRiding() && playerIn.vehicle instanceof EntityPig)
{
EntityPig entitypig = (EntityPig)playerIn.vehicle;
if (entitypig.getAIControlledByPlayer().isControlledByPlayer() && itemStackIn.getMaxDamage() - itemStackIn.getItemDamage() >= 7)
{
entitypig.getAIControlledByPlayer().boostSpeed();
itemStackIn.damage(7, playerIn);
}
}
return itemStackIn;
}
public WieldType getWieldType() {
return WieldType.TOOL_FLIP;
}
}