use of net.minecraft.server.v1_11_R1.IBlockData in project Citizens2 by CitizensDev.
the class CitizensBlockBreaker method strengthMod.
private float strengthMod(IBlockData block) {
ItemStack itemstack = getCurrentItem();
float f = itemstack.a(block);
if (entity instanceof EntityLiving) {
EntityLiving handle = (EntityLiving) entity;
if (f > 1.0F) {
int i = EnchantmentManager.getDigSpeedEnchantmentLevel(handle);
if (i > 0) {
f += i * i + 1;
}
}
if (handle.hasEffect(MobEffects.FASTER_DIG)) {
f *= (1.0F + (handle.getEffect(MobEffects.FASTER_DIG).getAmplifier() + 1) * 0.2F);
}
if (handle.hasEffect(MobEffects.SLOWER_DIG)) {
float f1 = 1.0F;
switch(handle.getEffect(MobEffects.SLOWER_DIG).getAmplifier()) {
case 0:
f1 = 0.3F;
break;
case 1:
f1 = 0.09F;
break;
case 2:
f1 = 0.0027F;
break;
case 3:
default:
f1 = 8.1E-4F;
}
f *= f1;
}
if ((handle.a(Material.WATER)) && (!EnchantmentManager.i(handle))) {
f /= 5.0F;
}
}
if (!entity.onGround) {
f /= 5.0F;
}
return f;
}
use of net.minecraft.server.v1_11_R1.IBlockData in project askyblock by tastybento.
the class NMSHandler method setBlockSuperFast.
@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
net.minecraft.server.v1_10_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
net.minecraft.server.v1_10_R1.Chunk chunk = w.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());
int combined = blockId + (data << 12);
IBlockData ibd = net.minecraft.server.v1_10_R1.Block.getByCombinedId(combined);
if (applyPhysics) {
w.setTypeAndData(bp, ibd, 3);
} else {
w.setTypeAndData(bp, ibd, 2);
}
chunk.a(bp, ibd);
}
use of net.minecraft.server.v1_11_R1.IBlockData in project askyblock by tastybento.
the class NMSHandler method setBlockSuperFast.
@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
net.minecraft.server.v1_8_R3.World w = ((CraftWorld) b.getWorld()).getHandle();
net.minecraft.server.v1_8_R3.Chunk chunk = w.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());
int combined = blockId + (data << 12);
IBlockData ibd = net.minecraft.server.v1_8_R3.Block.getByCombinedId(combined);
if (applyPhysics) {
w.setTypeAndData(bp, ibd, 3);
} else {
w.setTypeAndData(bp, ibd, 2);
}
chunk.a(bp, ibd);
}
use of net.minecraft.server.v1_11_R1.IBlockData in project askyblock by tastybento.
the class NMSHandler method setBlockSuperFast.
@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
net.minecraft.server.v1_9_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
net.minecraft.server.v1_9_R1.Chunk chunk = w.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());
int combined = blockId + (data << 12);
IBlockData ibd = net.minecraft.server.v1_9_R1.Block.getByCombinedId(combined);
if (applyPhysics) {
w.setTypeAndData(bp, ibd, 3);
} else {
w.setTypeAndData(bp, ibd, 2);
}
chunk.a(bp, ibd);
}
use of net.minecraft.server.v1_11_R1.IBlockData in project askyblock by tastybento.
the class NMSHandler method setBlockSuperFast.
@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
net.minecraft.server.v1_11_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
net.minecraft.server.v1_11_R1.Chunk chunk = w.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());
int combined = blockId + (data << 12);
IBlockData ibd = net.minecraft.server.v1_11_R1.Block.getByCombinedId(combined);
if (applyPhysics) {
w.setTypeAndData(bp, ibd, 3);
} else {
w.setTypeAndData(bp, ibd, 2);
}
chunk.a(bp, ibd);
}
Aggregations