diff --git a/.gitignore b/.gitignore index aac1cdc0..f1d036ca 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,5 @@ build run .DS_Store Thumbs.db -remappedSrc \ No newline at end of file +remappedSrc +logs \ No newline at end of file diff --git a/logs/latest.log b/logs/latest.log deleted file mode 100644 index 6d1dd757..00000000 --- a/logs/latest.log +++ /dev/null @@ -1 +0,0 @@ -[23:07:02] [main/ERROR]: Unable to bootstrap registry 'minecraft:sound_event' diff --git a/src/main/java/org/dimdev/dimcore/schematic/Schematic.java b/src/main/java/org/dimdev/dimcore/schematic/Schematic.java index 3abcf8f8..245e9dff 100644 --- a/src/main/java/org/dimdev/dimcore/schematic/Schematic.java +++ b/src/main/java/org/dimdev/dimcore/schematic/Schematic.java @@ -1,7 +1,12 @@ package org.dimdev.dimcore.schematic; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -13,7 +18,11 @@ import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.FluidState; -import net.minecraft.nbt.*; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.DoubleTag; +import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.StringTag; +import net.minecraft.nbt.Tag; import net.minecraft.server.world.ServerWorld; import net.minecraft.state.StateManager; import net.minecraft.state.property.Property; diff --git a/src/main/java/org/dimdev/dimdoors/DimensionalDoorsInitializer.java b/src/main/java/org/dimdev/dimdoors/DimensionalDoorsInitializer.java index fd31ea7d..89766014 100644 --- a/src/main/java/org/dimdev/dimdoors/DimensionalDoorsInitializer.java +++ b/src/main/java/org/dimdev/dimdoors/DimensionalDoorsInitializer.java @@ -5,7 +5,19 @@ import org.dimdev.dimdoors.block.entity.ModBlockEntityTypes; import org.dimdev.dimdoors.command.ModCommands; import org.dimdev.dimdoors.entity.ModEntityTypes; import org.dimdev.dimdoors.item.ModItems; -import org.dimdev.dimdoors.rift.targets.*; +import org.dimdev.dimdoors.rift.targets.EscapeTarget; +import org.dimdev.dimdoors.rift.targets.GlobalReference; +import org.dimdev.dimdoors.rift.targets.LimboTarget; +import org.dimdev.dimdoors.rift.targets.LocalReference; +import org.dimdev.dimdoors.rift.targets.PocketEntranceMarker; +import org.dimdev.dimdoors.rift.targets.PocketExitMarker; +import org.dimdev.dimdoors.rift.targets.PrivatePocketExitTarget; +import org.dimdev.dimdoors.rift.targets.PrivatePocketTarget; +import org.dimdev.dimdoors.rift.targets.PublicPocketTarget; +import org.dimdev.dimdoors.rift.targets.RandomTarget; +import org.dimdev.dimdoors.rift.targets.RelativeReference; +import org.dimdev.dimdoors.rift.targets.Targets; +import org.dimdev.dimdoors.rift.targets.VirtualTarget; import org.dimdev.dimdoors.sound.ModSoundEvents; import org.dimdev.dimdoors.world.ModBiomes; import org.dimdev.dimdoors.world.ModDimensions; diff --git a/src/main/java/org/dimdev/dimdoors/block/entity/DetachedRiftBlockEntity.java b/src/main/java/org/dimdev/dimdoors/block/entity/DetachedRiftBlockEntity.java index 3c514d5a..aae6f421 100644 --- a/src/main/java/org/dimdev/dimdoors/block/entity/DetachedRiftBlockEntity.java +++ b/src/main/java/org/dimdev/dimdoors/block/entity/DetachedRiftBlockEntity.java @@ -44,7 +44,7 @@ public class DetachedRiftBlockEntity extends RiftBlockEntity implements Tickable @Override public void tick() { - if(world == null) { + if (world == null) { return; } diff --git a/src/main/java/org/dimdev/dimdoors/block/entity/RiftBlockEntity.java b/src/main/java/org/dimdev/dimdoors/block/entity/RiftBlockEntity.java index de5a810e..618af514 100644 --- a/src/main/java/org/dimdev/dimdoors/block/entity/RiftBlockEntity.java +++ b/src/main/java/org/dimdev/dimdoors/block/entity/RiftBlockEntity.java @@ -11,10 +11,14 @@ import org.dimdev.dimdoors.pockets.PocketTemplate; import org.dimdev.dimdoors.rift.registry.LinkProperties; import org.dimdev.dimdoors.rift.registry.Rift; import org.dimdev.dimdoors.rift.registry.RiftRegistry; -import org.dimdev.dimdoors.rift.targets.*; -import org.dimdev.dimdoors.world.pocket.VirtualLocation; +import org.dimdev.dimdoors.rift.targets.EntityTarget; +import org.dimdev.dimdoors.rift.targets.MessageTarget; +import org.dimdev.dimdoors.rift.targets.Target; +import org.dimdev.dimdoors.rift.targets.Targets; +import org.dimdev.dimdoors.rift.targets.VirtualTarget; import org.dimdev.dimdoors.util.EntityUtils; import org.dimdev.dimdoors.util.Location; +import org.dimdev.dimdoors.world.pocket.VirtualLocation; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; diff --git a/src/main/java/org/dimdev/dimdoors/client/ModRendering.java b/src/main/java/org/dimdev/dimdoors/client/ModRendering.java index f8963656..8be06d4d 100644 --- a/src/main/java/org/dimdev/dimdoors/client/ModRendering.java +++ b/src/main/java/org/dimdev/dimdoors/client/ModRendering.java @@ -3,7 +3,6 @@ package org.dimdev.dimdoors.client; import java.util.function.Function; import org.dimdev.dimdoors.fluid.ModFluids; -import org.dimdev.dimdoors.world.ModDimensions; import net.minecraft.client.MinecraftClient; import net.minecraft.client.texture.Sprite; @@ -14,7 +13,6 @@ import net.minecraft.resource.ResourceManager; import net.minecraft.resource.ResourceType; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3i; import net.minecraft.util.registry.Registry; import net.minecraft.world.BlockRenderView; diff --git a/src/main/java/org/dimdev/dimdoors/client/RiftCurves.java b/src/main/java/org/dimdev/dimdoors/client/RiftCurves.java index 5144893f..60a17952 100644 --- a/src/main/java/org/dimdev/dimdoors/client/RiftCurves.java +++ b/src/main/java/org/dimdev/dimdoors/client/RiftCurves.java @@ -1,6 +1,10 @@ package org.dimdev.dimdoors.client; -import java.util.*; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; import org.poly2tri.Poly2Tri; import org.poly2tri.geometry.polygon.Polygon; diff --git a/src/main/java/org/dimdev/dimdoors/command/PocketCommand.java b/src/main/java/org/dimdev/dimdoors/command/PocketCommand.java index c9496cad..02ad36a2 100644 --- a/src/main/java/org/dimdev/dimdoors/command/PocketCommand.java +++ b/src/main/java/org/dimdev/dimdoors/command/PocketCommand.java @@ -12,10 +12,10 @@ import org.dimdev.dimdoors.pockets.PocketTemplate; import org.dimdev.dimdoors.pockets.SchematicHandler; import org.dimdev.dimdoors.rift.registry.RiftRegistry; import org.dimdev.dimdoors.rift.targets.EntityTarget; -import org.dimdev.dimdoors.world.ModDimensions; -import org.dimdev.dimdoors.world.pocket.Pocket; import org.dimdev.dimdoors.util.Location; import org.dimdev.dimdoors.util.TeleportUtil; +import org.dimdev.dimdoors.world.ModDimensions; +import org.dimdev.dimdoors.world.pocket.Pocket; import net.minecraft.command.CommandException; import net.minecraft.server.command.CommandManager; diff --git a/src/main/java/org/dimdev/dimdoors/entity/MonolithEntity.java b/src/main/java/org/dimdev/dimdoors/entity/MonolithEntity.java index c27569ae..893cfb82 100644 --- a/src/main/java/org/dimdev/dimdoors/entity/MonolithEntity.java +++ b/src/main/java/org/dimdev/dimdoors/entity/MonolithEntity.java @@ -8,7 +8,11 @@ import org.dimdev.dimdoors.item.ModItems; import org.dimdev.dimdoors.sound.ModSoundEvents; import org.dimdev.dimdoors.world.ModDimensions; -import net.minecraft.entity.*; +import net.minecraft.entity.EntityDimensions; +import net.minecraft.entity.EntityPose; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.MovementType; +import net.minecraft.entity.SpawnReason; import net.minecraft.entity.ai.control.LookControl; import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.data.DataTracker; @@ -21,7 +25,6 @@ import net.minecraft.network.PacketByteBuf; import net.minecraft.particle.ParticleTypes; import net.minecraft.sound.SoundCategory; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; @@ -148,16 +151,16 @@ public class MonolithEntity extends MobEntity { public void updateAggroLevel(PlayerEntity player, boolean visibility) { // If we're working on the server side, adjust aggro level // If we're working on the client side, retrieve aggro level from dataWatcher - if(player == null) { + if (player == null) { return; } - if((player.inventory.armor.get(0).getItem() == ModItems.WORLD_THREAD_HELMET && player.inventory.armor.get(1).getItem() == ModItems.WORLD_THREAD_CHESTPLATE && player.inventory.armor.get(2).getItem() == ModItems.WORLD_THREAD_LEGGINGS && player.inventory.armor.get(3).getItem() == ModItems.WORLD_THREAD_BOOTS)) { + if ((player.inventory.armor.get(0).getItem() == ModItems.WORLD_THREAD_HELMET && player.inventory.armor.get(1).getItem() == ModItems.WORLD_THREAD_CHESTPLATE && player.inventory.armor.get(2).getItem() == ModItems.WORLD_THREAD_LEGGINGS && player.inventory.armor.get(3).getItem() == ModItems.WORLD_THREAD_BOOTS)) { return; } if (!world.isClient) { - if(player.distanceTo(this) > 70) { + if (player.distanceTo(this) > 70) { return; } @@ -233,7 +236,7 @@ public class MonolithEntity extends MobEntity { int aggro = data.readInt(); context.getTaskQueue().execute(() -> { - if(aggro < 120) { + if (aggro < 120) { return; } int count = 10 * aggro / MAX_AGGRO; diff --git a/src/main/java/org/dimdev/dimdoors/entity/ai/MonolithTask.java b/src/main/java/org/dimdev/dimdoors/entity/ai/MonolithTask.java index f677cd02..ab95dc2f 100644 --- a/src/main/java/org/dimdev/dimdoors/entity/ai/MonolithTask.java +++ b/src/main/java/org/dimdev/dimdoors/entity/ai/MonolithTask.java @@ -38,7 +38,7 @@ public class MonolithTask extends Goal { private PlayerEntity getTarget() { PlayerEntity playerEntity = this.mob.world.getClosestPlayer(this.targetPredicate, this.mob, this.mob.getX(), this.mob.getEyeY(), this.mob.getZ()); - return playerEntity != null && mob.canSee(playerEntity) && playerEntity.distanceTo(this.mob) < 50? playerEntity : null; + return playerEntity != null && mob.canSee(playerEntity) && playerEntity.distanceTo(this.mob) < 50 ? playerEntity : null; } public boolean canStart() { @@ -58,16 +58,16 @@ public class MonolithTask extends Goal { } public void tick() { - if(target != null && this.target.distanceTo(this.mob) > 70) { + if (target != null && this.target.distanceTo(this.mob) > 70) { this.stop(); return; } - if(target != null && (target.inventory.armor.get(0).getItem() == ModItems.WORLD_THREAD_HELMET && target.inventory.armor.get(1).getItem() == ModItems.WORLD_THREAD_CHESTPLATE && target.inventory.armor.get(2).getItem() == ModItems.WORLD_THREAD_LEGGINGS && target.inventory.armor.get(3).getItem() == ModItems.WORLD_THREAD_BOOTS)) { + if (target != null && (target.inventory.armor.get(0).getItem() == ModItems.WORLD_THREAD_HELMET && target.inventory.armor.get(1).getItem() == ModItems.WORLD_THREAD_CHESTPLATE && target.inventory.armor.get(2).getItem() == ModItems.WORLD_THREAD_LEGGINGS && target.inventory.armor.get(3).getItem() == ModItems.WORLD_THREAD_BOOTS)) { Random random = new Random(); int i = random.nextInt(64); - if(this.target instanceof ServerPlayerEntity) { - if(i < 6) { + if (this.target instanceof ServerPlayerEntity) { + if (i < 6) { target.inventory.armor.get(0).damage(i, random, (ServerPlayerEntity) this.target); target.inventory.armor.get(1).damage(i, random, (ServerPlayerEntity) this.target); target.inventory.armor.get(2).damage(i, random, (ServerPlayerEntity) this.target); diff --git a/src/main/java/org/dimdev/dimdoors/item/ModItems.java b/src/main/java/org/dimdev/dimdoors/item/ModItems.java index c9cce887..e69ee077 100644 --- a/src/main/java/org/dimdev/dimdoors/item/ModItems.java +++ b/src/main/java/org/dimdev/dimdoors/item/ModItems.java @@ -7,13 +7,21 @@ import java.util.HashSet; import org.dimdev.dimdoors.block.ModBlocks; import org.dimdev.dimdoors.fluid.ModFluids; import org.dimdev.dimdoors.rift.registry.LinkProperties; -import org.dimdev.dimdoors.rift.targets.*; +import org.dimdev.dimdoors.rift.targets.EscapeTarget; +import org.dimdev.dimdoors.rift.targets.PrivatePocketExitTarget; +import org.dimdev.dimdoors.rift.targets.PrivatePocketTarget; +import org.dimdev.dimdoors.rift.targets.PublicPocketTarget; +import org.dimdev.dimdoors.rift.targets.RandomTarget; import org.dimdev.dimdoors.sound.ModSoundEvents; import org.dimdev.dimdoors.world.ModDimensions; import net.minecraft.block.Block; import net.minecraft.entity.EquipmentSlot; -import net.minecraft.item.*; +import net.minecraft.item.ArmorItem; +import net.minecraft.item.BlockItem; +import net.minecraft.item.BucketItem; +import net.minecraft.item.Item; +import net.minecraft.item.Items; import net.minecraft.sound.SoundEvent; import net.minecraft.util.Identifier; import net.minecraft.util.registry.Registry; diff --git a/src/main/java/org/dimdev/dimdoors/pockets/PocketTemplate.java b/src/main/java/org/dimdev/dimdoors/pockets/PocketTemplate.java index 88afabe3..79c0af93 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/PocketTemplate.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/PocketTemplate.java @@ -17,10 +17,10 @@ import org.dimdev.dimdoors.rift.registry.RiftRegistry; import org.dimdev.dimdoors.rift.targets.PocketEntranceMarker; import org.dimdev.dimdoors.rift.targets.PocketExitMarker; import org.dimdev.dimdoors.rift.targets.VirtualTarget; -import org.dimdev.dimdoors.world.pocket.Pocket; -import org.dimdev.dimdoors.world.pocket.PocketRegistry; import org.dimdev.dimdoors.util.Location; import org.dimdev.dimdoors.util.math.MathUtil; +import org.dimdev.dimdoors.world.pocket.Pocket; +import org.dimdev.dimdoors.world.pocket.PocketRegistry; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; diff --git a/src/main/java/org/dimdev/dimdoors/pockets/SchematicHandler.java b/src/main/java/org/dimdev/dimdoors/pockets/SchematicHandler.java index d7180c10..0726a95c 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/SchematicHandler.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/SchematicHandler.java @@ -1,11 +1,26 @@ package org.dimdev.dimdoors.pockets; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.nio.charset.StandardCharsets; import java.util.AbstractMap.SimpleEntry; -import java.util.*; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import java.util.stream.Collectors; import com.google.gson.JsonArray; diff --git a/src/main/java/org/dimdev/dimdoors/rift/registry/RiftRegistry.java b/src/main/java/org/dimdev/dimdoors/rift/registry/RiftRegistry.java index 1a96e213..99b13b56 100644 --- a/src/main/java/org/dimdev/dimdoors/rift/registry/RiftRegistry.java +++ b/src/main/java/org/dimdev/dimdoors/rift/registry/RiftRegistry.java @@ -1,15 +1,20 @@ package org.dimdev.dimdoors.rift.registry; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.UUID; import java.util.stream.Collectors; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.dimdev.dimdoors.util.GraphUtils; +import org.dimdev.dimdoors.util.Location; import org.dimdev.dimdoors.world.pocket.Pocket; import org.dimdev.dimdoors.world.pocket.PocketRegistry; import org.dimdev.dimdoors.world.pocket.PrivatePocketData; -import org.dimdev.dimdoors.util.GraphUtils; -import org.dimdev.dimdoors.util.Location; import org.jgrapht.graph.DefaultDirectedGraph; import org.jgrapht.graph.DefaultEdge; diff --git a/src/main/java/org/dimdev/dimdoors/rift/targets/EscapeTarget.java b/src/main/java/org/dimdev/dimdoors/rift/targets/EscapeTarget.java index f1ea0da1..d1982538 100644 --- a/src/main/java/org/dimdev/dimdoors/rift/targets/EscapeTarget.java +++ b/src/main/java/org/dimdev/dimdoors/rift/targets/EscapeTarget.java @@ -4,10 +4,10 @@ import java.util.UUID; import org.dimdev.dimdoors.block.entity.RiftBlockEntity; import org.dimdev.dimdoors.rift.registry.RiftRegistry; -import org.dimdev.dimdoors.world.ModDimensions; -import org.dimdev.dimdoors.world.pocket.VirtualLocation; import org.dimdev.dimdoors.util.Location; import org.dimdev.dimdoors.util.TeleportUtil; +import org.dimdev.dimdoors.world.ModDimensions; +import org.dimdev.dimdoors.world.pocket.VirtualLocation; import net.minecraft.entity.Entity; import net.minecraft.nbt.CompoundTag; diff --git a/src/main/java/org/dimdev/dimdoors/rift/targets/LimboTarget.java b/src/main/java/org/dimdev/dimdoors/rift/targets/LimboTarget.java index d67f50dc..100816e0 100644 --- a/src/main/java/org/dimdev/dimdoors/rift/targets/LimboTarget.java +++ b/src/main/java/org/dimdev/dimdoors/rift/targets/LimboTarget.java @@ -3,8 +3,6 @@ package org.dimdev.dimdoors.rift.targets; import net.minecraft.entity.Entity; import net.minecraft.nbt.CompoundTag; -import static org.dimdev.dimdoors.world.ModDimensions.LIMBO; - public class LimboTarget extends VirtualTarget implements EntityTarget { public LimboTarget() { } diff --git a/src/main/java/org/dimdev/dimdoors/rift/targets/PrivatePocketExitTarget.java b/src/main/java/org/dimdev/dimdoors/rift/targets/PrivatePocketExitTarget.java index 10cec81a..99fd40e6 100644 --- a/src/main/java/org/dimdev/dimdoors/rift/targets/PrivatePocketExitTarget.java +++ b/src/main/java/org/dimdev/dimdoors/rift/targets/PrivatePocketExitTarget.java @@ -4,12 +4,12 @@ import java.util.UUID; import org.dimdev.dimdoors.block.entity.RiftBlockEntity; import org.dimdev.dimdoors.rift.registry.RiftRegistry; +import org.dimdev.dimdoors.util.EntityUtils; +import org.dimdev.dimdoors.util.Location; import org.dimdev.dimdoors.world.ModDimensions; import org.dimdev.dimdoors.world.pocket.Pocket; import org.dimdev.dimdoors.world.pocket.PocketRegistry; import org.dimdev.dimdoors.world.pocket.PrivatePocketData; -import org.dimdev.dimdoors.util.EntityUtils; -import org.dimdev.dimdoors.util.Location; import net.minecraft.entity.Entity; import net.minecraft.nbt.CompoundTag; diff --git a/src/main/java/org/dimdev/dimdoors/rift/targets/PrivatePocketTarget.java b/src/main/java/org/dimdev/dimdoors/rift/targets/PrivatePocketTarget.java index a22a209c..cd2588a3 100644 --- a/src/main/java/org/dimdev/dimdoors/rift/targets/PrivatePocketTarget.java +++ b/src/main/java/org/dimdev/dimdoors/rift/targets/PrivatePocketTarget.java @@ -6,11 +6,11 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.dimdev.dimdoors.pockets.PocketGenerator; import org.dimdev.dimdoors.rift.registry.RiftRegistry; +import org.dimdev.dimdoors.util.EntityUtils; +import org.dimdev.dimdoors.util.Location; import org.dimdev.dimdoors.world.pocket.Pocket; import org.dimdev.dimdoors.world.pocket.PrivatePocketData; import org.dimdev.dimdoors.world.pocket.VirtualLocation; -import org.dimdev.dimdoors.util.EntityUtils; -import org.dimdev.dimdoors.util.Location; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.Entity; diff --git a/src/main/java/org/dimdev/dimdoors/rift/targets/PublicPocketTarget.java b/src/main/java/org/dimdev/dimdoors/rift/targets/PublicPocketTarget.java index 567c0ca8..ea1b3566 100644 --- a/src/main/java/org/dimdev/dimdoors/rift/targets/PublicPocketTarget.java +++ b/src/main/java/org/dimdev/dimdoors/rift/targets/PublicPocketTarget.java @@ -2,9 +2,9 @@ package org.dimdev.dimdoors.rift.targets; import org.dimdev.dimdoors.pockets.PocketGenerator; import org.dimdev.dimdoors.rift.registry.RiftRegistry; +import org.dimdev.dimdoors.util.Location; import org.dimdev.dimdoors.world.pocket.Pocket; import org.dimdev.dimdoors.world.pocket.VirtualLocation; -import org.dimdev.dimdoors.util.Location; import net.minecraft.nbt.CompoundTag; diff --git a/src/main/java/org/dimdev/dimdoors/rift/targets/RandomTarget.java b/src/main/java/org/dimdev/dimdoors/rift/targets/RandomTarget.java index 703c6636..516d79d9 100644 --- a/src/main/java/org/dimdev/dimdoors/rift/targets/RandomTarget.java +++ b/src/main/java/org/dimdev/dimdoors/rift/targets/RandomTarget.java @@ -14,10 +14,10 @@ import org.dimdev.dimdoors.pockets.PocketGenerator; import org.dimdev.dimdoors.rift.registry.LinkProperties; import org.dimdev.dimdoors.rift.registry.Rift; import org.dimdev.dimdoors.rift.registry.RiftRegistry; -import org.dimdev.dimdoors.world.pocket.Pocket; -import org.dimdev.dimdoors.world.pocket.VirtualLocation; import org.dimdev.dimdoors.util.Location; import org.dimdev.dimdoors.util.math.MathUtil; +import org.dimdev.dimdoors.world.pocket.Pocket; +import org.dimdev.dimdoors.world.pocket.VirtualLocation; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.world.ServerWorld; diff --git a/src/main/java/org/dimdev/dimdoors/util/TeleportUtil.java b/src/main/java/org/dimdev/dimdoors/util/TeleportUtil.java index af58c854..042c83db 100644 --- a/src/main/java/org/dimdev/dimdoors/util/TeleportUtil.java +++ b/src/main/java/org/dimdev/dimdoors/util/TeleportUtil.java @@ -1,9 +1,7 @@ package org.dimdev.dimdoors.util; -import net.minecraft.block.pattern.BlockPattern; import net.minecraft.entity.Entity; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; diff --git a/src/main/java/org/dimdev/dimdoors/world/LimboEntityPlacer.java b/src/main/java/org/dimdev/dimdoors/world/LimboEntityPlacer.java index 1e751610..8be03569 100644 --- a/src/main/java/org/dimdev/dimdoors/world/LimboEntityPlacer.java +++ b/src/main/java/org/dimdev/dimdoors/world/LimboEntityPlacer.java @@ -1,10 +1,5 @@ package org.dimdev.dimdoors.world; -import net.minecraft.block.pattern.BlockPattern; -import net.minecraft.entity.Entity; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.math.Direction; - public class LimboEntityPlacer { // @Override // public BlockPattern.Result placeEntity(Entity entity, ServerWorld serverWorld, Direction direction, double v, double v1) { diff --git a/src/main/java/org/dimdev/dimdoors/world/ModBiomes.java b/src/main/java/org/dimdev/dimdoors/world/ModBiomes.java index e76b11d4..48d669b1 100644 --- a/src/main/java/org/dimdev/dimdoors/world/ModBiomes.java +++ b/src/main/java/org/dimdev/dimdoors/world/ModBiomes.java @@ -13,6 +13,7 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.BiomeEffects; import net.minecraft.world.biome.GenerationSettings; import net.minecraft.world.biome.SpawnSettings; +import net.minecraft.world.gen.GenerationStep; import net.minecraft.world.gen.surfacebuilder.ConfiguredSurfaceBuilder; import net.minecraft.world.gen.surfacebuilder.DefaultSurfaceBuilder; import net.minecraft.world.gen.surfacebuilder.TernarySurfaceConfig; @@ -28,9 +29,13 @@ public final class ModBiomes { .foliageColor(0) .waterFogColor(0) .moodSound(new BiomeMoodSound(ModSoundEvents.CREEPY, 6000, 8, 2.0)) + .skyColor(0x404040) + .grassColor(0) .build()) .generationSettings(new GenerationSettings.Builder() .surfaceBuilder(new ConfiguredSurfaceBuilder<>(new DefaultSurfaceBuilder(TernarySurfaceConfig.CODEC), new TernarySurfaceConfig(ModBlocks.UNRAVELLED_FABRIC.getDefaultState(), ModBlocks.UNRAVELLED_FABRIC.getDefaultState(), ModBlocks.ETERNAL_FLUID.getDefaultState()))) + .feature(GenerationStep.Feature.UNDERGROUND_ORES, ModFeatures.LIMBO_BEDROCK_FLUID_ORE) + .feature(GenerationStep.Feature.UNDERGROUND_ORES, ModFeatures.LIMBO_FABRIC_FLUID_ORE) .build()) .precipitation(Biome.Precipitation.NONE) .scale(0.9f) diff --git a/src/main/java/org/dimdev/dimdoors/world/ModFeatures.java b/src/main/java/org/dimdev/dimdoors/world/ModFeatures.java index 57d9b543..ddd1b53b 100644 --- a/src/main/java/org/dimdev/dimdoors/world/ModFeatures.java +++ b/src/main/java/org/dimdev/dimdoors/world/ModFeatures.java @@ -1,28 +1,23 @@ package org.dimdev.dimdoors.world; import org.dimdev.dimdoors.block.ModBlocks; -import org.dimdev.dimdoors.world.feature.CustomOreFeature; -import org.dimdev.dimdoors.world.feature.CustomOreFeatureConfig; import net.minecraft.block.Blocks; +import net.minecraft.structure.rule.BlockMatchRuleTest; import net.minecraft.util.Identifier; +import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.Registry; -import net.minecraft.world.gen.GenerationStep; import net.minecraft.world.gen.decorator.Decorator; import net.minecraft.world.gen.decorator.RangeDecoratorConfig; +import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.OreFeatureConfig; -public class ModFeatures { - //public static final Feature ORE = Registry.register(Registry.FEATURE, new Identifier("dimdoors", "custom_ore"), new CustomOreFeature(CustomOreFeatureConfig.CODEC)); +public final class ModFeatures { + public static final ConfiguredFeature LIMBO_BEDROCK_FLUID_ORE = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier("dimdoors", "limbo_bedrock_fluid_ore"), Feature.ORE.configure(new OreFeatureConfig(new BlockMatchRuleTest(Blocks.BEDROCK), ModBlocks.ETERNAL_FLUID.getDefaultState(), 6)).decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(0, 5, 7)))); + public static final ConfiguredFeature LIMBO_FABRIC_FLUID_ORE = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier("dimdoors", "limbo_fabric_fluid_ore"), Feature.ORE.configure(new OreFeatureConfig(new BlockMatchRuleTest(ModBlocks.UNRAVELLED_FABRIC), ModBlocks.ETERNAL_FLUID.getDefaultState(), 6)).decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(0, 11, 9)))); public static void init() { - //CustomOreFeatureConfig eternalFluidFabricConfig = new CustomOreFeatureConfig(blockState -> blockState == ModBlocks.UNRAVELLED_FABRIC.getDefaultState(), ModBlocks.ETERNAL_FLUID.getDefaultState(), 16); - //RangeDecoratorConfig eternalFluidFabricRange = new RangeDecoratorConfig(2, 0, 5, 24); - //ModBiomes.LIMBO.addFeature(GenerationStep.Feature.UNDERGROUND_ORES, ORE.configure(eternalFluidFabricConfig).createDecoratedFeature(Decorator.COUNT_RANGE.configure(eternalFluidFabricRange))); - - //CustomOreFeatureConfig eternalFluidBedrockConfig = new CustomOreFeatureConfig(blockState -> blockState == Blocks.BEDROCK.getDefaultState(), ModBlocks.ETERNAL_FLUID.getDefaultState(), 16); - //RangeDecoratorConfig eternalFluidBedrockRange = new RangeDecoratorConfig(1, 0, 0, 6); - //ModBiomes.LIMBO.addFeature(GenerationStep.Feature.UNDERGROUND_ORES, ORE.configure(eternalFluidBedrockConfig).createDecoratedFeature(Decorator.COUNT_RANGE.configure(eternalFluidBedrockRange))); + //just loads the class } } diff --git a/src/main/java/org/dimdev/dimdoors/world/PocketDimensionPlacer.java b/src/main/java/org/dimdev/dimdoors/world/PocketDimensionPlacer.java index 1af1c511..910a0758 100644 --- a/src/main/java/org/dimdev/dimdoors/world/PocketDimensionPlacer.java +++ b/src/main/java/org/dimdev/dimdoors/world/PocketDimensionPlacer.java @@ -1,10 +1,5 @@ package org.dimdev.dimdoors.world; -import net.minecraft.block.pattern.BlockPattern; -import net.minecraft.entity.Entity; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.math.Direction; - //import net.fabricmc.fabric.api.dimension.v1.EntityPlacer; public class PocketDimensionPlacer { diff --git a/src/main/java/org/dimdev/dimdoors/world/limbo/LimboBiome.java b/src/main/java/org/dimdev/dimdoors/world/limbo/LimboBiome.java index fdcc437d..a442d110 100644 --- a/src/main/java/org/dimdev/dimdoors/world/limbo/LimboBiome.java +++ b/src/main/java/org/dimdev/dimdoors/world/limbo/LimboBiome.java @@ -27,7 +27,8 @@ // ModBlocks.ETERNAL_FLUID.getDefaultState() // ) // ) -// .precipitation(Biome.Precipitation.NONE).category(Biome.Category.NETHER) +// .precipitation(Biome.Precipitation.NONE) +// .category(Biome.Category.NETHER) // .depth(0.1F) // .scale(0.2F) // .temperature(2.0F) @@ -38,7 +39,6 @@ // .waterFogColor(0x000000) // .fogColor(0x000000) // .loopSound(ModSoundEvents.CREEPY) -// // TODO: moodSound, additionsSound? // .build() // ) // .parent(null) diff --git a/src/main/java/org/dimdev/dimdoors/world/limbo/LimboChunkGenerator.java b/src/main/java/org/dimdev/dimdoors/world/limbo/LimboChunkGenerator.java index 27d9a37f..fbb1c9c4 100644 --- a/src/main/java/org/dimdev/dimdoors/world/limbo/LimboChunkGenerator.java +++ b/src/main/java/org/dimdev/dimdoors/world/limbo/LimboChunkGenerator.java @@ -1,18 +1,21 @@ package org.dimdev.dimdoors.world.limbo; -import com.mojang.serialization.Codec; -import com.mojang.serialization.codecs.RecordCodecBuilder; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectList; import it.unimi.dsi.fastutil.objects.ObjectListIterator; + import java.util.Iterator; import java.util.List; import java.util.Random; import java.util.function.Predicate; import java.util.function.Supplier; import java.util.stream.IntStream; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import org.dimdev.dimdoors.mixin.ChunkGeneratorSettingsAccessor; +import org.jetbrains.annotations.Nullable; + import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.SpawnGroup; @@ -52,26 +55,26 @@ import net.minecraft.world.gen.chunk.GenerationShapeConfig; import net.minecraft.world.gen.chunk.VerticalBlockSample; import net.minecraft.world.gen.feature.StructureFeature; -import org.dimdev.dimdoors.mixin.ChunkGeneratorSettingsAccessor; -import org.jetbrains.annotations.Nullable; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; @SuppressWarnings("deprecated") public class LimboChunkGenerator extends ChunkGenerator { public static final Codec CODEC = RecordCodecBuilder.create((instance) -> instance.group(BiomeSource.CODEC.fieldOf("biome_source").forGetter((noiseChunkGenerator) -> noiseChunkGenerator.biomeSource), Codec.LONG.fieldOf("seed").stable().forGetter((noiseChunkGenerator) -> new Random().nextLong()), ChunkGeneratorSettings.REGISTRY_CODEC.fieldOf("settings").forGetter((noiseChunkGenerator) -> noiseChunkGenerator.settings)).apply(instance, instance.stable(LimboChunkGenerator::new))); private static final float[] NOISE_WEIGHT_TABLE = Util.make(new float[13824], (array) -> { - for(int i = 0; i < 24; ++i) { - for(int j = 0; j < 24; ++j) { - for(int k = 0; k < 24; ++k) { - array[i * 24 * 24 + j * 24 + k] = (float)calculateNoiseWeight(j - 12, k - 12, i - 12); + for (int i = 0; i < 24; ++i) { + for (int j = 0; j < 24; ++j) { + for (int k = 0; k < 24; ++k) { + array[i * 24 * 24 + j * 24 + k] = (float) calculateNoiseWeight(j - 12, k - 12, i - 12); } } } }); private static final float[] BIOME_WEIGHT_TABLE = Util.make(new float[25], (fs) -> { - for(int i = -2; i <= 2; ++i) { - for(int j = -2; j <= 2; ++j) { - float f = 10.0F / MathHelper.sqrt((float)(i * i + j * j) + 0.2F); + for (int i = -2; i <= 2; ++i) { + for (int j = -2; j <= 2; ++j) { + float f = 10.0F / MathHelper.sqrt((float) (i * i + j * j) + 0.2F); fs[i + 2 + (j + 2) * 5] = f; } } @@ -151,25 +154,25 @@ public class LimboChunkGenerator extends ChunkGenerator { double f = 0.0D; double g = 1.0D; - for(int i = 0; i < 16; ++i) { - double h = OctavePerlinNoiseSampler.maintainPrecision((double)x * horizontalScale * g); - double j = OctavePerlinNoiseSampler.maintainPrecision((double)y * verticalScale * g); - double k = OctavePerlinNoiseSampler.maintainPrecision((double)z * horizontalScale * g); + for (int i = 0; i < 16; ++i) { + double h = OctavePerlinNoiseSampler.maintainPrecision((double) x * horizontalScale * g); + double j = OctavePerlinNoiseSampler.maintainPrecision((double) y * verticalScale * g); + double k = OctavePerlinNoiseSampler.maintainPrecision((double) z * horizontalScale * g); double l = verticalScale * g; PerlinNoiseSampler perlinNoiseSampler = this.lowerInterpolatedNoise.getOctave(i); if (perlinNoiseSampler != null) { - d += perlinNoiseSampler.sample(h, j, k, l, (double)y * l) / g; + d += perlinNoiseSampler.sample(h, j, k, l, (double) y * l) / g; } PerlinNoiseSampler perlinNoiseSampler2 = this.upperInterpolatedNoise.getOctave(i); if (perlinNoiseSampler2 != null) { - e += perlinNoiseSampler2.sample(h, j, k, l, (double)y * l) / g; + e += perlinNoiseSampler2.sample(h, j, k, l, (double) y * l) / g; } if (i < 8) { PerlinNoiseSampler perlinNoiseSampler3 = this.interpolationNoise.getOctave(i); if (perlinNoiseSampler3 != null) { - f += perlinNoiseSampler3.sample(OctavePerlinNoiseSampler.maintainPrecision((double)x * horizontalStretch * g), OctavePerlinNoiseSampler.maintainPrecision((double)y * verticalStretch * g), OctavePerlinNoiseSampler.maintainPrecision((double)z * horizontalStretch * g), verticalStretch * g, (double)y * verticalStretch * g) / g; + f += perlinNoiseSampler3.sample(OctavePerlinNoiseSampler.maintainPrecision((double) x * horizontalStretch * g), OctavePerlinNoiseSampler.maintainPrecision((double) y * verticalStretch * g), OctavePerlinNoiseSampler.maintainPrecision((double) z * horizontalStretch * g), verticalStretch * g, (double) y * verticalStretch * g) / g; } } @@ -205,8 +208,8 @@ public class LimboChunkGenerator extends ChunkGenerator { int k = this.getSeaLevel(); float l = this.biomeSource.getBiomeForNoiseGen(x, k, z).getDepth(); - for(int m = -2; m <= 2; ++m) { - for(int n = -2; n <= 2; ++n) { + for (int m = -2; m <= 2; ++m) { + for (int n = -2; n <= 2; ++n) { Biome biome = this.biomeSource.getBiomeForNoiseGen(x + m, k, z + n); float o = biome.getDepth(); float p = biome.getScale(); @@ -250,9 +253,9 @@ public class LimboChunkGenerator extends ChunkGenerator { double ap = generationShapeConfig.getDensityFactor(); double aq = generationShapeConfig.getDensityOffset(); - for(int ar = 0; ar <= this.noiseSizeY; ++ar) { + for (int ar = 0; ar <= this.noiseSizeY; ++ar) { double as = this.sampleNoise(x, ar, z, ae, af, ag, ah); - double at = 1.0D - (double)ar * 2.0D / (double)this.noiseSizeY + ao; + double at = 1.0D - (double) ar * 2.0D / (double) this.noiseSizeY + ao; double au = at * ap + aq; double av = (au + ac) * ad; if (av > 0.0D) { @@ -263,12 +266,12 @@ public class LimboChunkGenerator extends ChunkGenerator { double ax; if (aj > 0.0D) { - ax = ((double)(this.noiseSizeY - ar) - ak) / aj; + ax = ((double) (this.noiseSizeY - ar) - ak) / aj; as = MathHelper.clampedLerp(ai, as, ax); } if (am > 0.0D) { - ax = ((double)ar - an) / am; + ax = ((double) ar - an) / am; as = MathHelper.clampedLerp(al, as, ax); } @@ -305,11 +308,11 @@ public class LimboChunkGenerator extends ChunkGenerator { int j = Math.floorDiv(z, this.horizontalNoiseResolution); int k = Math.floorMod(x, this.horizontalNoiseResolution); int l = Math.floorMod(z, this.horizontalNoiseResolution); - double d = (double)k / (double)this.horizontalNoiseResolution; - double e = (double)l / (double)this.horizontalNoiseResolution; + double d = (double) k / (double) this.horizontalNoiseResolution; + double e = (double) l / (double) this.horizontalNoiseResolution; double[][] ds = new double[][]{this.sampleNoiseColumn(i, j), this.sampleNoiseColumn(i, j + 1), this.sampleNoiseColumn(i + 1, j), this.sampleNoiseColumn(i + 1, j + 1)}; - for(int m = this.noiseSizeY - 1; m >= 0; --m) { + for (int m = this.noiseSizeY - 1; m >= 0; --m) { double f = ds[0][m]; double g = ds[1][m]; double h = ds[2][m]; @@ -319,8 +322,8 @@ public class LimboChunkGenerator extends ChunkGenerator { double q = ds[2][m + 1]; double r = ds[3][m + 1]; - for(int s = this.verticalNoiseResolution - 1; s >= 0; --s) { - double t = (double)s / (double)this.verticalNoiseResolution; + for (int s = this.verticalNoiseResolution - 1; s >= 0; --s) { + double t = (double) s / (double) this.verticalNoiseResolution; double u = MathHelper.lerp3(t, d, e, f, o, h, q, g, p, n, r); int v = m * this.verticalNoiseResolution + s; BlockState blockState = this.getBlockState(u, v); @@ -361,12 +364,12 @@ public class LimboChunkGenerator extends ChunkGenerator { int l = chunkPos2.getStartZ(); BlockPos.Mutable mutable = new BlockPos.Mutable(); - for(int m = 0; m < 16; ++m) { - for(int n = 0; n < 16; ++n) { + for (int m = 0; m < 16; ++m) { + for (int n = 0; n < 16; ++n) { int o = k + m; int p = l + n; int q = chunk.sampleHeightmap(Heightmap.Type.WORLD_SURFACE_WG, m, n) + 1; - double e = this.surfaceDepthNoise.sample((double)o * 0.0625D, (double)p * 0.0625D, 0.0625D, (double)m * 0.0625D) * 15.0D; + double e = this.surfaceDepthNoise.sample((double) o * 0.0625D, (double) p * 0.0625D, 0.0625D, (double) m * 0.0625D) * 15.0D; region.getBiome(mutable.set(k + m, q, l + n)).buildSurface(chunkRandom, chunk, o, p, q, e, this.defaultBlock, this.defaultFluid, this.getSeaLevel(), region.getSeed()); } } @@ -386,7 +389,7 @@ public class LimboChunkGenerator extends ChunkGenerator { if (bl || bl2) { Iterator var12 = BlockPos.iterate(i, 0, j, i + 15, 0, j + 15).iterator(); - while(true) { + while (true) { BlockPos blockPos; int o; do { @@ -394,17 +397,17 @@ public class LimboChunkGenerator extends ChunkGenerator { return; } - blockPos = (BlockPos)var12.next(); + blockPos = (BlockPos) var12.next(); if (bl) { - for(o = 0; o < 5; ++o) { + for (o = 0; o < 5; ++o) { if (o <= random.nextInt(5)) { chunk.setBlockState(mutable.set(blockPos.getX(), l - o, blockPos.getZ()), Blocks.BEDROCK.getDefaultState(), false); } } } - } while(!bl2); + } while (!bl2); - for(o = 4; o >= 0; --o) { + for (o = 4; o >= 0; --o) { if (o <= random.nextInt(5)) { chunk.setBlockState(mutable.set(blockPos.getX(), k + o, blockPos.getZ()), Blocks.BEDROCK.getDefaultState(), false); } @@ -459,30 +462,30 @@ public class LimboChunkGenerator extends ChunkGenerator { double[][][] ds = new double[2][this.noiseSizeZ + 1][this.noiseSizeY + 1]; - for(int m = 0; m < this.noiseSizeZ + 1; ++m) { + for (int m = 0; m < this.noiseSizeZ + 1; ++m) { ds[0][m] = new double[this.noiseSizeY + 1]; this.sampleNoiseColumn(ds[0][m], i * this.noiseSizeX, j * this.noiseSizeZ + m); ds[1][m] = new double[this.noiseSizeY + 1]; } - ProtoChunk protoChunk = (ProtoChunk)chunk; + ProtoChunk protoChunk = (ProtoChunk) chunk; Heightmap heightmap = protoChunk.getHeightmap(Heightmap.Type.OCEAN_FLOOR_WG); Heightmap heightmap2 = protoChunk.getHeightmap(Heightmap.Type.WORLD_SURFACE_WG); BlockPos.Mutable mutable = new BlockPos.Mutable(); ObjectListIterator objectListIterator = objectList.iterator(); ObjectListIterator objectListIterator2 = objectList2.iterator(); - for(int n = 0; n < this.noiseSizeX; ++n) { + for (int n = 0; n < this.noiseSizeX; ++n) { int p; - for(p = 0; p < this.noiseSizeZ + 1; ++p) { + for (p = 0; p < this.noiseSizeZ + 1; ++p) { this.sampleNoiseColumn(ds[1][p], i * this.noiseSizeX + n + 1, j * this.noiseSizeZ + p); } - for(p = 0; p < this.noiseSizeZ; ++p) { + for (p = 0; p < this.noiseSizeZ; ++p) { ChunkSection chunkSection = protoChunk.getSection(15); chunkSection.lock(); - for(int q = this.noiseSizeY - 1; q >= 0; --q) { + for (int q = this.noiseSizeY - 1; q >= 0; --q) { double d = ds[0][p][q]; double e = ds[0][p + 1][q]; double f = ds[1][p][q]; @@ -492,7 +495,7 @@ public class LimboChunkGenerator extends ChunkGenerator { double s = ds[1][p][q + 1]; double t = ds[1][p + 1][q + 1]; - for(int u = this.verticalNoiseResolution - 1; u >= 0; --u) { + for (int u = this.verticalNoiseResolution - 1; u >= 0; --u) { int v = q * this.verticalNoiseResolution + u; int w = v & 15; int x = v >> 4; @@ -502,40 +505,40 @@ public class LimboChunkGenerator extends ChunkGenerator { chunkSection.lock(); } - double y = (double)u / (double)this.verticalNoiseResolution; + double y = (double) u / (double) this.verticalNoiseResolution; double z = MathHelper.lerp(y, d, h); double aa = MathHelper.lerp(y, f, s); double ab = MathHelper.lerp(y, e, r); double ac = MathHelper.lerp(y, g, t); - for(int ad = 0; ad < this.horizontalNoiseResolution; ++ad) { + for (int ad = 0; ad < this.horizontalNoiseResolution; ++ad) { int ae = k + n * this.horizontalNoiseResolution + ad; int af = ae & 15; - double ag = (double)ad / (double)this.horizontalNoiseResolution; + double ag = (double) ad / (double) this.horizontalNoiseResolution; double ah = MathHelper.lerp(ag, z, aa); double ai = MathHelper.lerp(ag, ab, ac); - for(int aj = 0; aj < this.horizontalNoiseResolution; ++aj) { + for (int aj = 0; aj < this.horizontalNoiseResolution; ++aj) { int ak = l + p * this.horizontalNoiseResolution + aj; int al = ak & 15; - double am = (double)aj / (double)this.horizontalNoiseResolution; + double am = (double) aj / (double) this.horizontalNoiseResolution; double an = MathHelper.lerp(am, ah, ai); double ao = MathHelper.clamp(an / 200.0D, -1.0D, 1.0D); int at; int au; int ar; - for(ao = ao / 2.0D - ao * ao * ao / 24.0D; objectListIterator.hasNext(); ao += getNoiseWeight(at, au, ar) * 0.8D) { + for (ao = ao / 2.0D - ao * ao * ao / 24.0D; objectListIterator.hasNext(); ao += getNoiseWeight(at, au, ar) * 0.8D) { StructurePiece structurePiece = objectListIterator.next(); BlockBox blockBox = structurePiece.getBoundingBox(); at = Math.max(0, Math.max(blockBox.minX - ae, ae - blockBox.maxX)); - au = v - (blockBox.minY + (structurePiece instanceof PoolStructurePiece ? ((PoolStructurePiece)structurePiece).getGroundLevelDelta() : 0)); + au = v - (blockBox.minY + (structurePiece instanceof PoolStructurePiece ? ((PoolStructurePiece) structurePiece).getGroundLevelDelta() : 0)); ar = Math.max(0, Math.max(blockBox.minZ - ak, ak - blockBox.maxZ)); } objectListIterator.back(objectList.size()); - while(objectListIterator2.hasNext()) { + while (objectListIterator2.hasNext()) { JigsawJunction jigsawJunction = objectListIterator2.next(); int as = ae - jigsawJunction.getSourceX(); at = v - jigsawJunction.getSourceGroundY(); @@ -576,7 +579,7 @@ public class LimboChunkGenerator extends ChunkGenerator { int k = z + 12; if (i >= 0 && i < 24) { if (j >= 0 && j < 24) { - return k >= 0 && k < 24 ? (double)NOISE_WEIGHT_TABLE[k * 24 * 24 + i * 24 + j] : 0.0D; + return k >= 0 && k < 24 ? (double) NOISE_WEIGHT_TABLE[k * 24 * 24 + i * 24 + j] : 0.0D; } else { return 0.0D; } @@ -587,7 +590,7 @@ public class LimboChunkGenerator extends ChunkGenerator { private static double calculateNoiseWeight(int x, int y, int z) { double d = x * x + z * z; - double e = (double)y + 0.5D; + double e = (double) y + 0.5D; double f = e * e; double g = Math.pow(2.718281828459045D, -(f / 16.0D + d / 16.0D)); double h = -e * MathHelper.fastInverseSqrt(f / 2.0D + d / 2.0D) / 2.0D; diff --git a/src/main/java/org/dimdev/dimdoors/world/pocket/PocketRegistry.java b/src/main/java/org/dimdev/dimdoors/world/pocket/PocketRegistry.java index a0059dfb..5d029bff 100644 --- a/src/main/java/org/dimdev/dimdoors/world/pocket/PocketRegistry.java +++ b/src/main/java/org/dimdev/dimdoors/world/pocket/PocketRegistry.java @@ -6,8 +6,8 @@ import java.util.Map; import org.dimdev.annotatednbt.AnnotatedNbt; import org.dimdev.annotatednbt.Saved; import org.dimdev.dimdoors.ModConfig; -import org.dimdev.dimdoors.world.ModDimensions; import org.dimdev.dimdoors.util.math.GridUtil; +import org.dimdev.dimdoors.world.ModDimensions; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.world.ServerWorld; diff --git a/src/main/java/org/dimdev/dimdoors/world/pocket/VirtualLocation.java b/src/main/java/org/dimdev/dimdoors/world/pocket/VirtualLocation.java index 624de267..ccfd11e0 100644 --- a/src/main/java/org/dimdev/dimdoors/world/pocket/VirtualLocation.java +++ b/src/main/java/org/dimdev/dimdoors/world/pocket/VirtualLocation.java @@ -3,8 +3,8 @@ package org.dimdev.dimdoors.world.pocket; import org.dimdev.annotatednbt.AnnotatedNbt; import org.dimdev.annotatednbt.Saved; import org.dimdev.dimdoors.ModConfig; -import org.dimdev.dimdoors.world.ModDimensions; import org.dimdev.dimdoors.util.Location; +import org.dimdev.dimdoors.world.ModDimensions; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.world.ServerWorld; diff --git a/src/main/java/org/dimdev/gsonnbt/NbtReader.java b/src/main/java/org/dimdev/gsonnbt/NbtReader.java index 4b7ff736..1ab14476 100644 --- a/src/main/java/org/dimdev/gsonnbt/NbtReader.java +++ b/src/main/java/org/dimdev/gsonnbt/NbtReader.java @@ -10,7 +10,13 @@ import java.util.stream.Collectors; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonToken; -import net.minecraft.nbt.*; +import net.minecraft.nbt.AbstractNumberTag; +import net.minecraft.nbt.ByteTag; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.EndTag; +import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.StringTag; +import net.minecraft.nbt.Tag; public class NbtReader extends JsonReader { private static final Reader UNREADABLE_READER = new Reader() {