当前位置: 首页>>代码示例>>Java>>正文


Java ITurtleAccess.getWorld方法代码示例

本文整理汇总了Java中dan200.computercraft.api.turtle.ITurtleAccess.getWorld方法的典型用法代码示例。如果您正苦于以下问题:Java ITurtleAccess.getWorld方法的具体用法?Java ITurtleAccess.getWorld怎么用?Java ITurtleAccess.getWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dan200.computercraft.api.turtle.ITurtleAccess的用法示例。


在下文中一共展示了ITurtleAccess.getWorld方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import dan200.computercraft.api.turtle.ITurtleAccess; //导入方法依赖的package包/类
@Override
public void update(ITurtleAccess turtle, TurtleSide side)
{
	//CRMod.infoLog("chunky.update(): getUpgrade="+turtle.getUpgrade(side));
	if(turtle.getWorld().isRemote)//on Client getPeripheral doesn't work (CC1.63pr3)
		return;
	IPeripheral p = turtle.getPeripheral(side);
	if( p instanceof ChunkyPeripheral)
	{
		((ChunkyPeripheral) p).update();
	}
	else
	{
		if(p!=null)
			ChunkyPeripherals.logger.error("update called on a turtle without chunky module ( p is "+p.getClass().getName()+")");
		else
			ChunkyPeripherals.logger.error("update called on a turtle without chunky module ( p is null )");
	}
}
 
开发者ID:c-rizz,项目名称:ChunkyPeripherals,代码行数:20,代码来源:ChunkyUpgrade.java

示例2: update

