本文整理匯總了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)
{
}
}