From 6910dab13971f5a747fcd7c5cd06643d44a6d67d Mon Sep 17 00:00:00 2001 From: lucsoft Date: Sat, 29 May 2021 19:16:31 +0200 Subject: [PATCH] Migrated Tests and API/Bus --- Mojang.MD | 21 +++++++++++++++++++ gradle.properties | 4 ++-- .../oc2/api/bus/BlockDeviceBusElement.java | 2 +- .../bus/device/provider/BlockDeviceQuery.java | 2 +- .../li/cil/oc2/common/bus/DeviceBusTests.java | 2 +- .../serialization/SerializationTests.java | 6 +++--- 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/Mojang.MD b/Mojang.MD index e69de29b..2ec3a0f6 100644 --- a/Mojang.MD +++ b/Mojang.MD @@ -0,0 +1,21 @@ +**Last Modified**: 02/17/2021 + +At the time of this writing, the current license applied to the Official Mojang mapping files is: + +> (c) 2020 Microsoft Corporation. These mappings are provided "as-is" +> and you bear the risk of using them. You may copy and use the mappings +> for development purposes, but you may not redistribute the mappings +> complete and unmodified. Microsoft makes no warranties, express or +> implied, with respect to the mappings provided here. Use and +> modification of this document or the source code (in any form) of +> Minecraft: Java Edition is governed by the Minecraft End User License + +Obtained From: [1.16.5's client.txt](https://launcher.mojang.com/v1/objects/374c6b789574afbdc901371207155661e0509e17/client.txt) + +The first concern, which affects all developers most directly but is a lesser risk, is that the license terms for the official mappings don’t have any explicit provision for distributing mod code referencing Minecraft code under the official names. Since those references would have been derived from those mappings, directly or indirectly, they could still be considered derivative works used outside development, which means they may not be explicitly allowed, and so they must be covered by the fallback, the EULA, which states that mods can only distribute Mojang code/assets if they are not “substantial portions”. + +The bigger concern, which affects projects like MCPConfig, is that in order to do our job, the data we create is derived in part from the official mappings, in order to patch the vanilla code, and make it usable as a platform for mods to run on. This usage of the data may not be considered development use, and so it’s the most at risk to be excluded by the license terms. Whether or not the EULA allows this use, is not clear. + +We understand that the people at Mojang want this to be allowed, but the license does not clearly back their words, and puts us in this difficult position. However, we have almost a decade worth of working experience with the people at Mojang. To the best of our knowledge we are in good standing and they explicitly wish to allow us to use this data for our purposes. As such, we have decided to move forward with the license in it's current form. + +We advise that everyone using this project, it's data, or anything that has something to do with the Official Mojang mappings be aware of the license they are under. You can make your own decision on how you want to proceed. \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 8b11b9e3..c81248e9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,8 +5,8 @@ org.gradle.daemon=false minecraft_version=1.16.5 minecraft_version_min=1.16.5 -mappings_channel=snapshot -mappings_version=20201028-1.16.3 +mappings_channel=official +mappings_version=1.16.5 forge_version=36.1.24 forge_version_min=36.1.0 diff --git a/src/main/java/li/cil/oc2/api/bus/BlockDeviceBusElement.java b/src/main/java/li/cil/oc2/api/bus/BlockDeviceBusElement.java index d529d44d..3fc7e586 100644 --- a/src/main/java/li/cil/oc2/api/bus/BlockDeviceBusElement.java +++ b/src/main/java/li/cil/oc2/api/bus/BlockDeviceBusElement.java @@ -16,7 +16,7 @@ public interface BlockDeviceBusElement extends DeviceBusElement { * * @return the world the bus lives in. */ - IWorld getWorld(); + IWorld getLevel(); /** * The position of this bus element. diff --git a/src/main/java/li/cil/oc2/api/bus/device/provider/BlockDeviceQuery.java b/src/main/java/li/cil/oc2/api/bus/device/provider/BlockDeviceQuery.java index 827f4acf..6fe74438 100644 --- a/src/main/java/li/cil/oc2/api/bus/device/provider/BlockDeviceQuery.java +++ b/src/main/java/li/cil/oc2/api/bus/device/provider/BlockDeviceQuery.java @@ -17,7 +17,7 @@ public interface BlockDeviceQuery { * * @return the world containing the block. */ - World getWorld(); + World getLevel(); /** * The position of the block this query is performed for. diff --git a/src/test/java/li/cil/oc2/common/bus/DeviceBusTests.java b/src/test/java/li/cil/oc2/common/bus/DeviceBusTests.java index 7a3f7cf9..71f27c48 100644 --- a/src/test/java/li/cil/oc2/common/bus/DeviceBusTests.java +++ b/src/test/java/li/cil/oc2/common/bus/DeviceBusTests.java @@ -31,7 +31,7 @@ public class DeviceBusTests { public static void setup() { // Gotta go through regular MC bootstrapping first because otherwise class // load order may lead to errors because static fields reference each other. - Bootstrap.register(); + Bootstrap.bootStrap(); } @BeforeEach diff --git a/src/test/java/li/cil/oc2/common/serialization/SerializationTests.java b/src/test/java/li/cil/oc2/common/serialization/SerializationTests.java index 0623169c..6c898964 100644 --- a/src/test/java/li/cil/oc2/common/serialization/SerializationTests.java +++ b/src/test/java/li/cil/oc2/common/serialization/SerializationTests.java @@ -38,7 +38,7 @@ public final class SerializationTests { assertArrayEquals(new int[]{4, 5, 6}, nbt.getIntArray("intArrayValue")); assertArrayEquals(new long[]{7, 8, 9}, nbt.getLongArray("longArrayValue")); assertEquals("test string", nbt.getString("stringValue")); - assertEquals(uuid, nbt.getCompound("uuidValue").getUniqueId("uuidValue")); + assertEquals(uuid, nbt.getCompound("uuidValue").getUUID("uuidValue")); } @Test @@ -56,7 +56,7 @@ public final class SerializationTests { nbt.putString("stringValue", "another test"); final UUID uuid = UUID.randomUUID(); final CompoundNBT uuidNBT = new CompoundNBT(); - uuidNBT.putUniqueId("uuidValue", uuid); + uuidNBT.putUUID("uuidValue", uuid); nbt.put("uuidValue", uuidNBT); final Flat value = assertDoesNotThrow(() -> NBTSerialization.deserialize(nbt, Flat.class, new Flat())); @@ -90,7 +90,7 @@ public final class SerializationTests { nbt.putString("stringValue", "another test"); final UUID uuid = UUID.randomUUID(); final CompoundNBT uuidNBT = new CompoundNBT(); - uuidNBT.putUniqueId("uuidValue", uuid); + uuidNBT.putUUID("uuidValue", uuid); nbt.put("uuidValue", uuidNBT); final Flat value = assertDoesNotThrow(() -> NBTSerialization.deserialize(nbt, Flat.class, null));