import dan200.computercraft.api.turtle.ITurtleAccess; //导入方法依赖的package包/类
@Override
public void update(ITurtleAccess turtle, TurtleSide side) {
	if (!Config.enableRidableTurtle) {
		return;
	}
	World world = turtle.getWorld();
	if (!world.isRemote) {
		try {
			getEntity(turtle);
		} catch (Exception e) {
			EntityRidableTurtle ridableTurtle = new EntityRidableTurtle(world);
			ridableTurtle.setPosition(turtle.getPosition().posX + 0.5, turtle.getPosition().posY,
					turtle.getPosition().posZ + 0.5);
			ridableTurtle.setTurtle(turtle);
			world.spawnEntityInWorld(ridableTurtle);
		}
	}
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:19,代码来源:TurtleRidable.java

示例3: update

import dan200.computercraft.api.turtle.ITurtleAccess; //导入方法依赖的package包/类
@Override
public void update(ITurtleAccess turtle, TurtleSide side)
{
	//update the chunky part of the peripheral
	super.update(turtle,side);
	
	
	//do what dan does
	if(turtle.getWorld().isRemote)
		return;
	IPeripheral p = turtle.getPeripheral(side);
	if( p!=null && p instanceof WirelessChunkyPeripheral)
	{
		Object subPeripheral = ((WirelessChunkyPeripheral)p).getSubPeripheral();
		if((Boolean) CCReflectionHelper.invokeMethod(subPeripheral, true, "pollChanged"))
		{
			turtle.getUpgradeNBTData(side).setBoolean("active", (Boolean) CCReflectionHelper.invokeMethod(subPeripheral, true, "isActive"));
	        turtle.updateUpgradeNBTData(side);
		}
	}
	else
	{
		if(p!=null)
			ChunkyPeripherals.logger.error("update called on a turtle without wireless chunky module ( p is "+p.getClass().getName()+")");
		else
			ChunkyPeripherals.logger.error("update called on a turtle without wireless chunky module ( p is null )");
	}
}
 
开发者ID:c-rizz,项目名称:ChunkyPeripherals,代码行数:29,代码来源:WirelessChunkyUpgrade.java

示例4: PeripheralTank

import dan200.computercraft.api.turtle.ITurtleAccess; //导入方法依赖的package包/类
public PeripheralTank(ITurtleAccess turtle, TurtleSide side) {
	this.turtle = turtle;
	this.side = side;

	if (!turtle.getWorld().isRemote) {
		NBTTagCompound turtleTag = turtle.getUpgradeNBTData(side);
		NBTTagCompound tankData = turtleTag.getCompoundTag("TankData");
		if (tankData != null) {
			fluidTank.readFromNBT(tankData);
		}
	}

}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:14,代码来源:PeripheralTank.java

示例5: getNearbyEntities

import dan200.computercraft.api.turtle.ITurtleAccess; //导入方法依赖的package包/类
public static List getNearbyEntities(ITurtleAccess turtle, int radiusStart, int radiusEnd, Class entityType) {
	World world = turtle.getWorld();
	AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(
			turtle.getPosition().posX - radiusStart, turtle.getPosition().posY - radiusStart,
			turtle.getPosition().posZ - radiusStart, turtle.getPosition().posX + radiusEnd,
			turtle.getPosition().posY + radiusEnd, turtle.getPosition().posZ + radiusEnd);
	return world.getEntitiesWithinAABB(entityType, bb);
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:9,代码来源:TurtleRidable.java

示例6: TileEntityPlayerSensor

import dan200.computercraft.api.turtle.ITurtleAccess; //导入方法依赖的package包/类
public TileEntityPlayerSensor(ITurtleAccess turtle) {
	location = new Location(turtle.getPosition().posX,turtle.getPosition().posY, turtle.getPosition().posZ, turtle.getWorld());
	this.turtle = turtle;
	this.xCoord = turtle.getPosition().posX;
	this.yCoord = turtle.getPosition().posY;
	this.zCoord = turtle.getPosition().posZ;
	this.setWorldObj(turtle.getWorld());
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:9,代码来源:TileEntityPlayerSensor.java

示例7: TileEntityNoteBlock

import dan200.computercraft.api.turtle.ITurtleAccess; //导入方法依赖的package包/类
public TileEntityNoteBlock(ITurtleAccess turtle) {
	location = new Location(turtle.getPosition().posX, turtle.getPosition().posY, turtle.getPosition().posZ, turtle.getWorld());
	this.xCoord = (int) location.getX();
	this.yCoord = (int) location.getY();
	this.zCoord = (int) location.getZ();
	this.setWorldObj(location.getWorld());
	this.turtle = turtle;
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:9,代码来源:TileEntityNoteBlock.java

示例8: setTurtle

import dan200.computercraft.api.turtle.ITurtleAccess; //导入方法依赖的package包/类
public void setTurtle(ITurtleAccess turtle, int direction) {
	this.turtle = turtle;
	this.world = turtle.getWorld();
	this.pos = turtle.getPosition();
	this.direction = direction;
	this.offsetX = pos.posX + Facing.offsetsXForSide[direction];
	this.offsetY = pos.posY + Facing.offsetsYForSide[direction];
	this.offsetZ = pos.posZ + Facing.offsetsZForSide[direction];
	if (!this.world.isRemote) {
		WorldServer server = DimensionManager.getWorld(this.world.provider.dimensionId);
		this.fakePlayer = new FakePlayer(server, new GameProfile(null, "turtlePlayer"));
	}
}
 
开发者ID:SlimeVoid,项目名称:TurtleExtension,代码行数:14,代码来源:TurtleUpgradeBase.java

示例9: PlayerTurtle

import dan200.computercraft.api.turtle.ITurtleAccess; //导入方法依赖的package包/类
public PlayerTurtle(ITurtleAccess turtle) {
    super((WorldServer) turtle.getWorld(), new GameProfile(null, "MoarPeripheralsTurtle"));
    final ChunkCoordinates coordinates = turtle.getPosition();
    setPosition(coordinates.posX + 0.5d, coordinates.posY + 0.5d, coordinates.posZ + 0.5d);
}
 
开发者ID:thraaawn,项目名称:CCFactoryManager,代码行数:6,代码来源:PlayerTurtle.java

示例10: FakeTurtlePlayer

import dan200.computercraft.api.turtle.ITurtleAccess; //导入方法依赖的package包/类
public FakeTurtlePlayer(ITurtleAccess turtle) {
	this((WorldServer) turtle.getWorld());
	ChunkCoordinates position = turtle.getPosition();
	setPosition(position.posX + 0.5D, position.posY + 0.5D, position.posZ + 0.5D);
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:6,代码来源:FakeTurtlePlayer.java

示例11: isTurtleValid

import dan200.computercraft.api.turtle.ITurtleAccess; //导入方法依赖的package包/类
public static boolean isTurtleValid(ITurtleAccess access) {
	World world = access.getWorld();
	if (world == null) return false;
	ChunkCoordinates coords = access.getPosition();
	return world.blockExists(coords.posX, coords.posY, coords.posZ);
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Addons,代码行数:7,代码来源:CCUtils.java


注:本文中的dan200.computercraft.api.turtle.ITurtleAccess.getWorld方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。