Java Code Examples for co.aikar.timings.Timings#getBlockEntityTiming()

The following examples show how to use co.aikar.timings.Timings#getBlockEntityTiming() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlockEntity.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
public BlockEntity(FullChunk chunk, CompoundTag nbt) {
    if (chunk == null || chunk.getProvider() == null) {
        throw new ChunkException("Invalid garbage Chunk given to Block Entity");
    }

    this.timing = Timings.getBlockEntityTiming(this);
    this.server = chunk.getProvider().getLevel().getServer();
    this.chunk = chunk;
    this.setLevel(chunk.getProvider().getLevel());
    this.namedTag = nbt;
    this.name = "";
    this.lastUpdate = System.currentTimeMillis();
    this.id = BlockEntity.count++;
    this.x = this.namedTag.getInt("x");
    this.y = this.namedTag.getInt("y");
    this.z = this.namedTag.getInt("z");
    this.movable = this.namedTag.getBoolean("isMovable");

    this.chunk.addBlockEntity(this);
    this.getLevel().addBlockEntity(this);
}
 
Example 2
Source File: BlockEntity.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
public BlockEntity(FullChunk chunk, CompoundTag nbt) {
    if (chunk == null || chunk.getProvider() == null) {
        throw new ChunkException("Invalid garbage Chunk given to Block Entity");
    }

    this.timing = Timings.getBlockEntityTiming(this);
    this.server = chunk.getProvider().getLevel().getServer();
    this.chunk = chunk;
    this.setLevel(chunk.getProvider().getLevel());
    this.namedTag = nbt;
    this.name = "";
    this.lastUpdate = System.currentTimeMillis();
    this.id = BlockEntity.count++;
    this.x = this.namedTag.getInt("x");
    this.y = this.namedTag.getInt("y");
    this.z = this.namedTag.getInt("z");
    this.movable = this.namedTag.getBoolean("isMovable");

    this.initBlockEntity();

    this.chunk.addBlockEntity(this);
    this.getLevel().addBlockEntity(this);
}
 
Example 3
Source File: BlockEntity.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
public BlockEntity(FullChunk chunk, CompoundTag nbt) {
    if (chunk == null || chunk.getProvider() == null) {
        throw new ChunkException("Invalid garbage Chunk given to Block Entity");
    }

    this.timing = Timings.getBlockEntityTiming(this);
    this.server = chunk.getProvider().getLevel().getServer();
    this.chunk = chunk;
    this.setLevel(chunk.getProvider().getLevel());
    this.namedTag = nbt;
    this.name = "";
    this.lastUpdate = System.currentTimeMillis();
    this.id = BlockEntity.count++;
    this.x = this.namedTag.getInt("x");
    this.y = this.namedTag.getInt("y");
    this.z = this.namedTag.getInt("z");
    this.movable = this.namedTag.getBoolean("isMovable");

    this.initBlockEntity();

    this.chunk.addBlockEntity(this);
    this.getLevel().addBlockEntity(this);
}