Added spotless back and reformatted

This commit is contained in:
Sebastian Hartte
2020-07-27 20:07:27 +02:00
parent 49296915c9
commit 780f68952b
593 changed files with 4192 additions and 3969 deletions
+5 -4
View File
@@ -18,16 +18,17 @@
package appeng.server;
import appeng.api.features.AEFeature;
import appeng.core.AEConfig;
import appeng.core.AppEng;
import static net.minecraft.server.command.CommandManager.literal;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;
import static net.minecraft.server.command.CommandManager.literal;
import appeng.api.features.AEFeature;
import appeng.core.AEConfig;
import appeng.core.AppEng;
public final class AECommand {
+12 -10
View File
@@ -1,12 +1,10 @@
package appeng.server;
import appeng.api.parts.CableRenderMode;
import appeng.client.ActionKey;
import appeng.client.EffectType;
import appeng.core.AppEngBase;
import appeng.core.sync.network.ServerNetworkHandler;
import appeng.core.worlddata.WorldData;
import appeng.hooks.TickHandler;
import java.util.Random;
import java.util.stream.Stream;
import javax.annotation.Nonnull;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.fabric.api.server.PlayerStream;
import net.minecraft.client.util.InputUtil;
@@ -15,9 +13,13 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.util.hit.HitResult;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
import java.util.Random;
import java.util.stream.Stream;
import appeng.api.parts.CableRenderMode;
import appeng.client.ActionKey;
import appeng.client.EffectType;
import appeng.core.AppEngBase;
import appeng.core.sync.network.ServerNetworkHandler;
import appeng.core.worlddata.WorldData;
import appeng.hooks.TickHandler;
public final class AppEngServer extends AppEngBase {
+1 -1
View File
@@ -21,8 +21,8 @@ package appeng.server;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;
public interface ISubCommand {
@@ -21,22 +21,24 @@ package appeng.server.subcommands;
import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerChunkEvents;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.text.TranslatableText;
import net.minecraft.world.chunk.WorldChunk;
import appeng.api.features.AEFeature;
import appeng.core.AEConfig;
import appeng.core.AELog;
import appeng.server.ISubCommand;
import net.minecraft.world.chunk.WorldChunk;
public class ChunkLogger implements ISubCommand {
private boolean enabled = false;
// Since we cannot unregister a listener once it's registered, but
// we still only want to register it if the command is ever used we track it here
// we still only want to register it if the command is ever used we track it
// here
private boolean listenerRegistered = false;
private void onChunkLoadEvent(ServerWorld world, WorldChunk chunk) {
@@ -70,7 +72,8 @@ public class ChunkLogger implements ISubCommand {
}
@Override
public synchronized void call(final MinecraftServer srv, final CommandContext<ServerCommandSource> data, final ServerCommandSource sender) {
public synchronized void call(final MinecraftServer srv, final CommandContext<ServerCommandSource> data,
final ServerCommandSource sender) {
this.enabled = !this.enabled;
if (this.enabled) {
@@ -21,8 +21,8 @@ package appeng.server.subcommands;
import com.google.common.base.Joiner;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.text.LiteralText;
import appeng.server.ISubCommand;
@@ -30,7 +30,8 @@ import appeng.server.ISubCommand;
public class Supporters implements ISubCommand {
@Override
public void call(final MinecraftServer srv, final CommandContext<ServerCommandSource> data, final ServerCommandSource sender) {
public void call(final MinecraftServer srv, final CommandContext<ServerCommandSource> data,
final ServerCommandSource sender) {
final String[] who = { "Stig Halvorsen", "Josh Ricker", "Jenny \"Othlon\" Sutherland", "Hristo Bogdanov",
"BevoLJ" };
sender.sendFeedback(new LiteralText("Special thanks to " + Joiner.on(", ").join(who)), true);
@@ -25,26 +25,26 @@ import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import appeng.core.AppEng;
import com.google.common.math.StatsAccumulator;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.structure.StructureStart;
import net.minecraft.text.*;
import net.minecraft.util.Formatting;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.Heightmap;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.Heightmap;
import net.minecraft.server.world.ServerWorld;
import appeng.core.AppEng;
import appeng.server.ISubCommand;
import appeng.worldgen.meteorite.MeteoriteStructure;
import appeng.worldgen.meteorite.MeteoriteStructurePiece;
@@ -65,7 +65,8 @@ public class TestMeteoritesCommand implements ISubCommand {
}
@Override
public void call(final MinecraftServer srv, final CommandContext<ServerCommandSource> ctx, final ServerCommandSource sender) {
public void call(final MinecraftServer srv, final CommandContext<ServerCommandSource> ctx,
final ServerCommandSource sender) {
test(srv, sender, false);
}
@@ -177,8 +178,7 @@ public class TestMeteoritesCommand implements ISubCommand {
}
// Add a clickable link to teleport the user to the Meteorite
private static Text getClickablePosition(ServerWorld world, PlacedMeteoriteSettings settings,
BlockPos pos) {
private static Text getClickablePosition(ServerWorld world, PlacedMeteoriteSettings settings, BlockPos pos) {
BlockPos tpPos = pos.up((int) Math.ceil(settings.getMeteoriteRadius()));
int surfaceY = world.getTopY(Heightmap.Type.WORLD_SURFACE, tpPos.getX(), tpPos.getZ());
if (surfaceY > tpPos.getY()) {
@@ -188,8 +188,7 @@ public class TestMeteoritesCommand implements ISubCommand {
String displayText = String.format(Locale.ROOT, "pos=%d,%d,%d", tpPos.getX(), tpPos.getY(), tpPos.getZ());
String tpCommand = String.format(Locale.ROOT, "/tp @s %d %d %d", tpPos.getX(), tpPos.getY(), tpPos.getZ());
return new LiteralText(displayText)
.formatted(Formatting.UNDERLINE)
return new LiteralText(displayText).formatted(Formatting.UNDERLINE)
.styled(style -> style.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, tpCommand)));
}
@@ -29,15 +29,15 @@ import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.block.BlockState;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.text.LiteralText;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.world.chunk.ChunkStatus;
import appeng.core.Api;
import appeng.server.ISubCommand;
@@ -56,7 +56,8 @@ public class TestOreGenCommand implements ISubCommand {
}
@Override
public void call(final MinecraftServer srv, final CommandContext<ServerCommandSource> data, final ServerCommandSource sender) {
public void call(final MinecraftServer srv, final CommandContext<ServerCommandSource> data,
final ServerCommandSource sender) {
int radius = 1000;