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'
}
loom {
accessWidenerPath = file("src/main/resources/dynmap.accesswidener")
}
processResources {
filesMatching('fabric.mod.json') {
expand "version": project.version

View File

@ -13,12 +13,10 @@ import net.minecraft.block.FluidBlock;
import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.network.ClientConnection;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayNetworkHandler;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.Identifier;
@ -191,10 +189,6 @@ public class DynmapPlugin {
return Item.byRawId(id);
}
public static final ClientConnection getNetworkManager(ServerPlayNetworkHandler nh) {
return nh.connection;
}
FabricPlayer getOrAddPlayer(ServerPlayerEntity player) {
String name = player.getName().getString();
FabricPlayer fp = players.get(name);
@ -339,7 +333,7 @@ public class DynmapPlugin {
if (bb != null) {
String id = biomeRegistry.getId(bb).getPath();
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();
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() {
if (player != null) {
ServerPlayNetworkHandler networkHandler = player.networkHandler;
if ((networkHandler != null) && (networkHandler.getConnection() != null)) {
SocketAddress sa = networkHandler.getConnection().getAddress();
if (networkHandler != null) {
SocketAddress sa = networkHandler.getConnectionAddress();
if (sa instanceof InetSocketAddress) {
return (InetSocketAddress) sa;
}

View File

@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ServerPlayerEntity.class)
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) {
ServerPlayerEntity player = (ServerPlayerEntity) (Object) this;
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": [
"dynmap.mixins.json"
],
"accessWidener" : "dynmap.accesswidener",
"depends": {
"fabricloader": ">=0.14.17",