mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 16:58:34 +01:00
Fixed bowls of water being hideous because they weren't going into the main hand
This commit is contained in:
parent
4bf0fce0d2
commit
a0f66373b6
1 changed files with 5 additions and 1 deletions
|
@ -42,6 +42,7 @@ public class ItemWaterBowl extends ItemBase{
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onPlayerInteractEvent(PlayerInteractEvent event){
|
public void onPlayerInteractEvent(PlayerInteractEvent event){
|
||||||
|
System.out.println("ACTIVE");
|
||||||
if(event.getWorld() != null){
|
if(event.getWorld() != null){
|
||||||
if(ConfigBoolValues.WATER_BOWL.isEnabled()){
|
if(ConfigBoolValues.WATER_BOWL.isEnabled()){
|
||||||
if(event.getItemStack() != null && event.getItemStack().getItem() == Items.BOWL){
|
if(event.getItemStack() != null && event.getItemStack().getItem() == Items.BOWL){
|
||||||
|
@ -60,7 +61,10 @@ public class ItemWaterBowl extends ItemBase{
|
||||||
event.getItemStack().stackSize--;
|
event.getItemStack().stackSize--;
|
||||||
|
|
||||||
ItemStack bowl = new ItemStack(InitItems.itemWaterBowl);
|
ItemStack bowl = new ItemStack(InitItems.itemWaterBowl);
|
||||||
if(!event.getEntityPlayer().inventory.addItemStackToInventory(bowl.copy())){
|
if(event.getItemStack().stackSize <= 0){
|
||||||
|
event.getEntityPlayer().setHeldItem(event.getHand(), bowl);
|
||||||
|
}
|
||||||
|
else if(!event.getEntityPlayer().inventory.addItemStackToInventory(bowl.copy())){
|
||||||
EntityItem entityItem = new EntityItem(event.getWorld(), event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ, bowl.copy());
|
EntityItem entityItem = new EntityItem(event.getWorld(), event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ, bowl.copy());
|
||||||
entityItem.setPickupDelay(0);
|
entityItem.setPickupDelay(0);
|
||||||
event.getWorld().spawnEntityInWorld(entityItem);
|
event.getWorld().spawnEntityInWorld(entityItem);
|
||||||
|
|
Loading…
Reference in a new issue