Tick Handler Changes
1. Renamed CommonTickHandler to ServerTickHandler. Given that it only handles server ticks, this seems like a reasonable name. Also changed its profiler label to the new name. 2. Deleted ClientTickHandler and removed any references to it in mod_pocketDim. It was never used for anything.
This commit is contained in:
parent
8da0339c78
commit
c22479c0e8
3 changed files with 5 additions and 72 deletions
|
@ -52,12 +52,12 @@ import StevenDimDoors.mod_pocketDim.items.ItemUnstableDoor;
|
|||
import StevenDimDoors.mod_pocketDim.items.ItemWarpDoor;
|
||||
import StevenDimDoors.mod_pocketDim.items.ItemWorldThread;
|
||||
import StevenDimDoors.mod_pocketDim.items.itemRiftRemover;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.CommonTickHandler;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.CustomLimboPopulator;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.FastRiftRegenerator;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.LimboDecay;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.MobMonolith;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.RiftRegenerator;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.ServerTickHandler;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoorGold;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityRift;
|
||||
|
@ -69,7 +69,6 @@ import StevenDimDoors.mod_pocketDim.world.LimboProvider;
|
|||
import StevenDimDoors.mod_pocketDim.world.PocketProvider;
|
||||
import StevenDimDoors.mod_pocketDim.world.gateways.GatewayGenerator;
|
||||
import StevenDimDoors.mod_pocketDimClient.ClientPacketHandler;
|
||||
import StevenDimDoors.mod_pocketDimClient.ClientTickHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
|
@ -183,8 +182,7 @@ public class mod_pocketDim
|
|||
@EventHandler
|
||||
public void onInitialization(FMLInitializationEvent event)
|
||||
{
|
||||
CommonTickHandler commonTickHandler = new CommonTickHandler();
|
||||
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
|
||||
ServerTickHandler commonTickHandler = new ServerTickHandler();
|
||||
TickRegistry.registerTickHandler(commonTickHandler, Side.SERVER);
|
||||
|
||||
//MonolithSpawner should be initialized before any provider instances are created
|
||||
|
|
|
@ -7,15 +7,15 @@ import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
|||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
|
||||
public class CommonTickHandler implements ITickHandler, IRegularTickSender
|
||||
public class ServerTickHandler implements ITickHandler, IRegularTickSender
|
||||
{
|
||||
private static final String PROFILING_LABEL = "Dimensional Doors: Common Tick";
|
||||
private static final String PROFILING_LABEL = "Dimensional Doors: Server Tick";
|
||||
|
||||
private int tickCount = 0;
|
||||
private ArrayList<RegularTickReceiverInfo> receivers;
|
||||
|
||||
|
||||
public CommonTickHandler()
|
||||
public ServerTickHandler()
|
||||
{
|
||||
this.receivers = new ArrayList<RegularTickReceiverInfo>();
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
package StevenDimDoors.mod_pocketDimClient;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
|
||||
public class ClientTickHandler implements ITickHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public void tickStart(EnumSet<TickType> type, Object... tickData) {}
|
||||
|
||||
@Override
|
||||
public void tickEnd(EnumSet<TickType> type, Object... tickData)
|
||||
{
|
||||
if (type.equals(EnumSet.of(TickType.RENDER)))
|
||||
{
|
||||
onRenderTick();
|
||||
}
|
||||
else if (type.equals(EnumSet.of(TickType.CLIENT)))
|
||||
{
|
||||
GuiScreen guiscreen = Minecraft.getMinecraft().currentScreen;
|
||||
if (guiscreen != null)
|
||||
{
|
||||
onTickInGUI(guiscreen);
|
||||
} else {
|
||||
onTickInGame();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<TickType> ticks()
|
||||
{
|
||||
return EnumSet.of(TickType.RENDER, TickType.CLIENT);
|
||||
// In my testing only RENDER, CLIENT, & PLAYER did anything on the client side.
|
||||
// Read 'cpw.mods.fml.common.TickType.java' for a full list and description of available types
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() { return null; }
|
||||
|
||||
|
||||
public void onRenderTick()
|
||||
{
|
||||
//System.out.println("onRenderTick");
|
||||
//TODO: Your Code Here
|
||||
}
|
||||
|
||||
public void onTickInGUI(GuiScreen guiscreen)
|
||||
{
|
||||
//System.out.println("onTickInGUI");
|
||||
//TODO: Your Code Here
|
||||
}
|
||||
|
||||
public void onTickInGame()
|
||||
{
|
||||
|
||||
|
||||
//System.out.println("onTickInGame");
|
||||
//TODO: Your Code Here
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue