Skip to content

Commit

Permalink
Initial 1.20.2 support (Fabric)
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Sep 14, 2023
1 parent 5b4322e commit 4a4b98a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 80 deletions.
6 changes: 3 additions & 3 deletions worldedit-fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ applyShadowConfiguration()
apply(plugin = "fabric-loom")
apply(plugin = "java-library")

val minecraftVersion = "1.20"
val loaderVersion = "0.14.21"
val minecraftVersion = "1.20.2-pre4"
val loaderVersion = "0.14.22"

val fabricApiConfiguration: Configuration = configurations.create("fabricApi")

Expand Down Expand Up @@ -53,7 +53,7 @@ dependencies {
"modImplementation"("net.fabricmc:fabric-loader:$loaderVersion")

// [1] declare fabric-api dependency...
"fabricApi"("net.fabricmc.fabric-api:fabric-api:0.83.0+1.20")
"fabricApi"("net.fabricmc.fabric-api:fabric-api:0.88.4+1.20.2")

// [2] Load the API dependencies from the fabric mod json...
@Suppress("UNCHECKED_CAST")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.extension.platform.AbstractPlayerActor;
import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.fabric.internal.ExtendedPlayerEntity;
import com.sk89q.worldedit.fabric.internal.NBTConverter;
import com.sk89q.worldedit.fabric.mixin.AccessorClientboundBlockEntityDataPacket;
import com.sk89q.worldedit.fabric.net.handler.WECUIPacketHandler;
Expand Down Expand Up @@ -141,7 +140,7 @@ public void dispatchCUIEvent(CUIEvent event) {

@Override
public Locale getLocale() {
return TextUtils.getLocaleByMinecraftTag(((ExtendedPlayerEntity) this.player).getLanguage());
return TextUtils.getLocaleByMinecraftTag(this.player.clientInformation().language());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,21 @@

import com.mojang.authlib.GameProfile;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ClientInformation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.stats.Stat;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.HumanoidArm;
import net.minecraft.world.entity.player.ChatVisiblity;

import java.util.UUID;

public class WorldEditFakePlayer extends ServerPlayer {
private static final GameProfile FAKE_WORLDEDIT_PROFILE = new GameProfile(UUID.nameUUIDFromBytes("worldedit".getBytes()), "[WorldEdit]");

public WorldEditFakePlayer(ServerLevel world) {
super(world.getServer(), world, FAKE_WORLDEDIT_PROFILE);
super(world.getServer(), world, FAKE_WORLDEDIT_PROFILE, new ClientInformation("", 0, ChatVisiblity.FULL, false, 0, HumanoidArm.RIGHT, false, false));
}

@Override
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"AccessorServerPlayerGameMode",
"MixinLevelChunkSetBlockHook",
"MixinMinecraftServer",
"MixinServerGamePacketListenerImpl",
"MixinServerPlayer"
"MixinServerGamePacketListenerImpl"
],
"plugin": "com.sk89q.worldedit.fabric.internal.MixinConfigPlugin",
"server": [
Expand Down

0 comments on commit 4a4b98a

Please sign in to comment.