Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
Trying to fix integrity
Browse files Browse the repository at this point in the history
  • Loading branch information
msifd committed Apr 14, 2021
1 parent 77929cb commit 52e5ba9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repositories {
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'org.spongepowered.mixin'

version = '2.1.1'
version = '2.1.2'
group = 'msifeed.misca'
archivesBaseName = 'misca'

Expand Down
2 changes: 1 addition & 1 deletion run/config/misca/shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"charstate": {
"globalMiningSpeedModifier": 0.5,
"integrityRestPerSec": 1.6E-5,
"integrityCostPerDamage": 0.1,
"integrityCostPerDamage": 1.0,
"sanityRestPerFood": 1.0,
"sanityRestPerSpeechChar": 0.001,
"sanityRestModPerPsySkill": 0.15,
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/msifeed/misca/charstate/Charstate.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.event.entity.EntityEvent;
import net.minecraftforge.event.entity.living.LivingDamageEvent;
import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
Expand Down Expand Up @@ -92,11 +92,10 @@ public void onPlayerTick(LivingEvent.LivingUpdateEvent event) {
}

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPlayerHurt(LivingHurtEvent event) {
public void onPlayerDamaged(LivingDamageEvent event) {
if (event.isCanceled() || event.getAmount() < 1) return;
if (!(event.getEntity() instanceof EntityPlayer)) return;
if (event.getEntity().world.isRemote) return;
if (event.getSource().canHarmInCreative()) return;
if (!(event.getEntity() instanceof EntityPlayer)) return;

final EntityPlayer player = (EntityPlayer) event.getEntityLiving();
integrityHandler.handleDamage(player, event.getAmount());
Expand Down

0 comments on commit 52e5ba9

Please sign in to comment.