diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..c4f847c Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 2516cec..72244a7 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ build # other eclipse run +.DS_Store diff --git a/build.gradle b/build.gradle index bfa06c8..eb5e0a4 100644 --- a/build.gradle +++ b/build.gradle @@ -1,21 +1,20 @@ buildscript { repositories { - // These repositories are only for Gradle plugins, put any other repositories in the repository block further below - maven { url = 'https://maven.minecraftforge.net' } mavenCentral() + maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } } dependencies { - classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true - classpath 'org.ajoberstar:gradle-git:0.10.1' + classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT' } } -// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. + plugins { id 'eclipse' id 'maven-publish' + id 'net.minecraftforge.gradle' version '5.1.+' } -apply plugin: 'net.minecraftforge.gradle' +apply plugin: 'org.spongepowered.mixin' version = "${mc_version}-${mod_version}" group = package_group // http://maven.apache.org/guides/mini/guide-naming-conventions.html @@ -39,95 +38,63 @@ minecraft { // // Use non-default mappings at your own risk. They may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. - mappings channel: 'official', version: '1.18.2' - - accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') + mappings channel: 'official', version: '1.19.2' // Default run configurations. // These can be tweaked, removed, or duplicated as needed. runs { client { - workingDirectory project.file('run') - - // Recommended logging data for a userdev environment - // The markers can be added/remove as needed separated by commas. - // "SCAN": For mods scan. - // "REGISTRIES": For firing of registry events. - // "REGISTRYDUMP": For getting the contents of all registries. - property 'forge.logging.markers', 'REGISTRIES' - - // Recommended logging level for the console - // You can set various levels here. - // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels - property 'forge.logging.console.level', 'debug' - - // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. - property 'forge.enabledGameTestNamespaces', 'magicfeather' - + jvmArgs '-Xms1G', '-Xmx4G' + property 'fml.earlyprogresswindow', 'false' + if (file("src/main/resources/${mod_name}.mixins.json").exists()) { + arg "-mixin.config=${mod_name}.mixins.json" + } + ideaModule "${rootProject.name}.${project.name}.main" + taskName 'Client' + property 'terminal.ansi', 'true' + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" + property 'mixin.debug.export', 'true' mods { - magicfeather { + modClientRun { source sourceSets.main } } } server { - workingDirectory project.file('run') - - property 'forge.logging.markers', 'REGISTRIES' - - property 'forge.logging.console.level', 'debug' - - // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. - property 'forge.enabledGameTestNamespaces', 'magicfeather' - - mods { - magicfeather { - source sourceSets.main - } + jvmArgs '-Xms1G', '-Xmx4G' + arg 'nogui' + if (file("src/main/resources/${mod_name}.mixins.json").exists()) { + arg "-mixin.config=${mod_name}.mixins.json" } - } - - // This run config launches GameTestServer and runs all registered gametests, then exits. - // By default, the server will crash when no gametests are provided. - // The gametest system is also enabled by default for other run configs under the /test command. - gameTestServer { - workingDirectory project.file('run') - - // Recommended logging data for a userdev environment - // The markers can be added/remove as needed separated by commas. - // "SCAN": For mods scan. - // "REGISTRIES": For firing of registry events. - // "REGISTRYDUMP": For getting the contents of all registries. - property 'forge.logging.markers', 'REGISTRIES' - - // Recommended logging level for the console - // You can set various levels here. - // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels - property 'forge.logging.console.level', 'debug' - - // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. - property 'forge.enabledGameTestNamespaces', 'magicfeather' - + ideaModule "${rootProject.name}.${project.name}.main" + taskName 'Server' + property 'terminal.ansi', 'true' + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" + property 'mixin.debug.export', 'true' mods { - magicfeather { + modServerRun { source sourceSets.main } } } data { - workingDirectory project.file('run') - - property 'forge.logging.markers', 'REGISTRIES' - - property 'forge.logging.console.level', 'debug' - - // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. - args '--mod', 'magicfeather', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') - + jvmArgs '-Xms1G', '-Xmx4G' + if (file("src/main/resources/${mod_name}.mixins.json").exists()) { + arg "-mixin.config=${mod_name}.mixins.json" + } + args '--mod', mod_name, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') + ideaModule "${rootProject.name}.${project.name}.main" + taskName 'Data' + property 'terminal.ansi', 'true' + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" + property 'mixin.debug.export', 'true' mods { - magicfeather { + modDataRun { source sourceSets.main } } @@ -157,15 +124,23 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.18.2-40.1.0' + minecraft 'net.minecraftforge:forge:1.19.2-43.2.4' + annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' // https://github.com/Ephys/CookieCore/packages/102415 // You'll need to authenticate to Github Packages // See https://docs.github.com/en/packages/guides/configuring-gradle-for-use-with-github-packages#authenticating-to-github-packages - implementation fg.deobf('be.ephys.cookiecore:cookiecore:1.18.2-4.0.0-c56fd52') +// implementation fg.deobf('be.ephys.cookiecore:cookiecore:1.18.2-4.0.0-c56fd52') - compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.18.2-5.0.7.1:api") - runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.18.2-5.0.7.1") + compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.19.2-5.1.2.2:api") + runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.19.2-5.1.2.2") +} + +mixin { + if (file("src/main/resources/${mod_name}.mixins.json").exists()) { + add sourceSets.main, "${mod_name}.refmap.json" + config "${mod_name}.mixins.json" + } } // Example for how to get properties into the manifest for reading at runtime. diff --git a/gradle.properties b/gradle.properties index dbbbbc1..b379c95 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,5 +4,5 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false mod_name=magicfeather package_group=be.ephys.magicfeather -mod_version=4.2.0 -mc_version=1.18.2 +mod_version=5.0.0 +mc_version=1.19.2 diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..91e7f01 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,7 @@ +pluginManagement { + repositories { + gradlePluginPortal() + maven { url = 'https://maven.minecraftforge.net/' } + maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } + } +} \ No newline at end of file diff --git a/src/main/java/be/ephys/magicfeather/BeaconRangeCalculator.java b/src/main/java/be/ephys/magicfeather/BeaconRangeCalculator.java index 0c9e93f..bf1c620 100644 --- a/src/main/java/be/ephys/magicfeather/BeaconRangeCalculator.java +++ b/src/main/java/be/ephys/magicfeather/BeaconRangeCalculator.java @@ -1,130 +1,103 @@ package be.ephys.magicfeather; -import be.ephys.cookiecore.config.Config; +import be.ephys.magicfeather.mixin.BeaconBlockEntityAccessor; +import be.ephys.magicfeather.mixin.LevelAccessor; import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.ai.village.poi.PoiManager; +import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BeaconBlockEntity; import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.TickingBlockEntity; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.common.ForgeConfigSpec; -import java.util.Optional; +import java.util.List; +import java.util.Objects; import java.util.WeakHashMap; +import java.util.function.Predicate; public final class BeaconRangeCalculator { - public enum BeaconVerticalRangeType { - Java(0, 256), - FullHeight(0, 0); + public enum BeaconVerticalRangeType { + JAVA(0, 256), + FULL_HEIGHT(0, 0); - private final int downRangeExtension; - private final int upRangeExtension; + private final int downRangeExtension; + private final int upRangeExtension; - BeaconVerticalRangeType(int downRangeExtension, int upRangeExtension) { - this.downRangeExtension = downRangeExtension; - this.upRangeExtension = upRangeExtension; + BeaconVerticalRangeType(int downRangeExtension, int upRangeExtension) { + this.downRangeExtension = downRangeExtension; + this.upRangeExtension = upRangeExtension; + } } - } - @Config(name = "range_computation.vertical_range_type", description = "How the beacon range is calculated vertically. Java = Vanilla Java Behavior. Bedrock = Vanilla Bedrock behavior. FullHeight = expand vertical range to maximum") - @Config.EnumDefault(value = "FullHeight", enumType = BeaconVerticalRangeType.class) - public static ForgeConfigSpec.EnumValue verticalRangeType; + private static final WeakHashMap, BeaconTypeHandler> GLOBAL_BEACON_HANDLERS = new WeakHashMap<>(); - @Config(name = "range_computation.base_range", description = "What is the beacon base range?") - @Config.IntDefault(10) - public static ForgeConfigSpec.IntValue baseRange; + public static void registerBeaconType(BeaconTypeHandler data) { + GLOBAL_BEACON_HANDLERS.put(data.getTargetClass(), data); + } - @Config(name = "range_computation.range_step", description = "How many blocks are added to the range per level?") - @Config.IntDefault(10) - public static ForgeConfigSpec.IntValue rangeStep; + public static boolean isInBeaconRange(Entity entity) { + Level world = entity.level; + Vec3 entityPos = entity.position(); - private static final WeakHashMap, BeaconTypeHandler> beaconHandlers = new WeakHashMap<>(); + BeaconVerticalRangeType verticalRangeType = ModConfigFile.verticalRangeType.get(); - public static void registerBeaconType(BeaconTypeHandler data) { - beaconHandlers.put(data.getTargetClass(), data); - } + // vanilla creates a new block entity if one isn't found, this will be problematic here, so use the forge method that doesn't do that and just returns null + List tickingBlockEntities = ((LevelAccessor) world).getBlockEntityTickers().stream() + .filter(blockEntity -> !blockEntity.isRemoved() && blockEntity.getPos() != null) + .map(blockEntity -> world.getExistingBlockEntity(blockEntity.getPos())) + .filter(Objects::nonNull) + .toList(); - public static boolean isInBeaconRange(Entity entity) { - ServerLevel world = (ServerLevel) entity.getLevel(); - Vec3 entityPos = entity.getEyePosition(); + for (BlockEntity t : tickingBlockEntities) { + int radius = getBeaconRange(t); - BeaconVerticalRangeType verticalRangeType = BeaconRangeCalculator.verticalRangeType.get(); + if (radius == 0) { + continue; + } - PoiManager poiManager = world.getPoiManager(); + BlockPos pos = t.getBlockPos(); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); - int maxRange = getRangeForLevel(6); + if (entityPos.x < (x - radius) || entityPos.x > (x + radius)) { + continue; + } - Optional foundBeaconPos = poiManager.find( - MagicFeatherMod.getBeaconPoi().getPredicate(), - (pos) -> { - BlockEntity blockEntityAtPos = world.getBlockEntity(pos); + if (entityPos.z < (z - radius) || entityPos.z > (z + radius)) { + continue; + } - if (!(blockEntityAtPos instanceof BeaconBlockEntity)) { - return false; - } + if (verticalRangeType != BeaconVerticalRangeType.FULL_HEIGHT) { + if (entityPos.y < (y - radius - verticalRangeType.downRangeExtension) + || entityPos.y > (y + radius + verticalRangeType.upRangeExtension)) { + continue; + } + } - int radius = getBeaconRange(blockEntityAtPos); - if (radius == 0) { - return false; + return true; } - int x = pos.getX(); - int y = pos.getY(); - int z = pos.getZ(); + return false; + } - if (entityPos.x < (x - radius) || entityPos.x > (x + radius)) { - return false; + private static int getBeaconRange(BlockEntity te) { + Class classObj = te.getClass(); + BeaconTypeHandler handler = GLOBAL_BEACON_HANDLERS.get(classObj); + if (handler != null) { + return handler.getFlightRangeAroundBeacon(te); } - if (entityPos.z < (z - radius) || entityPos.z > (z + radius)) { - return false; + if (!(te instanceof BeaconBlockEntity beacon)) { + return 0; } - if (verticalRangeType != BeaconVerticalRangeType.FullHeight) { - if (entityPos.y < (y - radius - verticalRangeType.downRangeExtension) - || entityPos.y > (y + radius + verticalRangeType.upRangeExtension)) { - return false; - } - } + int rangeStep = ModConfigFile.rangeStep.get(); + int baseRange = ModConfigFile.baseRange.get(); - return true; - }, - entity.blockPosition(), - maxRange, - PoiManager.Occupancy.ANY - ); - - return foundBeaconPos.isPresent(); - } - - private static int getRangeForLevel(int level) { - return baseRange.get() + (level * rangeStep.get()); - } - - private static int getBeaconRange(BlockEntity te) { - Class classObj = te.getClass(); - BeaconTypeHandler handler = beaconHandlers.get(classObj); - if (handler != null) { - return handler.getFlightRangeAroundBeacon(te); - } + int level = ((BeaconBlockEntityAccessor) beacon).getLevels(); - if (!(te instanceof BeaconBlockEntity)) { - return 0; + return (level * rangeStep + baseRange); } - - BeaconBlockEntity beacon = (BeaconBlockEntity) te; - // beacon is disabled - if (beacon.beamSections.isEmpty()) { - return 0; - } - - int level = beacon.levels; - if (level == 0) { - return 0; - } - - return getRangeForLevel(level); - } -} +} \ No newline at end of file diff --git a/src/main/java/be/ephys/magicfeather/ItemMagicFeather.java b/src/main/java/be/ephys/magicfeather/ItemMagicFeather.java index 61a0805..2dfab35 100644 --- a/src/main/java/be/ephys/magicfeather/ItemMagicFeather.java +++ b/src/main/java/be/ephys/magicfeather/ItemMagicFeather.java @@ -1,24 +1,20 @@ package be.ephys.magicfeather; -import be.ephys.cookiecore.config.Config; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Style; -import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Abilities; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.event.TickEvent; import net.minecraftforge.fml.LogicalSide; import net.minecraftforge.fml.ModList; @@ -29,31 +25,16 @@ import java.util.WeakHashMap; public class ItemMagicFeather extends Item { + // TODO this should be a capability + private static final WeakHashMap GLOBAL_PLAYER_DATA = new WeakHashMap<>(); - public static final String NAME = "magicfeather"; - private static final WeakHashMap playerData = new WeakHashMap<>(); - - @Config(name = "item.requires_curios", description = "If curios is installed, the magic feather will need to be installed in its charm slot to function.") - @Config.BooleanDefault(value = true) - public static ForgeConfigSpec.BooleanValue looseRequiresCurios; - - @Config(name = "too_close_to_the_sun_behavior", description = "When losing the ability to fly, should the player receive a slow fall effect or simply negate the fall damage?") - @Config.EnumDefault(value = "NEGATE_FALL_DAMAGE", enumType = FallStyle.class) - public static ForgeConfigSpec.EnumValue fallStyle; - - enum FallStyle { + public enum FallStyle { SLOW_FALL, NEGATE_FALL_DAMAGE } - public ItemMagicFeather() { - super( - new Item.Properties() - .stacksTo(1) - .tab(CreativeModeTab.TAB_TRANSPORTATION) - ); - - setRegistryName(NAME); + public ItemMagicFeather(Properties properties) { + super(properties); } public int getEntityLifespan(ItemStack itemStack, Level world) { @@ -75,7 +56,7 @@ public boolean hasCustomEntity(ItemStack stack) { } private static boolean requiresCurios() { - return isCuriosInstalled() && looseRequiresCurios.get(); + return isCuriosInstalled() && ModConfigFile.looseRequiresCurios.get(); } private static boolean isCuriosInstalled() { @@ -93,7 +74,7 @@ private static boolean hasItem(Player player, Item item) { } // if requireCurios is false, we'll check the main inventory - if (looseRequiresCurios.get()) { + if (ModConfigFile.looseRequiresCurios.get()) { return false; } } @@ -115,15 +96,15 @@ public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List event) { - if (ModList.get().isLoaded("alexsmobs")) { - return; - } - - MF_BEACON_POI = new PoiType( - MagicFeatherMod.MODID + ":beacon", - PoiType.getBlockStates(Blocks.BEACON), - 0, - 1 - ); - - MF_BEACON_POI.setRegistryName(MagicFeatherMod.MODID, "beacon"); - - event.getRegistry().register(MF_BEACON_POI); - + @SubscribeEvent + public static void onConstructMod(final FMLConstructModEvent evt) { + ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, ModConfigFile.buildSpec()); } @SubscribeEvent diff --git a/src/main/java/be/ephys/magicfeather/ModConfigFile.java b/src/main/java/be/ephys/magicfeather/ModConfigFile.java new file mode 100644 index 0000000..0aacab0 --- /dev/null +++ b/src/main/java/be/ephys/magicfeather/ModConfigFile.java @@ -0,0 +1,23 @@ +package be.ephys.magicfeather; + +import net.minecraftforge.common.ForgeConfigSpec; + +public class ModConfigFile { + public static ForgeConfigSpec.EnumValue verticalRangeType; + public static ForgeConfigSpec.IntValue baseRange; + public static ForgeConfigSpec.IntValue rangeStep; + public static ForgeConfigSpec.BooleanValue looseRequiresCurios; + public static ForgeConfigSpec.EnumValue fallStyle; + + public static ForgeConfigSpec buildSpec() { + ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder(); + verticalRangeType = builder.comment("How the beacon range is calculated vertically. JAVA = Vanilla Java Behavior. FULL_HEIGHT = expand vertical range to maximum") + .defineEnum("range_computation.vertical_range_type", BeaconRangeCalculator.BeaconVerticalRangeType.FULL_HEIGHT); + baseRange = builder.comment("What is the beacon base range?").defineInRange("range_computation.base_range", 10, Integer.MIN_VALUE, Integer.MAX_VALUE); + rangeStep = builder.comment("How many blocks are added to the range per level?").defineInRange("range_computation.range_step", 10, Integer.MIN_VALUE, Integer.MAX_VALUE); + looseRequiresCurios = builder.comment("If curios is installed, the magic feather will need to be installed in its charm slot to function.").define("item.requires_curios", true); + fallStyle = builder.comment("When losing the ability to fly, should the player receive a slow fall effect or simply negate the fall damage?") + .defineEnum("too_close_to_the_sun_behavior", ItemMagicFeather.FallStyle.NEGATE_FALL_DAMAGE); + return builder.build(); + } +} diff --git a/src/main/java/be/ephys/magicfeather/ModItems.java b/src/main/java/be/ephys/magicfeather/ModItems.java index 987b280..39bafbf 100644 --- a/src/main/java/be/ephys/magicfeather/ModItems.java +++ b/src/main/java/be/ephys/magicfeather/ModItems.java @@ -1,25 +1,29 @@ package be.ephys.magicfeather; +import net.minecraft.core.Registry; +import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.InterModComms; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.event.lifecycle.FMLConstructModEvent; import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.RegistryObject; import top.theillusivec4.curios.api.SlotTypeMessage; import top.theillusivec4.curios.api.SlotTypePreset; @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = MagicFeatherMod.MODID) public class ModItems { - public static ItemMagicFeather magicFeather; + private static final DeferredRegister ITEM_DEFERRED_REGISTER = DeferredRegister.create(Registry.ITEM_REGISTRY, MagicFeatherMod.MODID); + public static final RegistryObject MAGIC_FEATHER = ITEM_DEFERRED_REGISTER.register("magicfeather", () -> new ItemMagicFeather(new Item.Properties().stacksTo(1).tab(CreativeModeTab.TAB_TRANSPORTATION))); @SubscribeEvent - public static void registerItems(RegistryEvent.Register event) { - magicFeather = new ItemMagicFeather(); - - event.getRegistry().register(magicFeather); - MinecraftForge.EVENT_BUS.addListener(ModItems.magicFeather::onPlayerTick); + public static void onConstructMod(final FMLConstructModEvent evt) { + ITEM_DEFERRED_REGISTER.register(FMLJavaModLoadingContext.get().getModEventBus()); + MinecraftForge.EVENT_BUS.addListener(ItemMagicFeather::onPlayerTick); } @SubscribeEvent diff --git a/src/main/java/be/ephys/magicfeather/mixin/BeaconBlockEntityAccessor.java b/src/main/java/be/ephys/magicfeather/mixin/BeaconBlockEntityAccessor.java new file mode 100644 index 0000000..a78990a --- /dev/null +++ b/src/main/java/be/ephys/magicfeather/mixin/BeaconBlockEntityAccessor.java @@ -0,0 +1,12 @@ +package be.ephys.magicfeather.mixin; + +import net.minecraft.world.level.block.entity.BeaconBlockEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(BeaconBlockEntity.class) +public interface BeaconBlockEntityAccessor { + + @Accessor + int getLevels(); +} diff --git a/src/main/java/be/ephys/magicfeather/mixin/LevelAccessor.java b/src/main/java/be/ephys/magicfeather/mixin/LevelAccessor.java new file mode 100644 index 0000000..3878f05 --- /dev/null +++ b/src/main/java/be/ephys/magicfeather/mixin/LevelAccessor.java @@ -0,0 +1,15 @@ +package be.ephys.magicfeather.mixin; + +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.TickingBlockEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import java.util.List; + +@Mixin(Level.class) +public interface LevelAccessor { + + @Accessor + List getBlockEntityTickers(); +} diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg deleted file mode 100644 index 710890b..0000000 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ /dev/null @@ -1,2 +0,0 @@ -public net.minecraft.world.level.block.entity.BeaconBlockEntity f_58650_ # levels -public net.minecraft.world.level.block.entity.BeaconBlockEntity f_58648_ # beamSections diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index a169748..57f0105 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[40,)" +loaderVersion="[41,)" license="MIT" issueTrackerURL="https://github.com/Ephys/minecraft-magic-feather/issues" @@ -21,30 +21,19 @@ to use alternative methods of travel when exploring. [[dependencies.magicfeather]] modId="forge" mandatory=true - versionRange="[40,)" + versionRange="[41,)" ordering="AFTER" side="BOTH" [[dependencies.magicfeather]] modId="minecraft" mandatory=true - versionRange="[1.18.2,1.19)" + versionRange="[1.19,1.19.2]" ordering="NONE" side="BOTH" -[[dependencies.magicfeather]] - modId="cookiecore" - mandatory=true - versionRange="[1.18.2-4.0.0,)" - ordering="AFTER" - side="BOTH" -[[dependencies.magicfeather]] - modId="alexsmobs" - mandatory=false - ordering="AFTER" - versionRange="[1.0.0,)" [[dependencies.magicfeather]] modId="curios" mandatory=false - versionRange="[1.18.2-5.0.7.1,)" + versionRange="*" ordering="AFTER" side="BOTH" diff --git a/src/main/resources/magicfeather.mixins.json b/src/main/resources/magicfeather.mixins.json new file mode 100644 index 0000000..15bf5a1 --- /dev/null +++ b/src/main/resources/magicfeather.mixins.json @@ -0,0 +1,16 @@ +{ + "required": true, + "minVersion": "0.8", + "compatibilityLevel": "JAVA_17", + "package": "be.ephys.magicfeather.mixin", + "refmap": "magicfeather.refmap.json", + "mixins": [ + "BeaconBlockEntityAccessor", + "LevelAccessor" + ], + "client": [ + ], + "injectors": { + "defaultRequire": 1 + } +} diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index c79a362..c2d5f11 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,6 @@ { "pack": { - "description": "examplemod resources", - "pack_format": 6, - "_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods." + "description": "Magic Feather Resources", + "pack_format": 9 } }