Skip to content

Commit

Permalink
Hot fluids doesnt instantly kill the player anymore, closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Mar 24, 2019
1 parent 0ef226f commit d8d7fc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
modGroup=com.buuz135
minecraftVersion=1.12
modVersion=1.1.1
modVersion=1.1.2
modBaseName=HotOrNot
forgeVersion=1.12.2-14.23.5.2768
mcpVersion=snapshot_20180508
12 changes: 6 additions & 6 deletions src/main/java/com/buuz135/hotornot/HotOrNot.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class HotOrNot {

public static final String MOD_ID = "hotornot";
public static final String MOD_NAME = "HotOrNot";
public static final String VERSION = "1.0";
public static final String VERSION = "1.1.2";

@SidedProxy(clientSide = "com.buuz135.hotornot.proxy.ClientProxy", serverSide = "com.buuz135.hotornot.proxy.CommonProxy")
public static CommonProxy proxy;
Expand Down Expand Up @@ -101,10 +101,10 @@ public static void modelRegistryEvent(ModelRegistryEvent event) {
public enum FluidEffect {
HOT(fluidStack -> fluidStack.getFluid().getTemperature(fluidStack) >= HotConfig.HOT, entityPlayerMP -> entityPlayerMP.setFire(1), TextFormatting.RED, "tooltip.hotornot.toohot"),
COLD(fluidStack -> fluidStack.getFluid().getTemperature(fluidStack) <= HotConfig.COLD, entityPlayerMP -> {
entityPlayerMP.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 2, 1));
entityPlayerMP.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 2, 1));
entityPlayerMP.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 21, 1));
entityPlayerMP.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 21, 1));
}, TextFormatting.AQUA, "tooltip.hotornot.toocold"),
GAS(fluidStack -> fluidStack.getFluid().isGaseous(fluidStack) && HotConfig.GASEOUS, entityPlayerMP -> entityPlayerMP.addPotionEffect(new PotionEffect(MobEffects.LEVITATION, 2, 1)), TextFormatting.YELLOW, "tooltip.hotornot.toolight")
GAS(fluidStack -> fluidStack.getFluid().isGaseous(fluidStack) && HotConfig.GASEOUS, entityPlayerMP -> entityPlayerMP.addPotionEffect(new PotionEffect(MobEffects.LEVITATION, 21, 1)), TextFormatting.YELLOW, "tooltip.hotornot.toolight")
;

private final Predicate<FluidStack> isValid;
Expand All @@ -125,7 +125,7 @@ public enum FluidEffect {
public static class ServerTick {

@SubscribeEvent
public static void onTick(TickEvent.ServerTickEvent event) {
public static void onTick(TickEvent.WorldTickEvent event) {
if (event.phase == TickEvent.Phase.START) {
for (EntityPlayerMP entityPlayerMP : FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayers()) {
if (!entityPlayerMP.isBurning() && !entityPlayerMP.isCreative() && entityPlayerMP.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)) {
Expand All @@ -141,7 +141,7 @@ public static void onTick(TickEvent.ServerTickEvent event) {
ItemStack offHand = entityPlayerMP.getHeldItemOffhand();
if (offHand.getItem().equals(CommonProxy.MITTS)) {
offHand.damageItem(1, entityPlayerMP);
} else {
} else if (event.world.getTotalWorldTime() % 20 == 0) {
effect.interactPlayer.accept(entityPlayerMP);
}
}
Expand Down

0 comments on commit d8d7fc4

Please sign in to comment.