Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
DrZed committed Feb 5, 2015
1 parent 5b5e334 commit eab2547
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class EventBlockInteract implements EventListener {
Random rand = new Random();
int randInt = rand.nextInt(50);
float randfloat = (randInt*.01f);
float randfloat = (randInt/10);
@SubscribeEvent
public void onPlayerInteract(PlayerInteractEvent event) {
Block block = event.world.getBlock(event.x, event.y, event.z);
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/HxCKDMS/HxCBlocks/Events/EventEntityUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import HxCKDMS.HxCCore.Handlers.NBTFileIO;
import HxCKDMS.HxCCore.HxCCore;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.event.entity.living.LivingEvent;

Expand All @@ -14,16 +12,15 @@
@SuppressWarnings("unused")
public class EventEntityUpdate {
@SubscribeEvent
@SideOnly(Side.SERVER)
public void LivingUpdateEvent(LivingEvent.LivingUpdateEvent event){
if (event.entityLiving instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer)event.entityLiving;
if (event.entityLiving instanceof EntityPlayerMP){
EntityPlayerMP player = (EntityPlayerMP)event.entityLiving;
String UUID = player.getUniqueID().toString();
File CustomPlayerData = new File(HxCCore.HxCCoreDir, "HxC-" + UUID + ".dat");
NBTTagCompound nbt = NBTFileIO.getData(CustomPlayerData);
float soul = nbt.getFloat("Soul");
int SoulTimer = nbt.getInteger("SoulTimer");
if (soul != 1f) {
if (soul < 1.0f) {
SoulTimer--;
NBTFileIO.setInteger(CustomPlayerData, "SoulTimer", SoulTimer);
if (SoulTimer <= 0){
Expand Down

0 comments on commit eab2547

Please sign in to comment.