WIP Fix Robot

This commit is contained in:
lucsoft
2021-05-29 20:31:16 +02:00
parent ab2db1ef76
commit 6f3f83837b
3 changed files with 9 additions and 4 deletions

View File

@@ -38,6 +38,11 @@ public final class RobotTerminalScreen extends ContainerScreen<RobotTerminalCont
terminalWidget.renderBackground(matrixStack, mouseX, mouseY);
}
@Override
protected void renderLabels(final MatrixStack p_230451_1_, final int p_230451_2_, final int p_230451_3_) {
}
@Override
public void render(final MatrixStack matrixStack, final int mouseX, final int mouseY, final float partialTicks) {
terminalWidget.setEnergyInfo(menu.getEnergy(), menu.getEnergyCapacity(), menu.getEnergyConsumption());

View File

@@ -366,9 +366,9 @@ public final class RobotEntity extends Entity implements Robot {
@Override
protected void defineSynchedData() {
final EntityDataManager dataManager = getEntityData();
dataManager.set(TARGET_POSITION, BlockPos.ZERO);
dataManager.set(TARGET_DIRECTION, Direction.NORTH);
dataManager.set(SELECTED_SLOT, (byte) 0);
dataManager.define(TARGET_POSITION, BlockPos.ZERO);
dataManager.define(TARGET_DIRECTION, Direction.NORTH);
dataManager.define(SELECTED_SLOT, (byte) 0);
}
@Override

View File

@@ -67,7 +67,7 @@ public final class RobotItem extends ModItem {
}
final RobotEntity robot = Entities.ROBOT.get().create(context.getLevel());
robot.moveTo(position.x, position.y - robot.getEyeHeight() * 0.5f, position.z,
robot.moveTo(position.x, position.y - robot.getBbHeight() * 0.5f, position.z,
Direction.fromYRot(context.getRotation()).getOpposite().toYRot(), 0);
if (!world.noCollision(robot)) {
return super.useOn(context);