fabric-1.19.4: adapt for 1.19.4 changes

This commit is contained in:
Kosma Moczek 2023-03-14 22:22:27 +01:00
parent 3bb74d41c2
commit b4c4b21a04
6 changed files with 12 additions and 10 deletions

View File

@ -36,6 +36,10 @@ dependencies {
compileOnly 'net.luckperms:api:5.4' compileOnly 'net.luckperms:api:5.4'
} }
loom {
accessWidenerPath = file("src/main/resources/dynmap.accesswidener")
}
processResources { processResources {
filesMatching('fabric.mod.json') { filesMatching('fabric.mod.json') {
expand "version": project.version expand "version": project.version

View File

@ -13,12 +13,10 @@ import net.minecraft.block.FluidBlock;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.network.ClientConnection;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayNetworkHandler;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld; import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
@ -191,10 +189,6 @@ public class DynmapPlugin {
return Item.byRawId(id); return Item.byRawId(id);
} }
public static final ClientConnection getNetworkManager(ServerPlayNetworkHandler nh) {
return nh.connection;
}
FabricPlayer getOrAddPlayer(ServerPlayerEntity player) { FabricPlayer getOrAddPlayer(ServerPlayerEntity player) {
String name = player.getName().getString(); String name = player.getName().getString();
FabricPlayer fp = players.get(name); FabricPlayer fp = players.get(name);
@ -339,7 +333,7 @@ public class DynmapPlugin {
if (bb != null) { if (bb != null) {
String id = biomeRegistry.getId(bb).getPath(); String id = biomeRegistry.getId(bb).getPath();
String rl = biomeRegistry.getId(bb).toString(); String rl = biomeRegistry.getId(bb).toString();
float tmp = bb.getTemperature(), hum = bb.getDownfall(); float tmp = bb.getTemperature(), hum = bb.weather.downfall();
int watermult = ((BiomeEffectsAccessor) bb.getEffects()).getWaterColor(); int watermult = ((BiomeEffectsAccessor) bb.getEffects()).getWaterColor();
Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult)); Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult));

View File

@ -120,8 +120,8 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer {
public InetSocketAddress getAddress() { public InetSocketAddress getAddress() {
if (player != null) { if (player != null) {
ServerPlayNetworkHandler networkHandler = player.networkHandler; ServerPlayNetworkHandler networkHandler = player.networkHandler;
if ((networkHandler != null) && (networkHandler.getConnection() != null)) { if (networkHandler != null) {
SocketAddress sa = networkHandler.getConnection().getAddress(); SocketAddress sa = networkHandler.getConnectionAddress();
if (sa instanceof InetSocketAddress) { if (sa instanceof InetSocketAddress) {
return (InetSocketAddress) sa; return (InetSocketAddress) sa;
} }

View File

@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ServerPlayerEntity.class) @Mixin(ServerPlayerEntity.class)
public class ServerPlayerEntityMixin { public class ServerPlayerEntityMixin {
@Inject(method = "teleport", at = @At("RETURN")) @Inject(method = "teleport(Lnet/minecraft/server/world/ServerWorld;DDDFF)V", at = @At("RETURN"))
public void teleport(ServerWorld targetWorld, double x, double y, double z, float yaw, float pitch, CallbackInfo info) { public void teleport(ServerWorld targetWorld, double x, double y, double z, float yaw, float pitch, CallbackInfo info) {
ServerPlayerEntity player = (ServerPlayerEntity) (Object) this; ServerPlayerEntity player = (ServerPlayerEntity) (Object) this;
if (targetWorld != player.world) { if (targetWorld != player.world) {

View File

@ -0,0 +1,3 @@
accessWidener v1 named
accessible class net/minecraft/world/biome/Biome$Weather
accessible field net/minecraft/world/biome/Biome weather Lnet/minecraft/world/biome/Biome$Weather;

View File

@ -24,6 +24,7 @@
"mixins": [ "mixins": [
"dynmap.mixins.json" "dynmap.mixins.json"
], ],
"accessWidener" : "dynmap.accesswidener",
"depends": { "depends": {
"fabricloader": ">=0.14.17", "fabricloader": ">=0.14.17",