Fixed Drill of the Rockbreaker and Stream Chainsaw

This commit is contained in:
Tombenpotter committed 2014-10-25 10:56:13 +02:00
1 parent 257da356b0
commit 2b61e40a66
3 files changed
+8 -7

No files matched your search

@@ -24,9 +24,10 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import thaumcraft.common.lib.Utils;
import thaumcraft.common.lib.network.PacketHandler;
import thaumcraft.common.lib.network.fx.PacketFXBlockBubble;
import thaumcraft.common.lib.utils.BlockUtils;
import thaumcraft.common.lib.utils.Utils;
import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
@@ -69,7 +70,7 @@ public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
Block bi = world.getBlock(x, y, z);
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
if (!world.isRemote) {
if (Utils.breakFurthestBlock(world, x, y, z, bi, player)) {
if (BlockUtils.breakFurthestBlock(world, x, y, z, bi, player)) {
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
ElectricItem.manager.use(itemstack, cost, player);
this.alternateServer = (!this.alternateServer);
@@ -89,7 +90,7 @@ public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
Block bi = world.getBlock(x, y, z);
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
if (!world.isRemote) {
Utils.breakFurthestBlock(world, x, y, z, bi, player);
BlockUtils.breakFurthestBlock(world, x, y, z, bi, player);
PacketHandler.INSTANCE.sendToAllAround(new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()), new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D));
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
@@ -37,7 +37,7 @@ import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.event.ForgeEventFactory;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.entities.EntityFollowingItem;
import thaumcraft.common.lib.Utils;
import thaumcraft.common.lib.utils.BlockUtils;
import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
import tombenpotter.emt.common.util.ConfigHandler;
@@ -86,7 +86,7 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
@Override
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) {
MovingObjectPosition movingobjectposition = Utils.getTargetBlock(((Entity) (player)).worldObj, player, true);
MovingObjectPosition movingobjectposition = BlockUtils.getTargetBlock(((Entity) (player)).worldObj, player, true);
if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
side = movingobjectposition.sideHit;
}
@@ -31,7 +31,7 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.common.config.Config;
import thaumcraft.common.lib.InventoryHelper;
import thaumcraft.common.lib.utils.InventoryUtils;
import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
@@ -214,7 +214,7 @@ public class ItemMaterials extends Item {
if ((!entity.worldObj.isRemote) && ((stack.getItemDamage() == 14)) && ((entity instanceof EntityLivingBase)) && (!((EntityLivingBase) entity).isEntityUndead()) && (!((EntityLivingBase) entity).isPotionActive(Config.potionTaintPoisonID)) && (world.rand.nextInt(4321) <= stack.stackSize)) {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 120, 0, false));
if ((entity instanceof EntityPlayer)) {
InventoryHelper.consumeInventoryItem((EntityPlayer) entity, stack.getItem(), stack.getItemDamage());
InventoryUtils.consumeInventoryItem((EntityPlayer) entity, stack.getItem(), stack.getItemDamage());
}
}
}