Skip to content

Commit

Permalink
Updated to 1.11, Icons are broken
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkGuardsman committed Jun 21, 2017
1 parent f2dcccd commit 91dd738
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -23,7 +23,7 @@ plugins {
id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "1.45"
}

apply from: 'https://raw.githubusercontent.com/BuiltBrokenModding/BuiltBrokenScripts/1.10.2/index/index.gradle'
apply from: 'https://raw.githubusercontent.com/BuiltBrokenModding/BuiltBrokenScripts/1.11/index/index.gradle'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'jacoco'

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
@@ -1,6 +1,6 @@
version_major=0
version_minor=0
version_revis=4
version_revis=5
archivebase=SBM-BagablePlants
groupid=sbm-bagableplants
org=builtbroken
Expand Down
Expand Up @@ -93,7 +93,7 @@ public static boolean register(ResourceLocation name, InteractionHandler handler
public void preInit(FMLPreInitializationEvent event)
{
itemBag = new ItemBag();
GameRegistry.registerItem(itemBag, "bpPlantBag");
GameRegistry.register(itemBag, new ResourceLocation("bagableplants", "bpPlantBag"));
proxy.preInit();
}

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/com/builtbroken/bagableplants/ItemBag.java
Expand Up @@ -56,8 +56,9 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
}

@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos clickPos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos clickPos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
{
ItemStack stack = player.getHeldItem(hand);
ItemStack blockStack = getBlockStack(stack);
if (blockStack == null)
{
Expand All @@ -73,7 +74,7 @@ public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World wo
{
if (!world.isRemote)
{
if (copy == null || copy.stackSize <= 0)
if (copy == null || copy.getCount() <= 0)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, result);
}
Expand Down Expand Up @@ -149,7 +150,7 @@ public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World wo
}
else if (!world.isRemote)
{
player.addChatComponentMessage(new TextComponentTranslation(getUnlocalizedName() + ".cantPlace.name"));
player.sendMessage(new TextComponentTranslation(getUnlocalizedName() + ".cantPlace.name"));
}
return EnumActionResult.SUCCESS;
}
Expand Down Expand Up @@ -188,7 +189,7 @@ public static ItemStack getBlockStack(ItemStack bag)
{
return null;
}
return ItemStack.loadItemStackFromNBT(bag.getTagCompound().getCompoundTag("data"));
return new ItemStack(bag.getTagCompound().getCompoundTag("data"));
}

/**
Expand Down
Expand Up @@ -36,21 +36,21 @@ public ItemStack pickupBlock(World world, BlockPos pos, ItemStack bagStack)
{
Block block = world.getBlockState(pos).getBlock();
ItemStack stack = bagStack.copy();
stack.stackSize = 1;
stack.setCount(1);
if (block == Blocks.REEDS)
{
NBTTagCompound nbt = new NBTTagCompound();
nbt.setInteger("count", breakAndGetCount(world, pos, Blocks.REEDS));
ItemBag.encodeBlock(stack, new ItemStack(Items.REEDS), nbt);
bagStack.stackSize--;
bagStack.setCount(bagStack.getCount() - 1);
return stack;
}
else if (block == Blocks.CACTUS)
{
NBTTagCompound nbt = new NBTTagCompound();
nbt.setInteger("count", breakAndGetCount(world, pos, Blocks.CACTUS));
ItemBag.encodeBlock(stack, new ItemStack(Blocks.CACTUS), nbt);
bagStack.stackSize--;
bagStack.setCount(bagStack.getCount() - 1);
return stack;
}
return bagStack;
Expand Down

0 comments on commit 91dd738

Please sign in to comment.