Skip to content

Commit

Permalink
Shaderoot and Iceroot drop from carrots.
Browse files Browse the repository at this point in the history
  • Loading branch information
Waterpicker committed Dec 29, 2024
1 parent 10445d1 commit db126c9
Show file tree
Hide file tree
Showing 11 changed files with 301 additions and 87 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "generations_core:species_key",
"key": "cobblemon:spectrier"
},
{
"chance": 0.001,
"condition": "minecraft:random_chance"
},
{
"block": "minecraft:carrots",
"condition": "minecraft:block_state_property",
"properties": {
"age": "7"
}
}
],
"name": "generations_core:shaderoot_carrot"
},
{
"type": "minecraft:item",
"conditions": [
{
"condition": "generations_core:species_key",
"key": "cobblemon:glastrier"
},
{
"chance": 0.001,
"condition": "minecraft:random_chance"
},
{
"block": "minecraft:carrots",
"condition": "minecraft:block_state_property",
"properties": {
"age": "7"
}
}
],
"name": "generations_core:iceroot_carrot"
}
]
}
],
"rolls": 1.0
}
],
"random_sequence": "generations_core:blocks/calyrex_roots"
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,101 +56,101 @@
"generations_core:cursed_carved_pumpkin",
"generations_core:scarecrow",
"generations_core:box",
"generations_core:orange_couch_arm_left",
"generations_core:yellow_couch_arm_left",
"generations_core:white_couch_arm_left",
"generations_core:light_gray_couch_arm_left",
"generations_core:black_couch_arm_left",
"generations_core:light_blue_couch_arm_left",
"generations_core:blue_couch_arm_left",
"generations_core:yellow_couch_arm_left",
"generations_core:pink_couch_arm_left",
"generations_core:green_couch_arm_left",
"generations_core:light_gray_couch_arm_left",
"generations_core:white_couch_arm_left",
"generations_core:lime_couch_arm_left",
"generations_core:purple_couch_arm_left",
"generations_core:orange_couch_arm_left",
"generations_core:red_couch_arm_left",
"generations_core:black_couch_arm_left",
"generations_core:magenta_couch_arm_left",
"generations_core:cyan_couch_arm_left",
"generations_core:brown_couch_arm_left",
"generations_core:lime_couch_arm_left",
"generations_core:pink_couch_arm_left",
"generations_core:gray_couch_arm_left",
"generations_core:purple_couch_arm_left",
"generations_core:orange_couch_arm_right",
"generations_core:cyan_couch_arm_left",
"generations_core:magenta_couch_arm_left",
"generations_core:yellow_couch_arm_right",
"generations_core:white_couch_arm_right",
"generations_core:light_gray_couch_arm_right",
"generations_core:black_couch_arm_right",
"generations_core:light_blue_couch_arm_right",
"generations_core:blue_couch_arm_right",
"generations_core:yellow_couch_arm_right",
"generations_core:pink_couch_arm_right",
"generations_core:green_couch_arm_right",
"generations_core:light_gray_couch_arm_right",
"generations_core:white_couch_arm_right",
"generations_core:lime_couch_arm_right",
"generations_core:purple_couch_arm_right",
"generations_core:orange_couch_arm_right",
"generations_core:red_couch_arm_right",
"generations_core:black_couch_arm_right",
"generations_core:magenta_couch_arm_right",
"generations_core:cyan_couch_arm_right",
"generations_core:brown_couch_arm_right",
"generations_core:lime_couch_arm_right",
"generations_core:pink_couch_arm_right",
"generations_core:gray_couch_arm_right",
"generations_core:purple_couch_arm_right",
"generations_core:orange_couch_corner_left",
"generations_core:cyan_couch_arm_right",
"generations_core:magenta_couch_arm_right",
"generations_core:yellow_couch_corner_left",
"generations_core:white_couch_corner_left",
"generations_core:light_gray_couch_corner_left",
"generations_core:black_couch_corner_left",
"generations_core:light_blue_couch_corner_left",
"generations_core:blue_couch_corner_left",
"generations_core:yellow_couch_corner_left",
"generations_core:pink_couch_corner_left",
"generations_core:green_couch_corner_left",
"generations_core:light_gray_couch_corner_left",
"generations_core:white_couch_corner_left",
"generations_core:lime_couch_corner_left",
"generations_core:purple_couch_corner_left",
"generations_core:orange_couch_corner_left",
"generations_core:red_couch_corner_left",
"generations_core:black_couch_corner_left",
"generations_core:magenta_couch_corner_left",
"generations_core:cyan_couch_corner_left",
"generations_core:brown_couch_corner_left",
"generations_core:lime_couch_corner_left",
"generations_core:pink_couch_corner_left",
"generations_core:gray_couch_corner_left",
"generations_core:purple_couch_corner_left",
"generations_core:orange_couch_corner_right",
"generations_core:cyan_couch_corner_left",
"generations_core:magenta_couch_corner_left",
"generations_core:yellow_couch_corner_right",
"generations_core:white_couch_corner_right",
"generations_core:light_gray_couch_corner_right",
"generations_core:black_couch_corner_right",
"generations_core:light_blue_couch_corner_right",
"generations_core:blue_couch_corner_right",
"generations_core:yellow_couch_corner_right",
"generations_core:pink_couch_corner_right",
"generations_core:green_couch_corner_right",
"generations_core:light_gray_couch_corner_right",
"generations_core:white_couch_corner_right",
"generations_core:lime_couch_corner_right",
"generations_core:purple_couch_corner_right",
"generations_core:orange_couch_corner_right",
"generations_core:red_couch_corner_right",
"generations_core:black_couch_corner_right",
"generations_core:magenta_couch_corner_right",
"generations_core:cyan_couch_corner_right",
"generations_core:brown_couch_corner_right",
"generations_core:lime_couch_corner_right",
"generations_core:pink_couch_corner_right",
"generations_core:gray_couch_corner_right",
"generations_core:purple_couch_corner_right",
"generations_core:orange_couch_middle",
"generations_core:cyan_couch_corner_right",
"generations_core:magenta_couch_corner_right",
"generations_core:yellow_couch_middle",
"generations_core:white_couch_middle",
"generations_core:light_gray_couch_middle",
"generations_core:black_couch_middle",
"generations_core:light_blue_couch_middle",
"generations_core:blue_couch_middle",
"generations_core:yellow_couch_middle",
"generations_core:pink_couch_middle",
"generations_core:green_couch_middle",
"generations_core:light_gray_couch_middle",
"generations_core:white_couch_middle",
"generations_core:lime_couch_middle",
"generations_core:purple_couch_middle",
"generations_core:orange_couch_middle",
"generations_core:red_couch_middle",
"generations_core:black_couch_middle",
"generations_core:magenta_couch_middle",
"generations_core:cyan_couch_middle",
"generations_core:brown_couch_middle",
"generations_core:lime_couch_middle",
"generations_core:pink_couch_middle",
"generations_core:gray_couch_middle",
"generations_core:purple_couch_middle",
"generations_core:orange_couch_ottoman",
"generations_core:cyan_couch_middle",
"generations_core:magenta_couch_middle",
"generations_core:yellow_couch_ottoman",
"generations_core:white_couch_ottoman",
"generations_core:light_gray_couch_ottoman",
"generations_core:black_couch_ottoman",
"generations_core:light_blue_couch_ottoman",
"generations_core:blue_couch_ottoman",
"generations_core:yellow_couch_ottoman",
"generations_core:pink_couch_ottoman",
"generations_core:green_couch_ottoman",
"generations_core:light_gray_couch_ottoman",
"generations_core:white_couch_ottoman",
"generations_core:lime_couch_ottoman",
"generations_core:purple_couch_ottoman",
"generations_core:orange_couch_ottoman",
"generations_core:red_couch_ottoman",
"generations_core:black_couch_ottoman",
"generations_core:magenta_couch_ottoman",
"generations_core:cyan_couch_ottoman",
"generations_core:brown_couch_ottoman",
"generations_core:lime_couch_ottoman",
"generations_core:pink_couch_ottoman",
"generations_core:gray_couch_ottoman",
"generations_core:purple_couch_ottoman"
"generations_core:cyan_couch_ottoman",
"generations_core:magenta_couch_ottoman"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -802,38 +802,38 @@
"generations_core:pink_elevator",
"generations_core:desk",
"generations_core:fridge",
"generations_core:orange_street_lamp",
"generations_core:yellow_street_lamp",
"generations_core:white_street_lamp",
"generations_core:light_gray_street_lamp",
"generations_core:black_street_lamp",
"generations_core:light_blue_street_lamp",
"generations_core:blue_street_lamp",
"generations_core:yellow_street_lamp",
"generations_core:pink_street_lamp",
"generations_core:green_street_lamp",
"generations_core:light_gray_street_lamp",
"generations_core:white_street_lamp",
"generations_core:lime_street_lamp",
"generations_core:purple_street_lamp",
"generations_core:orange_street_lamp",
"generations_core:red_street_lamp",
"generations_core:black_street_lamp",
"generations_core:magenta_street_lamp",
"generations_core:cyan_street_lamp",
"generations_core:brown_street_lamp",
"generations_core:lime_street_lamp",
"generations_core:pink_street_lamp",
"generations_core:gray_street_lamp",
"generations_core:purple_street_lamp",
"generations_core:orange_pc",
"generations_core:cyan_street_lamp",
"generations_core:magenta_street_lamp",
"generations_core:yellow_pc",
"generations_core:white_pc",
"generations_core:light_gray_pc",
"generations_core:black_pc",
"generations_core:light_blue_pc",
"generations_core:blue_pc",
"generations_core:yellow_pc",
"generations_core:pink_pc",
"generations_core:green_pc",
"generations_core:light_gray_pc",
"generations_core:white_pc",
"generations_core:lime_pc",
"generations_core:purple_pc",
"generations_core:orange_pc",
"generations_core:red_pc",
"generations_core:black_pc",
"generations_core:magenta_pc",
"generations_core:cyan_pc",
"generations_core:brown_pc",
"generations_core:lime_pc",
"generations_core:pink_pc",
"generations_core:gray_pc",
"generations_core:purple_pc",
"generations_core:cyan_pc",
"generations_core:magenta_pc",
"generations_core:empty_ball_display",
"generations_core:poke_ball_display",
"generations_core:great_ball_display",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import generations.gg.generations.core.generationscore.common.client.render.rarecandy.ModelRegistry;
import generations.gg.generations.core.generationscore.common.config.Config;
import generations.gg.generations.core.generationscore.common.config.ConfigLoader;
import generations.gg.generations.core.generationscore.common.config.LegendKeys;
import generations.gg.generations.core.generationscore.common.recipe.GenerationsIngredidents;
import generations.gg.generations.core.generationscore.common.world.container.GenerationsContainers;
import generations.gg.generations.core.generationscore.common.world.entity.GenerationsEntities;
Expand All @@ -34,7 +35,9 @@
import generations.gg.generations.core.generationscore.common.world.item.legends.EnchantableItem;
import generations.gg.generations.core.generationscore.common.world.level.block.*;
import generations.gg.generations.core.generationscore.common.world.level.block.entities.GenerationsBlockEntities;
import generations.gg.generations.core.generationscore.common.world.loot.LootItemConditionTypes;
import generations.gg.generations.core.generationscore.common.world.loot.LootPoolEntryTypes;
import generations.gg.generations.core.generationscore.common.world.loot.SpeciesKeyCondition;
import generations.gg.generations.core.generationscore.common.world.recipe.*;
import generations.gg.generations.core.generationscore.common.world.sound.GenerationsSounds;
import generations.gg.generations.core.generationscore.common.world.spawning.ZygardeCellDetail;
Expand All @@ -44,10 +47,19 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.packs.PackType;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.storage.loot.*;
import net.minecraft.world.level.storage.loot.entries.AlternativesEntry;
import net.minecraft.world.level.storage.loot.entries.LootItem;
import net.minecraft.world.level.storage.loot.entries.LootTableReference;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType;
import net.minecraft.world.level.storage.loot.predicates.LootItemEntityPropertyCondition;
import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition;
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
import org.apache.logging.log4j.util.TriConsumer;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
Expand Down Expand Up @@ -89,7 +101,9 @@ public static void init(GenerationsImplementation implementation) {
if(id.getNamespace().equals("minecraft") && id.getPath().contains("chests") && !id.getPath().contains("inject")) {
var inject = new ResourceLocation(id.getNamespace(), id.getPath().replace("chests", "chests/inject"));
context.addPool(LootPool.lootPool().add(LootTableReference.lootTableReference(inject)));
}
} else if(id.toString().equals("minecraft:blocks/carrots")) {
context.addPool(LootPool.lootPool().add(LootTableReference.lootTableReference(GenerationsCore.id("blocks/calyrex_roots"))));
}
});

