diff --git a/src/main/java/uk/co/wehavecookies56/bonfires/CommandBonfires.java b/src/main/java/uk/co/wehavecookies56/bonfires/CommandBonfires.java index 1989bc9..5e8e796 100644 --- a/src/main/java/uk/co/wehavecookies56/bonfires/CommandBonfires.java +++ b/src/main/java/uk/co/wehavecookies56/bonfires/CommandBonfires.java @@ -4,7 +4,6 @@ import com.google.common.base.Function; import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; -import net.minecraft.client.resources.I18n; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; @@ -91,7 +90,7 @@ public String getUsage(ICommandSender sender) { public static void listQueriedBonfires(List query, ICommandSender sender) { query.forEach((bonfires -> { GameProfile owner = sender.getServer().getPlayerProfileCache().getProfileByUUID(bonfires.getOwner()); - String name = I18n.format(LocalStrings.COMMAND_NA); + String name = new TextComponentTranslation(LocalStrings.COMMAND_NA).getUnformattedComponentText(); if(owner != null) { name = owner.getName(); } diff --git a/src/main/java/uk/co/wehavecookies56/bonfires/blocks/BlockAshBonePile.java b/src/main/java/uk/co/wehavecookies56/bonfires/blocks/BlockAshBonePile.java index 1aa97c8..e59f1b4 100644 --- a/src/main/java/uk/co/wehavecookies56/bonfires/blocks/BlockAshBonePile.java +++ b/src/main/java/uk/co/wehavecookies56/bonfires/blocks/BlockAshBonePile.java @@ -41,6 +41,7 @@ public class BlockAshBonePile extends Block implements ITileEntityProvider { public static final PropertyDirection FACING = BlockHorizontal.FACING; public static final PropertyBool LIT = PropertyBool.create("lit"); + boolean dropFragment = false; public BlockAshBonePile(Material blockMaterialIn) { super(blockMaterialIn); @@ -82,7 +83,10 @@ public EnumBlockRenderType getRenderType(IBlockState state) { public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { List stacks = new ArrayList<>(); stacks.add(new ItemStack(getItemDropped(state, new Random(), fortune))); - stacks.add(new ItemStack(Bonfires.coiledSwordFragment)); + if (dropFragment) { + stacks.add(new ItemStack(Bonfires.coiledSwordFragment)); + dropFragment = false; + } return stacks; } @@ -161,6 +165,9 @@ public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState st public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { TileEntityBonfire te = (TileEntityBonfire) worldIn.getTileEntity(pos); if (te != null) { + if (te.isBonfire()) { + dropFragment = true; + } if (te.isLit()) { te.destroyBonfire(te.getID()); BonfireRegistry.INSTANCE.removeBonfire(te.getID()); @@ -178,11 +185,16 @@ public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random ra @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { - if (state.getValue(LIT)) { - return new AxisAlignedBB(0.2, 0, 0.2, 0.8, 1.0, 0.8); - } else { - return new AxisAlignedBB(0.2, 0, 0.2, 0.8, 0.2, 0.8); + if (source.getTileEntity(pos) != null) { + if (source.getTileEntity(pos) instanceof TileEntityBonfire) { + if (((TileEntityBonfire)source.getTileEntity(pos)).isBonfire()) { + return new AxisAlignedBB(0.2, 0, 0.2, 0.8, 1.0, 0.8); + } else { + return new AxisAlignedBB(0.2, 0, 0.2, 0.8, 0.2, 0.8); + } + } } + return new AxisAlignedBB(0.2, 0, 0.2, 0.8, 0.2, 0.8); } @Override diff --git a/src/main/resources/assets/bonfires/lang/en_US.lang b/src/main/resources/assets/bonfires/lang/en_US.lang index 6af7d58..1b90811 100644 --- a/src/main/resources/assets/bonfires/lang/en_US.lang +++ b/src/main/resources/assets/bonfires/lang/en_US.lang @@ -21,7 +21,7 @@ command.radius.match=Found %1$s bonfire(s) within a radius of %2$s blocks command.radius.nomatch=No bonfires found within a radius of %1$s blocks command.radius.invalid=Error: '%1$s' is not a valid radius command.filter.invalid=Not a valid filter. Use /bonfires filters for the list of filters -command.bonfires.usage=Usage: /bonfires , /bonfires filters to display list of filters +command.bonfires.usage=Usage: /bonfires [parameter], /bonfires filters to display list of filters command.all.desc=%1$s, displays every bonfire in the world command.dim.desc=%1$s, displays every bonfire in the specified dimension command.name.desc=%1$s, displays every bonfire with a name containing the specified name