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