Fix #794, fix some issues with ic2 wrench, and use new forge perms to check when taping and wrenching blocks

This commit is contained in:
modmuss50 2016-11-05 15:10:28 +00:00
parent 015620094c
commit c9ff3330ca
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA
5 changed files with 31 additions and 4 deletions

View file

@ -18,7 +18,10 @@ import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.server.permission.PermissionAPI;
import net.minecraftforge.server.permission.context.BlockPosContext;
import reborncore.RebornCore;
import reborncore.common.util.RebornPermissions;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModSounds;
import techreborn.items.ItemParts;
@ -147,6 +150,9 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ);
if(!PermissionAPI.hasPermission(playerIn.getGameProfile(), RebornPermissions.TAP_BLOCK, new BlockPosContext(playerIn, pos, worldIn.getBlockState(pos), side))){
return false;
}
if (playerIn.getHeldItem(EnumHand.MAIN_HAND) != null
&& playerIn.getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof ItemTreeTap)
if (state.getValue(HAS_SAP)) {