本文整理汇总了Java中cpw.mods.fml.common.gameevent.TickEvent.Phase.END属性的典型用法代码示例。如果您正苦于以下问题:Java Phase.END属性的具体用法?Java Phase.END怎么用?Java Phase.END使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cpw.mods.fml.common.gameevent.TickEvent.Phase
的用法示例。
在下文中一共展示了Phase.END属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onTick
@SubscribeEvent
public void onTick(ClientTickEvent event)
{
if (event.side == Side.CLIENT)
{
if (event.phase == Phase.START)
{
this.keyTick(event.type, false);
}
else if (event.phase == Phase.END)
{
this.keyTick(event.type, true);
}
}
}
示例2: Point_CuringFog
/** ʵ��Skill331-������֮����Ч���� */
@SubscribeEvent
public void Point_CuringFog(PlayerTickEvent event) {
if (event.phase == Phase.END) {
return;
}
EntityPlayer player = event.player;
if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ�����
&& RewriteHelper.hasSkill(player, RewriteHelper.CuringFog.id)
&& new Random().nextInt(1200) == 600
) {
List entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX-3.0D, player.posY-2.0D, player.posZ-3.0D, player.posX+3.0D, player.posY+2.0D, player.posZ+3.0D));
for (Iterator iterator = entities.iterator(); iterator.hasNext(); ) {
EntityLivingBase entity = (EntityLivingBase)iterator.next();
if (entity.isPotionActive(Potion.blindness)) entity.removePotionEffect(Potion.blindness.id);
if (entity.isPotionActive(Potion.confusion)) entity.removePotionEffect(Potion.confusion.id);
if (entity.isPotionActive(Potion.digSlowdown)) entity.removePotionEffect(Potion.digSlowdown.id);
if (entity.isPotionActive(Potion.hunger)) entity.removePotionEffect(Potion.hunger.id);
if (entity.isPotionActive(Potion.poison)) entity.removePotionEffect(Potion.poison.id);
if (entity.isPotionActive(Potion.weakness)) entity.removePotionEffect(Potion.weakness.id);
if (entity.isPotionActive(Potion.wither)) entity.removePotionEffect(Potion.wither.id);
}
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.cure")));
}
}
示例3: Point_HealingFog
/** ʵ��Skill332-������֮����Ч���� */
@SubscribeEvent
public void Point_HealingFog(PlayerTickEvent event) {
if (event.phase == Phase.END) {
return;
}
EntityPlayer player = event.player;
if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ�����
&& RewriteHelper.hasSkill(player, RewriteHelper.HealingFog.id)
&& new Random().nextInt(2400) == 800
) {
List entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX-3.0D, player.posY-2.0D, player.posZ-3.0D, player.posX+3.0D, player.posY+2.0D, player.posZ+3.0D));
for (Iterator iterator = entities.iterator(); iterator.hasNext(); ) {
EntityLivingBase entity = (EntityLivingBase)iterator.next();
entity.addPotionEffect(new PotionEffect(Potion.heal.id, 1, 0));
}
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.heal")));
}
}
示例4: Point_HurtingFog
/** ʵ��Skill333-���˺�֮����Ч���� */
@SubscribeEvent
public void Point_HurtingFog(PlayerTickEvent event) {
if (event.phase == Phase.END) {
return;
}
EntityPlayer player = event.player;
if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ�����
&& RewriteHelper.hasSkill(player, RewriteHelper.HurtingFog.id)
&& new Random().nextInt(2400) == 1600
) {
List entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX-3.0D, player.posY-2.0D, player.posZ-3.0D, player.posX+3.0D, player.posY+2.0D, player.posZ+3.0D));
for (Iterator iterator = entities.iterator(); iterator.hasNext(); ) {
EntityLivingBase entity = (EntityLivingBase)iterator.next();
if (!entity.equals(player)) entity.attackEntityFrom(DamageSource.causePlayerDamage(player), 10.0F);
}
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.hurt")));
}
}
示例5: Point_AuroraAutoRecover
/** �������Skill343-��ŷ������������ŷ�������� */
@SubscribeEvent
public void Point_AuroraAutoRecover(PlayerTickEvent event) {
if (event.phase == Phase.END) {
return;
}
EntityPlayer player = event.player;
if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ�����
&& RewriteHelper.hasSkill(player, RewriteHelper.AuroraRegeneration.id)
&& new Random().nextInt(6000) == 3000
) {
RewriteHelper.modifyAuroraPoint(player, 1);
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.aurorarecovery")));
}
}
示例6: tickEventEnd
@SubscribeEvent(priority=EventPriority.LOWEST)
public void tickEventEnd(ServerTickEvent event) {
if(event.phase == Phase.END)
{
getTimedGroup("other").endTimer();
root.endTick(true);
if(debugTimer)
System.out.println("Tick time used: " + (root.getTimeUsed()/root.timeMilisecond) + "ms");
//After every world is done ticking, re-balance the time slices according
//to the data gathered during the tick.
root.balanceTime();
//Calculate TPS
updateTPS();
if(saveConfig)
{
saveConfig = false;
config.save();
}
}
}
示例7: onServerWorldTick
@SubscribeEvent
public void onServerWorldTick(WorldTickEvent e)
{
if (e.phase == Phase.START)
{
if (e.world.provider.dimensionId == 0 && !ModRecipes.ScriptsReloaded)
{
//ModRecipes.initialiseAnvil();
}
}
else if(e.phase == Phase.END)
{
}
}
示例8: tick
public void tick(Phase phase) {
FakeWorld.getFakeWorld(this);
if (progress >= 1)
return;
if (phase == Phase.END) {
if (progress == 0) {
if (!getWorld().isRemote)
NetworkHandler.instance().sendToAllAround(new PacketStartMoving(motor, this), getWorld(), 128);
startMoving();
if (!getWorld().isRemote)
NetworkHandler.instance().sendToAllAround(new PacketBlockSync(motor, this), getWorld(), 128);
}
progress += speed;
moveEntities();
if (progress >= 1)
finishMoving();
}
}
示例9: onWorldTick
@SubscribeEvent
public void onWorldTick(WorldTickEvent event) {
if(event.side == Side.SERVER && event.phase == Phase.END) {
World world = event.world;
if (world.provider.dimensionId == 0) { // only operate on overworld (for now)
Long thisTick = world.getWorldTime();
if (instantTickDelay == 0) {
if (WorldTickEvents.eventPendingInstant) {
if (eventPendingInstantUsers.size() > 0) { // player instants
doPlayerInstants();
}
}
instantTickDelay = instantTickDelayReset;
}
instantTickDelay--;
if (thisTick % ticksPerQuartHour == 0) { // check for stuff every in-game quarter-hour
globalTicker(event);
}
}
}
}
示例10: onTick
@SubscribeEvent
public void onTick(ServerTickEvent e) {
if (e.phase == Phase.END) {
if (!chunksToGen.isEmpty()) {
GenData data = chunksToGen.pop();
Chunk chunk = data.chunk;
if (data.level == 0) {
yttrGen.generate(chunk.worldObj.rand, chunk.xPosition, chunk.zPosition, chunk.worldObj, null, null);
} else if (data.level == 1) {
xenoGen.generate(chunk.worldObj.rand, chunk.xPosition, chunk.zPosition, chunk.worldObj, null, null);
}
chunk.setChunkModified();
log.info("Retrogenerating "+chunk.xPosition+", "+chunk.zPosition);
}
}
}
示例11: onClientTick
@SubscribeEvent
public void onClientTick(ClientTickEvent event) {
if(event.phase == Phase.END) {
for(EQMod mod : EQMod.mods.values()) {
if(mod.config.displayVersionResult && !mod.versionMessage && mod.versionResult == EQVersion.OUTDATED) {
if(FMLClientHandler.instance().getClient().currentScreen == null) {
if(mod.versionResult != EQVersion.UNINITIALIZED || mod.versionResult != EQVersion.FINAL_ERROR) {
mod.versionMessage = true;
if(mod.versionResult == EQVersion.OUTDATED) {
ChatComponentText chatComponent = new ChatComponentText(EQVersion.getResultMessageForClient(mod));
chatComponent.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(LanguageManager.getLocalization("elconqore.version.chat_hover"))));
chatComponent.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, mod.remoteUpdateLocation));
Minecraft.getMinecraft().thePlayer.addChatMessage(chatComponent);
}
}
}
}
}
}
}
示例12: TickEvent
@SubscribeEvent
public void TickEvent(RenderTickEvent event) {
config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory
+ DefaultProps.defaultConfigFile));
config.load();
displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth);
config.save();
if (event.phase == Phase.END && displayBossHealth) {
if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) {
renderBossHealthBar(targetBoss, targetBoss.getDefaultEntityName() + " Health");
}
}
}
示例13: onRenderTick
@SubscribeEvent
public void onRenderTick(RenderTickEvent event) {
if(event.phase == Phase.END) {
Minecraft mc = Minecraft.getMinecraft();
if(mc.currentScreen instanceof net.minecraft.client.gui.GuiMainMenu && !(mc.currentScreen instanceof GuiMainMenu)) {
mc.displayGuiScreen(new GuiMainMenu());
}
if(!(mc.ingameGUI instanceof GuiInGame)) {
mc.ingameGUI = new GuiInGame(mc);
}
if(GuiTechTreeComponent.instance == null) {
GuiTechTreeComponent.instance = new GuiTechTreeComponent();
}
GuiTechTreeComponent.instance.updateTechTreeWindow();
}
}
示例14: RenderTickEvent
@SubscribeEvent
public void RenderTickEvent(RenderTickEvent event) {
if ((event.type == Type.RENDER || event.type == Type.CLIENT) && event.phase == Phase.END) {
Minecraft mc = Minecraft.getMinecraft();
if (!ticked && mc.ingameGUI != null) {
mc.ingameGUI = new GuiAdvancedHUD(mc);
ticked = true;
}
if (firstload && mc != null) {
if (!SaveController.loadConfig("config")) {
HUDRegistry.checkForResize();
HUDRegistry.resetAllDefaults();
SaveController.saveConfig("config");
}
firstload = false;
}
// TODO Add notification on main menu when an update for advancedhud is available :)
// if (mc.currentScreen instanceof GuiMainMenu) {
// int mouseX = Mouse.getX() * mc.currentScreen.width / mc.displayWidth;
// int mouseY = mc.currentScreen.height - Mouse.getY() * mc.currentScreen.height / mc.displayHeight - 1;
// RenderAssist.drawCircle(mouseX, mouseY, 3, 24, 0xFFFFFFFF);
// RenderAssist.drawRect(1, 1, 70, 11, 0x608f3eff);
// mc.currentScreen.drawString(mc.fontRenderer, "AdvancedHUD!", 2, 2, 0x48dce9);
// }
}
}
示例15: onServerWorldTick
@SubscribeEvent
public void onServerWorldTick(WorldTickEvent e)
{
if (e.phase == Phase.START)
{
if (e.world.provider.dimensionId == 0)
ModRecipes.initialiseAnvil();
}
else if(e.phase == Phase.END)
{
}
}