Golden Oak can be silk touched.

This commit is contained in:
bconlon 2020-08-20 19:50:26 -07:00
parent 56817e28ec
commit 76b2321b69

View file

@ -1,5 +1,6 @@
package com.gildedgames.the_aether.blocks.natural;
import java.util.ArrayList;
import java.util.Random;
import com.gildedgames.the_aether.blocks.BlocksAether;
@ -21,6 +22,7 @@ import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.event.ForgeEventFactory;
public class BlockAetherLog extends BlockLog {
@ -37,6 +39,32 @@ public class BlockAetherLog extends BlockLog {
ItemStack stack = player.getCurrentEquippedItem();
if (this.canSilkHarvest(worldIn, player, x, y, z, meta) && EnchantmentHelper.getSilkTouchModifier(player))
{
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
ItemStack itemstack = this.createStackedBlock(meta);
// if (this == BlocksAether.golden_oak_log)
// {
// Item item = Item.getItemFromBlock(this);
//
// itemstack = new ItemStack(item, 1, EnumLogType.Oak.getMeta());
// }
if (itemstack != null)
{
items.add(itemstack);
}
ForgeEventFactory.fireBlockHarvesting(items, worldIn, this, x, y, z, meta, 0, 1.0f, true, player);
for (ItemStack is : items)
{
this.dropBlockAsItem(worldIn, x, y, z, is);
}
}
else
{
if (stack != null && ((stack.getItem() instanceof ItemAetherTool && ((ItemAetherTool) stack.getItem()).toolType == EnumAetherToolType.AXE) || stack.getItem() == Items.diamond_axe)) {
if (stack.getItem() instanceof ItemZaniteTool || stack.getItem() instanceof ItemGravititeTool || stack.getItem() instanceof ItemValkyrieTool || stack.getItem() == Items.diamond_axe) {
if (this == BlocksAether.golden_oak_log) {
@ -55,6 +83,7 @@ public class BlockAetherLog extends BlockLog {
super.harvestBlock(worldIn, player, x, y, z, meta);
}
}
}
@Override
public Item getItemDropped(int meta, Random random, int fortune) {