diff --git a/settings.gradle.kts b/settings.gradle.kts index a7c9bbb..fb46c1c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -31,7 +31,7 @@ extensions.configure { centralScript = "build.gradle.kts" shared { versions("1.20.1", "1.20.4", "1.20.6", "1.21") - vcsVersion = "1.20.6" + vcsVersion = "1.21" } create(":telekinesis-fabric") } diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/AbstractMinecartMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/AbstractMinecartMixin.java index 7930df7..f15c07c 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/AbstractMinecartMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/AbstractMinecartMixin.java @@ -12,7 +12,7 @@ public class AbstractMinecartMixin { /*? <=1.20.2 {*/ - @ModifyExpressionValue( + /*@ModifyExpressionValue( method = "destroy", at = @At( value = "INVOKE", @@ -25,5 +25,5 @@ private Item redirectMinecartDrops( ) { return MixinHelper.modifyExpressionValueOldVehicle(original, damageSource); } - /*?}*/ + *//*?}*/ } diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/BlockMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/BlockMixin.java index c981183..3b0899b 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/BlockMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/BlockMixin.java @@ -96,7 +96,7 @@ private static void checkForPlayerBreak( method = "tryDropExperience", at = @At( value = "INVOKE", - target = /*? if >=1.21 {*//* "Lnet/minecraft/world/item/enchantment/EnchantmentHelper;processBlockExperience(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/item/ItemStack;I)I" *//*?} else {*/ "Lnet/minecraft/util/valueproviders/IntProvider;sample(Lnet/minecraft/util/RandomSource;)I" /*?}*/ + target = /*? if >=1.21 {*/ "Lnet/minecraft/world/item/enchantment/EnchantmentHelper;processBlockExperience(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/item/ItemStack;I)I" /*?} else {*/ /*"Lnet/minecraft/util/valueproviders/IntProvider;sample(Lnet/minecraft/util/RandomSource;)I" *//*?}*/ ) ) private int modifyExp( diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/BoatMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/BoatMixin.java index 8b89701..7cc83bd 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/BoatMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/BoatMixin.java @@ -11,7 +11,7 @@ @Mixin(Boat.class) public class BoatMixin { /*? <=1.20.2 {*/ - @ModifyExpressionValue( + /*@ModifyExpressionValue( method = "destroy(Lnet/minecraft/world/damagesource/DamageSource;)V", at = @At( value = "INVOKE", @@ -24,5 +24,5 @@ private Item changeDroppedItem( ) { return MixinHelper.modifyExpressionValueOldVehicle(original, damageSource); } - /*?}*/ + *//*?}*/ } diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/ChestBoatMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/ChestBoatMixin.java index e2aa49d..7225d13 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/ChestBoatMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/ChestBoatMixin.java @@ -13,7 +13,7 @@ public abstract class ChestBoatMixin { /*? if >1.20.2 {*/ - /*@WrapOperation( + @WrapOperation( method = "destroy(Lnet/minecraft/world/damagesource/DamageSource;)V", at = @At( value = "INVOKE", @@ -28,7 +28,7 @@ private void checkForPlayer( ) { MixinHelper.prepareVehicleServerPlayer(instance, item, original, source); } - *//*?}*/ + /*?}*/ // TODO: boat inventory does still not work!!! as well as furnaces!! } diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/EnchantmentsMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/EnchantmentsMixin.java index 64e39ae..0b77e9c 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/EnchantmentsMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/EnchantmentsMixin.java @@ -1,7 +1,7 @@ package dev.nyon.telekinesis.mixins; /*? if <1.21 {*/ -import dev.nyon.telekinesis.MainKt; +/*import dev.nyon.telekinesis.MainKt; import dev.nyon.telekinesis.TelekinesisEnchantment; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; @@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -/*?}*/ +*//*?}*/ import net.minecraft.world.item.enchantment.Enchantments; import org.spongepowered.asm.mixin.Mixin; @@ -19,7 +19,7 @@ public abstract class EnchantmentsMixin { /*? if <1.21 {*/ - @Unique + /*@Unique private static boolean isTelekinesisRegistered = false; @Inject( @@ -37,5 +37,5 @@ private static void registerTelekinesis( Registry.register(BuiltInRegistries.ENCHANTMENT, new ResourceLocation("telekinesis", "telekinesis"), MainKt.getTelekinesis()); } } - /*?}*/ + *//*?}*/ } diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/EnderManMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/EnderManMixin.java index 4fcd2a7..ce86988 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/EnderManMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/EnderManMixin.java @@ -22,13 +22,13 @@ public class EnderManMixin { public boolean redirectEquipmentDrop( EnderMan instance, ItemStack itemStack, - /*? if >=1.21 {*//* + /*? if >=1.21 {*/ ServerLevel serverLevel, DamageSource damageSource, boolean bl - *//*?} else {*/ - DamageSource damageSource, int looting, boolean hitByPlayer - /*?}*/ + /*?} else {*/ + /*DamageSource damageSource, int looting, boolean hitByPlayer + *//*?}*/ ) { return MixinHelper.entityCustomDeathLootSingle(damageSource, itemStack); } diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/LivingEntityMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/LivingEntityMixin.java index ff39aaa..9308d2c 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/LivingEntityMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/LivingEntityMixin.java @@ -35,17 +35,17 @@ public abstract class LivingEntityMixin { method = "dropExperience", at = @At( value = "INVOKE", - target = /*? if >=1.21 {*/ /*"Lnet/minecraft/world/entity/LivingEntity;getExperienceReward(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/entity/Entity;)I" *//*?} else {*/ "Lnet/minecraft/world/entity/LivingEntity;getExperienceReward()I" /*?}*/ + target = /*? if >=1.21 {*/ "Lnet/minecraft/world/entity/LivingEntity;getExperienceReward(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/entity/Entity;)I" /*?} else {*/ /*"Lnet/minecraft/world/entity/LivingEntity;getExperienceReward()I" *//*?}*/ ) ) public int redirectExp( int original - /*? if >=1.21*//* , Entity entity */ + /*? if >=1.21*/ , Entity entity ) { - /*? if >=1.21 {*//* + /*? if >=1.21 {*/ if (!(entity instanceof ServerPlayer player)) return original; - *//*?} else {*/ - ServerPlayer player = threadLocal.get(); + /*?} else {*/ + /*ServerPlayer player = threadLocal.get(); return MixinHelper.modifyExpressionValuePlayerExp(player, original); } @@ -76,7 +76,7 @@ public Consumer redirectCommonDrops( }; } - /*? if <1.21 {*/ + /^? if <1.21 {^/ @WrapOperation( method = "dropAllDeathLoot", at = @At( @@ -102,5 +102,6 @@ private void cachePlayer( threadLocal.set(previous); } } - /*?}*/ + /^?}^/ } +*/ \ No newline at end of file diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/MinecartTNTMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/MinecartTNTMixin.java index 9d5f754..b1e6475 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/MinecartTNTMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/MinecartTNTMixin.java @@ -7,16 +7,16 @@ import org.spongepowered.asm.mixin.Mixin; /*? if >1.20.2 {*/ -/*import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.item.Item; import org.spongepowered.asm.mixin.injection.At; - *//*?}*/ + /*?}*/ @Mixin(MinecartTNT.class) public class MinecartTNTMixin { /*? if >1.20.2 {*/ - /*@WrapOperation( + @WrapOperation( method = "destroy(Lnet/minecraft/world/damagesource/DamageSource;)V", at = @At( value = "INVOKE", @@ -31,5 +31,5 @@ private void checkForPlayer( ) { MixinHelper.prepareVehicleServerPlayer(instance, dropItem, original, source); } - *//*?}*/ + /*?}*/ } diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/MobMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/MobMixin.java index 0619223..aa6594e 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/MobMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/MobMixin.java @@ -22,13 +22,13 @@ public class MobMixin { public boolean modifyCustomDeathLoot( Mob instance, ItemStack itemStack, - /*? if >=1.21 {*/ /*ServerLevel serverLevel, DamageSource damageSource, boolean bl *//*?} else {*/ DamageSource damageSource, int looting, boolean hitByPlayer /*?}*/ + /*? if >=1.21 {*/ ServerLevel serverLevel, DamageSource damageSource, boolean bl /*?} else {*/ /*DamageSource damageSource, int looting, boolean hitByPlayer *//*?}*/ ) { return MixinHelper.entityCustomDeathLootSingle(damageSource, itemStack); } /*? if >=1.21 {*/ - /*@WrapWithCondition( + @WrapWithCondition( method = "dropPreservedEquipment(Ljava/util/function/Predicate;)Ljava/util/Set;", at = @At( value = "INVOKE", @@ -41,5 +41,5 @@ public boolean modifyCustomDeathLoot( ) { return MixinHelper.entityDropEquipmentSingle(instance, itemStack); } - *//*?}*/ + /*?}*/ } diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/PiglinMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/PiglinMixin.java index c75e29b..1800f3c 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/PiglinMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/PiglinMixin.java @@ -23,7 +23,7 @@ public class PiglinMixin { ) public List redirectDrops( List original, - /*? if >=1.21 {*/ /*ServerLevel serverLevel, DamageSource damageSource, boolean bl *//*?} else {*/ DamageSource damageSource, int looting, boolean hitByPlayer /*?}*/ + /*? if >=1.21 {*/ ServerLevel serverLevel, DamageSource damageSource, boolean bl /*?} else {*/ /*DamageSource damageSource, int looting, boolean hitByPlayer *//*?}*/ ) { return MixinHelper.entityCustomDeathLootMultiple(damageSource, original); } diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/PlayerMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/PlayerMixin.java index ccac5fa..faa6897 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/PlayerMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/PlayerMixin.java @@ -18,7 +18,7 @@ @Mixin(Player.class) public class PlayerMixin { - /*? if >=1.20.5 {*//*@Shadow*//*?} else {*/ @Unique /*?}*/ + /*? if >=1.20.5 {*/@Shadow/*?} else {*/ /*@Unique *//*?}*/ @Final Inventory inventory; @Unique diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/SweetBerryBushBlockMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/SweetBerryBushBlockMixin.java index a1bab9a..f9904c1 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/SweetBerryBushBlockMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/SweetBerryBushBlockMixin.java @@ -18,7 +18,7 @@ public class SweetBerryBushBlockMixin { @WrapWithCondition( - method = /*? >1.20.5 {*/ /*"useWithoutItem" *//*?} else {*/ "use" /*?}*/, + method = /*? >1.20.5 {*/ "useWithoutItem" /*?} else {*/ /*"use" *//*?}*/, at = @At( value = "INVOKE", target = "Lnet/minecraft/world/level/block/SweetBerryBushBlock;popResource(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/item/ItemStack;)V" @@ -32,7 +32,7 @@ private boolean manipulateBerryDrops( Level _level, BlockPos _blockPos, Player player, - /*? if <=1.20.4*/ InteractionHand hand, + /*? if <=1.20.4*/ /*InteractionHand hand,*/ BlockHitResult blockHitResult ) { if (!(player instanceof ServerPlayer serverPlayer)) return true; diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/VehicleEntityMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/VehicleEntityMixin.java index 578532e..13be492 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/VehicleEntityMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/VehicleEntityMixin.java @@ -6,7 +6,7 @@ import dev.nyon.telekinesis.utils.MixinHelper; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.damagesource.DamageSource; -/*? if >=1.20.4*/ /*import net.minecraft.world.entity.vehicle.VehicleEntity;*/ +/*? if >=1.20.4*/ import net.minecraft.world.entity.vehicle.VehicleEntity; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import org.spongepowered.asm.mixin.Mixin; @@ -18,7 +18,7 @@ @Pseudo @Mixin(targets = "net.minecraft.world.entity.vehicle.VehicleEntity") public class VehicleEntityMixin { - /*? if >=1.20.4 {*//* + /*? if >=1.20.4 {*/ @WrapOperation( method = "destroy(Lnet/minecraft/world/damagesource/DamageSource;)V", at = @At( @@ -51,5 +51,5 @@ private boolean replaceDropItem( return MixinHelper.wrapWithConditionPlayerItemSingle(player, itemStack); } - *//*?}*/ + /*?}*/ } \ No newline at end of file diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/WitherBossMixin.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/WitherBossMixin.java index 2f712da..dbec90e 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/WitherBossMixin.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/mixins/WitherBossMixin.java @@ -22,7 +22,7 @@ public abstract class WitherBossMixin { ) ) protected void redirectEquipmentDrop( - Args args, /*? if >=1.21 {*/ /*ServerLevel serverLevel, DamageSource damageSource, boolean bl *//*?} else {*/ DamageSource damageSource, int looting, boolean hitByPlayer /*?}*/ + Args args, /*? if >=1.21 {*/ ServerLevel serverLevel, DamageSource damageSource, boolean bl /*?} else {*/ /*DamageSource damageSource, int looting, boolean hitByPlayer *//*?}*/ ) { ItemLike original = args.get(0); diff --git a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/utils/MixinHelper.java b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/utils/MixinHelper.java index b564b88..0c87c0f 100644 --- a/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/utils/MixinHelper.java +++ b/telekinesis-fabric/src/main/java/dev/nyon/telekinesis/utils/MixinHelper.java @@ -9,10 +9,10 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.Shearable; import net.minecraft.world.entity.player.Player; -/*? if >=1.20.4 {*//* +/*? if >=1.20.4 {*/ import net.minecraft.world.entity.vehicle.VehicleEntity; import net.minecraft.world.item.Item; -*//*?}*/ +/*?}*/ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import org.apache.commons.lang3.mutable.MutableInt; @@ -97,7 +97,7 @@ public static boolean entityCustomDeathLootSingle( .invoke(mutableList, new MutableInt(0), player, - Objects.requireNonNullElseGet(/*? if >=1.21 {*//*source.getWeaponItem() *//*?} else {*/ player.getMainHandItem() /*?}*/, player::getMainHandItem) + Objects.requireNonNullElseGet(/*? if >=1.21 {*/source.getWeaponItem() /*?} else {*/ /*player.getMainHandItem() *//*?}*/, player::getMainHandItem) ); return !mutableList.isEmpty(); @@ -116,13 +116,13 @@ public static List entityCustomDeathLootMultiple( .invoke(mutableList, new MutableInt(0), player, - Objects.requireNonNullElseGet(/*? if >=1.21 {*//*source.getWeaponItem() *//*?} else {*/ player.getMainHandItem() /*?}*/, player::getMainHandItem) + Objects.requireNonNullElseGet(/*? if >=1.21 {*/source.getWeaponItem() /*?} else {*/ /*player.getMainHandItem() *//*?}*/, player::getMainHandItem) ); return mutableList; } - /*? if >=1.20.4 {*//* + /*? if >=1.20.4 {*/ public static void prepareVehicleServerPlayer( VehicleEntity instance, Item item, @@ -142,7 +142,7 @@ public static void prepareVehicleServerPlayer( threadLocal.set(previous); } } - *//*?}*/ + /*?}*/ public static void prepareShearableServerPlayer( Shearable instance, diff --git a/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/DropEvent.kt b/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/DropEvent.kt index f62aec0..7f48c5a 100644 --- a/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/DropEvent.kt +++ b/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/DropEvent.kt @@ -20,7 +20,7 @@ object DropEvent { @Suppress("unused") private val listener = event.register { items, exp, player, tool -> if (config.needSneak && !player.isCrouching) return@register - if (config.needEnchantment && /*? if >=1.21 {*/ /*!EnchantmentHelper.hasTag(tool, telekinesisEffectId)*//*?} else {*/ EnchantmentHelper.getItemEnchantmentLevel(telekinesis, tool) == 0 /*?}*/) return@register + if (config.needEnchantment && /*? if >=1.21 {*/ !EnchantmentHelper.hasTag(tool, telekinesisEffectId)/*?} else {*/ /*EnchantmentHelper.getItemEnchantmentLevel(telekinesis, tool) == 0 *//*?}*/) return@register if (config.itemsAllowed) items.removeIf(player::addItem) if (config.expAllowed) { diff --git a/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/Main.kt b/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/Main.kt index 0e014ac..f02e0c5 100644 --- a/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/Main.kt +++ b/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/Main.kt @@ -9,7 +9,7 @@ import net.fabricmc.loader.api.FabricLoader import dev.nyon.telekinesis.config.config as internalConfig //? if <=1.20.6 -lateinit var telekinesis: TelekinesisEnchantment +/*lateinit var telekinesis: TelekinesisEnchantment*/ fun init() { config(FabricLoader.getInstance().configDir.resolve("telekinesis.json"), 1, Config()) { _, _ -> null } diff --git a/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantment.kt b/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantment.kt index 376d460..f7be8ef 100644 --- a/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantment.kt +++ b/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantment.kt @@ -5,14 +5,14 @@ import net.minecraft.network.chat.Component import net.minecraft.world.item.enchantment.Enchantment import net.minecraft.world.entity.EquipmentSlot /*? if >=1.21 {*/ -/* + import net.minecraft.core.registries.Registries import net.minecraft.resources.ResourceLocation import net.minecraft.tags.TagKey val telekinesisEffectId: TagKey = TagKey.create(Registries.ENCHANTMENT, ResourceLocation.fromNamespaceAndPath("telekinesis", "auto_move")) val telekinesisEnchantmentId: ResourceLocation = ResourceLocation.fromNamespaceAndPath("telekinesis", "telekinesis") -*//*?}*/ +/*?}*/ /*? if <1.21 && >=1.20.5 {*/ /*import net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags @@ -39,7 +39,7 @@ import net.minecraft.world.item.enchantment.EnchantmentCategory Component.translatable("enchantment.telekinesis.telekinesis.name").withStyle(ChatFormatting.GRAY) } *//*?} elif <1.20.5 {*/ -class TelekinesisEnchantment : Enchantment( +/*class TelekinesisEnchantment : Enchantment( Rarity.RARE, EnchantmentCategory.BREAKABLE, listOf(EquipmentSlot.OFFHAND, EquipmentSlot.MAINHAND).toTypedArray() ) { override fun getMinLevel(): Int = 1 @@ -54,4 +54,4 @@ class TelekinesisEnchantment : Enchantment( override fun getFullname(i: Int): Component = Component.translatable("enchantment.telekinesis.telekinesis.name").withStyle(ChatFormatting.GRAY) } -/*?}*/ \ No newline at end of file +*//*?}*/ \ No newline at end of file diff --git a/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantmentGenerator.kt b/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantmentGenerator.kt index d06bcd4..ad1e007 100644 --- a/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantmentGenerator.kt +++ b/telekinesis-fabric/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantmentGenerator.kt @@ -3,7 +3,7 @@ package dev.nyon.telekinesis import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator /*? if >=1.21 {*/ -/*import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider.EnchantmentTagProvider import net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags @@ -16,21 +16,21 @@ import net.minecraft.world.item.enchantment.Enchantment import net.minecraft.world.item.enchantment.Enchantment.EnchantmentDefinition import net.minecraft.world.item.enchantment.Enchantment.dynamicCost import java.util.concurrent.CompletableFuture -*//*?}*/ +/*?}*/ class TelekinesisEnchantmentGenerator : DataGeneratorEntrypoint { override fun onInitializeDataGenerator(generator: FabricDataGenerator) { /*? if >=1.21 {*/ - /*val pack = generator.createPack() + val pack = generator.createPack() pack.addProvider(::EnchantmentProvider) pack.addProvider(::TelekinesisEnchantmentTagProvider) - *//*?}*/ + /*?}*/ } } /*? if >=1.21 {*/ -/*private class TelekinesisEnchantmentTagProvider( +private class TelekinesisEnchantmentTagProvider( output: FabricDataOutput, completableFuture: CompletableFuture ) : EnchantmentTagProvider(output, completableFuture) { override fun addTags(registries: HolderLookup.Provider) { @@ -62,4 +62,4 @@ private class EnchantmentProvider( entries.add(ResourceKey.create(Registries.ENCHANTMENT, telekinesisEnchantmentId), enchantment) } } -*//*?}*/ \ No newline at end of file +/*?}*/ \ No newline at end of file diff --git a/telekinesis-fabric/stonecutter.gradle.kts b/telekinesis-fabric/stonecutter.gradle.kts index bf34bf4..343f09f 100644 --- a/telekinesis-fabric/stonecutter.gradle.kts +++ b/telekinesis-fabric/stonecutter.gradle.kts @@ -10,7 +10,7 @@ import java.time.Instant plugins { id("dev.kikugie.stonecutter") } -stonecutter active "1.20.1" /* [SC] DO NOT EDIT */ +stonecutter active "1.21" /* [SC] DO NOT EDIT */ stonecutter registerChiseled tasks.register("buildAllVersions", stonecutter.chiseled) { group = "mod"