当前位置: 首页>>代码示例>>Java>>正文


Java PlayerCapabilities类代码示例

本文整理汇总了Java中net.minecraft.entity.player.PlayerCapabilities的典型用法代码示例。如果您正苦于以下问题:Java PlayerCapabilities类的具体用法?Java PlayerCapabilities怎么用?Java PlayerCapabilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PlayerCapabilities类属于net.minecraft.entity.player包,在下文中一共展示了PlayerCapabilities类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configurePlayerCapabilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:26,代码来源:WorldSettings.java

示例2: configurePlayerCapabilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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();
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:19,代码来源:WorldSettings.java

示例3: configurePlayerCapabilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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();
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:19,代码来源:WorldSettings.java

示例4: C13PacketPlayerAbilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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());
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:C13PacketPlayerAbilities.java

示例5: S39PacketPlayerAbilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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());
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:S39PacketPlayerAbilities.java

示例6: CPacketPlayerAbilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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());
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:CPacketPlayerAbilities.java

示例7: SPacketPlayerAbilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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());
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:SPacketPlayerAbilities.java

示例8: C13PacketPlayerAbilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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());
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:10,代码来源:C13PacketPlayerAbilities.java

示例9: S39PacketPlayerAbilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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());
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:10,代码来源:S39PacketPlayerAbilities.java

示例10: onWornTick

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
@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;  
           
}
 
开发者ID:mookie1097,项目名称:NightfallMod,代码行数:10,代码来源:CreativeAmulet.java

示例11: entityUpdate

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:a1lic,项目名称:McMod-CheatStar,代码行数:41,代码来源:EventItemSuperStar.java

示例12: setPlayerWalkSpeed

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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();
	}
}
 
开发者ID:MyshaVoidWalker,项目名称:Draconix-ThePowerOfUseres,代码行数:16,代码来源:Utils.java

示例13: setPlayerFlySpeed

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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();
	}
}
 
开发者ID:testmad,项目名称:GaiaMod,代码行数:15,代码来源:GaiaModEventHandler.java

示例14: Packet202PlayerAbilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
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());
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:Packet202PlayerAbilities.java

示例15: Packet202PlayerAbilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
public Packet202PlayerAbilities(PlayerCapabilities par1PlayerCapabilities)
{
    this.setDisableDamage(par1PlayerCapabilities.disableDamage);
    this.setFlying(par1PlayerCapabilities.isFlying);
    this.setAllowFlying(par1PlayerCapabilities.allowFlying);
    this.setCreativeMode(par1PlayerCapabilities.isCreativeMode);
    this.setFlySpeed(par1PlayerCapabilities.getFlySpeed());
    this.setWalkSpeed(par1PlayerCapabilities.getWalkSpeed());
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:10,代码来源:Packet202PlayerAbilities.java


注:本文中的net.minecraft.entity.player.PlayerCapabilities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。