本文整理汇总了Java中cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent类的典型用法代码示例。如果您正苦于以下问题:Java WorldTickEvent类的具体用法?Java WorldTickEvent怎么用?Java WorldTickEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorldTickEvent类属于cpw.mods.fml.common.gameevent.TickEvent包,在下文中一共展示了WorldTickEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void update(WorldTickEvent evt) {
if(evt.world != world) {
return;
}
if(activeCondition != null && !activeCondition.isConditionMet(world, structure, worldPos)) {
return;
}
spawnActiveParticles();
if(spawnCondition != null && !spawnCondition.isConditionMet(world, structure, worldPos)) {
return;
}
remainingSpawnTries = behaviour.getNumberSpawned() + behaviour.getMaxSpawnRetries();
for (int i = 0; i < behaviour.getNumberSpawned() && remainingSpawnTries > 0; ++i) {
if(!trySpawnEntity()) {
break;
}
}
}
示例2: onServerWorldTick
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@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)
{
}
}
示例3: onWorldTick
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@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);
}
}
}
}
示例4: handle
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void handle(WorldTickEvent wte) {
if(burningArrowCache.containsKey(wte.world)) {
HashSet<EntityArrow> arrows=burningArrowCache.get(wte.world);
synchronized(arrows) {
Iterator<EntityArrow> iter=arrows.iterator();
while(iter.hasNext()) {
Entity e=iter.next();
if(e.worldObj==wte.world) {
try {
if(arrowDotIsInGround.getBoolean(e)) {
iter.remove();
int x=(int) (e.posX-.5);
int y=(int) (e.posY);
int z=(int) (e.posZ-.5);
if(wte.world.getBlock(x,y,z) ==Blocks.air)
wte.world.setBlock(x,y,z, Blocks.fire);
}
} catch (Exception except) {
except.printStackTrace();
}
}
}
}
}
}
示例5: onServerWorldTick
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@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)
{
}
}
示例6: onServerTick
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerTick(WorldTickEvent event)
{
if(event.phase == Phase.START)
{
if(event.world.provider.dimensionId == 0 && AnvilRecipeHandler.world == null)
{
AnvilRecipeHandler.world = event.world;
AnvilRecipeHandler.getInstance().registerRecipes();
}
}
}
示例7: onServerWorldTick
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerWorldTick(WorldTickEvent e)
{
if (e.phase == Phase.START)
{
if (e.world.provider.dimensionId == 0 && e.world.getWorldInfo().getSeed() != wSeed) {
ModRecipes.initialiseAnvil(e.world);
wSeed = e.world.getWorldInfo().getSeed();
}
}
}
示例8: onServerWorldTick
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerWorldTick(WorldTickEvent e)
{
if (e.phase == Phase.START)
{
if (e.world.provider.dimensionId == 0)
TFCPPRecipes.initialiseAnvil();
}
else if(e.phase == Phase.END)
{
}
}
示例9: onWorldTick
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onWorldTick(WorldTickEvent event) {
if (!addWorldTick.isEmpty()) {
hWorldTick.addAll(addWorldTick);
addWorldTick.clear();
}
for (Iterator<LIHandler> it = hWorldTick.iterator(); it.hasNext(); ) {
LIHandler handler = it.next();
if (handler.isDead())
it.remove();
else
handler.trigger(event);
}
}
示例10: onTick
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onTick(WorldTickEvent evt)
{
if(evt.phase == Phase.END)
{
LogisticStorage.network.get().updateFields(evt.world);
}
else
{
handleTicks(evt.world);
}
}
示例11: worldTickEvent
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void worldTickEvent(WorldTickEvent event) {
Profiler profiler = event.world.theProfiler;
if(!(profiler instanceof CustomProfiler))
return;
CustomProfiler customProfiler = (CustomProfiler)profiler;
if(event.phase == Phase.START) {
customProfiler.setStage(CustomProfiler.Stage.BeforeLoop);
}
else {
customProfiler.setStage(CustomProfiler.Stage.None);
}
}
示例12: onTick
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onTick(WorldTickEvent event)
{
if(event.side == Side.SERVER)
{
if(event.phase == Phase.START)
{
tickStart(event.world);
}
else if(event.phase == Phase.END)
{
tickEnd(event.world);
}
}
}
示例13: onServerWorldTick
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerWorldTick(WorldTickEvent event)
{
World world = event.world;
if(event.phase == Phase.START)
{
if(world.provider.dimensionId == 0 && !Recipes.areAnvilRecipesRegistered())
{
Recipes.registerAnvilRecipes(world);
}
}
}
示例14: globalTicker
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
private void globalTicker(WorldTickEvent event) {
World world = event.world;
Long timeOfDay = world.getWorldTime() % 24000L;
if (timeOfDay == ticksDawn) { // new day has dawned
WorldData.worldDay += 1;
sendGlobalMessage(StatCollector.translateToLocalFormatted("text.newDayDawns", WorldData.worldDay));
WorldEvents.saveSettings(world, "global");
}
doPlayerEvents();
}
示例15: onServerWorldTick
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerWorldTick(WorldTickEvent event)
{
World world = event.world;
if(event.phase == Phase.START)
{
if(world.provider.dimensionId == 0 && !Recipes.areAnvilRecipesRegistered())
{
Recipes.registerAnvilRecipes();
}
}
}