reformat + imports

This commit is contained in:
dfsek committed 2021-08-03 12:59:58 -07:00
1 parent dca8dd4c4f
commit f1bda5c907
161 files changed
+342 -378

No files matched your search

@@ -22,10 +22,8 @@ import java.util.Optional;
public class TerraPluginImpl extends AbstractTerraPlugin {
private final ItemHandle itemHandle = new BukkitItemHandle();
private WorldHandle handle = new BukkitWorldHandle();
private final TerraBukkitPlugin plugin;
private WorldHandle handle = new BukkitWorldHandle();
public TerraPluginImpl(TerraBukkitPlugin plugin) {
this.plugin = plugin;
@@ -3,12 +3,11 @@ package com.dfsek.terra.bukkit.generator;
import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.config.WorldConfig;
import com.dfsek.terra.api.world.Chunk;
import com.dfsek.terra.api.world.generator.GeneratorWrapper;
import com.dfsek.terra.api.world.generator.ChunkGenerator;
import com.dfsek.terra.api.world.generator.GeneratorWrapper;
import com.dfsek.terra.bukkit.population.PopulationManager;
import com.dfsek.terra.bukkit.world.BukkitAdapter;
import com.dfsek.terra.bukkit.world.BukkitBiomeGrid;
import com.dfsek.terra.bukkit.world.BukkitWorld;
import org.bukkit.World;
import org.bukkit.generator.BlockPopulator;
import org.jetbrains.annotations.NotNull;
@@ -1,7 +1,7 @@
package com.dfsek.terra.bukkit.generator;
import com.dfsek.terra.api.world.generator.Chunkified;
import com.dfsek.terra.api.world.generator.ChunkGenerator;
import com.dfsek.terra.api.world.generator.Chunkified;
import com.dfsek.terra.bukkit.world.BukkitAdapter;
import org.bukkit.Chunk;
import org.bukkit.World;
@@ -4,9 +4,8 @@ import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.profiler.ProfileFrame;
import com.dfsek.terra.api.world.Chunk;
import com.dfsek.terra.api.world.World;
import com.dfsek.terra.api.world.generator.Chunkified;
import com.dfsek.terra.api.world.generator.ChunkGenerator;
import com.dfsek.terra.bukkit.TerraBukkitPlugin;
import com.dfsek.terra.api.world.generator.Chunkified;
import com.dfsek.terra.bukkit.TerraPluginImpl;
import com.dfsek.terra.bukkit.world.BukkitAdapter;
import com.dfsek.terra.bukkit.world.BukkitWorld;
@@ -15,11 +15,13 @@ import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.FeatureConfig;
public class FabricEntryPoint implements ModInitializer {
private static final TerraPluginImpl TERRA_PLUGIN = new TerraPluginImpl();
public static final PopulatorFeature POPULATOR_FEATURE = new PopulatorFeature(DefaultFeatureConfig.CODEC);
public static final ConfiguredFeature<?, ?> POPULATOR_CONFIGURED_FEATURE = POPULATOR_FEATURE.configure(FeatureConfig.DEFAULT).decorate(Decorator.NOPE.configure(NopeDecoratorConfig.INSTANCE));
private static final TerraPluginImpl TERRA_PLUGIN = new TerraPluginImpl();
public static TerraPluginImpl getTerraPlugin() {
return TERRA_PLUGIN;
}
@Override
public void onInitialize() {
@@ -31,8 +33,4 @@ public class FabricEntryPoint implements ModInitializer {
Registry.register(Registry.CHUNK_GENERATOR, new Identifier("terra:terra"), FabricChunkGeneratorWrapper.CODEC);
Registry.register(Registry.BIOME_SOURCE, new Identifier("terra:terra"), TerraBiomeSource.CODEC);
}
public static TerraPluginImpl getTerraPlugin() {
return TERRA_PLUGIN;
}
}
@@ -26,6 +26,10 @@ public class TerraPluginImpl extends AbstractTerraPlugin {
private final WorldHandle worldHandle = new FabricWorldHandle();
private final Lazy<File> dataFolder = Lazy.lazy(() -> new File(FabricLoader.getInstance().getConfigDir().toFile(), "Terra"));
public TerraPluginImpl() {
load();
}
@Override
public WorldHandle getWorldHandle() {
return worldHandle;
@@ -36,10 +40,6 @@ public class TerraPluginImpl extends AbstractTerraPlugin {
return Optional.of(new FabricAddon(this));
}
public TerraPluginImpl() {
load();
}
@Override
protected Logger createLogger() {
final org.apache.logging.log4j.Logger log4jLogger = LogManager.getLogger();
@@ -3,9 +3,9 @@ package com.dfsek.terra.fabric.generation;
import com.dfsek.terra.api.config.ConfigPack;
import com.dfsek.terra.api.world.World;
import com.dfsek.terra.api.world.generator.ChunkData;
import com.dfsek.terra.api.world.generator.ChunkGenerator;
import com.dfsek.terra.api.world.generator.Chunkified;
import com.dfsek.terra.api.world.generator.GeneratorWrapper;
import com.dfsek.terra.api.world.generator.ChunkGenerator;
import com.dfsek.terra.fabric.FabricEntryPoint;
import com.dfsek.terra.fabric.block.FabricBlockState;
import com.dfsek.terra.fabric.mixin.StructureAccessorAccessor;
@@ -43,13 +43,13 @@ import java.util.concurrent.Executor;
@Implements(@Interface(iface = World.class, prefix = "terra$", remap = Interface.Remap.NONE))
public abstract class ServerWorldMixin {
private WorldConfig config;
@Shadow
public abstract long getSeed();
@Shadow
@Final
private ServerChunkManager chunkManager;
@Shadow
public abstract long getSeed();
@Inject(at = @At("RETURN"), method = "<init>(Lnet/minecraft/server/MinecraftServer;Ljava/util/concurrent/Executor;Lnet/minecraft/world/level/storage/LevelStorage$Session;Lnet/minecraft/world/level/ServerWorldProperties;Lnet/minecraft/util/registry/RegistryKey;Lnet/minecraft/world/dimension/DimensionType;Lnet/minecraft/server/WorldGenerationProgressListener;Lnet/minecraft/world/gen/chunk/ChunkGenerator;ZJLjava/util/List;Z)V")
public void injectConstructor(MinecraftServer server, Executor workerExecutor, LevelStorage.Session session, ServerWorldProperties properties, RegistryKey<net.minecraft.world.World> worldKey, DimensionType dimensionType, WorldGenerationProgressListener worldGenerationProgressListener, net.minecraft.world.gen.chunk.ChunkGenerator chunkGenerator, boolean debugWorld, long seed, List<Spawner> spawners, boolean shouldTickTime, CallbackInfo ci) {
if(chunkGenerator instanceof FabricChunkGeneratorWrapper) {
@@ -1,7 +1,7 @@
package com.dfsek.terra.fabric.mixin.lifecycle.client;
import com.dfsek.terra.fabric.FabricEntryPoint;
import com.dfsek.terra.api.event.events.platform.PlatformInitializationEvent;
import com.dfsek.terra.fabric.FabricEntryPoint;
import com.dfsek.terra.fabric.generation.TerraGeneratorType;
import com.dfsek.terra.fabric.mixin.access.GeneratorTypeAccessor;
import net.minecraft.client.MinecraftClient;
@@ -1,7 +1,7 @@
package com.dfsek.terra.fabric.mixin.lifecycle.server;
import com.dfsek.terra.fabric.FabricEntryPoint;
import com.dfsek.terra.api.event.events.platform.PlatformInitializationEvent;
import com.dfsek.terra.fabric.FabricEntryPoint;
import net.minecraft.server.Main;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -36,7 +36,8 @@ public class DirectChunkData implements ChunkData, com.dfsek.terra.api.world.Chu
}
@Override
public @NotNull BlockState getBlock(int x, int y, int z) {
public @NotNull
BlockState getBlock(int x, int y, int z) {
CompoundTag tag = delegate.getBlockStateAt(x, y, z);
if(tag == null) return new State("minecraft:air");
return new State(tag.getString("Name"));
@@ -13,6 +13,7 @@ import java.io.File;
public class TerraPluginImpl extends AbstractTerraPlugin {
private final TerraSpongePlugin plugin;
private final SpongeWorldHandle worldHandle = new SpongeWorldHandle();
public TerraPluginImpl(TerraSpongePlugin plugin) {
this.plugin = plugin;
load();
@@ -9,6 +9,7 @@ import org.spongepowered.plugin.jvm.Plugin;
public class TerraSpongePlugin {
private final PluginContainer plugin;
private final TerraPluginImpl terraPlugin;
@Inject
public TerraSpongePlugin(PluginContainer plugin, Game game) {
this.plugin = plugin;