本文整理汇总了Java中net.minecraftforge.common.ForgeChunkManager.Type类的典型用法代码示例。如果您正苦于以下问题:Java Type类的具体用法?Java Type怎么用?Java Type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Type类属于net.minecraftforge.common.ForgeChunkManager包,在下文中一共展示了Type类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadChunks
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public void loadChunks()
{
if(!worldObj.isRemote)
{
while(chunkTicket == null)
{
chunkTicket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, worldObj, Type.NORMAL);
}
if(chunkTicket==null)
{
System.out.println("FuckingHell");
}
chunkTicket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderBlockID);
chunkTicket.getModData().setInteger("blockX", xCoord);
chunkTicket.getModData().setInteger("blockY", yCoord);
chunkTicket.getModData().setInteger("blockZ", zCoord);
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair(xCoord>>4, zCoord >>4));
}
}
示例2: forceChunkLoad
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public static void forceChunkLoad(World w, ChunkPos pos) {
if (!ticketList.containsKey(pos)) {
if (chunkLoaderTicket == null) {
chunkLoaderTicket = ForgeChunkManager.requestTicket(Currency.INSTANCE, w, Type.NORMAL);
}
ticketList.put(pos, 1);
ForgeChunkManager.forceChunk(chunkLoaderTicket, pos);
} else {
ticketList.put(pos, ticketList.get(pos) + 1);
}
}
示例3: setupInitialTicket
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的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));
}
}
示例4: onCreated
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
@Override
protected void onCreated() {
if(ticket == null) {
ticket = ForgeChunkManager.requestTicket(AdvancedRocketry.instance, this.worldObj, Type.NORMAL);
if(ticket != null)
ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(this.xCoord / 16 - (this.xCoord < 0 ? 1 : 0), this.zCoord / 16 - (this.zCoord < 0 ? 1 : 0)));
}
}
示例5: checkCanRun
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
/**
* Checks to see if the situation for firing the laser exists... and changes the state accordingly
*/
public void checkCanRun() {
//Laser requires lense, redstone power, not be jammed, and be in orbit and energy to function
if(!isAllowedToRun() || !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) {
if(laserSat.isAlive()) {
laserSat.deactivateLaser();
}
setRunning(false);
} else if(!laserSat.isAlive() && !finished && !laserSat.getJammed() && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord) && canMachineSeeEarth()) {
//Laser will be on at this point
int orbitDimId = ((WorldProviderSpace)this.worldObj.provider).getDimensionProperties(xCoord, zCoord).getParentPlanet();
if(orbitDimId == SpaceObjectManager.WARPDIMID)
return;
WorldServer orbitWorld = DimensionManager.getWorld(orbitDimId);
if(orbitWorld == null) {
DimensionManager.initDimension(orbitDimId);
orbitWorld = DimensionManager.getWorld(orbitDimId);
if(orbitWorld == null)
return;
}
if(ticket == null) {
ticket = ForgeChunkManager.requestTicket(AdvancedRocketry.instance, this.worldObj, Type.NORMAL);
if(ticket != null)
ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(this.xCoord / 16 - (this.xCoord < 0 ? 1 : 0), this.zCoord / 16 - (this.zCoord < 0 ? 1 : 0)));
}
setRunning(laserSat.activateLaser(orbitWorld, laserX, laserZ));
}
if(!this.worldObj.isRemote)
PacketHandler.sendToNearby(new PacketMachine(this, (byte)12), this.xCoord, this.yCoord, this.zCoord, 128, this.worldObj.provider.dimensionId);
}
示例6: activateLaser
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
/**
* creates the laser and begins mining. This can
* fail if the chunk cannot be force loaded
* @param world world to spawn the laser into
* @param x x coord
* @param z z coord
* @return whether creating the laser is successful
*/
public boolean activateLaser(World world, int x, int z) {
ticketLaser = ForgeChunkManager.requestTicket(AdvancedRocketry.instance, world, Type.NORMAL);
if(ticketLaser != null) {
ForgeChunkManager.forceChunk(ticketLaser, new ChunkCoordIntPair(x >> 4, z >> 4));
int y = 64;
if(world.getChunkFromBlockCoords(x, z).isChunkLoaded) {
int current = 0;
for(int i = 0; i < 9; i++) {
current = world.getTopSolidOrLiquidBlock(x + (i % 3) - 1, z + (i / 3) - 1);
if(current > y)
y = current;
}
if(y < 1)
y = 255;
}
else
y = 255;
laser = new EntityLaserNode(world, x, y, z);
laser.forceSpawn = true;
world.spawnEntityInWorld(laser);
return true;
}
return false;
}
示例7: update
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
@Override
public void update() {
if (!MiscPeripherals.proxy.isServer()) return;
Vec3 pos = turtle.getPosition();
if (pos == null) {
MiscPeripherals.log.warning("Turtle position is null! "+turtle);
return;
}
if (ticketCreated && (pos.xCoord != oldXCoord || pos.yCoord != oldYCoord || pos.zCoord != oldZCoord)) {
if (ticket == null) {
MiscPeripherals.log.warning("Null ticket when moving chunkloaded turtle "+(computer == null ? "[unknown]" : computer.getID())+" at ("+(int)pos.xCoord+","+(int)pos.yCoord+","+(int)pos.zCoord+")!");
} else {
ForgeChunkManager.releaseTicket(ticket);
ticketCreated = false;
oldXCoord = pos.xCoord;
oldYCoord = pos.yCoord;
oldZCoord = pos.zCoord;
}
}
if (!ticketCreated) {
ticketCreated = true;
ticket = ForgeChunkManager.requestTicket(MiscPeripherals.instance, turtle.getWorld(), Type.NORMAL);
if (ticket == null) {
MiscPeripherals.log.warning("Chunk loading limit exceeded, not chunkloading turtle "+(computer == null ? "[unknown]" : computer.getID())+" at ("+(int)pos.xCoord+","+(int)pos.yCoord+","+(int)pos.zCoord+")!");
return;
}
int width = (MiscPeripherals.instance.chunkLoaderRadius * 2) + 1;
ticket.setChunkListDepth(width * width);
}
}
示例8: EntitySpeedyChunkChestCart
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public EntitySpeedyChunkChestCart(World par1World)
{
super(par1World);
if(ticket == null)
ticket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, par1World, Type.ENTITY);
ticket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderCartID);
ticket.bindEntity(this);
ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(((int)this.posX) >> 4, ((int)this.posZ) >> 4));
}
示例9: EntityChunkLoadingCart
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public EntityChunkLoadingCart(World par1World)
{
super(par1World);
if(ticket == null)
ticket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, par1World, Type.ENTITY);
ticket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderCartID);
ticket.bindEntity(this);
ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(((int)this.posX) >> 4, ((int)this.posZ) >> 4));
}
示例10: EntityChunkChestCart
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public EntityChunkChestCart(World par1World)
{
super(par1World);
if(ticket == null)
ticket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, par1World, Type.ENTITY);
ticket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderCartID);
ticket.bindEntity(this);
ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(((int)this.posX) >> 4, ((int)this.posZ) >> 4));
}
示例11: loadMining
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public void loadMining()
{
if(miningTicket == null)
{
miningTicket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, worldObj, Type.NORMAL);
}
miningTicket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderQuarryDigID);
miningTicket.getModData().setInteger("blockX", xCoord);
miningTicket.getModData().setInteger("blocky", yCoord);
miningTicket.getModData().setInteger("blockz", zCoord);
isLoadingMining = true;
ForgeChunkManager.forceChunk(miningTicket, new ChunkCoordIntPair(digChunk[0], digChunk[1]));
}
示例12: loadChunks
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public void loadChunks()
{
if(chunkTicket == null)
{
chunkTicket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, worldObj, Type.NORMAL);
}
chunkTicket.getModData().setInteger("blockX", xCoord);
chunkTicket.getModData().setInteger("blocky", yCoord);
chunkTicket.getModData().setInteger("blockz", zCoord);
chunkTicket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderQuarryID);
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair(xCoord>>4, zCoord >>4));
}
示例13: createTicket
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
@Override
public Ticket createTicket(int dimension) {
return ForgeChunkManager.requestPlayerTicket(instance, username, DimensionManager.getWorld(dimension), Type.NORMAL);
}
示例14: onUpdate
import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
@Override
public void onUpdate()
{
super.onUpdate();
if(teleportBounds == null)
{
resetBounds();
}
if(!worldObj.isRemote)
{
if(chunkTicket == null)
{
Ticket ticket = ForgeChunkManager.requestTicket(Mekanism.instance, worldObj, Type.NORMAL);
if(ticket != null)
{
ticket.getModData().setInteger("xCoord", xCoord);
ticket.getModData().setInteger("yCoord", yCoord);
ticket.getModData().setInteger("zCoord", zCoord);
forceChunks(ticket);
}
}
FrequencyManager manager = getManager(frequency);
if(manager != null)
{
if(frequency != null && !frequency.valid)
{
frequency = manager.validateFrequency(owner, Coord4D.get(this), frequency);
}
if(frequency != null)
{
frequency = manager.update(owner, Coord4D.get(this), frequency);
}
}
else {
frequency = null;
}
status = canTeleport();
if(status == 1 && teleDelay == 0)
{
teleport();
}
if(teleDelay == 0 && didTeleport.size() > 0)
{
cleanTeleportCache();
}
shouldRender = status == 1 || status > 4;
if(shouldRender != prevShouldRender)
{
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this).getTargetPoint(40D));
}
prevShouldRender = shouldRender;
teleDelay = Math.max(0, teleDelay-1);
}
ChargeUtils.discharge(0, this);
}