mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-21 20:52:14 +00:00
Added base CoreMod data as a temporary solution to deps.
This commit is contained in:
1 parent
04764c83c9
commit
c56a5e9f65
7 files changed
+201
-9
No files matched your search
@@ -0,0 +1,38 @@
|
||||
package mcp.mobius.mobiuscore.profiler;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DummyProfiler implements IProfilerBase{
|
||||
@Override
|
||||
public void reset() {}
|
||||
|
||||
@Override
|
||||
public void start() {}
|
||||
|
||||
@Override
|
||||
public void stop() {}
|
||||
|
||||
@Override
|
||||
public void start(Object key) {}
|
||||
|
||||
@Override
|
||||
public void stop(Object key) {}
|
||||
|
||||
@Override
|
||||
public void start(Object key1, Object key2) {}
|
||||
|
||||
@Override
|
||||
public void stop(Object key1, Object key2) {}
|
||||
|
||||
@Override
|
||||
public void start(Object key1, Object key2, Object key3) {}
|
||||
|
||||
@Override
|
||||
public void stop(Object key1, Object key2, Object key3) {}
|
||||
|
||||
@Override
|
||||
public void start(Object key1, Object key2, Object key3, Object key4) {}
|
||||
|
||||
@Override
|
||||
public void stop(Object key1, Object key2, Object key3, Object key4) {}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package mcp.mobius.mobiuscore.profiler;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IProfilerBase {
|
||||
|
||||
public void reset();
|
||||
|
||||
public void start();
|
||||
public void stop();
|
||||
|
||||
public void start(Object key);
|
||||
public void stop(Object key);
|
||||
|
||||
public void start(Object key1, Object key2);
|
||||
public void stop(Object key1, Object key2);
|
||||
|
||||
public void start(Object key1, Object key2, Object key3);
|
||||
public void stop(Object key1, Object key2, Object key3);
|
||||
|
||||
public void start(Object key1, Object key2, Object key3, Object key4);
|
||||
public void stop(Object key1, Object key2, Object key3, Object key4);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package mcp.mobius.mobiuscore.profiler;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public enum ProfilerSection implements IProfilerBase{
|
||||
DIMENSION_TICK (RunType.REALTIME, Side.SERVER), //Global section around the ticks for each dim (Blocks & ents).
|
||||
DIMENSION_BLOCKTICK(RunType.ONREQUEST, Side.SERVER), //Subsection for dimension block tick.
|
||||
ENTITY_UPDATETIME (RunType.ONREQUEST, Side.SERVER), //Profiling of the entity tick time, per entity.
|
||||
TICK (RunType.REALTIME, Side.SERVER), //Tick timing profiling
|
||||
TILEENT_UPDATETIME (RunType.ONREQUEST, Side.SERVER), //Profiling of the TileEntity tick time, per TE.
|
||||
HANDLER_TICKSTART (RunType.ONREQUEST, EnumSet.of(Side.CLIENT, Side.SERVER)), //Server handler for ServerTick start.
|
||||
HANDLER_TICKSTOP (RunType.ONREQUEST, EnumSet.of(Side.CLIENT, Side.SERVER)), //Server handler for ServerTick stop.
|
||||
PACKET_INBOUND (RunType.REALTIME, Side.SERVER), //Outbound packet analysis
|
||||
PACKET_OUTBOUND (RunType.REALTIME, Side.SERVER), //Inbound packet analysis
|
||||
|
||||
NETWORK_TICK (RunType.ONREQUEST, Side.SERVER), //The time it takes for the server to handle the packets during a tick.
|
||||
EVENT_INVOKE (RunType.ONREQUEST, EnumSet.of(Side.CLIENT, Side.SERVER)), //Timing of the event invokation
|
||||
|
||||
RENDER_TILEENTITY (RunType.ONREQUEST, Side.CLIENT), //Profiler for TileEnt rendering
|
||||
RENDER_ENTITY (RunType.ONREQUEST, Side.CLIENT), //Profiler for Entity rendering
|
||||
RENDER_BLOCK (RunType.ONREQUEST, Side.CLIENT); //Profiler for Block rendering
|
||||
|
||||
public enum RunType{
|
||||
REALTIME,
|
||||
ONREQUEST;
|
||||
}
|
||||
|
||||
private EnumSet<Side> sides;
|
||||
private RunType runType;
|
||||
private IProfilerBase profiler = new DummyProfiler();;
|
||||
private IProfilerBase profilerSuspended = new DummyProfiler();;
|
||||
|
||||
public static long timeStampLastRun;
|
||||
|
||||
private ProfilerSection(RunType runType, Side side){
|
||||
this.runType = runType;
|
||||
this.profiler = new DummyProfiler();
|
||||
this.sides = EnumSet.of(side);
|
||||
}
|
||||
|
||||
private ProfilerSection(RunType runType, EnumSet<Side> sides){
|
||||
this.runType = runType;
|
||||
this.profiler = new DummyProfiler();
|
||||
this.sides = sides;
|
||||
}
|
||||
|
||||
public RunType getRunType(){
|
||||
return this.runType;
|
||||
}
|
||||
|
||||
public EnumSet<Side> getSide(){
|
||||
return this.sides;
|
||||
}
|
||||
|
||||
public IProfilerBase getProfiler(){
|
||||
return this.profilerSuspended;
|
||||
}
|
||||
|
||||
public void setProfiler(IProfilerBase profiler){
|
||||
this.profilerSuspended = profiler;
|
||||
if (this.runType == RunType.REALTIME)
|
||||
this.profiler = profiler;
|
||||
}
|
||||
|
||||
public void activate(){
|
||||
this.profiler = profilerSuspended;
|
||||
this.timeStampLastRun = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public void desactivate(){
|
||||
if (this.runType == RunType.ONREQUEST)
|
||||
this.profiler = new DummyProfiler();
|
||||
}
|
||||
|
||||
public static void activateAll(Side trgside){
|
||||
for (ProfilerSection section : ProfilerSection.values())
|
||||
if (section.sides.contains(trgside))
|
||||
section.activate();
|
||||
}
|
||||
|
||||
public static void desactivateAll(Side trgside){
|
||||
for (ProfilerSection section : ProfilerSection.values())
|
||||
if (section.sides.contains(trgside))
|
||||
section.desactivate();
|
||||
}
|
||||
|
||||
public static void resetAll(Side trgside){
|
||||
for (ProfilerSection section : ProfilerSection.values())
|
||||
if (section.sides.contains(trgside))
|
||||
section.reset();
|
||||
}
|
||||
|
||||
public static String getClassName(){
|
||||
return ProfilerSection.class.getCanonicalName().replace(".", "/");
|
||||
}
|
||||
|
||||
public static String getTypeName(){
|
||||
return "L" + ProfilerSection.getClassName() + ";";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() { this.profiler.reset(); this.profilerSuspended.reset(); }
|
||||
@Override
|
||||
public void start() { this.profiler.start(); }
|
||||
@Override
|
||||
public void stop() { this.profiler.stop(); }
|
||||
@Override
|
||||
public void start(Object key) { this.profiler.start(key); }
|
||||
@Override
|
||||
public void stop(Object key) { this.profiler.stop(key); }
|
||||
@Override
|
||||
public void start(Object key1, Object key2) { this.profiler.start(key1, key2); }
|
||||
@Override
|
||||
public void stop(Object key1, Object key2) { this.profiler.stop(key1, key2); }
|
||||
@Override
|
||||
public void start(Object key1, Object key2, Object key3) { this.profiler.start(key1, key2, key3);}
|
||||
@Override
|
||||
public void stop(Object key1, Object key2, Object key3) { this.profiler.stop(key1, key2, key3); }
|
||||
@Override
|
||||
public void start(Object key1, Object key2, Object key3, Object key4) { this.profiler.start(key1, key2, key3, key4);}
|
||||
@Override
|
||||
public void stop(Object key1, Object key2, Object key3, Object key4) { this.profiler.stop(key1, key2, key3, key4); }
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import javax.swing.JTabbedPane;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import mcp.mobius.opis.data.holders.basetypes.SerialInt;
|
||||
import mcp.mobius.opis.network.enums.Message;
|
||||
import mcp.mobius.opis.network.packets.client.Packet_ReqData;
|
||||
|
||||
@@ -5,9 +5,8 @@ import mcp.mobius.opis.events.PlayerTracker;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
|
||||
|
||||
public class CommandAddPrivileged extends CommandBase implements IOpisCommand{
|
||||
|
||||
|
||||
@@ -4,10 +4,9 @@ import java.util.logging.Logger;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import mcp.mobius.mobiuscore.profiler.ProfilerSection;
|
||||
import mcp.mobius.opis.commands.client.CommandClientShowRenderTick;
|
||||
import mcp.mobius.opis.commands.client.CommandClientStart;
|
||||
@@ -63,20 +62,17 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.ServerStarting;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkMod;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@Mod(modid="Opis", name="Opis", version="1.2.2")
|
||||
@NetworkMod(channels={"Opis", "Opis_Chunk"},clientSideRequired=false, serverSideRequired=false, connectionHandler=OpisConnectionHandler.class, packetHandler=OpisPacketHandler.class)
|
||||
//@NetworkMod(channels={"Opis", "Opis_Chunk"},clientSideRequired=false, serverSideRequired=false, connectionHandler=OpisConnectionHandler.class, packetHandler=OpisPacketHandler.class)
|
||||
|
||||
public class modOpis {
|
||||
|
||||
|
||||
Reference in new issue
Block a user