本文整理汇总了Java中cpw.mods.fml.common.eventhandler.EventPriority.LOWEST属性的典型用法代码示例。如果您正苦于以下问题:Java EventPriority.LOWEST属性的具体用法?Java EventPriority.LOWEST怎么用?Java EventPriority.LOWEST使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cpw.mods.fml.common.eventhandler.EventPriority
的用法示例。
在下文中一共展示了EventPriority.LOWEST属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: denyCraft
@SubscribeEvent(priority = EventPriority.LOWEST)
public void denyCraft(final ToolBuildEvent event) {
if (ExtraUtils.tcon_unstable_material_id <= 0) {
return;
}
final WorldServer world = DimensionManager.getWorld(0);
if (world == null) {
return;
}
if (isToolExpired(event.headStack, world) || isToolExpired(event.handleStack, world) || isToolExpired(event.accessoryStack, world) || isToolExpired(event.extraStack, world)) {
event.headStack = null;
event.handleStack = null;
event.accessoryStack = null;
event.extraStack = null;
}
}
示例2: onServerChat
@SubscribeEvent(priority=EventPriority.LOWEST)
public void onServerChat(ServerChatEvent e)
{
EntityPlayerMP sender = e.player;
List<EntityPlayerMP> players = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
String finalMessage = ChatFormatter.ChatParser(sender);
for (EntityPlayerMP receiver : players)
{receiver.addChatMessage(new ChatComponentText(finalMessage + "<" + e.username + ">: " + e.message));
}
BetterChat.bLog.info(sender.getDisplayName() + " said: " + e.message);
e.setCanceled(true);
}
示例3: onPlayerPearl
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPlayerPearl(EnderTeleportEvent event)
{
if ( !(event.entityLiving instanceof EntityPlayerMP) )
return;
if ( Config.getKnockBack() == 0.0 || !Config.getDenyEnderpearl() )
return;
EntityPlayerMP player = (EntityPlayerMP) event.entityLiving;
Log.trace( "Caught pearl teleport event by %s", player.getDisplayName() );
Location target = new Location(event, player);
Location newLoc = BorderCheck.checkPlayer(player, target, true, true);
if (newLoc != null)
{
event.setCanceled(true);
event.targetX = newLoc.posX;
event.targetY = newLoc.posY;
event.targetZ = newLoc.posZ;
}
}
示例4: onWorldDecoration
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onWorldDecoration(DecorateBiomeEvent.Decorate event)
{
if ((event.getResult() == Result.ALLOW || event.getResult() == Result.DEFAULT) && event.type == EventType.FLOWERS)
{
for(int i = 0; i < 2; i++)
{
int x = event.chunkX + event.rand.nextInt(16) + 8;
int z = event.chunkZ + event.rand.nextInt(16) + 8;
int y = event.world.getTopSolidOrLiquidBlock(x, z);
if(event.world.isAirBlock(x, y, z) && Blocks.flower_pot.canBlockStay(event.world, x, y, z) && ConfigPrimitiveCraft.genrocks)
{
event.world.setBlock(x, y, z, ModBlocks.rock);
}
else if(event.world.getBlock(x, y, z) == Blocks.water && ConfigPrimitiveCraft.genshale)
{
event.world.setBlock(x, y-1, z, ModBlocks.shale);
}
}
}
}
示例5: playerInteractEvent
@SubscribeEvent(priority = EventPriority.LOWEST)
public void playerInteractEvent(PlayerInteractEvent event)
{
WorldInteractLogEvent log = new WorldInteractLogEvent();
log.setType(TYPE_INTERACT_WORLD);
if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR)
{
log.setPlayerPosAndUuid(event.entityPlayer);
}
else
{
log.setPlayerUUID(event.entityPlayer);
log.setPosition(event.entity.dimension, event.x, event.y, event.z);
log.setData(event.action, event.face, event.entityPlayer.getCurrentEquippedItem());
}
LoggingQueue.addToQueue(log);
}
示例6: onBiomeDecoration
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onBiomeDecoration(DecorateBiomeEvent.Decorate event)
{
if (event.type == DecorateBiomeEvent.Decorate.EventType.FLOWERS && (event.getResult() == Event.Result.ALLOW || event.getResult() == Event.Result.DEFAULT))
{
for (int i = 0; i < Settings.FLOWER_QUANTITY; i++)
{
int x = event.chunkX + event.rand.nextInt(16) + 8;
int z = event.chunkZ + event.rand.nextInt(16) + 8;
int y = event.world.getTopSolidOrLiquidBlock(x, z);
Block randomPlant = ModBlocks.plants[event.rand.nextInt(ModBlocks.plants.length)];
if (event.world.isAirBlock(x, y, z) && (!event.world.provider.hasNoSky || y < 255) && randomPlant.canBlockStay(event.world, x, y, z))
{
event.world.setBlock(x, y, z, randomPlant, 0, 2);
}
}
}
}
示例7: blockBreakEvent
@SubscribeEvent(priority = EventPriority.LOWEST)
public void blockBreakEvent(BlockEvent.BreakEvent event)
{
BlockSnapshotLogEvent log = new BlockSnapshotLogEvent();
log.setType(TYPE_BLOCK_BREAK);
log.setPlayerUUID(event.getPlayer());
log.setPosition(event.world.provider.dimensionId, event.x, event.y, event.z);
NBTTagCompound nbt = null;
if (event.block.hasTileEntity(event.blockMetadata))
{
TileEntity te = event.world.getTileEntity(event.x, event.y, event.z);
if (te != null)
{
nbt = new NBTTagCompound();
te.writeToNBT(nbt);
}
}
log.setData(new BlockSnapshot(event.world, event.x, event.y, event.z, event.block, event.blockMetadata, nbt));
LoggingQueue.addToQueue(log);
}
示例8: onWorldDecoration
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onWorldDecoration(DecorateBiomeEvent.Decorate event) {
BiomeGenBase biome = event.world.getBiomeGenForCoords(event.chunkX, event.chunkZ);
if (biome != null && isValidBiomeType(biome)) {
if ((event.getResult() == Event.Result.ALLOW || event.getResult() == Event.Result.DEFAULT) && event.type == DecorateBiomeEvent.Decorate.EventType.FLOWERS) {
for (int i = 0; i < ModLibs.manaFlowerQuantity; i++) {
int x = event.chunkX + event.rand.nextInt(16) + 8;
int z = event.chunkZ + event.rand.nextInt(16) + 8;
int y = event.world.getTopSolidOrLiquidBlock(x, z);
for (int j = 0; j < ModLibs.manaFlowerDensity; j++) {
int x1 = x + event.rand.nextInt(8) - event.rand.nextInt(8);
int y1 = y + event.rand.nextInt(4) - event.rand.nextInt(4);
int z1 = z + event.rand.nextInt(8) - event.rand.nextInt(8);
if (event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && ModBlocks.manaFlower.canBlockStay(event.world, x1, y1, z1))
event.world.setBlock(x1, y1, z1, ModBlocks.manaFlower, event.rand.nextInt(3), 2);
}
}
}
}
}
示例9: onLivingDrop
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onLivingDrop(LivingDropsEvent event)
{
if (event.entityLiving instanceof EntityCreeper)
{
boolean foundRecord = false;
Iterator<EntityItem> iter = event.drops.iterator();
while (iter.hasNext())
{
EntityItem e = iter.next();
if (e.getEntityItem().getItem() instanceof ItemRecord)
{
foundRecord = true;
}
}
if (foundRecord)
{
addRandomRecordToDrops(event.drops);
}
}
}
示例10: onServerTick
/** Uses lowest event priority to run after everything else has */
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onServerTick(TickEvent.ServerTickEvent event)
{
// Only run at end of tick to catch players that just moved past border
if (event.phase == TickEvent.Phase.START)
return;
if ( WorldBorder.SERVER.getTickCounter() % Config.getTimerTicks() != 0 )
return;
for (Object o : WorldBorder.SERVER.getConfigurationManager().playerEntityList)
BorderCheck.checkPlayer( (EntityPlayerMP) o, null, false, true );
}
示例11: entityInteractEvent
@SubscribeEvent(priority = EventPriority.LOWEST)
public void entityInteractEvent(EntityInteractEvent event)
{
EntityInteractLogEvent log = new EntityInteractLogEvent();
log.setType(TYPE_INTERACT_ENTITY);
log.setPlayerPosAndUuid(event.entityPlayer);
log.setData(event.target, event.entityPlayer.getCurrentEquippedItem());
LoggingQueue.addToQueue(log);
}
示例12: onModify
@SubscribeEvent(priority=EventPriority.LOWEST)
public void onModify(ModifyEvent event){
String key = event.modifier.key;
if(incompatibleModifierKeys.containsKey(key)){
for(String s : incompatibleModifierKeys.get(key))
if(event.itemStack.getTagCompound().getCompoundTag(event.item.getBaseTagName()).hasKey(s))
{
event.setCanceled(true);
return;
}
}
}
示例13: onArrowNock
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onArrowNock(ArrowNockEvent event) {
EntityPlayer player = event.entityPlayer;
ItemStack stack = player.getHeldItem();
if (player.capabilities.isCreativeMode || player.inventory.hasItem(Items.arrow)
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0) {
player.setItemInUse(stack, stack.getItem().getMaxItemUseDuration(stack));
}
event.result = stack;
event.setCanceled(true);
}
示例14: renderPost
@SubscribeEvent(priority = EventPriority.LOWEST, receiveCanceled = true)
public void renderPost(RenderLivingEvent.Post event) {
if(event.entity instanceof EntityPlayer) {
EntityPlayer p = (EntityPlayer) event.entity;
if(armor != null) {
p.inventory.armorInventory = armor;
}
}
}
示例15: playerEvent_Login
@SubscribeEvent(priority = EventPriority.LOWEST)
public void playerEvent_Login(PlayerEvent.PlayerLoggedInEvent event)
{
PlayerCache.login(event.player.getGameProfile());
LogEvent log = new LogEvent();
log.setType(TYPE_LOGIN);
log.setPlayerPosAndUuid(event.player);
LoggingQueue.addToQueue(log);
}