本文整理匯總了Java中net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java TickEvent.ServerTickEvent方法的具體用法?Java TickEvent.ServerTickEvent怎麽用?Java TickEvent.ServerTickEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraftforge.fml.common.gameevent.TickEvent
的用法示例。
在下文中一共展示了TickEvent.ServerTickEvent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onServerTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
if (event.phase == TickEvent.Phase.END) {
Iterator<Map.Entry<WorldAndCoord, IHackableBlock>> blockIterator = hackedBlocks.entrySet().iterator();
while (blockIterator.hasNext()) {
Map.Entry<WorldAndCoord, IHackableBlock> entry = blockIterator.next();
IHackableBlock hackableBlock = entry.getValue();
WorldAndCoord hackedBlock = entry.getKey();
boolean found = false;
for (Map.Entry<Block, Class<? extends IHackableBlock>> registeredEntry : PneumaticHelmetRegistry.getInstance().hackableBlocks.entrySet()) {
if (hackableBlock.getClass() == registeredEntry.getValue()) {
if (hackedBlock.getBlock() == registeredEntry.getKey()) {
if (!hackableBlock.afterHackTick((World) hackedBlock.world, hackedBlock.pos)) {
blockIterator.remove();
}
found = true;
break;
}
}
}
if (!found) blockIterator.remove();
}
}
}
示例2: onServerTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
for (ISemiBlock semiBlock : addingBlocks) {
Chunk chunk = semiBlock.getWorld().getChunkFromBlockCoords(semiBlock.getPos());
addPendingBlock(chunk, semiBlock);
chunk.markDirty();
for (EntityPlayer player : syncList.get(chunk)) {
NetworkHandler.sendTo(new PacketAddSemiBlock(semiBlock), (EntityPlayerMP) player);
PacketDescription descPacket = semiBlock.getDescriptionPacket();
if (descPacket != null) NetworkHandler.sendTo(descPacket, (EntityPlayerMP) player);
}
}
addingBlocks.clear();
for (Chunk removingChunk : chunksMarkedForRemoval) {
if (!removingChunk.isLoaded()) {
semiBlocks.remove(removingChunk);
syncList.remove(removingChunk);
}
}
chunksMarkedForRemoval.clear();
semiBlocks.values().forEach(this::update);
}
示例3: serverTickEnd
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void serverTickEnd(TickEvent.ServerTickEvent event) {
if (event.phase == TickEvent.Phase.START)
if (tickleft <= 0) {
tickleft = 20;
Object[] entArray = ItemUsable.lastDamage.keySet().toArray();
for (int x = 0; x < entArray.length; x++) {
Entity entity = (Entity) entArray[x];
float[] dmg = ItemUsable.lastDamage.get(entArray[x]);
for (int i = 19; i >= 0; i--)
if (i > 0) {
dmg[i] = dmg[i - 1];
} else {
dmg[0] = 0;
}
}
} else {
tickleft--;
}
}
示例4: onServerTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event)
{
if(event.phase == TickEvent.Phase.END)
{
Iterator<Track> ite = tracksPlaying.iterator();
while(ite.hasNext())
{
Track track = ite.next();
if(!track.update())
{
ite.remove();
continue;
}
}
}
}
示例5: serverTicks
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void serverTicks(TickEvent.ServerTickEvent event) {
if (event.phase != TickEvent.Phase.START) return;
i++;
if (watchDog != null) {
// Pat Lagssie
watchDog.ticks++;
} else if (i == 40) {
watchDog = new LagssieWatchDog("LAG-SERVER", Thread.currentThread(), Lagssie.intervalServer);
watchDog.start();
}
}
示例6: clientTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void clientTick(TickEvent.ServerTickEvent event) {
if (event.phase == TickEvent.Phase.END) return;
if (EventCalendar.isGuiFun()) {
GuiHealthScreen.BED_ITEMSTACK.setItemDamage(id);
Minecraft mc = Minecraft.getMinecraft();
if (mc.world != null && mc.world.getWorldTime() % 3 == 0) id++;
if (id > 15) id = 0;
}
}
示例7: onServerTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
/** Tick event called on the Server.<br>
* Used to send the heart-beat at regular intervals.
* @param ev ClientTickEvent for this tick.
*/
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent ev)
{
if (isTimeForBeat())
{
beat();
}
}
示例8: onServerTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent ev)
{
// Pass the event on to the active episode, if there is one:
this.stateEpisodeLock.readLock().lock();
if (this.stateEpisode != null && this.stateEpisode.isLive())
{
this.stateEpisode.onServerTick(ev);
}
this.stateEpisodeLock.readLock().unlock();
}
示例9: onServerTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@Override
protected void onServerTick(TickEvent.ServerTickEvent ev)
{
try
{
checkForMissionCommand();
}
catch (Exception e)
{
// TODO: What now?
e.printStackTrace();
}
}
示例10: onServerTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
if (event.phase!=TickEvent.Phase.START) return;
inc++;
if (inc>=10) { //Only pulse about twice a second.
inc = 0;
synchronized(schedulers) {
for(Scheduler scheduler : schedulers.values()) {
scheduler.tick();
}
}
}
}
示例11: onServerTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
/** 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.getPlayerList().getPlayerList())
BorderCheck.checkPlayer( (EntityPlayerMP) o, null, false, true );
}
示例12: onServerTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
AllChunks.onTick();
}
示例13: onWorldTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldTick(TickEvent.ServerTickEvent event) {
ServerActionManager.getManager().tick();
}
示例14: serverTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void serverTick(TickEvent.ServerTickEvent event) {
Pregen.tick();
}
示例15: addTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void addTick(TickEvent.ServerTickEvent e) {
if(e.phase == TickEvent.Phase.START) {
ticks.incrementAndGet();
}
}