Fix falling perpetually with Freeze mode, fixes

This commit is contained in:
Stephen Seo 2018-09-25 15:16:35 +09:00
parent a4c3a28028
commit 6ead1e1d3d
3 changed files with 5 additions and 9 deletions

View file

@ -148,7 +148,7 @@ public class BattleMusic
public void playBattle(float volume)
{
if(!initialized || volume <= 0.0f)
if(!initialized || volume <= 0.0f || battleMusic.isEmpty())
{
return;
}
@ -163,7 +163,7 @@ public class BattleMusic
public void playSilly(float volume)
{
if(!initialized || volume <= 0.0f)
if(!initialized || volume <= 0.0f || sillyMusic.isEmpty())
{
return;
}

View file

@ -147,7 +147,6 @@ public class Battle
if(TurnBasedMinecraftMod.config.isFreezeCombatantsEnabled())
{
newCombatant.x = e.posX;
newCombatant.y = e.posY;
newCombatant.z = e.posZ;
newCombatant.yaw = e.rotationYaw;
newCombatant.pitch = e.rotationPitch;
@ -176,7 +175,6 @@ public class Battle
if(TurnBasedMinecraftMod.config.isFreezeCombatantsEnabled())
{
newCombatant.x = e.posX;
newCombatant.y = e.posY;
newCombatant.z = e.posZ;
newCombatant.yaw = e.rotationYaw;
newCombatant.pitch = e.rotationPitch;
@ -270,7 +268,6 @@ public class Battle
if(TurnBasedMinecraftMod.config.isFreezeCombatantsEnabled())
{
newCombatant.x = e.posX;
newCombatant.y = e.posY;
newCombatant.z = e.posZ;
newCombatant.yaw = e.rotationYaw;
newCombatant.pitch = e.rotationPitch;
@ -310,7 +307,6 @@ public class Battle
if(TurnBasedMinecraftMod.config.isFreezeCombatantsEnabled())
{
newCombatant.x = e.posX;
newCombatant.y = e.posY;
newCombatant.z = e.posZ;
newCombatant.yaw = e.rotationYaw;
newCombatant.pitch = e.rotationPitch;
@ -574,11 +570,11 @@ public class Battle
{
for(Combatant c : sideA.values())
{
c.entity.setPositionAndRotation(c.x, c.y, c.z, c.yaw, c.pitch);
c.entity.setPositionAndRotation(c.x, c.entity.posY, c.z, c.yaw, c.pitch);
}
for(Combatant c : sideB.values())
{
c.entity.setPositionAndRotation(c.x, c.y, c.z, c.yaw, c.pitch);
c.entity.setPositionAndRotation(c.x, c.entity.posY, c.z, c.yaw, c.pitch);
}
}

View file

@ -20,7 +20,7 @@ public class Combatant
public int remainingDefenses;
public int battleID;
public double x;
public double y;
//public double y; // y is ignored to prevent perpetual fall damage when FreezeBattleCombatants is enabled
public double z;
public float yaw;
public float pitch;