Skip to content

Commit

Permalink
move to Integration Pack
Browse files Browse the repository at this point in the history
  • Loading branch information
f-raZ0R committed Oct 6, 2024
1 parent eee01ac commit eb201ed
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import de.dafuqs.spectrum.registries.*;
import de.dafuqs.spectrum.registries.client.*;
import de.dafuqs.spectrum.blocks.*;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.block.*;
import net.minecraft.block.enums.*;
import net.minecraft.item.*;
Expand Down Expand Up @@ -36,10 +35,6 @@ public class AmaranthCropBlock extends TallCropBlock implements RevelationAware

public AmaranthCropBlock(Settings settings) {
super(settings, LAST_SINGLE_BLOCK_AGE);
if(FabricLoader.getInstance().isModLoaded("farmersdelight"))
{
this.lootTableId = SpectrumCommon.locate("blocks/amaranth_fd");
}
RevelationAware.register(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import de.dafuqs.spectrum.compat.alloy_forgery.*;
import de.dafuqs.spectrum.compat.botania.*;
import de.dafuqs.spectrum.compat.create.*;
import de.dafuqs.spectrum.compat.farmersdelight.FDCompat;
import de.dafuqs.spectrum.compat.gobber.*;
import de.dafuqs.spectrum.compat.modonomicon.*;
import de.dafuqs.spectrum.compat.neepmeat.NEEPMeatCompat;
Expand Down Expand Up @@ -39,7 +40,7 @@ protected static void registerIntegrationPack(String modId, Supplier<ModIntegrat
public static final String BOTANIA_ID = "botania";
public static final String MODONOMICON_ID = "modonomicon";
public static final String CREATE_ID = "create";

public static final String FARMERSDELIGHT_ID = "farmersdelight";
public static final String NEEPMEAT_ID = "neepmeat";

@SuppressWarnings("Convert2MethodRef")
Expand All @@ -51,6 +52,7 @@ public static void register() {
registerIntegrationPack(BOTANIA_ID, () -> new BotaniaCompat());
registerIntegrationPack(MODONOMICON_ID, () -> new ModonomiconCompat());
registerIntegrationPack(NEEPMEAT_ID, () -> new NEEPMeatCompat());
registerIntegrationPack(FARMERSDELIGHT_ID, () -> new FDCompat());
if (!FabricLoader.getInstance().isModLoaded("forgified-fabric-api")) {
registerIntegrationPack(CREATE_ID, () -> new CreateCompat());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package de.dafuqs.spectrum.compat.farmersdelight;

import de.dafuqs.spectrum.compat.SpectrumIntegrationPacks;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

public class FDCompat extends SpectrumIntegrationPacks.ModIntegrationPack{
public void register() {

}

@Environment(EnvType.CLIENT)
@Override
public void registerClient() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
import de.dafuqs.spectrum.*;
import de.dafuqs.spectrum.api.energy.color.*;
import de.dafuqs.spectrum.blocks.mob_head.*;
import de.dafuqs.spectrum.compat.SpectrumIntegrationPacks;
import de.dafuqs.spectrum.compat.farmersdelight.FDCompat;
import de.dafuqs.spectrum.compat.gofish.*;
import de.dafuqs.spectrum.entity.type_specific_predicates.*;
import de.dafuqs.spectrum.loot.conditions.*;
import de.dafuqs.spectrum.recipe.titration_barrel.FermentationData;
import de.dafuqs.spectrum.registries.*;
import net.fabricmc.fabric.api.loot.v2.*;
import net.minecraft.entity.passive.*;
Expand Down Expand Up @@ -206,6 +209,13 @@ else if (id.equals(new Identifier("gameplay/sniffer_digging"))) {
}
}
});
LootTableEvents.REPLACE.register((resourceManager, lootManager, id, original, source) -> {
if (SpectrumIntegrationPacks.isIntegrationPackActive(SpectrumIntegrationPacks.FARMERSDELIGHT_ID) && id.equals(SpectrumCommon.locate("blocks/amaranth")))
{
return lootManager.getLootTable(SpectrumCommon.locate("blocks/amaranth_fd"));
}
return original;
});
}

private static LootPool getLootPool(TreasureHunterDropDefinition treasureHunterDropDefinition) {
Expand Down

0 comments on commit eb201ed

Please sign in to comment.