本文整理汇总了Java中net.minecraftforge.common.ForgeChunkManager.releaseTicket方法的典型用法代码示例。如果您正苦于以下问题:Java ForgeChunkManager.releaseTicket方法的具体用法?Java ForgeChunkManager.releaseTicket怎么用?Java ForgeChunkManager.releaseTicket使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.ForgeChunkManager
的用法示例。
在下文中一共展示了ForgeChunkManager.releaseTicket方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: breakBlock
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
SimpleChunks.logger.info("Releasing chunkloading ticket");
TileEntity te = worldIn.getTileEntity(pos);
if (te instanceof TileEntityChunkLoader)
{
TileEntityChunkLoader loader = (TileEntityChunkLoader) te;
loader.clearTicketChunks();
ForgeChunkManager.Ticket tkt = loader.getChunkTicket();
ForgeChunkManager.releaseTicket(tkt);
}
super.breakBlock(worldIn, pos, state);
}
示例2: ticketsLoaded
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void ticketsLoaded(List<ForgeChunkManager.Ticket> tickets, World world)
{
for (ForgeChunkManager.Ticket ticket : tickets)
{
BlockPos ticketPosition = NBTUtil.getPosFromTag(ticket.getModData().getCompoundTag("position"));
TileEntity te = world.getTileEntity(ticketPosition);
if (te instanceof TileEntityChunkLoader)
{
TileEntityChunkLoader loader = (TileEntityChunkLoader) te;
loader.setChunkTicket(ticket);
loader.forceChunks();
}
else
{
ForgeChunkManager.releaseTicket(ticket);
}
}
}
示例3: nextChunk
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void nextChunk() {
this.unloadChunk();
++this.chunk_x;
if (this.chunk_x << 4 >= this.max_x) {
this.chunk_x = this.min_x + 1 >> 4;
++this.chunk_z;
if (this.chunk_z << 4 >= this.max_z) {
this.finished = true;
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, 2, 2);
ForgeChunkManager.releaseTicket(this.chunkTicket);
return;
}
}
this.dy = this.chunk_y;
this.loadChunk();
}
示例4: disable
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void disable()
{
if(enabled)
{
//FMLLog.log(Level.INFO, "Disabling chunk at: " + toString() + " for owner: " + ownerId);
// Unforce chunk, release ticket
unforceChunkLoading();
if(ticket != null)
{
ForgeChunkManager.releaseTicket(ticket);
ticket = null;
}
enabled = false;
}
}
示例5: invalidate
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void invalidate() {
if(ticket != null)
{
ForgeChunkManager.releaseTicket(ticket);
ticket = null;
}
// Remove loader from world data
SavedData data = SavedData.get(world);
if(world.isRemote
|| data == null)
{
return;
}
ChunkLoaders cl = data.getChunkLoaders();
if(world.provider != null)
{
cl.removeLoader(new ChunkLoaderPos(ownerId.toString(), world.provider.getDimension(), getPos(), 0));
data.setChunkLoaders(cl);
}
super.invalidate();
}
示例6: ticketsLoaded
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void ticketsLoaded(List<ForgeChunkManager.Ticket> tickets, World world)
{
for(ForgeChunkManager.Ticket ticket : tickets)
{
boolean saved = false;
Entity ent = ticket.getEntity();
if(ent instanceof EntityMeteorite || ent instanceof EntityTransformer || ent instanceof EntityPigzilla)
{
if(!ent.isDead)
{
saved = true;
addTicket(ent, ticket);
}
}
if(!saved)
{
ForgeChunkManager.releaseTicket(ticket);
}
}
}
示例7: revalidateTicket
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
private static void revalidateTicket(CoordSet chunkXZSet, Ticket currentTicket) {
TicketWrapper wrapper = ticketMap.get(chunkXZSet);
if (wrapper == null) {
DPLogger.severe("Can't revalidate ticket! No TicketWrapper in ticketMap for chunkSet: " + chunkXZSet.toString());
return;
}
if (wrapper.ticket != null) {
ForgeChunkManager.releaseTicket(wrapper.ticket);
}
wrapper.ticket = currentTicket;
ForgeChunkManager.forceChunk(wrapper.ticket, new ChunkCoordIntPair(chunkXZSet.x, chunkXZSet.z));
}
示例8: removePocketFromChunkLoader
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public static void removePocketFromChunkLoader(Pocket pocket) {
Utils.enforceServer();
CoordSet pocketSet = pocket.getChunkCoords();
CoordSet chunkXZSet = pocketSet.copy();
chunkXZSet.y = 0;
if (!ticketMap.containsKey(chunkXZSet) && Reference.KEEP_POCKET_ROOMS_CHUNK_LOADED) {
DPLogger.warning("Something tried to remove a loaded pocket from a chunk that was never loaded before...");
return;
}
TicketWrapper wrapper = ticketMap.get(chunkXZSet);
if (wrapper.loadedRooms.remove(pocketSet)) {
DPLogger.info("Removed the following pocket room from the list of loaded rooms: " + pocketSet.toString(), ChunkLoaderHandler.class);
} else {
DPLogger.warning("The following pocket room wanted to be removed, but was not marked as loaded: " + pocketSet.toString(), ChunkLoaderHandler.class);
}
if (wrapper.loadedRooms.isEmpty()) {
ForgeChunkManager.releaseTicket(wrapper.ticket);
wrapper.ticket = null;
}
}
示例9: invalidate
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void invalidate()
{
super.invalidate();
if (this.chunkLoadTicket != null)
{
ForgeChunkManager.releaseTicket(this.chunkLoadTicket);
}
}
示例10: release
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void release() {
if (chunkLoaderTicket != null) {
try {
ForgeChunkManager.releaseTicket(chunkLoaderTicket);
} catch (Throwable e) {
// ignored
}
chunkLoaderTicket = null;
}
}
示例11: onBlockBroken
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void onBlockBroken()
{
for(WorksiteUpgrade ug : this.upgrades)
{
ItemUtil.spawnItemInWorldWithoutMotion(getWorld(), ItemWorksiteUpgrade.getStack(ug), getPos());
}
efficiencyBonusFactor = 0;
upgrades.clear();
if(this.chunkTicket!=null)
{
ForgeChunkManager.releaseTicket(chunkTicket);
this.chunkTicket = null;
}
}
示例12: setTicket
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void setTicket(Ticket tk)
{
if(chunkTicket!=null)
{
ForgeChunkManager.releaseTicket(chunkTicket);
chunkTicket=null;
}
this.chunkTicket = tk;
if(this.chunkTicket==null){return;}
writeDataToTicket(chunkTicket);
ChunkPos ccip = new ChunkPos(getPos().getX()>>4, getPos().getZ()>>4);
ForgeChunkManager.forceChunk(chunkTicket, ccip);
if(this.hasWorkBounds())
{
int minX = getWorkBoundsMin().getX()>>4;
int minZ = getWorkBoundsMin().getZ()>>4;
int maxX = getWorkBoundsMax().getX()>>4;
int maxZ = getWorkBoundsMax().getZ()>>4;
for(int x = minX; x<=maxX; x++)
{
for(int z = minZ; z<=maxZ; z++)
{
ccip = new ChunkPos(x, z);
ForgeChunkManager.forceChunk(chunkTicket, ccip);
}
}
}
}
示例13: setupInitialTicket
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public final void setupInitialTicket()
{
if(chunkTicket!=null){ForgeChunkManager.releaseTicket(chunkTicket);}
if(getUpgrades().contains(WorksiteUpgrade.BASIC_CHUNK_LOADER) || getUpgrades().contains(WorksiteUpgrade.QUARRY_CHUNK_LOADER))
{
setTicket(ForgeChunkManager.requestTicket(CrystalMod.instance, getWorld(), Type.NORMAL));
}
}
示例14: stopChunkLoading
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void stopChunkLoading()
{
if (this.chunkTicket != null)
{
ForgeChunkManager.releaseTicket(this.chunkTicket);
this.chunkTicket = null;
}
}
示例15: forceChunkLoading
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void forceChunkLoading(ForgeChunkManager.Ticket aTicket)
{
if(ticket != null
&& ticket != aTicket)
{
ForgeChunkManager.releaseTicket(ticket);
}
ticket = aTicket;
forceChunkLoading();
}