Merge remote-tracking branch 'remotes/origin/1.10.2-v1' into 1.11
# Conflicts: # build.gradle # src/main/java/techreborn/blocks/BlockRubberLog.java # src/main/java/techreborn/init/ModRecipes.java # src/main/java/techreborn/items/tools/ItemElectricTreetap.java # src/main/java/techreborn/items/tools/ItemTreeTap.java
This commit is contained in:
commit
c1d2e875bf
4 changed files with 54 additions and 3 deletions
|
@ -185,7 +185,7 @@ uploadArchives {
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
//this is when the build is executed on the master node
|
||||
println 'Uploading to local Maven Repo'
|
||||
repository(url: "file:///var/www/maven/")
|
||||
|
|
|
@ -1,12 +1,20 @@
|
|||
package techreborn.items.tools;
|
||||
|
||||
import ic2.core.item.tool.ItemTreetap;
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.RebornCore;
|
||||
|
@ -16,6 +24,7 @@ import reborncore.common.powerSystem.PoweredItem;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.ItemTRNoDestroy;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
/**
|
||||
|
@ -28,12 +37,23 @@ public class ItemElectricTreetap extends ItemTRNoDestroy implements IEnergyItemI
|
|||
public int cost = 20;
|
||||
|
||||
public ItemElectricTreetap() {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.electric_treetap");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
if(CompatManager.isIC2Loaded && block == Block.getBlockFromName("ic2:rubber_wood") && PoweredItem.canUseEnergy(20, stack))
|
||||
if (ItemTreetap.attemptExtract(playerIn, worldIn, pos, side, state, null) && !worldIn.isRemote) {
|
||||
PoweredItem.useEnergy(20, stack);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxPower(ItemStack stack) {
|
||||
return maxCharge;
|
||||
|
|
|
@ -1,8 +1,25 @@
|
|||
package techreborn.items.tools;
|
||||
|
||||
import ic2.core.item.tool.ItemTreetap;
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.RebornCore;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.items.ItemTRNoDestroy;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
public class ItemTreeTap extends ItemTRNoDestroy {
|
||||
|
||||
|
@ -13,6 +30,20 @@ public class ItemTreeTap extends ItemTRNoDestroy {
|
|||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
if(CompatManager.isIC2Loaded && block == Block.getBlockFromName("ic2:rubber_wood")) {
|
||||
ItemTreetap.attemptExtract(playerIn, worldIn, pos, side, state, null);
|
||||
if (!worldIn.isRemote)
|
||||
stack.damageItem(1, playerIn);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return stack.getMetadata() != 0;
|
||||
|
|
|
@ -75,7 +75,7 @@ public class TileEnergyStorage extends TilePowerAcceptor implements IWrenchable,
|
|||
}
|
||||
IEnergyItemInfo item = (IEnergyItemInfo) stack.getItem();
|
||||
if (item.canProvideEnergy(stack)) {
|
||||
if (getEnergy() != getMaxPower()) {
|
||||
if (getEnergy() != getMaxPower() && PoweredItem.getEnergy(stack) > 0) {
|
||||
addEnergy(item.getMaxTransfer(stack));
|
||||
PoweredItem.setEnergy(PoweredItem.getEnergy(stack) - item.getMaxTransfer(stack), stack);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue