java类net.minecraft.entity.player.PlayerCapabilities的实例源码

WorldSettings.java 文件源码 项目:DecompiledMinecraft 阅读 23 收藏 0 点赞 0 评论 0
public void configurePlayerCapabilities(PlayerCapabilities capabilities)
{
    if (this == CREATIVE)
    {
        capabilities.allowFlying = true;
        capabilities.isCreativeMode = true;
        capabilities.disableDamage = true;
    }
    else if (this == SPECTATOR)
    {
        capabilities.allowFlying = true;
        capabilities.isCreativeMode = false;
        capabilities.disableDamage = true;
        capabilities.isFlying = true;
    }
    else
    {
        capabilities.allowFlying = false;
        capabilities.isCreativeMode = false;
        capabilities.disableDamage = false;
        capabilities.isFlying = false;
    }

    capabilities.allowEdit = !this.isAdventure();
}
WorldSettings.java 文件源码 项目:DecompiledMinecraft 阅读 21 收藏 0 点赞 0 评论 0
public void configurePlayerCapabilities(PlayerCapabilities capabilities)
{
    if (this == CREATIVE)
    {
        capabilities.allowFlying = true;
        capabilities.isCreativeMode = true;
        capabilities.disableDamage = true;
    }
    else if (this == SPECTATOR)
    {
        capabilities.allowFlying = true;
        capabilities.isCreativeMode = false;
        capabilities.disableDamage = true;
        capabilities.isFlying = true;
    }
    else
    {
        capabilities.allowFlying = false;
        capabilities.isCreativeMode = false;
        capabilities.disableDamage = false;
        capabilities.isFlying = false;
    }

    capabilities.allowEdit = !this.isAdventure();
}
WorldSettings.java 文件源码 项目:BaseClient 阅读 20 收藏 0 点赞 0 评论 0
public void configurePlayerCapabilities(PlayerCapabilities capabilities)
{
    if (this == CREATIVE)
    {
        capabilities.allowFlying = true;
        capabilities.isCreativeMode = true;
        capabilities.disableDamage = true;
    }
    else if (this == SPECTATOR)
    {
        capabilities.allowFlying = true;
        capabilities.isCreativeMode = false;
        capabilities.disableDamage = true;
        capabilities.isFlying = true;
    }
    else
    {
        capabilities.allowFlying = false;
        capabilities.isCreativeMode = false;
        capabilities.disableDamage = false;
        capabilities.isFlying = false;
    }

    capabilities.allowEdit = !this.isAdventure();
}
WorldSettings.java 文件源码 项目:BaseClient 阅读 21 收藏 0 点赞 0 评论 0
public void configurePlayerCapabilities(PlayerCapabilities capabilities)
{
    if (this == CREATIVE)
    {
        capabilities.allowFlying = true;
        capabilities.isCreativeMode = true;
        capabilities.disableDamage = true;
    }
    else if (this == SPECTATOR)
    {
        capabilities.allowFlying = true;
        capabilities.isCreativeMode = false;
        capabilities.disableDamage = true;
        capabilities.isFlying = true;
    }
    else
    {
        capabilities.allowFlying = false;
        capabilities.isCreativeMode = false;
        capabilities.disableDamage = false;
        capabilities.isFlying = false;
    }

    capabilities.allowEdit = !this.isAdventure();
}
WorldSettings.java 文件源码 项目:Resilience-Client-Source 阅读 19 收藏 0 点赞 0 评论 0
public void configurePlayerCapabilities(PlayerCapabilities par1PlayerCapabilities)
{
    if (this == CREATIVE)
    {
        par1PlayerCapabilities.allowFlying = true;
        par1PlayerCapabilities.isCreativeMode = true;
        par1PlayerCapabilities.disableDamage = true;
    }
    else
    {
        par1PlayerCapabilities.allowFlying = false;
        par1PlayerCapabilities.isCreativeMode = false;
        par1PlayerCapabilities.disableDamage = false;
        par1PlayerCapabilities.isFlying = false;
    }

    par1PlayerCapabilities.allowEdit = !this.isAdventure();
}
WorldSettings.java 文件源码 项目:Cauldron 阅读 26 收藏 0 点赞 0 评论 0
public void configurePlayerCapabilities(PlayerCapabilities p_77147_1_)
{
    if (this == CREATIVE)
    {
        p_77147_1_.allowFlying = true;
        p_77147_1_.isCreativeMode = true;
        p_77147_1_.disableDamage = true;
    }
    else
    {
        p_77147_1_.allowFlying = false;
        p_77147_1_.isCreativeMode = false;
        p_77147_1_.disableDamage = false;
        p_77147_1_.isFlying = false;
    }

    p_77147_1_.allowEdit = !this.isAdventure();
}
WorldSettings.java 文件源码 项目:Cauldron 阅读 19 收藏 0 点赞 0 评论 0
public void configurePlayerCapabilities(PlayerCapabilities p_77147_1_)
{
    if (this == CREATIVE)
    {
        p_77147_1_.allowFlying = true;
        p_77147_1_.isCreativeMode = true;
        p_77147_1_.disableDamage = true;
    }
    else
    {
        p_77147_1_.allowFlying = false;
        p_77147_1_.isCreativeMode = false;
        p_77147_1_.disableDamage = false;
        p_77147_1_.isFlying = false;
    }

    p_77147_1_.allowEdit = !this.isAdventure();
}
C13PacketPlayerAbilities.java 文件源码 项目:DecompiledMinecraft 阅读 30 收藏 0 点赞 0 评论 0
public C13PacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
S39PacketPlayerAbilities.java 文件源码 项目:DecompiledMinecraft 阅读 20 收藏 0 点赞 0 评论 0
public S39PacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
C13PacketPlayerAbilities.java 文件源码 项目:DecompiledMinecraft 阅读 28 收藏 0 点赞 0 评论 0
public C13PacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
S39PacketPlayerAbilities.java 文件源码 项目:DecompiledMinecraft 阅读 20 收藏 0 点赞 0 评论 0
public S39PacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
C13PacketPlayerAbilities.java 文件源码 项目:BaseClient 阅读 27 收藏 0 点赞 0 评论 0
public C13PacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
S39PacketPlayerAbilities.java 文件源码 项目:BaseClient 阅读 20 收藏 0 点赞 0 评论 0
public S39PacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
C13PacketPlayerAbilities.java 文件源码 项目:BaseClient 阅读 30 收藏 0 点赞 0 评论 0
public C13PacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
S39PacketPlayerAbilities.java 文件源码 项目:BaseClient 阅读 20 收藏 0 点赞 0 评论 0
public S39PacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
CPacketPlayerAbilities.java 文件源码 项目:Backmemed 阅读 19 收藏 0 点赞 0 评论 0
public CPacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
SPacketPlayerAbilities.java 文件源码 项目:Backmemed 阅读 28 收藏 0 点赞 0 评论 0
public SPacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
CPacketPlayerAbilities.java 文件源码 项目:CustomWorldGen 阅读 20 收藏 0 点赞 0 评论 0
public CPacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
SPacketPlayerAbilities.java 文件源码 项目:CustomWorldGen 阅读 18 收藏 0 点赞 0 评论 0
public SPacketPlayerAbilities(PlayerCapabilities capabilities)
{
    this.setInvulnerable(capabilities.disableDamage);
    this.setFlying(capabilities.isFlying);
    this.setAllowFlying(capabilities.allowFlying);
    this.setCreativeMode(capabilities.isCreativeMode);
    this.setFlySpeed(capabilities.getFlySpeed());
    this.setWalkSpeed(capabilities.getWalkSpeed());
}
C13PacketPlayerAbilities.java 文件源码 项目:Resilience-Client-Source 阅读 27 收藏 0 点赞 0 评论 0
public C13PacketPlayerAbilities(PlayerCapabilities p_i45257_1_)
{
    this.func_149490_a(p_i45257_1_.disableDamage);
    this.func_149483_b(p_i45257_1_.isFlying);
    this.func_149491_c(p_i45257_1_.allowFlying);
    this.func_149493_d(p_i45257_1_.isCreativeMode);
    this.func_149485_a(p_i45257_1_.getFlySpeed());
    this.func_149492_b(p_i45257_1_.getWalkSpeed());
}
S39PacketPlayerAbilities.java 文件源码 项目:Resilience-Client-Source 阅读 21 收藏 0 点赞 0 评论 0
public S39PacketPlayerAbilities(PlayerCapabilities p_i45208_1_)
{
    this.func_149108_a(p_i45208_1_.disableDamage);
    this.func_149102_b(p_i45208_1_.isFlying);
    this.func_149109_c(p_i45208_1_.allowFlying);
    this.func_149111_d(p_i45208_1_.isCreativeMode);
    this.func_149104_a(p_i45208_1_.getFlySpeed());
    this.func_149110_b(p_i45208_1_.getWalkSpeed());
}
CreativeAmulet.java 文件源码 项目:NightfallMod 阅读 22 收藏 0 点赞 0 评论 0
@Override
public void onWornTick(ItemStack itemstack, EntityLivingBase player) {
    PlayerCapabilities cap = ((EntityPlayer)player).capabilities;
           cap.allowFlying = true;
           cap.isCreativeMode = true;
           cap.disableDamage = true;
           cap.allowEdit = true;  

}
EventItemSuperStar.java 文件源码 项目:McMod-CheatStar 阅读 18 收藏 0 点赞 0 评论 0
@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);
    }
}
C13PacketPlayerAbilities.java 文件源码 项目:Cauldron 阅读 26 收藏 0 点赞 0 评论 0
public C13PacketPlayerAbilities(PlayerCapabilities p_i45257_1_)
{
    this.func_149490_a(p_i45257_1_.disableDamage);
    this.func_149483_b(p_i45257_1_.isFlying);
    this.func_149491_c(p_i45257_1_.allowFlying);
    this.func_149493_d(p_i45257_1_.isCreativeMode);
    this.func_149485_a(p_i45257_1_.getFlySpeed());
    this.func_149492_b(p_i45257_1_.getWalkSpeed());
}
S39PacketPlayerAbilities.java 文件源码 项目:Cauldron 阅读 21 收藏 0 点赞 0 评论 0
public S39PacketPlayerAbilities(PlayerCapabilities p_i45208_1_)
{
    this.func_149108_a(p_i45208_1_.disableDamage);
    this.func_149102_b(p_i45208_1_.isFlying);
    this.func_149109_c(p_i45208_1_.allowFlying);
    this.func_149111_d(p_i45208_1_.isCreativeMode);
    this.func_149104_a(p_i45208_1_.getFlySpeed());
    this.func_149110_b(p_i45208_1_.getWalkSpeed());
}
C13PacketPlayerAbilities.java 文件源码 项目:Cauldron 阅读 28 收藏 0 点赞 0 评论 0
public C13PacketPlayerAbilities(PlayerCapabilities p_i45257_1_)
{
    this.func_149490_a(p_i45257_1_.disableDamage);
    this.func_149483_b(p_i45257_1_.isFlying);
    this.func_149491_c(p_i45257_1_.allowFlying);
    this.func_149493_d(p_i45257_1_.isCreativeMode);
    this.func_149485_a(p_i45257_1_.getFlySpeed());
    this.func_149492_b(p_i45257_1_.getWalkSpeed());
}
S39PacketPlayerAbilities.java 文件源码 项目:Cauldron 阅读 23 收藏 0 点赞 0 评论 0
public S39PacketPlayerAbilities(PlayerCapabilities p_i45208_1_)
{
    this.func_149108_a(p_i45208_1_.disableDamage);
    this.func_149102_b(p_i45208_1_.isFlying);
    this.func_149109_c(p_i45208_1_.allowFlying);
    this.func_149111_d(p_i45208_1_.isCreativeMode);
    this.func_149104_a(p_i45208_1_.getFlySpeed());
    this.func_149110_b(p_i45208_1_.getWalkSpeed());
}
Utils.java 文件源码 项目:Draconix-ThePowerOfUseres 阅读 16 收藏 0 点赞 0 评论 0
public static void setPlayerWalkSpeed(EntityPlayer player, float value)
{
    Class c = PlayerCapabilities.class;
    Field field = c.getDeclaredFields()[6];
    field.setAccessible(true);

    try 
    {
        field.setFloat(player.capabilities, value);
    }
    catch (Exception e) 
    {
        e.printStackTrace();
    }
}
GaiaModEventHandler.java 文件源码 项目:GaiaMod 阅读 26 收藏 0 点赞 0 评论 0
private static void setPlayerFlySpeed(PlayerCapabilities capabilities,
        float flySpeed) {
    if (flySpeedField == null) {
        flySpeedField = ReflectionHelper.findField(
                PlayerCapabilities.class, "flySpeed", "field_75096_f");
        flySpeedField.setAccessible(true);
    }

    try {
        flySpeedField.set(capabilities, flySpeed);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}
Packet202PlayerAbilities.java 文件源码 项目:RuneCraftery 阅读 24 收藏 0 点赞 0 评论 0
public Packet202PlayerAbilities(PlayerCapabilities p_i1449_1_) {
   this.func_73353_a(p_i1449_1_.field_75102_a);
   this.func_73349_b(p_i1449_1_.field_75100_b);
   this.func_73354_c(p_i1449_1_.field_75101_c);
   this.func_73356_d(p_i1449_1_.field_75098_d);
   this.func_73351_a(p_i1449_1_.func_75093_a());
   this.func_73355_b(p_i1449_1_.func_75094_b());
}


问题


面经


文章

微信
公众号

扫码关注公众号