Merge pull request #3 from einsteinsci/main

Pull changes from einsteincsi/main
master
Leviathan143 2015-09-13 09:14:19 +12:00
commit 615ccfac9e
4 changed files with 29 additions and 6 deletions

View File

@ -38,7 +38,9 @@ minecraft {
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not allways work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_nodoc_20150404"
// mappings = "snapshot_20141130"
}
dependencies {

View File

@ -203,7 +203,7 @@ public class BBEventHandler
{
if (held.getItem() instanceof ItemKnife)
{
if (rand.nextInt(8) == 0)
if (rand.nextInt(4) == 0)
{
e.drops.add(new ItemStack(Blocks.vine));
}
@ -218,7 +218,7 @@ public class BBEventHandler
{
if (held.getItem() instanceof ItemKnife)
{
if (rand.nextInt(8) == 0)
if (rand.nextInt(4) == 0)
{
int meta = block.getMetaFromState(e.state);
e.drops.add(new ItemStack(block, 1, meta));
@ -232,7 +232,7 @@ public class BBEventHandler
{
if (held.getItem() instanceof ItemHammer)
{
ItemStack crushResult = ItemHammer.getCrushResult(block);
ItemStack crushResult = ItemHammer.getCrushResult(block, e.state);
if (crushResult != null)
{
e.drops.clear();
@ -241,6 +241,23 @@ public class BBEventHandler
}
}
// Tripwire -> thread
if (block == Blocks.tripwire)
{
int rem = 0;
for (int i = 0; i < e.drops.size(); i++)
{
if (e.drops.get(i).getItem() == Items.string)
{
rem = i;
}
}
int count = e.drops.get(rem).stackSize; // Almost certainly 1.
e.drops.remove(rem);
e.drops.add(new ItemStack(RegisterItems.thread, count));
}
// Makes sure emergency escape mechanic does not let blocks fall out (like logs)
ItemStack heldItemStack = player.getHeldItem();

View File

@ -46,7 +46,8 @@ public class ContainerCampfire extends Container
}
}
public void addCraftingToCrafters(ICrafting craft)
@Override
public void onCraftGuiOpened(ICrafting craft)
{
super.onCraftGuiOpened(craft);
@ -56,6 +57,7 @@ public class ContainerCampfire extends Container
craft.sendProgressBarUpdate(this, 3, tileCampfire.decayTime);
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();

View File

@ -2,6 +2,7 @@ package net.einsteinsci.betterbeginnings.items;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.*;
@ -16,11 +17,12 @@ public class ItemHammer extends ItemTool
protected ItemHammer(Item.ToolMaterial material)
{
super(2.0F, material, breakableBlocks);
setHarvestLevel("pickaxe", 1);
}
public static ItemStack getCrushResult(Block broken)
public static ItemStack getCrushResult(Block broken, IBlockState state)
{
if (broken == Blocks.stone)
if (broken == Blocks.stone && broken.getMetaFromState(state) == 0)
{
return new ItemStack(Blocks.cobblestone);
}