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


Java BreakSpeed.setNewSpeed方法代码示例

本文整理汇总了Java中net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed.setNewSpeed方法的典型用法代码示例。如果您正苦于以下问题:Java BreakSpeed.setNewSpeed方法的具体用法?Java BreakSpeed.setNewSpeed怎么用?Java BreakSpeed.setNewSpeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed的用法示例。


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

示例1: onBreakSpeed

import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; //导入方法依赖的package包/类
@SubscribeEvent
public void onBreakSpeed(BreakSpeed event) {
  if (event.getState().getBlock() == this) {
    ItemStack held = event.getEntityPlayer().getHeldItemMainhand();
    if (held.isEmpty() || held.getItem().getHarvestLevel(held, "pickaxe", event.getEntityPlayer(), event.getState()) == -1) {
      event.setNewSpeed(event.getNewSpeed() + 2);
    }
    IConduitBundle te = (IConduitBundle) event.getEntity().world.getTileEntity(NullHelper.notnullF(event.getPos(), "BreakSpeed#getPos"));
    if (te != null && te.getFacadeType().isHardened()) {
      if (!YetaUtil.isSolidFacadeRendered(te, event.getEntityPlayer())) {
        event.setNewSpeed(event.getNewSpeed() * 6);
      } else {
        event.setNewSpeed(event.getNewSpeed() * 2);
      }
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:18,代码来源:BlockConduitBundle.java

示例2: fistingSpeed

import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; //导入方法依赖的package包/类
@SubscribeEvent
public void fistingSpeed(BreakSpeed event) {
	
	ItemStack powerfist = BaublesApi.getBaublesHandler(event.getEntityPlayer()).getStackInSlot(6);
	if (powerfist == null || (powerfist != null && powerfist.getItem() != this)) return;
	
	ItemStack mininghand = event.getEntityPlayer().getHeldItemMainhand();
	if (mininghand != null) return;
	
	if (event.getNewSpeed() < 8.0F)
		event.setNewSpeed(8.0F);
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:13,代码来源:EmblemPowerfist.java

示例3: onPlayerStrVsBlock

import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerStrVsBlock(BreakSpeed event)
{
	PlayerAether playerAether = PlayerAether.get(event.getEntityPlayer());

	if (playerAether != null)
	{
		event.setNewSpeed(playerAether.getCurrentPlayerStrVsBlock(event.getOriginalSpeed()));
	}
}
 
开发者ID:Modding-Legacy,项目名称:Aether-Legacy,代码行数:11,代码来源:PlayerAetherEvents.java

示例4: breakSpeed

import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; //导入方法依赖的package包/类
public static boolean breakSpeed(BreakSpeed event) {
	try {
		float f = getWorldHandlerForDim(event.getEntityPlayer().world.provider.getDimension()).breakSpeed(event.getPos(), event.getEntityPlayer(), event.getOriginalSpeed());
		if (f < 0)
			return true;
		event.setNewSpeed(f);
	} catch (Exception e) {
	}
	return false;
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:11,代码来源:WorldHandler.java

示例5: onEvent

import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; //导入方法依赖的package包/类
@Override
public void onEvent(BreakSpeed event) {
	if (!(event.getEntityPlayer() instanceof EntityPlayerMP)) return;
	
	ServerPlayerSettings settings = getPlayerSettings((EntityPlayerMP) event.getEntityPlayer());
	event.setNewSpeed(settings.breakspeed > 0 ? settings.breakspeed : event.getOriginalSpeed());
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:8,代码来源:CommandBreakspeed.java

示例6: onBreakSpeed

import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; //导入方法依赖的package包/类
@SubscribeEvent
public void onBreakSpeed(BreakSpeed event) {
    EntityPlayer player = event.getEntityPlayer();
    if (player != null) {
        Block block = event.getState().getBlock();
        int meta = block.getMetaFromState(event.getState());
        if (ProgressionEvents.isEventCancelled(event.getEntityPlayer(), ActionType.BREAKBLOCKWITH, event.getEntityPlayer().getHeldItemMainhand(), ActionType.BREAKBLOCK, BlockActionHelper.getStackFromBlockData(block, meta))) {
            event.setNewSpeed(0F);
        }
    }
}
 
开发者ID:joshiejack,项目名称:Progression,代码行数:12,代码来源:ActionBreakBlock.java


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