diff --git a/README.md b/README.md index b21c659..5054305 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ This is a Minecraft forge mod using Mysql backend to make player data synchronization between different servers. Such as equipment,inventory,effects,experience,food level.Any other mods support is also possible. Support version now: +1.20.1 1.19-1.19.3 1.18.2 1.16.5 diff --git a/build.gradle b/build.gradle index ec8a33b..f8f9762 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ java.toolchain.languageVersion = JavaLanguageVersion.of(17) println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" minecraft { - mappings channel: 'official', version: '1.19.2' + mappings channel: 'official', version: '1.20.1' //accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default. @@ -116,18 +116,14 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.19.2-43.1.1' + minecraft 'net.minecraftforge:forge:1.20.1-47.1.0' jarJar("curse.maven:MySQL-561280:3685108") { jarJar.ranged(it, '[1.0,)') } - jarJar("com.zaxxer:HikariCP:3.4.5") { - jarJar.ranged(it, '[3.4.5,)') - } - - runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.19.2-5.1.1.0") - compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.19.2-5.1.1.0:api") + runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:5.3.2+1.20.1") + compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:5.3.2+1.20.1:api") implementation fg.deobf("curse.maven:MySQL-561280:3685108") implementation group: 'com.zaxxer', name: 'HikariCP', version: '3.4.5' } diff --git a/src/main/java/vip/fubuki/playersync/sync/ModsSupport.java b/src/main/java/vip/fubuki/playersync/sync/ModsSupport.java index 4b0f3ed..f1dcceb 100644 --- a/src/main/java/vip/fubuki/playersync/sync/ModsSupport.java +++ b/src/main/java/vip/fubuki/playersync/sync/ModsSupport.java @@ -6,7 +6,6 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.fml.ModList; -import net.minecraftforge.items.IItemHandlerModifiable; import vip.fubuki.playersync.util.JDBCsetUp; import vip.fubuki.playersync.util.LocalJsonUtil; @@ -23,7 +22,7 @@ public class ModsSupport { /* Curios Support */ - LazyOptional itemHandler = top.theillusivec4.curios.api.CuriosApi.getCuriosHelper().getEquippedCurios(player); + LazyOptional itemHandler = top.theillusivec4.curios.api.CuriosApi.getCuriosInventory(player); JDBCsetUp.QueryResult queryResult=JDBCsetUp.executeQuery("SELECT curios_item FROM curios WHERE uuid = '"+player.getUUID()+"'"); ResultSet resultSet = queryResult.getResultSet(); if(resultSet.next()) { @@ -34,7 +33,7 @@ public class ModsSupport { for (int i = 0; i < handler.getSlots(); i++) { try { if (curios.get(i) == null) continue; - handler.setStackInSlot(i, ItemStack.of(NbtUtils.snbtToStructure(curios.get(i).replace("|", ",")))); + handler.getEquippedCurios().setStackInSlot(i, ItemStack.of(NbtUtils.snbtToStructure(curios.get(i).replace("|", ",")))); } catch (CommandSyntaxException e) { throw new RuntimeException(e); } @@ -56,12 +55,12 @@ public class ModsSupport { } public void StoreCurios(Player player,boolean init) throws SQLException { - LazyOptional itemHandler = top.theillusivec4.curios.api.CuriosApi.getCuriosHelper().getEquippedCurios(player); + LazyOptional itemHandler = top.theillusivec4.curios.api.CuriosApi.getCuriosInventory(player); Map curios = new HashMap<>(); itemHandler.ifPresent(handler -> { for (int i = 0; i < handler.getSlots(); i++) { - if (!handler.getStackInSlot(i).isEmpty()) { - String sNBT= handler.getStackInSlot(i).serializeNBT().toString().replace(",", "|"); + if (!handler.getEquippedCurios().getStackInSlot(i).isEmpty()) { + String sNBT= handler.getEquippedCurios().getStackInSlot(i).serializeNBT().toString().replace(",", "|"); curios.put(i, sNBT); } } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 47935a6..24f9cfa 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -6,7 +6,7 @@ # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml modLoader="javafml" #mandatory # A version range to match for said mod loader - for regular FML @Mod it will be the forge version -loaderVersion="[43,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. +loaderVersion="[47,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. # The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. # Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. license="GPL-3.0 license" @@ -51,7 +51,7 @@ make multiserver players' data sync # Does this dependency have to exist - if not, ordering below must be specified mandatory=true #mandatory # The version range of the dependency - versionRange="[43,)" #mandatory + versionRange="[47,)" #mandatory # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory ordering="NONE" # Side this dependency is applied on - BOTH, CLIENT or SERVER @@ -61,6 +61,6 @@ make multiserver players' data sync modId="minecraft" mandatory=true # This version range declares a minimum of the current minecraft version up to but not including the next major version - versionRange="[1.19.2,1.20)" + versionRange="[1.20,1.21)" ordering="NONE" side="BOTH" \ No newline at end of file