Updated for 1.7.2
This commit is contained in:
parent
cc178e1a3b
commit
29228e18fe
105 changed files with 1939 additions and 2690 deletions
|
|
@ -6,16 +6,14 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class ItemStaffWater extends ItemStaff {
|
||||
public ItemStaffWater(int id) {
|
||||
super(id);
|
||||
public ItemStaffWater() {
|
||||
super();
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(200);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
|
|
@ -23,12 +21,12 @@ public class ItemStaffWater extends ItemStaff {
|
|||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
if (entityPlayer.isSneaking()) {
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
||||
if (movingobjectposition == null) {
|
||||
return itemStack;
|
||||
} else {
|
||||
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
|
@ -38,7 +36,7 @@ public class ItemStaffWater extends ItemStaff {
|
|||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||
return itemStack;
|
||||
}
|
||||
if (world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0) {
|
||||
if (world.getBlock(i, j, k).getMaterial() == Material.water && world.getBlockMetadata(i, j, k) == 0) {
|
||||
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||
world.setBlockToAir(i, j, k);
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
|
|
@ -65,10 +63,10 @@ public class ItemStaffWater extends ItemStaff {
|
|||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||
return itemStack;
|
||||
} else {
|
||||
int i1 = world.getBlockId(i, j, k);
|
||||
if (i1 == 0) {
|
||||
Block i1 = world.getBlock(i, j, k);
|
||||
if (i1 == Blocks.air) {
|
||||
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||
world.setBlock(i, j, k, Block.waterMoving.blockID);
|
||||
world.setBlock(i, j, k, Blocks.flowing_water);
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
}
|
||||
return itemStack;
|
||||
|
|
@ -78,7 +76,7 @@ public class ItemStaffWater extends ItemStaff {
|
|||
return itemStack;
|
||||
}
|
||||
} else {
|
||||
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(new EntityChargeWater(world, entityPlayer));
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
|
|
|
|||
Loading…
Reference in a new issue