Fixed step height issues with PotionBoost. Fixed some formatting errors. Set the path blocks' max path lengths.
This commit is contained in:
parent
1ed4926d31
commit
4e054224ac
6 changed files with 30 additions and 8 deletions
|
@ -40,11 +40,17 @@ public class BlockPath extends BlockString implements IIncensePath
|
|||
switch (this.getMetaFromState(state))
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
return 2;
|
||||
case 2:
|
||||
case 3:
|
||||
return 4;
|
||||
case 4:
|
||||
case 5:
|
||||
return 6;
|
||||
case 6:
|
||||
case 7:
|
||||
return 8;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,6 @@ public class PotionEventHandlers
|
|||
@SubscribeEvent
|
||||
public void onEntityUpdate(LivingEvent.LivingUpdateEvent event)
|
||||
{
|
||||
|
||||
if (event.entityLiving.isPotionActive(ModPotions.boost))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(ModPotions.boost).getAmplifier();
|
||||
|
@ -50,7 +49,6 @@ public class PotionEventHandlers
|
|||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
entityPlayer.stepHeight = 1.0f;
|
||||
|
||||
if ((entityPlayer.onGround || entityPlayer.capabilities.isFlying) && entityPlayer.moveForward > 0F)
|
||||
entityPlayer.moveFlying(0F, 1F, entityPlayer.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease);
|
||||
|
|
|
@ -174,7 +174,7 @@ public class TileIncenseAltar extends TileInventory implements ITickable
|
|||
totalTranquility += entry.getValue();
|
||||
}
|
||||
|
||||
if (totalTranquility <= 0)
|
||||
if (totalTranquility < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraftforge.common.MinecraftForge;
|
|||
import net.minecraftforge.event.AnvilUpdateEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHealEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
||||
|
@ -32,6 +33,7 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
|||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import WayofTime.bloodmagic.ConfigHandler;
|
||||
|
@ -76,6 +78,22 @@ public class EventHandler
|
|||
{
|
||||
Random random = new Random();
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onEntityUpdate(LivingEvent.LivingUpdateEvent event)
|
||||
{
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
if (event.entityLiving.isPotionActive(ModPotions.boost))
|
||||
{
|
||||
entityPlayer.stepHeight = 1.0f;
|
||||
} else
|
||||
{
|
||||
entityPlayer.stepHeight = 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityHurt(LivingHurtEvent event)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue