diff --git a/build.gradle b/build.gradle index 2681820a23..4cfc94a50b 100644 --- a/build.gradle +++ b/build.gradle @@ -118,17 +118,17 @@ dependencies { compileOnly "dev.emi:emi-neoforge:${project.emi_version}+${project.minecraft_version}" // theillusivec4 - //implementation "top.theillusivec4.curios:curios-neoforge:${project.curios_version}+${project.minecraft_version}" + implementation "top.theillusivec4.curios:curios-neoforge:${project.curios_version}+${project.minecraft_version}" //curse maven compileOnly "curse.maven:jade-324717:4980188" - //runtimeOnly fg.deobf("curse.maven:jeed-532286:4599236") - //runtimeOnly fg.deobf("curse.maven:museum-curator-859070:4629894") + //runtimeOnly "curse.maven:jeed-532286:4599236" + //runtimeOnly "curse.maven:museum-curator-859070:4629894" - //compileOnly fg.deobf("curse.maven:the-one-probe-245211:4629624") + compileOnly"curse.maven:the-one-probe-245211:5084077" //mods we dont have compat with but are nice to have - //runtimeOnly fg.deobf("team-twilight:crossdimcommands:${project.base_minecraft_version}-1.0") + //runtimeOnly "team-twilight:crossdimcommands:${project.base_minecraft_version}-1.0" //minecraft implementation "net.neoforged:neoforge:${project.neo_version}" diff --git a/gradle.properties b/gradle.properties index 6d70855d60..5736393d60 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,4 +19,4 @@ neo_version=20.4.150-beta jei_version=17.3.0.43 rei_version=14.0.688 emi_version=1.1.0 -curios_version=7.0.0-beta.2 \ No newline at end of file +curios_version=7.3.0 \ No newline at end of file diff --git a/src/main/java/twilightforest/TwilightForestMod.java b/src/main/java/twilightforest/TwilightForestMod.java index ce68f94771..01f8de1ade 100644 --- a/src/main/java/twilightforest/TwilightForestMod.java +++ b/src/main/java/twilightforest/TwilightForestMod.java @@ -36,6 +36,7 @@ import org.apache.logging.log4j.Logger; import twilightforest.client.TFClientSetup; import twilightforest.command.TFCommand; +import twilightforest.compat.curios.CuriosCompat; import twilightforest.data.custom.stalactites.entry.Stalactite; import twilightforest.dispenser.TFDispenserBehaviors; import twilightforest.entity.MagicPaintingVariant; @@ -141,11 +142,11 @@ public TwilightForestMod(IEventBus bus, Dist dist) { bus.addListener(this::createNewRegistries); bus.addListener(this::setRegistriesForDatapack); - if (ModList.get().isLoaded("curios")) { //FIXME: When curios gets updated, uncomment this - /*NeoForge.EVENT_BUS.addListener(CuriosCompat::keepCurios); + if (ModList.get().isLoaded("curios")) { + NeoForge.EVENT_BUS.addListener(CuriosCompat::keepCurios); bus.addListener(CuriosCompat::registerCuriosCapabilities); bus.addListener(CuriosCompat::registerCurioRenderers); - bus.addListener(CuriosCompat::registerCurioLayers);*/ + bus.addListener(CuriosCompat::registerCurioLayers); } BiomeGrassColors.init(); diff --git a/src/main/java/twilightforest/client/MovingCicadaSoundInstance.java b/src/main/java/twilightforest/client/MovingCicadaSoundInstance.java index 63a609ba37..74789be1b8 100644 --- a/src/main/java/twilightforest/client/MovingCicadaSoundInstance.java +++ b/src/main/java/twilightforest/client/MovingCicadaSoundInstance.java @@ -7,6 +7,7 @@ import net.minecraft.world.entity.LivingEntity; import net.neoforged.fml.ModList; import twilightforest.TFConfig; +import twilightforest.compat.curios.CuriosCompat; import twilightforest.init.TFBlocks; import twilightforest.init.TFSounds; @@ -36,8 +37,8 @@ public void tick() { } private boolean isWearingCicadaCurio() { - if (ModList.get().isLoaded("curios")) { //FIXME: When curios gets updated, uncomment this - //return CuriosCompat.isCurioEquipped(this.wearer, stack -> stack.is(TFBlocks.CICADA.asItem())); + if (ModList.get().isLoaded("curios")) { + return CuriosCompat.isCurioEquipped(this.wearer, stack -> stack.is(TFBlocks.CICADA.asItem())); } return false; } diff --git a/src/main/java/twilightforest/client/TFClientEvents.java b/src/main/java/twilightforest/client/TFClientEvents.java index fdce471e58..9e1b023db9 100644 --- a/src/main/java/twilightforest/client/TFClientEvents.java +++ b/src/main/java/twilightforest/client/TFClientEvents.java @@ -60,6 +60,7 @@ import twilightforest.client.renderer.TFSkyRenderer; import twilightforest.client.renderer.TFWeatherRenderer; import twilightforest.client.renderer.entity.ShieldLayer; +import twilightforest.compat.curios.CuriosCompat; import twilightforest.data.tags.ItemTagGenerator; import twilightforest.events.HostileMountEvents; import twilightforest.init.TFItems; @@ -327,8 +328,8 @@ public static void unrenderHeadWithTrophies(RenderLivingEvent.Pre event) { } private static boolean areCuriosEquipped(LivingEntity entity) { - if (ModList.get().isLoaded("curios")) { //FIXME: When curios gets updated, uncomment this - //return CuriosCompat.isCurioEquippedAndVisible(entity, stack -> stack.getItem() instanceof TrophyItem) || CuriosCompat.isCurioEquippedAndVisible(entity, stack -> stack.getItem() instanceof SkullCandleItem); + if (ModList.get().isLoaded("curios")) { + return CuriosCompat.isCurioEquippedAndVisible(entity, stack -> stack.getItem() instanceof TrophyItem) || CuriosCompat.isCurioEquippedAndVisible(entity, stack -> stack.getItem() instanceof SkullCandleItem); } return false; } diff --git a/src/main/disabled/compat/curios/CuriosCompat.java b/src/main/java/twilightforest/compat/curios/CuriosCompat.java similarity index 92% rename from src/main/disabled/compat/curios/CuriosCompat.java rename to src/main/java/twilightforest/compat/curios/CuriosCompat.java index 7a9afe97f0..4a8c55b292 100644 --- a/src/main/disabled/compat/curios/CuriosCompat.java +++ b/src/main/java/twilightforest/compat/curios/CuriosCompat.java @@ -49,10 +49,10 @@ public SoundInfo getEquipSound(SlotContext slotContext) { @Override public void onEquip(SlotContext context, ItemStack prevStack) { - //check that we dont have a cicada already on our head before trying to start the sound + //check that we don't have a cicada already on our head before trying to start the sound if (!context.entity().getItemBySlot(EquipmentSlot.HEAD).is(TFBlocks.CICADA.get().asItem())) { if (stack.is(TFBlocks.CICADA.get().asItem()) && !context.entity().level().isClientSide()) { - TFPacketHandler.CHANNEL.send(PacketDistributor.TRACKING_ENTITY_AND_SELF.with(context::entity), new CreateMovingCicadaSoundPacket(context.entity().getId())); + PacketDistributor.TRACKING_ENTITY_AND_SELF.with(context.entity()).send(new CreateMovingCicadaSoundPacket(context.entity().getId())); } } } @@ -74,7 +74,7 @@ public boolean canEquipFromUse(SlotContext slotContext) { public static void keepCurios(DropRulesEvent event) { if (event.getEntity() instanceof Player player) { CompoundTag playerData = CharmEvents.getPlayerData(player); - if (!player.level().isClientSide() && CharmEvents.charmUsed != null && playerData.contains(CharmEvents.CHARM_INV_TAG) && !playerData.getList(CharmEvents.CHARM_INV_TAG, 10).isEmpty()) { + if (!player.level().isClientSide() && playerData.contains(CharmEvents.CONSUMED_CHARM_TAG) && playerData.contains(CharmEvents.CHARM_INV_TAG) && !playerData.getList(CharmEvents.CHARM_INV_TAG, 10).isEmpty()) { //Keep all Curios items CuriosApi.getCuriosInventory(player).ifPresent(modifiable -> { for (int i = 0; i < modifiable.getSlots(); ++i) { @@ -133,6 +133,7 @@ public static boolean isCurioEquippedAndVisible(LivingEntity entity, Predicate slot = CuriosApi.getCuriosInventory(player).flatMap(handler -> handler.findFirstCurio(item)); if (slot.isPresent()) { + CharmEvents.getPlayerData(player).put(CharmEvents.CONSUMED_CHARM_TAG, slot.get().stack().save(new CompoundTag())); slot.get().stack().shrink(1); return true; } diff --git a/src/main/disabled/compat/curios/model/CharmOfLifeNecklaceModel.java b/src/main/java/twilightforest/compat/curios/model/CharmOfLifeNecklaceModel.java similarity index 100% rename from src/main/disabled/compat/curios/model/CharmOfLifeNecklaceModel.java rename to src/main/java/twilightforest/compat/curios/model/CharmOfLifeNecklaceModel.java diff --git a/src/main/disabled/compat/curios/model/package-info.java b/src/main/java/twilightforest/compat/curios/model/package-info.java similarity index 100% rename from src/main/disabled/compat/curios/model/package-info.java rename to src/main/java/twilightforest/compat/curios/model/package-info.java diff --git a/src/main/disabled/compat/curios/package-info.java b/src/main/java/twilightforest/compat/curios/package-info.java similarity index 100% rename from src/main/disabled/compat/curios/package-info.java rename to src/main/java/twilightforest/compat/curios/package-info.java diff --git a/src/main/disabled/compat/curios/renderer/CharmOfKeepingRenderer.java b/src/main/java/twilightforest/compat/curios/renderer/CharmOfKeepingRenderer.java similarity index 100% rename from src/main/disabled/compat/curios/renderer/CharmOfKeepingRenderer.java rename to src/main/java/twilightforest/compat/curios/renderer/CharmOfKeepingRenderer.java diff --git a/src/main/disabled/compat/curios/renderer/CharmOfLifeNecklaceRenderer.java b/src/main/java/twilightforest/compat/curios/renderer/CharmOfLifeNecklaceRenderer.java similarity index 100% rename from src/main/disabled/compat/curios/renderer/CharmOfLifeNecklaceRenderer.java rename to src/main/java/twilightforest/compat/curios/renderer/CharmOfLifeNecklaceRenderer.java diff --git a/src/main/disabled/compat/curios/renderer/CurioHeadRenderer.java b/src/main/java/twilightforest/compat/curios/renderer/CurioHeadRenderer.java similarity index 100% rename from src/main/disabled/compat/curios/renderer/CurioHeadRenderer.java rename to src/main/java/twilightforest/compat/curios/renderer/CurioHeadRenderer.java diff --git a/src/main/disabled/compat/curios/renderer/package-info.java b/src/main/java/twilightforest/compat/curios/renderer/package-info.java similarity index 100% rename from src/main/disabled/compat/curios/renderer/package-info.java rename to src/main/java/twilightforest/compat/curios/renderer/package-info.java diff --git a/src/main/disabled/compat/jade/JadeCompat.java b/src/main/java/twilightforest/compat/jade/JadeCompat.java similarity index 100% rename from src/main/disabled/compat/jade/JadeCompat.java rename to src/main/java/twilightforest/compat/jade/JadeCompat.java diff --git a/src/main/disabled/compat/jade/QuestRamWoolProvider.java b/src/main/java/twilightforest/compat/jade/QuestRamWoolProvider.java similarity index 100% rename from src/main/disabled/compat/jade/QuestRamWoolProvider.java rename to src/main/java/twilightforest/compat/jade/QuestRamWoolProvider.java diff --git a/src/main/disabled/compat/jade/package-info.java b/src/main/java/twilightforest/compat/jade/package-info.java similarity index 100% rename from src/main/disabled/compat/jade/package-info.java rename to src/main/java/twilightforest/compat/jade/package-info.java diff --git a/src/main/disabled/compat/top/QuestRamWoolElement.java b/src/main/java/twilightforest/compat/top/QuestRamWoolElement.java similarity index 100% rename from src/main/disabled/compat/top/QuestRamWoolElement.java rename to src/main/java/twilightforest/compat/top/QuestRamWoolElement.java diff --git a/src/main/disabled/compat/top/TOPQuestRamWoolProvider.java b/src/main/java/twilightforest/compat/top/TOPQuestRamWoolProvider.java similarity index 100% rename from src/main/disabled/compat/top/TOPQuestRamWoolProvider.java rename to src/main/java/twilightforest/compat/top/TOPQuestRamWoolProvider.java diff --git a/src/main/disabled/compat/top/TopCompat.java b/src/main/java/twilightforest/compat/top/TopCompat.java similarity index 100% rename from src/main/disabled/compat/top/TopCompat.java rename to src/main/java/twilightforest/compat/top/TopCompat.java diff --git a/src/main/java/twilightforest/events/CharmEvents.java b/src/main/java/twilightforest/events/CharmEvents.java index ddef7494ba..bc3a9c5aab 100644 --- a/src/main/java/twilightforest/events/CharmEvents.java +++ b/src/main/java/twilightforest/events/CharmEvents.java @@ -32,6 +32,7 @@ import twilightforest.TwilightForestMod; import twilightforest.block.KeepsakeCasketBlock; import twilightforest.block.entity.KeepsakeCasketBlockEntity; +import twilightforest.compat.curios.CuriosCompat; import twilightforest.data.tags.ItemTagGenerator; import twilightforest.entity.CharmEffect; import twilightforest.enums.BlockLoggingEnum; @@ -305,8 +306,8 @@ private static void keepWholeList(NonNullList transferTo, NonNullList } private static boolean hasCharmCurio(Item item, Player player) { - if (ModList.get().isLoaded("curios")) { //FIXME: When curios gets updated, uncomment this - //return CuriosCompat.findAndConsumeCurio(item, player); + if (ModList.get().isLoaded("curios")) { + return CuriosCompat.findAndConsumeCurio(item, player); } return false; diff --git a/src/main/java/twilightforest/events/MiscEvents.java b/src/main/java/twilightforest/events/MiscEvents.java index a69e1dd5fb..a48dc8a308 100644 --- a/src/main/java/twilightforest/events/MiscEvents.java +++ b/src/main/java/twilightforest/events/MiscEvents.java @@ -24,6 +24,7 @@ import net.neoforged.neoforge.network.PacketDistributor; import twilightforest.TwilightForestMod; import twilightforest.block.TomeSpawnerBlock; +import twilightforest.compat.curios.CuriosCompat; import twilightforest.entity.monster.DeathTome; import twilightforest.entity.passive.Bighorn; import twilightforest.entity.passive.DwarfRabbit; @@ -63,12 +64,12 @@ public static void addPrey(EntityJoinLevelEvent event) { public static void armorChanged(LivingEquipmentChangeEvent event) { LivingEntity living = event.getEntity(); - // from what I can see, vanilla doesnt have a hook for this in the item class. So this will have to do. + // from what I can see, vanilla doesn't have a hook for this in the item class. So this will have to do. // we only have to check equipping, when its unequipped the sound instance handles the rest - //if we have a cicada in our curios slot, dont try to run this - if (ModList.get().isLoaded("curios")) { //FIXME: When curios gets updated, uncomment this - //if (CuriosCompat.isCurioEquipped(living, stack -> stack.is(TFBlocks.CICADA.asItem()))) return; + //if we have a cicada in our curios slot, don't try to run this + if (ModList.get().isLoaded("curios")) { + if (CuriosCompat.isCurioEquipped(living, stack -> stack.is(TFBlocks.CICADA.asItem()))) return; } if (living != null && !living.level().isClientSide() && event.getSlot() == EquipmentSlot.HEAD && event.getTo().is(TFBlocks.CICADA.asItem())) {