continue working on fabric module

Dieser Commit ist enthalten in:
Aurora 2020-09-25 22:49:12 +02:00
Ursprung 9ca2d28648
Commit 3d98eef205
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 89839F67B53656AD
9 geänderte Dateien mit 45 neuen und 30 gelöschten Zeilen

Datei anzeigen

@ -52,11 +52,11 @@ dependencies {
implementation("com.github.jengelman.gradle.plugins:shadow:5.2.0")
implementation("net.ltgt.apt-eclipse:net.ltgt.apt-eclipse.gradle.plugin:0.21")
implementation("net.ltgt.apt-idea:net.ltgt.apt-idea.gradle.plugin:0.21")
//implementation("org.jfrog.buildinfo:build-info-extractor-gradle:4.16.0")
implementation("org.jfrog.buildinfo:build-info-extractor-gradle:4.16.0")
//implementation("gradle.plugin.org.spongepowered:spongegradle:0.9.0")
//implementation("net.minecraftforge.gradle:ForgeGradle:3.0.181")
//implementation("net.fabricmc:fabric-loom:$loomVersion")
//implementation("net.fabricmc:sponge-mixin:$mixinVersion")
implementation("net.fabricmc:fabric-loom:$loomVersion")
implementation("net.fabricmc:sponge-mixin:$mixinVersion")
implementation("gradle.plugin.com.mendhak.gradlecrowdin:plugin:0.1.0")
implementation("org.enginehub.gradle:gradle-codecov-plugin:0.1.0")
}

Datei anzeigen

@ -7,5 +7,5 @@ org.gradle.configureondemand=true
org.gradle.parallel=true
org.gradle.caching=true
loom.version=0.4.33
loom.version=0.5-SNAPSHOT
mixin.version=0.8.1+build.21

Datei anzeigen

@ -7,3 +7,5 @@ listOf("bukkit", "core", "fabric").forEach {
include("worldedit-$it")
}
include("worldedit-libs:core:ap")
include("worldedit-core:doctools")

Datei anzeigen

@ -65,7 +65,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
public final class FabricAdapter {
private static @Nullable MinecraftServer server;
@Nullable
private static MinecraftServer server;
private static MinecraftServer requireServer() {
return Objects.requireNonNull(server, "No server injected");

Datei anzeigen

@ -32,11 +32,6 @@ import net.minecraft.util.Util;
*/
class FabricBiomeRegistry implements BiomeRegistry {
@Override
public Component getRichName(BiomeType biomeType) {
return TranslatableComponent.of(Util.createTranslationKey("biome", new Identifier(biomeType.getId())));
}
@Deprecated
@Override
public BiomeData getData(BiomeType biome) {

Datei anzeigen

@ -38,11 +38,6 @@ public class FabricBlockRegistry extends BundledBlockRegistry {
private final Map<net.minecraft.block.BlockState, FabricBlockMaterial> materialMap = new HashMap<>();
@Override
public Component getRichName(BlockType blockType) {
return TranslatableComponent.of(FabricAdapter.adapt(blockType).getTranslationKey());
}
@Override
public BlockMaterial getMaterial(BlockType blockType) {
Block block = FabricAdapter.adapt(blockType);

Datei anzeigen

@ -198,6 +198,11 @@ public class FabricPlayer extends AbstractPlayerActor {
return FabricWorldEdit.inst.getPermissionsProvider().hasPermission(player, perm);
}
@Override
public void setPermission(String permission, boolean value) {
}
@Nullable
@Override
public <T> T getFacet(Class<? extends T> cls) {
@ -252,6 +257,11 @@ public class FabricPlayer extends AbstractPlayerActor {
}
}
@Override
public void sendTitle(Component title, Component sub) {
}
@Override
public SessionKey getSessionKey() {
return new SessionKeyImpl(player.getUuid(), player.getName().getString());

Datei anzeigen

@ -19,6 +19,8 @@
package com.sk89q.worldedit.fabric;
import com.boydti.fawe.beta.IChunkGet;
import com.boydti.fawe.beta.implementation.packet.ChunkPacket;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
@ -35,6 +37,7 @@ import com.sk89q.worldedit.blocks.BaseItem;
import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.fabric.internal.ExtendedMinecraftServer;
import com.sk89q.worldedit.fabric.internal.FabricWorldNativeAccess;
@ -176,6 +179,21 @@ public class FabricWorld extends AbstractWorld {
return getName() + "_" + getDimensionRegistryKey(getWorld());
}
@Override
public void refreshChunk(int chunkX, int chunkZ) {
}
@Override
public IChunkGet get(int x, int z) {
return null;
}
@Override
public void sendFakeChunk(@Nullable Player player, ChunkPacket packet) {
}
@Override
public Path getStoragePath() {
final World world = getWorld();
@ -213,6 +231,11 @@ public class FabricWorld extends AbstractWorld {
return false;
}
@Override
public boolean setTile(int x, int y, int z, CompoundTag tile) throws WorldEditException {
return false;
}
@Override
public boolean fullySupports3DBiomes() {
BiomeAccessType biomeAccessType = getWorld().getDimension().getBiomeAccessType();
@ -295,22 +318,10 @@ public class FabricWorld extends AbstractWorld {
}
@Override
public boolean regenerate(Region region, Extent extent, RegenOptions options) {
// Don't even try to regen if it's going to fail.
ChunkManager provider = getWorld().getChunkManager();
if (!(provider instanceof ServerChunkManager)) {
public boolean regenerate(Region region, EditSession editSession) {
return false;
}
try {
doRegen(region, extent, options);
} catch (Exception e) {
throw new IllegalStateException("Regen failed", e);
}
return true;
}
private void doRegen(Region region, Extent extent, RegenOptions options) throws Exception {
Path tempDir = Files.createTempDirectory("WorldEditWorldGen");
LevelStorage levelStorage = LevelStorage.create(tempDir);

Datei anzeigen

@ -31,10 +31,11 @@ import net.minecraft.server.world.ServerChunkManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.WorldChunk;
import org.jetbrains.annotations.Nullable;
import java.lang.ref.WeakReference;
import java.util.Objects;
import javax.annotation.Nullable;
public class FabricWorldNativeAccess implements WorldNativeAccess<WorldChunk, BlockState, BlockPos> {
private static final int UPDATE = 1;