SpawnDetail.Companion.registerSpawnType(ZygardeCellDetail.TYPE, ZygardeCellDetail.class);
Expand All @@ -102,6 +116,7 @@ public static void init(GenerationsImplementation implementation) {
GenerationsOres.init();
GenerationsDecorationBlocks.init();
LootPoolEntryTypes.init();
LootItemConditionTypes.init();
GenerationsUtilityBlocks.init();
GenerationsShrines.init();
GenerationsItems.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ public static class Caught {
.setCount(TAPU_LELE, 1)
.setCount(TAPU_BULU, 1)
.setCount(TAPU_FINI, 1)

.setCount(GLASTRIER, 1)
.setCount(SPECTRIER, 1)
.build();

public boolean capped(Player player, SpeciesKey speciesKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.cobblemon.mod.common.pokemon.Species;
import generations.gg.generations.core.generationscore.common.GenerationsCore;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition;
import org.jetbrains.annotations.NotNull;

import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package generations.gg.generations.core.generationscore.common.world.loot;

import dev.architectury.registry.registries.DeferredRegister;
import dev.architectury.registry.registries.RegistrySupplier;
import generations.gg.generations.core.generationscore.common.GenerationsCore;
import generations.gg.generations.core.generationscore.common.config.SpeciesKey;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.level.storage.loot.Serializer;
import net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer;
import net.minecraft.world.level.storage.loot.entries.LootPoolEntryType;
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition;
import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType;

import java.util.function.Supplier;

public class LootItemConditionTypes {
public static final DeferredRegister<LootItemConditionType> REGISTER = DeferredRegister.create(GenerationsCore.MOD_ID, Registries.LOOT_CONDITION_TYPE);

public static <T extends LootItemCondition> RegistrySupplier<LootItemConditionType> register(String name, Supplier<Serializer<T>> supplier) {
return REGISTER.register(name, () -> new LootItemConditionType(supplier.get()));
}

public static final RegistrySupplier<LootItemConditionType> SPECIES_KEY = register("species_key", SpeciesKeyCondition.Serializer::new);

public static void init() {
REGISTER.register();
}

}
Loading

0 comments on commit db126c9

Please sign in to comment.