Change Java whitespace handling in .editorconfig (#425)

* Change whitespace handling in .editorconfig

* Reformat code

* fix format error

* Reformat code

---------

Co-authored-by: Zoë Gidiere <duplexsys@protonmail.com>
This commit is contained in:
Astrashh
2023-11-13 11:57:01 +11:00
committed by GitHub
parent a73fda7d04
commit defd775f13
793 changed files with 7579 additions and 7577 deletions

View File

@@ -31,32 +31,32 @@ import com.dfsek.terra.sponge.handle.SpongeWorldHandle;
public class PlatformImpl extends AbstractPlatform {
private final TerraSpongePlugin plugin;
private final SpongeWorldHandle worldHandle = new SpongeWorldHandle();
public PlatformImpl(TerraSpongePlugin plugin) {
this.plugin = plugin;
load();
}
@Override
public boolean reload() {
return false;
}
@Override
public @NotNull String platformName() {
return "Sponge";
}
@Override
public @NotNull WorldHandle getWorldHandle() {
return worldHandle;
}
@Override
public @NotNull File getDataFolder() {
return Sponge.configManager().pluginConfig(plugin.getPluginContainer()).directory().toFile();
}
@Override
public @NotNull ItemHandle getItemHandle() {
return null;

View File

@@ -26,11 +26,11 @@ import com.dfsek.terra.api.event.events.platform.PlatformInitializationEvent;
public class SpongeListener {
private final TerraSpongePlugin plugin;
public SpongeListener(TerraSpongePlugin plugin) {
this.plugin = plugin;
}
@Listener
public void initialize(StartingEngineEvent<Server> event) {
plugin.getTerraPlugin().getEventManager().callEvent(new PlatformInitializationEvent());

View File

@@ -27,18 +27,18 @@ import org.spongepowered.plugin.builtin.jvm.Plugin;
public class TerraSpongePlugin {
private final PluginContainer plugin;
private final PlatformImpl terraPlugin;
@Inject
public TerraSpongePlugin(Game game) {
this.plugin = null;
this.terraPlugin = new PlatformImpl(this);
game.eventManager().registerListeners(plugin, new SpongeListener(this));
}
public PluginContainer getPluginContainer() {
return plugin;
}
public PlatformImpl getTerraPlugin() {
return terraPlugin;
}

View File

@@ -26,51 +26,51 @@ import com.dfsek.terra.api.block.state.properties.Property;
public class SpongeBlockState implements BlockState {
private final org.spongepowered.api.block.BlockState delegate;
public SpongeBlockState(org.spongepowered.api.block.BlockState delegate) {
this.delegate = delegate;
}
@Override
public org.spongepowered.api.block.BlockState getHandle() {
return delegate;
}
@Override
public boolean matches(BlockState other) {
return delegate.type().equals(((SpongeBlockType) other.getBlockType()).getHandle());
}
@Override
public <T extends Comparable<T>> boolean has(Property<T> property) {
return false;
}
@Override
public <T extends Comparable<T>> T get(Property<T> property) {
return null;
}
@Override
public <T extends Comparable<T>> BlockState set(Property<T> property, T value) {
return this;
}
@Override
public BlockType getBlockType() {
return new SpongeBlockType(delegate.type());
}
@Override
public String getAsString(boolean verbose) {
return delegate.toString();
}
@Override
public boolean isAir() {
return delegate.type().equals(BlockTypes.AIR.get());
}
@Override
public BlockState clone() {
return this;

View File

@@ -26,26 +26,26 @@ import com.dfsek.terra.api.block.state.BlockState;
public class SpongeBlockType implements BlockType {
private final org.spongepowered.api.block.BlockType delegate;
public SpongeBlockType(org.spongepowered.api.block.BlockType delegate) {
this.delegate = delegate;
}
@Override
public org.spongepowered.api.block.BlockType getHandle() {
return delegate;
}
@Override
public BlockState getDefaultState() {
return new SpongeBlockState(delegate.defaultState());
}
@Override
public boolean isSolid() {
return !delegate.getOrElse(Keys.IS_SOLID, false);
}
@Override
public boolean isWater() {
return delegate.equals(BlockTypes.WATER.get());

View File

@@ -29,21 +29,21 @@ import com.dfsek.terra.sponge.block.SpongeBlockState;
public class SpongeWorldHandle implements WorldHandle {
private final Lazy<SpongeBlockState> air;
public SpongeWorldHandle() {
air = Lazy.lazy(() -> new SpongeBlockState(BlockTypes.AIR.get().defaultState()));
}
@Override
public @NotNull BlockState createBlockState(@NotNull String data) {
return new SpongeBlockState(org.spongepowered.api.block.BlockState.fromString(data));
}
@Override
public @NotNull BlockState air() {
return air.value();
}
@Override
public @NotNull EntityType getEntity(@NotNull String id) {
throw new UnsupportedOperationException();