Skip to content

Commit

Permalink
Update to 1.21
Browse files Browse the repository at this point in the history
Replaced some previously unmapped methods and classes with the new
mappings.
  • Loading branch information
Peter Svensson authored and DrexHD committed Jun 13, 2024
1 parent 69dec8d commit 541be9d
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[versions]
minecraft = "24w21b"
yarn-mappings = "24w21b+build.1"
minecraft = "1.21"
yarn-mappings = "1.21+build.1"
fabric-loader = "0.15.11"

fabric-api = "0.99.0+1.21"
fabric-api = "0.100.1+1.21"

# Kotlin
kotlin = "1.9.23"
kotlin = "2.0.0"
# Also modrinth version in gradle.properties
fabric-kotlin = "1.10.19+kotlin.1.9.23"
fabric-kotlin = "1.11.0+kotlin.2.0.0"

fabric-permissions = "0.3.1"
translations = "2.3.0+1.20.5-rc2"
translations = "2.3.1+1.21-pre2"

exposed = "0.46.0"
sqlite-jdbc = "3.44.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.github.quiltservertools.ledger.utility.Sources;
import net.minecraft.block.BlockState;
import net.minecraft.enchantment.EnchantmentEffectContext;
import net.minecraft.enchantment.effect.entity.ReplaceDiscEnchantmentEffectType;
import net.minecraft.enchantment.effect.entity.ReplaceDiskEnchantmentEffect;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.world.ServerWorld;
Expand All @@ -15,7 +15,7 @@
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

@Mixin(ReplaceDiscEnchantmentEffectType.class)
@Mixin(ReplaceDiskEnchantmentEffect.class)
public abstract class FrostWalkerEnchantmentMixin {
@ModifyArgs(method = "apply", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z"))
private void logFrostWalkerPlacement(Args args, ServerWorld world, int level, EnchantmentEffectContext context, Entity entity, Vec3d vec3d) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.github.quiltservertools.ledger.callbacks.BlockChangeCallback;
import com.github.quiltservertools.ledger.utility.Sources;
import net.minecraft.block.BlockState;
import net.minecraft.class_9792;
import net.minecraft.component.type.JukeboxPlayableComponent;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ItemActionResult;
Expand All @@ -17,10 +17,10 @@
import static net.minecraft.block.JukeboxBlock.HAS_RECORD;


@Mixin(class_9792.class)
@Mixin(net.minecraft.component.type.JukeboxPlayableComponent.class)
public abstract class MusicDiscItemMixin {

@Inject(method = "method_60747", at = @At(value = "INVOKE",
@Inject(method = "tryPlayStack", at = @At(value = "INVOKE",
target = "Lnet/minecraft/block/entity/JukeboxBlockEntity;setStack(Lnet/minecraft/item/ItemStack;)V"))
private static void ledgerPlayerInsertMusicDisc(World world, BlockPos pos, ItemStack itemStack, PlayerEntity player, CallbackInfoReturnable<ItemActionResult> cir) {
BlockState blockState = world.getBlockState(pos);
Expand All @@ -35,4 +35,4 @@ private static void ledgerPlayerInsertMusicDisc(World world, BlockPos pos, ItemS
Sources.INTERACT,
player);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ object Ledger : DedicatedServerModInitializer, CoroutineScope {
registerEntityListeners()
}

fun identifier(path: String) = Identifier.method_60655(MOD_ID, path)
fun identifier(path: String) = Identifier.of(MOD_ID, path)
}

fun logDebug(message: String) = Ledger.logger.debug(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ abstract class AbstractActionType : ActionType {
override var timestamp: Instant = Instant.now()
override var pos: BlockPos = BlockPos.ORIGIN
override var world: Identifier? = null
override var objectIdentifier: Identifier = Identifier.method_60656("air")
override var oldObjectIdentifier: Identifier = Identifier.method_60656("air")
override var objectIdentifier: Identifier = Identifier.ofVanilla("air")
override var oldObjectIdentifier: Identifier = Identifier.ofVanilla("air")
override var objectState: String? = null
override var oldObjectState: String? = null
override var sourceName: String = Sources.UNKNOWN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class EntityChangeActionType : AbstractActionType() {
override val identifier = "entity-change"

override fun getTranslationType(): String {
val item = Registries.ITEM.get(Identifier.method_60654(extraData))
val item = Registries.ITEM.get(Identifier.of(extraData))
return if (item is BlockItem && item !is AliasedBlockItem) {
"block"
} else {
Expand All @@ -49,14 +49,14 @@ class EntityChangeActionType : AbstractActionType() {
}
)

if (extraData != null && Identifier.method_60654(extraData) != Identifier.tryParse("minecraft:air")) {
val stack = ItemStack(Registries.ITEM.get(Identifier.method_60654(extraData)))
if (extraData != null && Identifier.of(extraData) != Identifier.tryParse("minecraft:air")) {
val stack = ItemStack(Registries.ITEM.get(Identifier.of(extraData)))
text.append(Text.literal(" ").append(Text.translatable("text.ledger.action_message.with")).append(" "))
text.append(
Text.translatable(
Util.createTranslationKey(
this.getTranslationType(),
Identifier.method_60654(extraData)
Identifier.of(extraData)
)
).setStyle(TextColorPallet.secondaryVariant).styled {
it.withHoverEvent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ import net.minecraft.util.Identifier
// which provides the necessary constructor
data class IdentifierWrapper(val identifier: Identifier) {
@JsonCreator
constructor(id: String) : this(Identifier.method_60654(id))
constructor(id: String) : this(Identifier.of(id))
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ object DatabaseManager {
type.timestamp = action[Tables.Actions.timestamp]
type.pos = BlockPos(action[Tables.Actions.x], action[Tables.Actions.y], action[Tables.Actions.z])
type.world = Identifier.tryParse(action[Tables.Worlds.identifier])
type.objectIdentifier = Identifier.method_60654(action[Tables.ObjectIdentifiers.identifier])
type.oldObjectIdentifier = Identifier.method_60654(
type.objectIdentifier = Identifier.of(action[Tables.ObjectIdentifiers.identifier])
type.oldObjectIdentifier = Identifier.of(
action[Tables.ObjectIdentifiers.alias("oldObjects")[Tables.ObjectIdentifiers.identifier]]
)
type.objectState = action[Tables.Actions.blockState]
Expand Down

0 comments on commit 541be9d

Please sign in to comment.