本文整理汇总了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);
}
}
}
}
示例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);
}
示例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()));
}
}
示例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;
}
示例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());
}
示例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);
}
}
}