Skip to content

Commit

Permalink
feat: update to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Machine-Maker committed Jun 21, 2024
1 parent 13a2b06 commit 7eb2132
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
10 changes: 4 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

group = "me.machinemaker"
version = "0.6.0"
version = "0.7.0"

repositories {
mavenCentral()
Expand Down Expand Up @@ -44,18 +44,16 @@ spotless {
}
}

tasks {
assemble {
dependsOn(reobfJar)
}
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION

tasks {
shadowJar {
isEnableRelocation = true
relocationPrefix = "me.machinemaker.treasuremapsplus.libs"
}

compileJava {
options.release.set(21)
options.release = 21
options.encoding = Charsets.UTF_8.toString()
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[versions]
minecraft = "1.20.6"
minecraft = "1.21"
junit = "5.9.1"
mirror = "0.2.0"
reflectionRemapper = "0.1.0"
reflectionRemapper = "0.1.1"

paperweight = "1.7.1"
runPaper = "2.3.0"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public record RegistryOverride<T>(ResourceKey<? extends Registry<T>> registryKey

static {
try {
final ReflectionRemapper remapper = ReflectionRemapper.forReobfMappingsInPaperJar();
final ReflectionRemapper remapper = ReflectionRemapper.noop();
final MethodHandles.Lookup mappedRegistryLookup = MethodHandles.privateLookupIn(MappedRegistry.class, MethodHandles.lookup());
TO_ID_MAP = mappedRegistryLookup.findGetter(MappedRegistry.class, remapper.remapFieldName(MappedRegistry.class, "toId"), Reference2IntMap.class);
BY_VALUE_MAP = mappedRegistryLookup.findGetter(MappedRegistry.class, remapper.remapFieldName(MappedRegistry.class, "byValue"), Map.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private static List<net.minecraft.world.item.ItemStack> rollLootTable(final Item
final PersistentDataContainer pdc = item.getItemMeta().getPersistentDataContainer();
final @Nullable String tagKey = pdc.get(TreasureMapsPlus.MAP_STRUCTURE_TAG_KEY, PersistentDataType.STRING);
if (tagKey != null) {
final TagKey<Structure> structureTagKey = TagKey.create(Registries.STRUCTURE, new ResourceLocation(tagKey));
final TagKey<Structure> structureTagKey = TagKey.create(Registries.STRUCTURE, ResourceLocation.parse(tagKey));
if (structureTagKey == StructureTags.ON_TREASURE_MAPS) {
lootTable = BuiltInLootTables.BURIED_TREASURE;
} else if (structureTagKey == StructureTags.ON_OCEAN_EXPLORER_MAPS) {
Expand Down Expand Up @@ -116,8 +116,8 @@ private static LootParams createEntityParams(final ServerPlayer player) {
.withParameter(LootContextParams.THIS_ENTITY, guardian)
.withParameter(LootContextParams.ORIGIN, player.position())
.withParameter(LootContextParams.DAMAGE_SOURCE, player.serverLevel().damageSources().playerAttack(player))
.withOptionalParameter(LootContextParams.KILLER_ENTITY, player)
.withOptionalParameter(LootContextParams.DIRECT_KILLER_ENTITY, player)
.withOptionalParameter(LootContextParams.ATTACKING_ENTITY, player)
.withOptionalParameter(LootContextParams.DIRECT_ATTACKING_ENTITY, player)
.withParameter(LootContextParams.LAST_DAMAGE_PLAYER, player)
.withLuck(player.getLuck())
.create(LootContextParamSets.ENTITY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
public class ExplorationMapItemFunctionOverride {

@VisibleForTesting
static final ResourceKey<LootItemFunctionType<?>> EXPLORATION_FUNCTION_KEY = ResourceKey.create(Registries.LOOT_FUNCTION_TYPE, new ResourceLocation(ResourceLocation.DEFAULT_NAMESPACE, "exploration_map"));
static final ResourceKey<LootItemFunctionType<?>> EXPLORATION_FUNCTION_KEY = ResourceKey.create(Registries.LOOT_FUNCTION_TYPE, ResourceLocation.parse("exploration_map"));
private static final LootItemFunction.Builder SET_PDC_FUNCTION;

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class VillagerTradeOverride {


static {
final ReflectionRemapper remapper = ReflectionRemapper.forReobfMappingsInPaperJar();
final ReflectionRemapper remapper = ReflectionRemapper.noop();
TREASURE_MAP_TRADE_LISTING_CLASS = sneaky(() -> Class.forName(remapper.remapClassName("net.minecraft.world.entity.npc.VillagerTrades$TreasureMapForEmeralds")));
TYPE_SPECIFIC_TRADE_CLASS = sneaky(() -> Class.forName(remapper.remapClassName("net.minecraft.world.entity.npc.VillagerTrades$TypeSpecificTrade")));

Expand Down

0 comments on commit 7eb2132

Please sign in to comment.