BlockState -> BlockEntity

This commit is contained in:
dfsek
2021-06-25 19:12:23 -07:00
parent d880d95637
commit 3386570439
20 changed files with 43 additions and 43 deletions

View File

@@ -1,7 +1,7 @@
package com.dfsek.terra.api.structures.structure.buffer.items;
import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.block.state.BlockState;
import com.dfsek.terra.api.block.state.BlockEntity;
import com.dfsek.terra.api.block.state.Container;
import com.dfsek.terra.api.event.events.world.generation.LootPopulateEvent;
import com.dfsek.terra.api.structure.LootTable;
@@ -25,7 +25,7 @@ public class BufferedLootApplication implements BufferedItem {
@Override
public void paste(Vector3 origin, World world) {
try {
BlockState data = world.getBlockState(origin);
BlockEntity data = world.getBlockState(origin);
if(!(data instanceof Container)) {
main.logger().severe("Failed to place loot at " + origin + "; block " + data + " is not container.");
return;

View File

@@ -1,7 +1,7 @@
package com.dfsek.terra.api.structures.structure.buffer.items;
import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.block.state.BlockState;
import com.dfsek.terra.api.block.state.BlockEntity;
import com.dfsek.terra.api.structure.buffer.BufferedItem;
import com.dfsek.terra.api.vector.Vector3;
import com.dfsek.terra.api.world.World;
@@ -18,7 +18,7 @@ public class BufferedStateManipulator implements BufferedItem {
@Override
public void paste(Vector3 origin, World world) {
try {
BlockState state = world.getBlockState(origin);
BlockEntity state = world.getBlockState(origin);
state.applyState(data);
state.update(false);
} catch(Exception e) {

View File

@@ -2,7 +2,7 @@ package com.dfsek.terra.commands.structure;
import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.block.BlockData;
import com.dfsek.terra.api.block.state.BlockState;
import com.dfsek.terra.api.block.state.BlockEntity;
import com.dfsek.terra.api.block.state.Sign;
import com.dfsek.terra.api.command.CommandTemplate;
import com.dfsek.terra.api.command.annotation.Argument;
@@ -58,7 +58,7 @@ public class StructureExportCommand implements CommandTemplate {
for(int x = l1.getBlockX(); x <= l2.getBlockX(); x++) {
for(int y = l1.getBlockY(); y <= l2.getBlockY(); y++) {
for(int z = l1.getBlockZ(); z <= l2.getBlockZ(); z++) {
BlockState state = player.world().getBlockState(x, y, z);
BlockEntity state = player.world().getBlockState(x, y, z);
if(state instanceof Sign) {
Sign sign = (Sign) state;
if(sign.getLine(0).equals("[TERRA]") && sign.getLine(1).equals("[CENTER]")) {
@@ -77,7 +77,7 @@ public class StructureExportCommand implements CommandTemplate {
BlockData data = player.world().getBlockData(x, y, z);
if(data.isStructureVoid()) continue;
BlockState state = player.world().getBlockState(x, y, z);
BlockEntity state = player.world().getBlockState(x, y, z);
if(state instanceof Sign) {
Sign sign = (Sign) state;
if(sign.getLine(0).equals("[TERRA]")) {

View File

@@ -1,7 +1,7 @@
package com.dfsek.terra.config.dummy;
import com.dfsek.terra.api.block.BlockData;
import com.dfsek.terra.api.block.state.BlockState;
import com.dfsek.terra.api.block.state.BlockEntity;
import com.dfsek.terra.api.entity.Entity;
import com.dfsek.terra.api.entity.EntityType;
import com.dfsek.terra.api.vector.Vector3;
@@ -47,7 +47,7 @@ public class DummyWorld implements World {
}
@Override
public BlockState getBlockState(int x, int y, int z) {
public BlockEntity getBlockState(int x, int y, int z) {
throw new UnsupportedOperationException("Cannot get block in DummyWorld");
}