Another round of minor changes

This commit is contained in:
Frank Bauer 2021-06-24 12:34:12 +02:00
parent 32f9bf288e
commit 8555931932
6 changed files with 29 additions and 94 deletions

View file

@ -61,7 +61,7 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements IRenderTyped
FluidState fluidState = world.getFluidState(blockPos2);
Material material = blockState.getMaterial();
if (fluidState.is(FluidTags.WATER)) {
if (blockState.getBlock() instanceof BucketPickup && ((BucketPickup) blockState.getBlock()).takeLiquid(world, blockPos2, blockState) != Fluids.EMPTY) {
if (blockState.getBlock() instanceof BucketPickup && !((BucketPickup) blockState.getBlock()).pickupBlock(world, blockPos2, blockState).isEmpty()) {
++i;
if (j < 6) {
queue.add(new Tuple<>(blockPos2, j + 1));
@ -73,7 +73,7 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements IRenderTyped
queue.add(new Tuple<>(blockPos2, j + 1));
}
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
BlockEntity blockEntity = blockState.getBlock().isEntityBlock() ? world.getBlockEntity(blockPos2) : null;
BlockEntity blockEntity = blockState.hasBlockEntity() ? world.getBlockEntity(blockPos2) : null;
dropResources(blockState, world, blockPos2, blockEntity);
world.setBlock(blockPos2, Blocks.AIR.defaultBlockState(), 3);
++i;

View file

@ -28,10 +28,6 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
super(blockEntityType, blockPos, blockState);
}
public PedestalBlockEntity(BlockEntityType<?> type) {
super(type);
}
public int getAge() {
return age;
}

View file

@ -72,7 +72,7 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc
slotsChanged(inputSlots);
access.execute((world, blockPos) -> {
BlockState anvilState = world.getBlockState(blockPos);
if (!player.abilities.instabuild && anvilState.is(BlockTags.ANVIL) && player.getRandom().nextDouble() < 0.1) {
if (!player.getAbilities().instabuild && anvilState.is(BlockTags.ANVIL) && player.getRandom().nextDouble() < 0.1) {
BlockState landingState = EndAnvilBlock.applyDamage(anvilState);
if (landingState == null) {
world.removeBlock(blockPos, false);

View file

@ -69,7 +69,7 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt
@Inject(method = "findDimensionEntryPoint", at = @At("HEAD"), cancellable = true)
protected void be_getTeleportTarget(ServerLevel destination, CallbackInfoReturnable<PortalInfo> info) {
if (be_canTeleport()) {
info.setReturnValue(new PortalInfo(new Vec3(exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5), getDeltaMovement(), yRot, xRot));
info.setReturnValue(new PortalInfo(new Vec3(exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5), getDeltaMovement(), getYRot(), getXRot()));
}
}
@ -85,21 +85,21 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt
connection.send(new ClientboundChangeDifficultyPacket(worldProperties.getDifficulty(), worldProperties.isDifficultyLocked()));
PlayerList playerManager = server.getPlayerList();
playerManager.sendPlayerPermissionLevel(player);
serverWorld.removePlayerImmediately(player);
removed = false;
serverWorld.removePlayerImmediately(player, RemovalReason.CHANGED_DIMENSION);
unsetRemoved();
PortalInfo teleportTarget = findDimensionEntryPoint(destination);
if (teleportTarget != null) {
serverWorld.getProfiler().push("moving");
serverWorld.getProfiler().pop();
serverWorld.getProfiler().push("placing");
setLevel(destination);
this.level = destination;
destination.addDuringPortalTeleport(player);
setRot(teleportTarget.yRot, teleportTarget.xRot);
moveTo(teleportTarget.pos.x, teleportTarget.pos.y, teleportTarget.pos.z);
serverWorld.getProfiler().pop();
triggerDimensionChangeTriggers(serverWorld);
gameMode.setLevel(destination);
connection.send(new ClientboundPlayerAbilitiesPacket(abilities));
connection.send(new ClientboundPlayerAbilitiesPacket(getAbilities()));
playerManager.sendLevelInfo(player, destination);
playerManager.sendAllPlayerInfo(player);

View file

@ -16,7 +16,7 @@ package ru.betterend.noise;
* will be the same when ported to other languages.
*/
public class OpenSimplexNoise {
public final class OpenSimplexNoise {
private static final double STRETCH_CONSTANT_2D = -0.211324865405187; // (1/Math.sqrt(2+1)-1)/2;
private static final double SQUISH_CONSTANT_2D = 0.366025403784439; // (Math.sqrt(2+1)-1)/2;
private static final double STRETCH_CONSTANT_3D = -1.0 / 6; // (1/Math.sqrt(3+1)-1)/3;