public void scheduleFutureTick(BlockPos pos, float secondsUntil) { Chunk c = this.getChunk(pos); if (c != null) { c.scheduledTicks.Add(new ScheduledTick(pos, secondsUntil)); } else { Debug.LogWarning("A Block tried to schedule a tick at " + pos.ToString() + "! This is out of the world! Ignoring!"); } }
/// <summary> /// Returns the debug text to display. /// </summary> public string getDebugText() { StringBuilder s = new StringBuilder(); s.Append("FPS: " + this.fpsCounter.currentFps); s.Append("\nPlayer Position: " + this.player.transform.position.ToString()); s.Append("\nPlayer Rotation: " + this.player.transform.eulerAngles.ToString()); if (this.player.posLookingAt != null) { BlockPos p = (BlockPos)this.player.posLookingAt; int meta = this.worldObj.getMeta(p); s.Append("\nLooking At Light: " + this.worldObj.getLight(p.x, p.y, p.z)); s.Append("\nLooking At Pos: " + p.ToString()); s.Append("\nLooking At State: " + this.worldObj.getBlock(p).getAsDebugText(meta)); } s.Append("\nPress F3 to toggle debug info"); return(s.ToString()); }
/// <summary> /// Adds the passed TileEntity into the world, throwing an exception if there is already a TileEntity there. /// </summary> public void addTileEntity(BlockPos pos, TileEntityBase tileEntity) { Chunk chunk = this.getChunk(pos); if (chunk != null) { if (chunk.tileEntityDict.ContainsKey(pos)) { Debug.Log(chunk.tileEntityDict[pos]); throw new Exception("Error! Something tried to add a second TileEntity at " + pos.ToString() + "!"); } this.getChunk(pos).tileEntityDict.Add(pos, tileEntity); } }