EventItemSuperStar.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:McMod-CheatStar 作者:
@SubscribeEvent
public void entityUpdate(LivingEvent.LivingUpdateEvent event)
{
    if(!isPlayer(event.entityLiving))
    {
        return;
    }

    EntityPlayer player = (EntityPlayer)event.entityLiving;
    PlayerCapabilities capabilities = player.capabilities; 

    IAttributeInstance movementSpeed = player.getEntityAttribute(SharedMonsterAttributes.movementSpeed);

    if(!checkEquips(player))
    {
        event.entityLiving.stepHeight = 0.5F;
        capabilities.allowFlying = player.capabilities.isCreativeMode;

        if(!ModConfig.useSpeedPotion)
        {
            movementSpeed.setBaseValue(0.1);
        }

        FoodStats fs = player.getFoodStats();
        if(fs != null)
        {
            fs.addStats(20, 5);
        }

        return;
    }

    player.stepHeight = 1;

    capabilities.allowFlying = true;
    if(!ModConfig.useSpeedPotion)
    {
        movementSpeed.setBaseValue(ModConfig.speedMultiplicator);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号