From e6d5058326daa2edcf22fa2d722d3556b2e7fb59 Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Tue, 25 Aug 2020 19:25:31 +0200 Subject: [PATCH] Add more supported forge and fabric versions --- implementations/fabric-1.15.2/build.gradle | 65 +++++ .../bluemap/fabric/FabricCommandSource.java | 84 ++++++ .../bluemap/fabric/FabricEventForwarder.java | 140 ++++++++++ .../bluecolored/bluemap/fabric/FabricMod.java | 224 ++++++++++++++++ .../bluemap/fabric/FabricPlayer.java | 156 +++++++++++ .../bluemap/fabric/Log4jLogger.java | 69 +++++ .../fabric/events/ChunkFinalizeCallback.java | 43 +++ .../fabric/events/PlayerJoinCallback.java | 42 +++ .../fabric/events/PlayerLeaveCallback.java | 42 +++ .../fabric/events/WorldSaveCallback.java | 41 +++ .../fabric/mixin/MixinChunkGenerator.java | 46 ++++ .../fabric/mixin/MixinPlayerManager.java | 56 ++++ .../fabric/mixin/MixinServerWorld.java | 44 ++++ .../main/resources/assets/bluemap/icon.png | Bin 0 -> 10593 bytes .../src/main/resources/bluemap.mixins.json | 16 ++ .../de/bluecolored/bluemap/core-defaults.conf | 4 + .../de/bluecolored/bluemap/core.conf | 30 +++ .../bluecolored/bluemap/plugin-defaults.conf | 5 + .../de/bluecolored/bluemap/plugin.conf | 27 ++ .../bluecolored/bluemap/render-defaults.conf | 3 + .../de/bluecolored/bluemap/render.conf | 126 +++++++++ .../bluemap/webserver-defaults.conf | 4 + .../de/bluecolored/bluemap/webserver.conf | 29 ++ .../src/main/resources/fabric.mod.json | 35 +++ implementations/fabric-1.16.1/build.gradle | 65 +++++ .../bluemap/fabric/FabricCommandSource.java | 84 ++++++ .../bluemap/fabric/FabricEventForwarder.java | 140 ++++++++++ .../bluecolored/bluemap/fabric/FabricMod.java | 229 ++++++++++++++++ .../bluemap/fabric/FabricPlayer.java | 156 +++++++++++ .../bluemap/fabric/Log4jLogger.java | 69 +++++ .../fabric/events/ChunkFinalizeCallback.java | 43 +++ .../fabric/events/PlayerJoinCallback.java | 42 +++ .../fabric/events/PlayerLeaveCallback.java | 42 +++ .../fabric/events/WorldSaveCallback.java | 41 +++ .../fabric/mixin/MixinChunkGenerator.java | 47 ++++ .../fabric/mixin/MixinPlayerManager.java | 56 ++++ .../fabric/mixin/MixinServerWorld.java | 44 ++++ .../main/resources/assets/bluemap/icon.png | Bin 0 -> 10593 bytes .../src/main/resources/bluemap.mixins.json | 16 ++ .../de/bluecolored/bluemap/core-defaults.conf | 4 + .../de/bluecolored/bluemap/core.conf | 30 +++ .../bluecolored/bluemap/plugin-defaults.conf | 5 + .../de/bluecolored/bluemap/plugin.conf | 27 ++ .../bluecolored/bluemap/render-defaults.conf | 3 + .../de/bluecolored/bluemap/render.conf | 126 +++++++++ .../bluemap/webserver-defaults.conf | 4 + .../de/bluecolored/bluemap/webserver.conf | 29 ++ .../src/main/resources/fabric.mod.json | 35 +++ implementations/fabric-1.16.2/build.gradle | 2 +- implementations/forge-1.14.4/build.gradle | 67 +++++ .../bluemap/forge/ForgeCommandSource.java | 84 ++++++ .../bluemap/forge/ForgeEventForwarder.java | 116 ++++++++ .../bluecolored/bluemap/forge/ForgeMod.java | 249 ++++++++++++++++++ .../bluemap/forge/ForgePlayer.java | 156 +++++++++++ .../bluemap/forge/Log4jLogger.java | 69 +++++ .../src/main/resources/META-INF/mods.toml | 25 ++ .../de/bluecolored/bluemap/core-defaults.conf | 4 + .../de/bluecolored/bluemap/core.conf | 30 +++ .../bluecolored/bluemap/plugin-defaults.conf | 5 + .../de/bluecolored/bluemap/plugin.conf | 27 ++ .../bluecolored/bluemap/render-defaults.conf | 3 + .../de/bluecolored/bluemap/render.conf | 126 +++++++++ .../bluemap/webserver-defaults.conf | 4 + .../de/bluecolored/bluemap/webserver.conf | 29 ++ .../src/main/resources/pack.mcmeta | 6 + implementations/forge-1.15.2/build.gradle | 67 +++++ .../bluemap/forge/ForgeCommandSource.java | 84 ++++++ .../bluemap/forge/ForgeEventForwarder.java | 116 ++++++++ .../bluecolored/bluemap/forge/ForgeMod.java | 249 ++++++++++++++++++ .../bluemap/forge/ForgePlayer.java | 156 +++++++++++ .../bluemap/forge/Log4jLogger.java | 69 +++++ .../src/main/resources/META-INF/mods.toml | 25 ++ .../de/bluecolored/bluemap/core-defaults.conf | 4 + .../de/bluecolored/bluemap/core.conf | 30 +++ .../bluecolored/bluemap/plugin-defaults.conf | 5 + .../de/bluecolored/bluemap/plugin.conf | 27 ++ .../bluecolored/bluemap/render-defaults.conf | 3 + .../de/bluecolored/bluemap/render.conf | 126 +++++++++ .../bluemap/webserver-defaults.conf | 4 + .../de/bluecolored/bluemap/webserver.conf | 29 ++ .../src/main/resources/pack.mcmeta | 6 + .../bluecolored/bluemap/forge/ForgeMod.java | 3 + settings.gradle | 12 + 83 files changed, 4684 insertions(+), 1 deletion(-) create mode 100644 implementations/fabric-1.15.2/build.gradle create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/Log4jLogger.java create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/ChunkFinalizeCallback.java create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/PlayerJoinCallback.java create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/PlayerLeaveCallback.java create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/WorldSaveCallback.java create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinChunkGenerator.java create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinPlayerManager.java create mode 100644 implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinServerWorld.java create mode 100644 implementations/fabric-1.15.2/src/main/resources/assets/bluemap/icon.png create mode 100644 implementations/fabric-1.15.2/src/main/resources/bluemap.mixins.json create mode 100644 implementations/fabric-1.15.2/src/main/resources/de/bluecolored/bluemap/core-defaults.conf create mode 100644 implementations/fabric-1.15.2/src/main/resources/de/bluecolored/bluemap/core.conf create mode 100644 implementations/fabric-1.15.2/src/main/resources/de/bluecolored/bluemap/plugin-defaults.conf create mode 100644 implementations/fabric-1.15.2/src/main/resources/de/bluecolored/bluemap/plugin.conf create mode 100644 implementations/fabric-1.15.2/src/main/resources/de/bluecolored/bluemap/render-defaults.conf create mode 100644 implementations/fabric-1.15.2/src/main/resources/de/bluecolored/bluemap/render.conf create mode 100644 implementations/fabric-1.15.2/src/main/resources/de/bluecolored/bluemap/webserver-defaults.conf create mode 100644 implementations/fabric-1.15.2/src/main/resources/de/bluecolored/bluemap/webserver.conf create mode 100644 implementations/fabric-1.15.2/src/main/resources/fabric.mod.json create mode 100644 implementations/fabric-1.16.1/build.gradle create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/Log4jLogger.java create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/events/ChunkFinalizeCallback.java create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/events/PlayerJoinCallback.java create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/events/PlayerLeaveCallback.java create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/events/WorldSaveCallback.java create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinChunkGenerator.java create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinPlayerManager.java create mode 100644 implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinServerWorld.java create mode 100644 implementations/fabric-1.16.1/src/main/resources/assets/bluemap/icon.png create mode 100644 implementations/fabric-1.16.1/src/main/resources/bluemap.mixins.json create mode 100644 implementations/fabric-1.16.1/src/main/resources/de/bluecolored/bluemap/core-defaults.conf create mode 100644 implementations/fabric-1.16.1/src/main/resources/de/bluecolored/bluemap/core.conf create mode 100644 implementations/fabric-1.16.1/src/main/resources/de/bluecolored/bluemap/plugin-defaults.conf create mode 100644 implementations/fabric-1.16.1/src/main/resources/de/bluecolored/bluemap/plugin.conf create mode 100644 implementations/fabric-1.16.1/src/main/resources/de/bluecolored/bluemap/render-defaults.conf create mode 100644 implementations/fabric-1.16.1/src/main/resources/de/bluecolored/bluemap/render.conf create mode 100644 implementations/fabric-1.16.1/src/main/resources/de/bluecolored/bluemap/webserver-defaults.conf create mode 100644 implementations/fabric-1.16.1/src/main/resources/de/bluecolored/bluemap/webserver.conf create mode 100644 implementations/fabric-1.16.1/src/main/resources/fabric.mod.json create mode 100644 implementations/forge-1.14.4/build.gradle create mode 100644 implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java create mode 100644 implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java create mode 100644 implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java create mode 100644 implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java create mode 100644 implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/Log4jLogger.java create mode 100644 implementations/forge-1.14.4/src/main/resources/META-INF/mods.toml create mode 100644 implementations/forge-1.14.4/src/main/resources/de/bluecolored/bluemap/core-defaults.conf create mode 100644 implementations/forge-1.14.4/src/main/resources/de/bluecolored/bluemap/core.conf create mode 100644 implementations/forge-1.14.4/src/main/resources/de/bluecolored/bluemap/plugin-defaults.conf create mode 100644 implementations/forge-1.14.4/src/main/resources/de/bluecolored/bluemap/plugin.conf create mode 100644 implementations/forge-1.14.4/src/main/resources/de/bluecolored/bluemap/render-defaults.conf create mode 100644 implementations/forge-1.14.4/src/main/resources/de/bluecolored/bluemap/render.conf create mode 100644 implementations/forge-1.14.4/src/main/resources/de/bluecolored/bluemap/webserver-defaults.conf create mode 100644 implementations/forge-1.14.4/src/main/resources/de/bluecolored/bluemap/webserver.conf create mode 100644 implementations/forge-1.14.4/src/main/resources/pack.mcmeta create mode 100644 implementations/forge-1.15.2/build.gradle create mode 100644 implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java create mode 100644 implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java create mode 100644 implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java create mode 100644 implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java create mode 100644 implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/Log4jLogger.java create mode 100644 implementations/forge-1.15.2/src/main/resources/META-INF/mods.toml create mode 100644 implementations/forge-1.15.2/src/main/resources/de/bluecolored/bluemap/core-defaults.conf create mode 100644 implementations/forge-1.15.2/src/main/resources/de/bluecolored/bluemap/core.conf create mode 100644 implementations/forge-1.15.2/src/main/resources/de/bluecolored/bluemap/plugin-defaults.conf create mode 100644 implementations/forge-1.15.2/src/main/resources/de/bluecolored/bluemap/plugin.conf create mode 100644 implementations/forge-1.15.2/src/main/resources/de/bluecolored/bluemap/render-defaults.conf create mode 100644 implementations/forge-1.15.2/src/main/resources/de/bluecolored/bluemap/render.conf create mode 100644 implementations/forge-1.15.2/src/main/resources/de/bluecolored/bluemap/webserver-defaults.conf create mode 100644 implementations/forge-1.15.2/src/main/resources/de/bluecolored/bluemap/webserver.conf create mode 100644 implementations/forge-1.15.2/src/main/resources/pack.mcmeta diff --git a/implementations/fabric-1.15.2/build.gradle b/implementations/fabric-1.15.2/build.gradle new file mode 100644 index 00000000..228533c8 --- /dev/null +++ b/implementations/fabric-1.15.2/build.gradle @@ -0,0 +1,65 @@ +import net.fabricmc.loom.task.RemapJarTask + +plugins { + id 'fabric-loom' version '0.4-SNAPSHOT' +} + +configurations { + compile.extendsFrom shadowInclude +} + +dependencies { + minecraft "com.mojang:minecraft:1.15.2" + mappings "net.fabricmc:yarn:1.15.2+build.17:v2" + modImplementation "net.fabricmc:fabric-loader:0.9.2+build.206" + modImplementation "net.fabricmc.fabric-api:fabric-api:0.19.0+build.325-1.15" + + shadowInclude (project(':BlueMapCommon')) { + //exclude dependencies provided by fabric + exclude group: 'com.google.guava', module: 'guava' + exclude group: 'com.google.code.gson', module: 'gson' + exclude group: 'org.apache.commons', module: 'commons-lang3' + exclude group: 'commons-io', module: 'commons-io' + exclude group: 'com.mojang', module: 'brigadier' + } +} + +processResources { + inputs.property "version", project.version + + from(sourceSets.main.resources.srcDirs) { + include "fabric.mod.json" + expand "version": project.version + } + + from(sourceSets.main.resources.srcDirs) { + exclude "fabric.mod.json" + } +} + +shadowJar { + configurations = [project.configurations.shadowInclude] + + //relocate 'com.flowpowered.math', 'de.bluecolored.shadow.flowpowered.math' //DON'T relocate this, because the API depends on it + relocate 'com.typesafe.config', 'de.bluecolored.shadow.typesafe.config' + relocate 'net.querz.nbt', 'de.bluecolored.shadow.querz.nbt' + relocate 'ninja.leaping.configurate', 'de.bluecolored.shadow.ninja.leaping.configurate' + relocate 'org.yaml.snakeyaml', 'de.bluecolored.shadow.yaml.snakeyaml' + relocate 'com.github.benmanes.caffeine', 'de.bluecolored.shadow.benmanes.caffeine' + relocate 'com.google.errorprone', 'de.bluecolored.shadow.google.errorprone' + relocate 'org.checkerframework', 'de.bluecolored.shadow.checkerframework' +} + +task ramappedShadowJar(type: RemapJarTask) { + destinationDir = file '../../build/release' + dependsOn tasks.shadowJar + input = tasks.shadowJar.archivePath + addNestedDependencies = true + archiveName = "BlueMap-${version}-fabric-1.15.2.jar" +} +build.dependsOn ramappedShadowJar + +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = "sources" + from sourceSets.main.allSource +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java new file mode 100644 index 00000000..ed9b1542 --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java @@ -0,0 +1,84 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric; + +import java.io.IOException; +import java.util.Optional; + +import com.flowpowered.math.vector.Vector3d; + +import de.bluecolored.bluemap.common.plugin.Plugin; +import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.plugin.text.Text; +import de.bluecolored.bluemap.core.world.World; +import net.minecraft.server.command.ServerCommandSource; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.math.Vec3d; + +public class FabricCommandSource implements CommandSource { + + private FabricMod mod; + private Plugin plugin; + private ServerCommandSource delegate; + + public FabricCommandSource(FabricMod mod, Plugin plugin, ServerCommandSource delegate) { + this.mod = mod; + this.plugin = plugin; + this.delegate = delegate; + } + + @Override + public void sendMessage(Text text) { + delegate.sendFeedback(net.minecraft.text.Text.Serializer.fromJson(text.toJSONString()), false); + } + + @Override + public boolean hasPermission(String permission) { + return delegate.hasPermissionLevel(1); + } + + @Override + public Optional getPosition() { + Vec3d pos = delegate.getPosition(); + if (pos != null) { + return Optional.of(new Vector3d(pos.x, pos.y, pos.z)); + } + + return Optional.empty(); + } + + @Override + public Optional getWorld() { + try { + ServerWorld world = delegate.getWorld(); + if (world != null) { + return Optional.ofNullable(plugin.getWorld(mod.getUUIDForWorld(world))); + } + } catch (IOException ignore) {} + + return Optional.empty(); + } + +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java new file mode 100644 index 00000000..c96846e6 --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java @@ -0,0 +1,140 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.UUID; + +import com.flowpowered.math.vector.Vector2i; +import com.flowpowered.math.vector.Vector3i; + +import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.core.logger.Logger; +import de.bluecolored.bluemap.fabric.events.ChunkFinalizeCallback; +import de.bluecolored.bluemap.fabric.events.PlayerJoinCallback; +import de.bluecolored.bluemap.fabric.events.PlayerLeaveCallback; +import de.bluecolored.bluemap.fabric.events.WorldSaveCallback; +import net.fabricmc.fabric.api.event.player.AttackBlockCallback; +import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; + +public class FabricEventForwarder { + + private FabricMod mod; + private Collection eventListeners; + + public FabricEventForwarder(FabricMod mod) { + this.mod = mod; + this.eventListeners = new ArrayList<>(1); + + WorldSaveCallback.EVENT.register(this::onWorldSave); + ChunkFinalizeCallback.EVENT.register(this::onChunkFinalize); + AttackBlockCallback.EVENT.register(this::onBlockAttack); + UseBlockCallback.EVENT.register(this::onBlockUse); + + PlayerJoinCallback.EVENT.register(this::onPlayerJoin); + PlayerLeaveCallback.EVENT.register(this::onPlayerLeave); + } + + public synchronized void addEventListener(ServerEventListener listener) { + this.eventListeners.add(listener); + } + + public synchronized void removeAllListeners() { + this.eventListeners.clear(); + } + + + public ActionResult onBlockUse(PlayerEntity player, World world, Hand hand, BlockHitResult hitResult) { + if (world instanceof ServerWorld) { + onBlockChange((ServerWorld) world, hitResult.getBlockPos()); + } + + return ActionResult.PASS; + } + + public ActionResult onBlockAttack(PlayerEntity player, World world, Hand hand, BlockPos pos, Direction direction) { + if (world instanceof ServerWorld) { + onBlockChange((ServerWorld) world, pos); + } + + return ActionResult.PASS; + } + + public synchronized void onBlockChange(ServerWorld world, BlockPos blockPos) { + Vector3i position = new Vector3i(blockPos.getX(), blockPos.getY(), blockPos.getZ()); + + try { + UUID uuid = mod.getUUIDForWorld(world); + for (ServerEventListener listener : eventListeners) listener.onBlockChange(uuid, position); + } catch (IOException e) { + Logger.global.noFloodError("Failed to get the UUID for a world!", e); + } + } + + public synchronized void onWorldSave(ServerWorld world) { + try { + UUID uuid = mod.getUUIDForWorld(world); + for (ServerEventListener listener : eventListeners) listener.onWorldSaveToDisk(uuid); + } catch (IOException e) { + Logger.global.noFloodError("Failed to get the UUID for a world!", e); + } + } + + public synchronized void onChunkFinalize(ServerWorld world, Vector2i chunkPos) { + try { + UUID uuid = mod.getUUIDForWorld(world); + for (ServerEventListener listener : eventListeners) listener.onChunkFinishedGeneration(uuid, chunkPos); + } catch (IOException e) { + Logger.global.noFloodError("Failed to get the UUID for a world!", e); + } + } + + public synchronized void onPlayerJoin(MinecraftServer server, ServerPlayerEntity player) { + if (this.mod.getServer() != server) return; + + UUID uuid = player.getUuid(); + for (ServerEventListener listener : eventListeners) listener.onPlayerJoin(uuid); + } + + public synchronized void onPlayerLeave(MinecraftServer server, ServerPlayerEntity player) { + if (this.mod.getServer() != server) return; + + UUID uuid = player.getUuid(); + for (ServerEventListener listener : eventListeners) listener.onPlayerLeave(uuid); + } + +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java new file mode 100644 index 00000000..9b78ff53 --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java @@ -0,0 +1,224 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.logging.log4j.LogManager; + +import com.github.benmanes.caffeine.cache.Caffeine; +import com.github.benmanes.caffeine.cache.LoadingCache; + +import de.bluecolored.bluemap.common.plugin.Plugin; +import de.bluecolored.bluemap.common.plugin.commands.Commands; +import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; +import de.bluecolored.bluemap.core.MinecraftVersion; +import de.bluecolored.bluemap.core.logger.Logger; +import de.bluecolored.bluemap.core.resourcepack.ParseResourceException; +import de.bluecolored.bluemap.fabric.events.PlayerJoinCallback; +import de.bluecolored.bluemap.fabric.events.PlayerLeaveCallback; +import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; + +public class FabricMod implements ModInitializer, ServerInterface { + + private Plugin pluginInstance = null; + private MinecraftServer serverInstance = null; + + private Map worldUUIDs; + private FabricEventForwarder eventForwarder; + + private LoadingCache worldUuidCache; + + private int playerUpdateIndex = 0; + private Map onlinePlayerMap; + private List onlinePlayerList; + + public FabricMod() { + Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + + this.onlinePlayerMap = new ConcurrentHashMap<>(); + this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); + + pluginInstance = new Plugin(MinecraftVersion.MC_1_15, "fabric", this); + + this.worldUUIDs = new ConcurrentHashMap<>(); + this.eventForwarder = new FabricEventForwarder(this); + this.worldUuidCache = Caffeine.newBuilder() + .weakKeys() + .maximumSize(1000) + .build(this::loadUUIDForWorld); + } + + @Override + public void onInitialize() { + + //register commands + CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> { + new Commands<>(pluginInstance, dispatcher, fabricSource -> new FabricCommandSource(this, pluginInstance, fabricSource)); + }); + + ServerLifecycleEvents.SERVER_STARTED.register((MinecraftServer server) -> { + this.serverInstance = server; + + new Thread(()->{ + Logger.global.logInfo("Loading BlueMap..."); + + try { + pluginInstance.load(); + if (pluginInstance.isLoaded()) Logger.global.logInfo("BlueMap loaded!"); + } catch (IOException | ParseResourceException e) { + Logger.global.logError("Failed to load bluemap!", e); + pluginInstance.unload(); + } + }).start(); + }); + + ServerLifecycleEvents.SERVER_STOPPING.register((MinecraftServer server) -> { + pluginInstance.unload(); + Logger.global.logInfo("BlueMap unloaded!"); + }); + + PlayerJoinCallback.EVENT.register(this::onPlayerJoin); + PlayerLeaveCallback.EVENT.register(this::onPlayerLeave); + + ServerTickEvents.END_SERVER_TICK.register((MinecraftServer server) -> { + if (server == this.serverInstance) this.updateSomePlayers(); + }); + } + + @Override + public void registerListener(ServerEventListener listener) { + eventForwarder.addEventListener(listener); + } + + @Override + public void unregisterAllListeners() { + eventForwarder.removeAllListeners(); + } + + @Override + public UUID getUUIDForWorld(File worldFolder) throws IOException { + worldFolder = worldFolder.getCanonicalFile(); + + UUID uuid = worldUUIDs.get(worldFolder); + if (uuid == null) { + uuid = UUID.randomUUID(); + worldUUIDs.put(worldFolder, uuid); + } + + return uuid; + } + + public UUID getUUIDForWorld(ServerWorld world) throws IOException { + try { + return worldUuidCache.get(world); + } catch (RuntimeException e) { + Throwable cause = e.getCause(); + if (cause instanceof IOException) throw (IOException) cause; + else throw new IOException(cause); + } + } + + private UUID loadUUIDForWorld(ServerWorld world) throws IOException { + File dimensionDir = world.getDimension().getType().getSaveDirectory(world.getSaveHandler().getWorldDir()); + return getUUIDForWorld(dimensionDir.getCanonicalFile()); + } + + @Override + public File getConfigFolder() { + return new File("config/bluemap"); + } + + public void onPlayerJoin(MinecraftServer server, ServerPlayerEntity playerInstance) { + if (this.serverInstance != server) return; + + FabricPlayer player = new FabricPlayer(this, playerInstance); + onlinePlayerMap.put(player.getUuid(), player); + onlinePlayerList.add(player); + } + + public void onPlayerLeave(MinecraftServer server, ServerPlayerEntity player) { + if (this.serverInstance != server) return; + + UUID playerUUID = player.getUuid(); + onlinePlayerMap.remove(playerUUID); + synchronized (onlinePlayerList) { + onlinePlayerList.removeIf(p -> p.getUuid().equals(playerUUID)); + } + } + + public MinecraftServer getServer() { + return this.serverInstance; + } + + @Override + public Collection getOnlinePlayers() { + return onlinePlayerMap.values(); + } + + @Override + public Optional getPlayer(UUID uuid) { + return Optional.ofNullable(onlinePlayerMap.get(uuid)); + } + + /** + * Only update some of the online players each tick to minimize performance impact on the server-thread. + * Only call this method on the server-thread. + */ + private void updateSomePlayers() { + int onlinePlayerCount = onlinePlayerList.size(); + if (onlinePlayerCount == 0) return; + + int playersToBeUpdated = onlinePlayerCount / 20; //with 20 tps, each player is updated once a second + if (playersToBeUpdated == 0) playersToBeUpdated = 1; + + for (int i = 0; i < playersToBeUpdated; i++) { + playerUpdateIndex++; + if (playerUpdateIndex >= 20 && playerUpdateIndex >= onlinePlayerCount) playerUpdateIndex = 0; + + if (playerUpdateIndex < onlinePlayerCount) { + onlinePlayerList.get(playerUpdateIndex).update(); + } + } + } + +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java new file mode 100644 index 00000000..7c8ce5b6 --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java @@ -0,0 +1,156 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric; + +import java.io.IOException; +import java.lang.ref.WeakReference; +import java.util.EnumMap; +import java.util.Map; +import java.util.UUID; + +import com.flowpowered.math.vector.Vector3d; + +import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.plugin.text.Text; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.GameMode; + +public class FabricPlayer implements Player { + + private static final UUID UNKNOWN_WORLD_UUID = UUID.randomUUID(); + + private static final Map GAMEMODE_MAP = new EnumMap<>(GameMode.class); + static { + GAMEMODE_MAP.put(GameMode.ADVENTURE, Gamemode.ADVENTURE); + GAMEMODE_MAP.put(GameMode.SURVIVAL, Gamemode.SURVIVAL); + GAMEMODE_MAP.put(GameMode.CREATIVE, Gamemode.CREATIVE); + GAMEMODE_MAP.put(GameMode.SPECTATOR, Gamemode.SPECTATOR); + GAMEMODE_MAP.put(GameMode.NOT_SET, Gamemode.SURVIVAL); + } + + private UUID uuid; + private Text name; + private UUID world; + private Vector3d position; + private boolean online; + private boolean sneaking; + private boolean invisible; + private Gamemode gamemode; + + private FabricMod mod; + private WeakReference delegate; + + public FabricPlayer(FabricMod mod, ServerPlayerEntity delegate) { + this.uuid = delegate.getUuid(); + this.mod = mod; + this.delegate = new WeakReference<>(delegate); + + update(); + } + + @Override + public UUID getUuid() { + return this.uuid; + } + + @Override + public Text getName() { + return this.name; + } + + @Override + public UUID getWorld() { + return this.world; + } + + @Override + public Vector3d getPosition() { + return this.position; + } + + @Override + public boolean isOnline() { + return this.online; + } + + @Override + public boolean isSneaking() { + return this.sneaking; + } + + @Override + public boolean isInvisible() { + return this.invisible; + } + + @Override + public Gamemode getGamemode() { + return this.gamemode; + } + + /** + * Only call on server thread! + */ + public void update() { + ServerPlayerEntity player = delegate.get(); + if (player == null) { + MinecraftServer server = mod.getServer(); + if (server != null) { + player = server.getPlayerManager().getPlayer(uuid); + } + + if (player == null) { + this.online = false; + return; + } + + delegate = new WeakReference<>(player); + } + + this.gamemode = GAMEMODE_MAP.get(player.interactionManager.getGameMode()); + + StatusEffectInstance invis = player.getStatusEffect(StatusEffects.INVISIBILITY); + this.invisible = invis != null && invis.getDuration() > 0; + + this.name = Text.of(player.getName().getString()); + this.online = true; + + Vec3d pos = player.getPos(); + this.position = new Vector3d(pos.getX(), pos.getY(), pos.getZ()); + this.sneaking = player.isSneaking(); + + try { + this.world = mod.getUUIDForWorld(player.getServerWorld()); + } catch (IOException e) { + this.world = UNKNOWN_WORLD_UUID; + } + } + +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/Log4jLogger.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/Log4jLogger.java new file mode 100644 index 00000000..2d298f63 --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/Log4jLogger.java @@ -0,0 +1,69 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric; + +import org.apache.logging.log4j.Logger; + +import de.bluecolored.bluemap.core.logger.AbstractLogger; + +public class Log4jLogger extends AbstractLogger { + + private Logger out; + + public Log4jLogger(Logger out) { + this.out = out; + } + + @Override + public void logError(String message, Throwable throwable) { + out.error(message, throwable); + } + + @Override + public void logWarning(String message) { + out.warn(message); + } + + @Override + public void logInfo(String message) { + out.info(message); + } + + @Override + public void logDebug(String message) { + if (out.isDebugEnabled()) out.debug(message); + } + + @Override + public void noFloodDebug(String message) { + if (out.isDebugEnabled()) super.noFloodDebug(message); + } + + @Override + public void noFloodDebug(String key, String message) { + if (out.isDebugEnabled()) super.noFloodDebug(key, message); + } + +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/ChunkFinalizeCallback.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/ChunkFinalizeCallback.java new file mode 100644 index 00000000..49de240d --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/ChunkFinalizeCallback.java @@ -0,0 +1,43 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric.events; + +import com.flowpowered.math.vector.Vector2i; + +import net.fabricmc.fabric.api.event.Event; +import net.fabricmc.fabric.api.event.EventFactory; +import net.minecraft.server.world.ServerWorld; + +public interface ChunkFinalizeCallback { + Event EVENT = EventFactory.createArrayBacked(ChunkFinalizeCallback.class, + (listeners) -> (world, chunkPos) -> { + for (ChunkFinalizeCallback event : listeners) { + event.onChunkFinalized(world, chunkPos); + } + } + ); + + void onChunkFinalized(ServerWorld world, Vector2i chunkPos); +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/PlayerJoinCallback.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/PlayerJoinCallback.java new file mode 100644 index 00000000..d564012c --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/PlayerJoinCallback.java @@ -0,0 +1,42 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric.events; + +import net.fabricmc.fabric.api.event.Event; +import net.fabricmc.fabric.api.event.EventFactory; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.ServerPlayerEntity; + +public interface PlayerJoinCallback { + Event EVENT = EventFactory.createArrayBacked(PlayerJoinCallback.class, + (listeners) -> (server, player) -> { + for (PlayerJoinCallback event : listeners) { + event.onPlayerJoin(server, player); + } + } + ); + + void onPlayerJoin(MinecraftServer server, ServerPlayerEntity player); +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/PlayerLeaveCallback.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/PlayerLeaveCallback.java new file mode 100644 index 00000000..f1ce2922 --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/PlayerLeaveCallback.java @@ -0,0 +1,42 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric.events; + +import net.fabricmc.fabric.api.event.Event; +import net.fabricmc.fabric.api.event.EventFactory; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.ServerPlayerEntity; + +public interface PlayerLeaveCallback { + Event EVENT = EventFactory.createArrayBacked(PlayerLeaveCallback.class, + (listeners) -> (server, player) -> { + for (PlayerLeaveCallback event : listeners) { + event.onPlayerLeave(server, player); + } + } + ); + + void onPlayerLeave(MinecraftServer server, ServerPlayerEntity player); +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/WorldSaveCallback.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/WorldSaveCallback.java new file mode 100644 index 00000000..25b2ea9f --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/events/WorldSaveCallback.java @@ -0,0 +1,41 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric.events; + +import net.fabricmc.fabric.api.event.Event; +import net.fabricmc.fabric.api.event.EventFactory; +import net.minecraft.server.world.ServerWorld; + +public interface WorldSaveCallback { + Event EVENT = EventFactory.createArrayBacked(WorldSaveCallback.class, + (listeners) -> (world) -> { + for (WorldSaveCallback event : listeners) { + event.onWorldSaved(world); + } + } + ); + + void onWorldSaved(ServerWorld world); +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinChunkGenerator.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinChunkGenerator.java new file mode 100644 index 00000000..80304fde --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinChunkGenerator.java @@ -0,0 +1,46 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import com.flowpowered.math.vector.Vector2i; + +import de.bluecolored.bluemap.fabric.events.ChunkFinalizeCallback; +import net.minecraft.world.ChunkRegion; +import net.minecraft.world.gen.chunk.ChunkGenerator; + +@Mixin(ChunkGenerator.class) +public class MixinChunkGenerator { + + @Inject(at = @At("RETURN"), method = "generateFeatures") + public void generateFeatures(ChunkRegion region, CallbackInfo ci) { + ChunkFinalizeCallback.EVENT.invoker().onChunkFinalized(region.getWorld(), new Vector2i(region.getCenterChunkX(), region.getCenterChunkZ())); + } + +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinPlayerManager.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinPlayerManager.java new file mode 100644 index 00000000..b7109357 --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinPlayerManager.java @@ -0,0 +1,56 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import de.bluecolored.bluemap.fabric.events.PlayerJoinCallback; +import de.bluecolored.bluemap.fabric.events.PlayerLeaveCallback; +import net.minecraft.network.ClientConnection; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.PlayerManager; +import net.minecraft.server.network.ServerPlayerEntity; + +@Mixin(PlayerManager.class) +public abstract class MixinPlayerManager { + + @Shadow + public abstract MinecraftServer getServer(); + + @Inject(at = @At("RETURN"), method = "onPlayerConnect") + public void onPlayerConnect(ClientConnection connection, ServerPlayerEntity player, CallbackInfo ci) { + PlayerJoinCallback.EVENT.invoker().onPlayerJoin(this.getServer(), player); + } + + @Inject(at = @At("HEAD"), method = "remove") + public void remove(ServerPlayerEntity player, CallbackInfo ci) { + PlayerLeaveCallback.EVENT.invoker().onPlayerLeave(this.getServer(), player); + } + +} diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinServerWorld.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinServerWorld.java new file mode 100644 index 00000000..d2647bfa --- /dev/null +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinServerWorld.java @@ -0,0 +1,44 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.fabric.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import de.bluecolored.bluemap.fabric.events.WorldSaveCallback; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.ProgressListener; + +@Mixin(ServerWorld.class) +public abstract class MixinServerWorld { + + @Inject(at = @At("RETURN"), method = "save") + public void save(ProgressListener progressListener, boolean flush, boolean bl, CallbackInfo ci) { + WorldSaveCallback.EVENT.invoker().onWorldSaved((ServerWorld) (Object) this); + } + +} diff --git a/implementations/fabric-1.15.2/src/main/resources/assets/bluemap/icon.png b/implementations/fabric-1.15.2/src/main/resources/assets/bluemap/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..65d56d7a88fd8adb9003df6e0c10424b0ec8e375 GIT binary patch literal 10593 zcmV-nDW2AeP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZN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