mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-23 13:29:40 +00:00
More work on teleporters, implemented chunkloading
This commit is contained in:
1 parent
9c21621c06
commit
f9c10d9012
11 files changed
+332
-135
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package mekanism.common.chunkloading;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeChunkManager.LoadingCallback;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
|
||||
public class ChunkManager implements LoadingCallback
|
||||
{
|
||||
@Override
|
||||
public void ticketsLoaded(List<Ticket> tickets, World world)
|
||||
{
|
||||
for(Ticket ticket : tickets)
|
||||
{
|
||||
int x = ticket.getModData().getInteger("xCoord");
|
||||
int y = ticket.getModData().getInteger("yCoord");
|
||||
int z = ticket.getModData().getInteger("zCoord");
|
||||
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
|
||||
if(tileEntity instanceof IChunkLoader)
|
||||
{
|
||||
((IChunkLoader)tileEntity).forceChunks(ticket);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user