Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loonium with data-driven structure loot #4639

Open
wants to merge 21 commits into
base: 1.20.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c3969ac
Add structure detection to Loonium
TheRealWormbo May 7, 2024
d3b2ab5
Datagen for Loonium loot tables
TheRealWormbo May 8, 2024
7cd3bfa
Remove igloo bottom from loot structures
TheRealWormbo May 8, 2024
5d5e216
Adjust loot table definitions
TheRealWormbo May 8, 2024
420f919
Update lexicon description of Loonium
TheRealWormbo May 8, 2024
2807ba6
Expand wand HUD to indicate Loonium structure detection
TheRealWormbo May 9, 2024
37d1686
Datagen for structure-specific Loonium configurations
TheRealWormbo May 9, 2024
39db350
Datagen for and loading of structure-specific Loonium configurations
TheRealWormbo May 10, 2024
3086c97
Loonium uses structure configs and loot
TheRealWormbo May 10, 2024
40c8422
Remove unintended non-Loonium drops from additional mobs
TheRealWormbo May 12, 2024
1f52560
Limit number of spawned mobs around Loonium
TheRealWormbo May 12, 2024
1f2ec79
Loonium-spawned mobs have no instant despawn range
TheRealWormbo May 12, 2024
5d4214d
Fix structure configuration lookup
TheRealWormbo May 13, 2024
18658f4
Apply bonuses to additionally spawned Loonium mobs
TheRealWormbo May 17, 2024
6903b3d
General Loonium structure config cleanup
TheRealWormbo May 18, 2024
0ec339e
Add equipment table support to Loonium
TheRealWormbo May 20, 2024
afca0bf
Fix spawned mobs suffocating and add spawn effect to flower
TheRealWormbo May 24, 2024
20814da
Actually consume the configured amount of mana
TheRealWormbo May 24, 2024
e9df32d
Loonium mobs are on a team and grant an advancement
TheRealWormbo May 30, 2024
1c516fd
Hint at Loonium item exclusion list in lexicon description
TheRealWormbo Jun 17, 2024
39cc716
Code style improvements and review findings
TheRealWormbo Aug 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
import vazkii.botania.common.brew.BotaniaBrews;
import vazkii.botania.common.brew.BotaniaMobEffects;
import vazkii.botania.common.command.SkyblockCommand;
import vazkii.botania.common.config.ConfigDataManager;
import vazkii.botania.common.crafting.BotaniaRecipeTypes;
import vazkii.botania.common.entity.BotaniaEntities;
import vazkii.botania.common.entity.GaiaGuardianEntity;
Expand Down Expand Up @@ -138,6 +139,7 @@ public void onInitialize() {
PatchouliAPI.get().registerMultiblock(prefix("gaia_ritual"), GaiaGuardianEntity.ARENA_MULTIBLOCK.get());

OrechidManager.registerListener();
ConfigDataManager.registerListener();
CraftyCrateBlockEntity.registerListener();
CorporeaNodeDetectors.register(new FabricTransferCorporeaNodeDetector());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ private static void configureFabricDatagen(FabricDataGenerator.Pack pack) {

private static void configureXplatDatagen(FabricDataGenerator.Pack pack) {
pack.addProvider((PackOutput output) -> new BlockLootProvider(output));
pack.addProvider((PackOutput output) -> new LooniumStructureLootProvider(output));
pack.addProvider((PackOutput output) -> new LooniumStructureConfigurationProvider(output));
BlockTagProvider blockTagProvider = pack.addProvider(BlockTagProvider::new);
pack.addProvider((output, registriesFuture) -> new ItemTagProvider(output, registriesFuture, blockTagProvider.contentsGetter()));
pack.addProvider(EntityTagProvider::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
import dev.onyxstudios.cca.api.v3.entity.EntityComponentInitializer;
import dev.onyxstudios.cca.api.v3.entity.RespawnCopyStrategy;

import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.item.PrimedTnt;
import net.minecraft.world.entity.monster.*;
import net.minecraft.world.entity.vehicle.AbstractMinecart;

import vazkii.botania.common.block.flower.functional.LooniumBlockEntity;
import vazkii.botania.common.internal_caps.*;

import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;
Expand All @@ -36,10 +36,7 @@ public class CCAInternalEntityComponents implements EntityComponentInitializer {

@Override
public void registerEntityComponentFactories(EntityComponentFactoryRegistry registry) {
for (Class<? extends Monster> clz : LooniumBlockEntity.VALID_MOBS) {
registry.registerFor(clz, LOONIUM_DROP, e -> new CCALooniumComponent());
}

registry.registerFor(Mob.class, LOONIUM_DROP, e -> new CCALooniumComponent());
registry.registerFor(PrimedTnt.class, TNT_ETHICAL, CCAEthicalComponent::new);
registry.registerFor(Slime.class, NARSLIMMUS, e -> new CCANarslimmusComponent());
registry.registerFor(ItemEntity.class, INTERNAL_ITEM, e -> new CCAItemFlagsComponent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ private void dropEnd(DamageSource source, CallbackInfo ci) {
private void dropLoonium(DamageSource source, boolean causedByPlayer, CallbackInfo ci) {
var self = (LivingEntity) (Object) this;
LooniumBlockEntity.dropLooniumItems(self, stack -> {
self.spawnAtLocation(stack);
if (!stack.isEmpty()) {
self.spawnAtLocation(stack);
}
ci.cancel();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
import vazkii.botania.common.brew.BotaniaMobEffects;
import vazkii.botania.common.brew.effect.SoulCrossMobEffect;
import vazkii.botania.common.command.SkyblockCommand;
import vazkii.botania.common.config.ConfigDataManager;
import vazkii.botania.common.crafting.BotaniaRecipeTypes;
import vazkii.botania.common.entity.BotaniaEntities;
import vazkii.botania.common.entity.GaiaGuardianEntity;
Expand Down Expand Up @@ -166,6 +167,7 @@ public void commonSetup(FMLCommonSetupEvent evt) {
PatchouliAPI.get().registerMultiblock(prefix("gaia_ritual"), GaiaGuardianEntity.ARENA_MULTIBLOCK.get());

OrechidManager.registerListener();
ConfigDataManager.registerListener();
CraftyCrateBlockEntity.registerListener();
CorporeaNodeDetectors.register(new ForgeCapCorporeaNodeDetector());
if (ModList.get().isLoaded("inventorysorter")) {
Expand Down Expand Up @@ -393,9 +395,11 @@ private void registerEvents() {
});
LooniumBlockEntity.dropLooniumItems(living, stack -> {
e.getDrops().clear();
var ent = new ItemEntity(living.level(), living.getX(), living.getY(), living.getZ(), stack);
ent.setDefaultPickUpDelay();
e.getDrops().add(ent);
if (!stack.isEmpty()) {
var ent = new ItemEntity(living.level(), living.getX(), living.getY(), living.getZ(), stack);
ent.setDefaultPickUpDelay();
e.getDrops().add(ent);
}
});
});
bus.addListener((LivingDeathEvent e) -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package vazkii.botania.forge.internal_caps;

import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.item.PrimedTnt;
import net.minecraft.world.entity.monster.Creeper;
Expand All @@ -12,7 +13,6 @@
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

import vazkii.botania.common.block.flower.functional.LooniumBlockEntity;
import vazkii.botania.common.internal_caps.*;
import vazkii.botania.common.lib.LibMisc;
import vazkii.botania.forge.CapabilityUtil;
Expand Down Expand Up @@ -60,11 +60,8 @@ public static void attachCapabilities(AttachCapabilitiesEvent<Entity> evt) {
if (entity instanceof Player) {
evt.addCapability(prefix("kept_items"), CapabilityUtil.makeSavedProvider(KEPT_ITEMS, new KeptItemsComponent()));
}
for (Class<?> clz : LooniumBlockEntity.VALID_MOBS) {
if (clz.isInstance(entity)) {
evt.addCapability(prefix("loonium_drop"), CapabilityUtil.makeSavedProvider(LOONIUM_DROP, new LooniumComponent()));
break;
}
if (entity instanceof Mob) {
evt.addCapability(prefix("loonium_drop"), CapabilityUtil.makeSavedProvider(LOONIUM_DROP, new LooniumComponent()));
}
if (entity instanceof Slime) {
evt.addCapability(prefix("narslimmus"), CapabilityUtil.makeSavedProvider(NARSLIMMUS, new NarslimmusComponent()));
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading