• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PlayerCapabilities类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: tickEvent

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
@SubscribeEvent
public void tickEvent(TickEvent.PlayerTickEvent event) {
	EntityPlayer player = event.player;
	if (ItemArmorMod.hasFullSuit(player, WarsItems.knightArmor)) {
		player.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 10, 0));
	} else if (ItemArmorMod.hasFullSuit(player, WarsItems.scoutArmor)) {
		ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, player.capabilities, 0.15F, 6);
		player.fallDistance = 0;
		player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 10, 1));
	} else if (ItemArmorMod.hasFullSuit(player, WarsItems.ninjaArmor)) {
		ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, player.capabilities, 0.18F, 6);
		player.fallDistance = 0;
		player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 10, 1));
		player.addPotionEffect(new PotionEffect(MobEffects.JUMP_BOOST, 10, 1));
		if(player.motionY < 0 && player.motionY > -0.5){
			player.motionY *= 1.5;
		}
	}

	else if (ItemArmorMod.hasFullSuit(player, WarsItems.chaosArmor) || ItemArmorMod.hasFullSuit(player, WarsItems.enderArmor)) {

		player.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 10, 0));

	}

	if (ItemArmorMod.hasFullSuit(player, WarsItems.archerArmor) || ItemArmorMod.hasFullSuit(player, WarsItems.techArmor) || ItemArmorMod.hasFullSuit(player, WarsItems.chaosArmor) || ItemArmorMod.hasFullSuit(player, WarsItems.knightArmor) || ItemArmorMod.hasFullSuit(player, WarsItems.healerArmor)
			|| ItemArmorMod.hasFullSuit(player, WarsItems.guardArmor) || ItemArmorMod.hasFullSuit(player, WarsItems.scoutArmor) || ItemArmorMod.hasFullSuit(player, WarsItems.enderArmor) || ItemArmorMod.hasFullSuit(player, WarsItems.ninjaArmor)) {
		ItemStack boots = player.inventory.armorItemInSlot(0);
		if (!(boots != null)) {
			Random random = new Random();
			player.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 10, 10));
			player.addPotionEffect(new PotionEffect(MobEffects.MINING_FATIGUE, 10, 100));
			player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 10, 10));

			int num = random.nextInt(50);

			if (num == 1) {
				player.addChatMessage(new TextComponentTranslation("needteamboots"));
			}
		}
	}

	int killstreakBefore = player.getEntityData().getInteger("warsmod_killstreak");

	if (killstreakBefore > 1) {
		player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 10, 0));

	}
	if (killstreakBefore > 3) {
		player.addPotionEffect(new PotionEffect(MobEffects.JUMP_BOOST, 10, 0));

	}
	if (killstreakBefore > 7) {
		player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 20 * 15, 0));

	}
	if (killstreakBefore > 11) {
		player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 10, 0));

	}
	if (killstreakBefore > 19) {
		player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 10, 1));

	}
	if (killstreakBefore > 29) {
		player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 10, 1));

	}
	if (killstreakBefore > 2) {
		player.addPotionEffect(new PotionEffect(MobEffects.WATER_BREATHING, 10, 0));
	}
}
 
开发者ID:The-Fireplace-Minecraft-Mods,项目名称:Wars-Mod,代码行数:73,代码来源:CommonEvents.java


示例17: setFlySpeed

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
private void setFlySpeed( PlayerCapabilities pc, float speed )
{
	ReflectionHelper.setPrivateValue( PlayerCapabilities.class, pc, speed, 5 );
}
 
开发者ID:spacechase0,项目名称:SurvivalWings,代码行数:5,代码来源:WingsUpdater.java


示例18: updateCapabilities

import net.minecraft.entity.player.PlayerCapabilities; //导入依赖的package包/类
@Override
public void updateCapabilities() {
    this.playerNetServerHandler.sendPacket(new S39PacketPlayerAbilities((PlayerCapabilities) this.getCapabilities()));
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:5,代码来源:MixinEntityPlayerMP.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DigitalOutput类代码示例发布时间:2022-05-21
下一篇:
Java SymbolAxis类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap