Air Sigil
This commit is contained in:
parent
ac5402df6b
commit
ed515f5c80
|
@ -56,9 +56,9 @@ public class ItemBindable extends Item implements IBindable {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean syphonBatteries(ItemStack ist, EntityPlayer player, int damageToBeDone) {
|
public static boolean syphonBatteries(ItemStack stack, EntityPlayer player, int damageToBeDone) {
|
||||||
if (!player.worldObj.isRemote) {
|
if (!player.worldObj.isRemote) {
|
||||||
return NetworkHelper.syphonAndDamageFromNetwork(ist, player, damageToBeDone);
|
return NetworkHelper.getSoulNetwork(BindableHelper.getOwnerName(stack), player.worldObj).syphonAndDamage(damageToBeDone);
|
||||||
} else {
|
} else {
|
||||||
double posX = player.posX;
|
double posX = player.posX;
|
||||||
double posY = player.posY;
|
double posY = player.posY;
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
package WayofTime.bloodmagic.item.sigil;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.registry.ModPotions;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ItemSigilAir extends ItemSigilBase {
|
||||||
|
|
||||||
|
public ItemSigilAir() {
|
||||||
|
super("air", 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
if (!world.isRemote && !isUnusable(stack)) {
|
||||||
|
Vec3 vec = player.getLookVec();
|
||||||
|
double wantedVelocity = 1.7;
|
||||||
|
|
||||||
|
// TODO - Revisit after potions
|
||||||
|
// if (player.isPotionActive(ModPotions.customPotionBoost)) {
|
||||||
|
// int amplifier = player.getActivePotionEffect(ModPotions.customPotionBoost).getAmplifier();
|
||||||
|
// wantedVelocity += (1 + amplifier) * (0.35);
|
||||||
|
// }
|
||||||
|
|
||||||
|
player.motionX = vec.xCoord * wantedVelocity;
|
||||||
|
player.motionY = vec.yCoord * wantedVelocity;
|
||||||
|
player.motionZ = vec.zCoord * wantedVelocity;
|
||||||
|
player.velocityChanged = true;
|
||||||
|
world.playSoundEffect((double) ((float) player.posX + 0.5F), (double) ((float) player.posY + 0.5F), (double) ((float) player.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||||
|
player.fallDistance = 0;
|
||||||
|
|
||||||
|
if (!player.capabilities.isCreativeMode)
|
||||||
|
this.setUnusable(stack, !syphonBatteries(stack, player, getEnergyUsed()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onItemRightClick(stack, world, player);
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||||
import WayofTime.bloodmagic.item.ItemActivationCrystal;
|
import WayofTime.bloodmagic.item.ItemActivationCrystal;
|
||||||
import WayofTime.bloodmagic.item.ItemBloodOrb;
|
import WayofTime.bloodmagic.item.ItemBloodOrb;
|
||||||
import WayofTime.bloodmagic.item.ItemBucketEssence;
|
import WayofTime.bloodmagic.item.ItemBucketEssence;
|
||||||
|
import WayofTime.bloodmagic.item.sigil.ItemSigilAir;
|
||||||
import WayofTime.bloodmagic.item.sigil.ItemSigilDivination;
|
import WayofTime.bloodmagic.item.sigil.ItemSigilDivination;
|
||||||
import WayofTime.bloodmagic.util.helper.InventoryRenderHelper;
|
import WayofTime.bloodmagic.util.helper.InventoryRenderHelper;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -28,6 +29,7 @@ public class ModItems {
|
||||||
public static Item activationCrystal;
|
public static Item activationCrystal;
|
||||||
|
|
||||||
public static Item sigilDivination;
|
public static Item sigilDivination;
|
||||||
|
public static Item sigilAir;
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
bloodOrb = registerItem(new ItemBloodOrb());
|
bloodOrb = registerItem(new ItemBloodOrb());
|
||||||
|
@ -50,6 +52,7 @@ public class ModItems {
|
||||||
activationCrystal = registerItem(new ItemActivationCrystal());
|
activationCrystal = registerItem(new ItemActivationCrystal());
|
||||||
|
|
||||||
sigilDivination = registerItem(new ItemSigilDivination());
|
sigilDivination = registerItem(new ItemSigilDivination());
|
||||||
|
sigilAir = registerItem(new ItemSigilAir());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initRenders() {
|
public static void initRenders() {
|
||||||
|
@ -70,6 +73,7 @@ public class ModItems {
|
||||||
renderHelper.itemRender(activationCrystal, 2, "ItemActivationCrystal0");
|
renderHelper.itemRender(activationCrystal, 2, "ItemActivationCrystal0");
|
||||||
|
|
||||||
renderHelper.itemRender(sigilDivination);
|
renderHelper.itemRender(sigilDivination);
|
||||||
|
renderHelper.itemRender(sigilAir);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Item registerItem(Item item, String name) {
|
private static Item registerItem(Item item, String name) {
|
||||||
|
|
Loading…
Reference in a new issue