diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-08-13 21:12:11 +0100 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-08-13 21:12:11 +0100 |
| commit | 0ef6a00aa79f022e5bd56b3f77e6861bbecf6d94 (patch) | |
| tree | 03966c83cd16d1912ec1596d83f89f251cc35f83 /src/main/java/darkknight/jewelrycraft/potions/PotionStun.java | |
| parent | 921f1ba6f30e66c80c803618ebff496778e78970 (diff) | |
Added a new structure, a new curse, achievements, challenges, curses
entry in the guide; reworked liquids to be tile entities, cleaned the
structures code, potion code and... you know what? I improved and
changed so much stuff that I literally forgot what I did...
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/potions/PotionStun.java')
| -rw-r--r-- | src/main/java/darkknight/jewelrycraft/potions/PotionStun.java | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/potions/PotionStun.java b/src/main/java/darkknight/jewelrycraft/potions/PotionStun.java index f01a467..0e8ad7f 100644 --- a/src/main/java/darkknight/jewelrycraft/potions/PotionStun.java +++ b/src/main/java/darkknight/jewelrycraft/potions/PotionStun.java @@ -1,26 +1,38 @@ -/** - * - */ -package darkknight.jewelrycraft.potions; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.util.Variables; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; - -/** - * @author Sorin - */ -public class PotionStun extends Potion -{ - protected PotionStun(int id, boolean isBad, int color) - { - super(id, isBad, color); - this.setPotionName(Variables.MODID + ".potion.stun"); - } - - @SideOnly(Side.CLIENT) - public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) { } -} +/**
+ *
+ */
+package darkknight.jewelrycraft.potions;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+
+/**
+ * @author Sorin
+ */
+public class PotionStun extends PotionBase {
+ protected PotionStun(int id, boolean isBad, int color) {
+ super(id, isBad, color);
+ this.setPotionName(Variables.MODID + ".potion.stun");
+ }
+
+ public void action(EntityLivingBase entity) {
+ entity.motionX *= 0D;
+ entity.motionZ *= 0D;
+ entity.motionY *= 0D;
+ entity.isSwingInProgress = false;
+ entity.moveForward = 0F;
+ entity.moveStrafing = 0F;
+ entity.setAIMoveSpeed(0F);
+ entity.limbSwing = 0F;
+ entity.limbSwingAmount = 0F;
+ entity.swingProgressInt = 0;
+ entity.rotationPitch = entity.prevRotationPitch;
+ entity.rotationYaw = entity.prevRotationYaw;
+ entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ, 0.0D, 0.3D, 0.0D);
+ if (entity.getActivePotionEffect(PotionList.stun).getDuration() == 0) entity.removePotionEffect(PotionList.stun.id);
+ }
+}
|
