diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/handler')
3 files changed, 4 insertions, 210 deletions
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java index b7efcf08ea..cd25fdb1c3 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java @@ -12,6 +12,7 @@ import gtPlusPlus.xmod.galacticraft.HANDLER_GalactiCraft; import gtPlusPlus.xmod.gregtech.HANDLER_GT; import gtPlusPlus.xmod.growthcraft.HANDLER_GC; import gtPlusPlus.xmod.ic2.HANDLER_IC2; +import gtPlusPlus.xmod.ob.HANDLER_OpenBlocks; import gtPlusPlus.xmod.railcraft.HANDLER_Railcraft; import gtPlusPlus.xmod.reliquary.HANDLER_Reliquary; import gtPlusPlus.xmod.sc2.HANDLER_SC2; @@ -37,6 +38,7 @@ public class COMPAT_IntermodStaging { HANDLER_CropsPlusPlus.preInit(preinit); HANDLER_Railcraft.preInit(); HANDLER_Reliquary.preInit(); + HANDLER_OpenBlocks.preInit(); } public static void init(FMLInitializationEvent init){ @@ -55,6 +57,7 @@ public class COMPAT_IntermodStaging { HANDLER_CropsPlusPlus.init(init); HANDLER_Railcraft.init(); HANDLER_Reliquary.init(); + HANDLER_OpenBlocks.init(); } public static void postInit(FMLPostInitializationEvent postinit){ @@ -73,6 +76,7 @@ public class COMPAT_IntermodStaging { HANDLER_CropsPlusPlus.postInit(postinit); HANDLER_Railcraft.postInit(); HANDLER_Reliquary.postInit(); + HANDLER_OpenBlocks.postInit(); } public static void onLoadComplete(FMLLoadCompleteEvent event) { diff --git a/src/Java/gtPlusPlus/core/handler/chunkloading/ChunkLoading.java b/src/Java/gtPlusPlus/core/handler/chunkloading/ChunkLoading.java deleted file mode 100644 index bc690f250c..0000000000 --- a/src/Java/gtPlusPlus/core/handler/chunkloading/ChunkLoading.java +++ /dev/null @@ -1,57 +0,0 @@ -package gtPlusPlus.core.handler.chunkloading; - -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.event.FMLServerStoppingEvent; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.minecraft.ChunkManager; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.minecraft.network.PacketHandler; -import net.minecraftforge.common.ForgeChunkManager; - -public class ChunkLoading { - - private final ChunkLoading instance; - - public ChunkLoading() { - instance = this; - } - - public ChunkLoading getInstance() { - return this.instance; - } - - - public void preInit(final FMLPreInitializationEvent event) { - PacketHandler.init(); - ForgeChunkManager.setForcedChunkLoadingCallback(GTplusplus.instance, ChunkManager.getInstance()); - Utils.registerEvent(ChunkManager.getInstance()); - } - - - public void init(final FMLInitializationEvent event) { - - } - - - public void postInit(final FMLPostInitializationEvent event) { - - } - - - public synchronized void serverStarting(final FMLServerStartingEvent event) { - - } - - public void serverStopping(final FMLServerStoppingEvent event){ - //Chunkload Handler - if (ChunkManager.mChunkLoaderManagerMap.size() > 0) { - Logger.INFO("Clearing Chunk Loaders."); - ChunkManager.clearInternalMaps(); - } - } - -} diff --git a/src/Java/gtPlusPlus/core/handler/chunkloading/ChunkManager.java b/src/Java/gtPlusPlus/core/handler/chunkloading/ChunkManager.java deleted file mode 100644 index f95c4e7a78..0000000000 --- a/src/Java/gtPlusPlus/core/handler/chunkloading/ChunkManager.java +++ /dev/null @@ -1,153 +0,0 @@ -package gtPlusPlus.core.handler.chunkloading; - -import com.google.common.collect.LinkedListMultimap; -import com.google.common.collect.ListMultimap; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntityChunkLoader; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeChunkManager.LoadingCallback; -import net.minecraftforge.common.ForgeChunkManager.OrderedLoadingCallback; -import net.minecraftforge.common.ForgeChunkManager.PlayerOrderedLoadingCallback; -import net.minecraftforge.common.ForgeChunkManager.Ticket; -import net.minecraftforge.event.entity.EntityEvent.EnteringChunk; - -public class ChunkManager implements LoadingCallback, OrderedLoadingCallback, PlayerOrderedLoadingCallback { - private static ChunkManager instance; - - public static ChunkManager getInstance() { - if (instance == null) { - instance = new ChunkManager(); - } - - return instance; - } - - @SubscribeEvent - public void entityEnteredChunk(EnteringChunk event) { - - } - - public Set<ChunkCoordIntPair> getChunksBetween(int xChunkA, int zChunkA, int xChunkB, int zChunkB, int max) { - Set<ChunkCoordIntPair> chunkList = new HashSet<ChunkCoordIntPair>(); - if (xChunkA != xChunkB && zChunkA != zChunkB) { - return chunkList; - } else { - int xStart = Math.min(xChunkA, xChunkB); - int xEnd = Math.max(xChunkA, xChunkB); - int zStart = Math.min(zChunkA, zChunkB); - int zEnd = Math.max(zChunkA, zChunkB); - - for (int xx = xStart; xx <= xEnd; ++xx) { - for (int zz = zStart; zz <= zEnd; ++zz) { - chunkList.add(new ChunkCoordIntPair(xx, zz)); - if (chunkList.size() >= max) { - return chunkList; - } - } - } - - return chunkList; - } - } - - public Set<ChunkCoordIntPair> getChunksAround(int xChunk, int zChunk, int radius) { - Set<ChunkCoordIntPair> chunkList = new HashSet<ChunkCoordIntPair>(); - - for (int xx = xChunk - radius; xx <= xChunk + radius; ++xx) { - for (int zz = zChunk - radius; zz <= zChunk + radius; ++zz) { - chunkList.add(new ChunkCoordIntPair(xx, zz)); - } - } - - return chunkList; - } - - public Set<ChunkCoordIntPair> getBufferAround(int xWorld, int zWorld, int radius) { - int minX = xWorld - radius >> 4; - int maxX = xWorld + radius >> 4; - int minZ = zWorld - radius >> 4; - int maxZ = zWorld + radius >> 4; - Set<ChunkCoordIntPair> chunkList = new HashSet<ChunkCoordIntPair>(); - - for (int xx = minX; xx <= maxX; ++xx) { - for (int zz = minZ; zz <= maxZ; ++zz) { - chunkList.add(new ChunkCoordIntPair(xx, zz)); - } - } - - return chunkList; - } - - public void ticketsLoaded(List<Ticket> tickets, World world) { - Iterator<Ticket> var3 = tickets.iterator(); - while (var3.hasNext()) { - Ticket ticket = (Ticket) var3.next(); - if (!ticket.isPlayerTicket()) { - Entity entity = ticket.getEntity(); - if (entity == null) { - int x = ticket.getModData().getInteger("xCoord"); - int y = ticket.getModData().getInteger("yCoord"); - int z = ticket.getModData().getInteger("zCoord"); - if (y >= 0) { - TileEntity tile = world.getTileEntity(x, y, z); - if (tile instanceof IGregTechTileEntity) { - IGregTechTileEntity g = (IGregTechTileEntity) tile; - if (g instanceof GregtechMetaTileEntityChunkLoader) { - GregtechMetaTileEntityChunkLoader t = (GregtechMetaTileEntityChunkLoader) g; - t.forceChunkLoading(t.getBaseMetaTileEntity(), ticket); - // this.printChunkLoader(t.getName(), x, y, z); - } - } - } - } - } - } - } - - public List<Ticket> ticketsLoaded(List<Ticket> tickets, World world, int maxTicketCount) { - Set<Ticket> adminTickets = new HashSet<Ticket>(); - Set<Ticket> worldTickets = new HashSet<Ticket>(); - Set<Ticket> cartTickets = new HashSet<Ticket>(); - Iterator<Ticket> var7 = tickets.iterator(); - - while (var7.hasNext()) { - Ticket ticket = (Ticket) var7.next(); - Entity entity = ticket.getEntity(); - if (entity == null) { - int x = ticket.getModData().getInteger("xCoord"); - int y = ticket.getModData().getInteger("yCoord"); - int z = ticket.getModData().getInteger("zCoord"); - String type = ticket.getModData().getString("type"); - if (y >= 0) { - if (type.equals("AdminChunkLoader")) { - adminTickets.add(ticket); - } else if (type.equals("StandardChunkLoader")) { - worldTickets.add(ticket); - } else if (type.isEmpty()) { - worldTickets.add(ticket); - } - } - } - } - - List<Ticket> claimedTickets = new LinkedList<Ticket>(); - claimedTickets.addAll(cartTickets); - claimedTickets.addAll(adminTickets); - claimedTickets.addAll(worldTickets); - return claimedTickets; - } - - public ListMultimap<String, Ticket> playerTicketsLoaded(ListMultimap<String, Ticket> tickets, World world) { - return LinkedListMultimap.create(); - } -}
\ No newline at end of file |