diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-06-05 01:53:14 +0100 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-06-05 01:53:14 +0100 |
| commit | a6a3bfa6f313adba5afe6eb4a0da049a8d641cfc (patch) | |
| tree | 56da97ba430232a7d0da51a3b8b9f444d96325c7 /src/main/java/darkknight/jewelrycraft/entities | |
| parent | 40487f07fa5ef31fde99713c0b842d34a0ba3622 (diff) | |
Stuff!
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/entities')
3 files changed, 74 insertions, 82 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/entities/EntityHalfHeart.java b/src/main/java/darkknight/jewelrycraft/entities/EntityHalfHeart.java index c538f86..6b9561f 100644 --- a/src/main/java/darkknight/jewelrycraft/entities/EntityHalfHeart.java +++ b/src/main/java/darkknight/jewelrycraft/entities/EntityHalfHeart.java @@ -1,38 +1,35 @@ -/** - * - */ -package darkknight.jewelrycraft.entities; - -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * @author Sorin - */ -public class EntityHalfHeart extends EntityHeart -{ - public EntityHalfHeart(World world) - { - super(world); - } - - protected void entityInit() - { - super.entityInit(); - this.dataWatcher.updateObject(17, 1f); - } - - @Override - public void onCollideWithPlayer(EntityPlayer player) - { - super.onCollideWithPlayer(player); - } -} +package darkknight.jewelrycraft.entities;
+
+import net.minecraft.entity.SharedMonsterAttributes;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.network.PacketRequestPlayerInfo;
+import darkknight.jewelrycraft.util.PlayerUtils;
+import darkknight.jewelrycraft.util.Variables;
+
+/**
+ * @author Sorin
+ */
+public class EntityHalfHeart extends EntityHeart
+{
+ public EntityHalfHeart(World world)
+ {
+ super(world);
+ }
+
+ protected void entityInit()
+ {
+ super.entityInit();
+ this.dataWatcher.updateObject(17, 1f);
+ }
+
+ @Override
+ public void onCollideWithPlayer(EntityPlayer player)
+ {
+ super.onCollideWithPlayer(player);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/entities/EntityList.java b/src/main/java/darkknight/jewelrycraft/entities/EntityList.java index c17c553..831f3ca 100644 --- a/src/main/java/darkknight/jewelrycraft/entities/EntityList.java +++ b/src/main/java/darkknight/jewelrycraft/entities/EntityList.java @@ -1,22 +1,16 @@ -package darkknight.jewelrycraft.entities; - -import net.minecraft.entity.Entity; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.registry.EntityRegistry; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.util.Variables; - -public class EntityList -{ - public static void preInit(FMLPreInitializationEvent e) - { - createEntity(EntityHeart.class, Variables.MODID + ".Heart"); - createEntity(EntityHalfHeart.class, Variables.MODID + ".Half-Heart"); - } - - public static void createEntity(Class<? extends Entity> entity, String entityName) - { - int randomID = EntityRegistry.findGlobalUniqueEntityId(); - EntityRegistry.registerModEntity(entity, entityName, randomID, JewelrycraftMod.instance, 40, 3, false); - } -} +package darkknight.jewelrycraft.entities;
+
+import net.minecraft.entity.Entity;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.registry.EntityRegistry;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.util.Variables;
+
+public class EntityList
+{
+ public static void preInit(FMLPreInitializationEvent e)
+ {
+ EntityRegistry.registerModEntity(EntityHeart.class, "Heart", 1, JewelrycraftMod.instance, 40, 3, false);
+ EntityRegistry.registerModEntity(EntityHalfHeart.class, "HalfHeart", 2, JewelrycraftMod.instance, 40, 3, false);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java b/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java index 16ddfe1..8012d84 100644 --- a/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java +++ b/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java @@ -1,23 +1,24 @@ -package darkknight.jewelrycraft.entities.renders; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import org.lwjgl.opengl.GL11; - -public class RenderHelper -{ - public static void rotateIfSneaking(EntityPlayer player) - { - if (player.isSneaking()) applySneakingRotation(); - } - - public static void applySneakingRotation() - { - GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F); - } - - public static void translateToHeadLevel(EntityPlayer player) - { - GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.62F : 0F) - player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0); - } +package darkknight.jewelrycraft.entities.renders;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.player.EntityPlayer;
+import org.lwjgl.opengl.GL11;
+import cpw.mods.fml.common.Loader;
+
+public class RenderHelper
+{
+ public static void rotateIfSneaking(EntityPlayer player)
+ {
+ if (player.isSneaking()) applySneakingRotation();
+ }
+
+ public static void applySneakingRotation()
+ {
+ GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F);
+ }
+
+ public static void translateToHeadLevel(EntityPlayer player)
+ {
+ GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.62F : 0F) - player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0);
+ }
}
\ No newline at end of file |
