-
-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix raider camp terrain adaption (#10605)
Fix raider camp terrain adaption Changed crop dropchance slightly, introduced boni for using better hoes Fix sorting
- Loading branch information
1 parent
4b442e0
commit 2d685a3
Showing
10 changed files
with
105 additions
and
73 deletions.
There are no files selected for viewing
118 changes: 61 additions & 57 deletions
118
src/main/java/com/minecolonies/api/loot/ModLootConditions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,61 @@ | ||
package com.minecolonies.api.loot; | ||
|
||
import com.minecolonies.api.util.constant.Constants; | ||
import net.minecraft.advancements.critereon.EnchantmentPredicate; | ||
import net.minecraft.advancements.critereon.ItemPredicate; | ||
import net.minecraft.advancements.critereon.MinMaxBounds; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.tags.ItemTags; | ||
import net.minecraft.world.item.Items; | ||
import net.minecraft.world.item.enchantment.Enchantments; | ||
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; | ||
import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType; | ||
import net.minecraft.world.level.storage.loot.predicates.MatchTool; | ||
import net.minecraftforge.registries.DeferredRegister; | ||
import net.minecraftforge.registries.RegistryObject; | ||
|
||
import static com.minecolonies.api.util.constant.Constants.MOD_ID; | ||
|
||
/** Container class for registering custom loot conditions */ | ||
public final class ModLootConditions | ||
{ | ||
public final static DeferredRegister<LootItemConditionType> DEFERRED_REGISTER = DeferredRegister.create(Registries.LOOT_CONDITION_TYPE, Constants.MOD_ID); | ||
|
||
public static final ResourceLocation ENTITY_IN_BIOME_TAG_ID = new ResourceLocation(MOD_ID, "entity_in_biome_tag"); | ||
public static final ResourceLocation RESEARCH_UNLOCKED_ID = new ResourceLocation(MOD_ID, "research_unlocked"); | ||
|
||
public static final RegistryObject<LootItemConditionType> entityInBiomeTag; | ||
public static final RegistryObject<LootItemConditionType> researchUnlocked; | ||
|
||
// also some convenience definitions for existing conditions; some stolen from BlockLootSubProvider | ||
public static final LootItemCondition.Builder HAS_SILK_TOUCH = MatchTool.toolMatches(ItemPredicate.Builder.item().hasEnchantment(new EnchantmentPredicate(Enchantments.SILK_TOUCH, MinMaxBounds.Ints.atLeast(1)))); | ||
public static final LootItemCondition.Builder HAS_SHEARS = MatchTool.toolMatches(ItemPredicate.Builder.item().of(Items.SHEARS)); | ||
public static final LootItemCondition.Builder HAS_SHEARS_OR_SILK_TOUCH = HAS_SHEARS.or(HAS_SILK_TOUCH); | ||
public static final LootItemCondition.Builder HAS_NO_SHEARS_OR_SILK_TOUCH = HAS_SHEARS_OR_SILK_TOUCH.invert(); | ||
public static final LootItemCondition.Builder HAS_HOE = MatchTool.toolMatches(ItemPredicate.Builder.item().of(ItemTags.HOES)); | ||
|
||
public static void init() | ||
{ | ||
// just for classloading | ||
} | ||
|
||
static | ||
{ | ||
entityInBiomeTag = DEFERRED_REGISTER.register(ModLootConditions.ENTITY_IN_BIOME_TAG_ID.getPath(), | ||
() -> new LootItemConditionType(new EntityInBiomeTag.Serializer())); | ||
|
||
researchUnlocked = DEFERRED_REGISTER.register(ModLootConditions.RESEARCH_UNLOCKED_ID.getPath(), | ||
() -> new LootItemConditionType(new ResearchUnlocked.Serializer())); | ||
} | ||
|
||
|
||
private ModLootConditions() | ||
{ | ||
throw new IllegalStateException("Tried to initialize: ModLootConditions but this is a Utility class."); | ||
} | ||
} | ||
package com.minecolonies.api.loot; | ||
|
||
import com.minecolonies.api.util.constant.Constants; | ||
import net.minecraft.advancements.critereon.EnchantmentPredicate; | ||
import net.minecraft.advancements.critereon.ItemPredicate; | ||
import net.minecraft.advancements.critereon.MinMaxBounds; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.tags.ItemTags; | ||
import net.minecraft.world.item.Items; | ||
import net.minecraft.world.item.enchantment.Enchantments; | ||
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; | ||
import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType; | ||
import net.minecraft.world.level.storage.loot.predicates.MatchTool; | ||
import net.minecraftforge.registries.DeferredRegister; | ||
import net.minecraftforge.registries.RegistryObject; | ||
|
||
import static com.minecolonies.api.util.constant.Constants.MOD_ID; | ||
|
||
/** Container class for registering custom loot conditions */ | ||
public final class ModLootConditions | ||
{ | ||
public final static DeferredRegister<LootItemConditionType> DEFERRED_REGISTER = DeferredRegister.create(Registries.LOOT_CONDITION_TYPE, Constants.MOD_ID); | ||
|
||
public static final ResourceLocation ENTITY_IN_BIOME_TAG_ID = new ResourceLocation(MOD_ID, "entity_in_biome_tag"); | ||
public static final ResourceLocation RESEARCH_UNLOCKED_ID = new ResourceLocation(MOD_ID, "research_unlocked"); | ||
|
||
public static final RegistryObject<LootItemConditionType> entityInBiomeTag; | ||
public static final RegistryObject<LootItemConditionType> researchUnlocked; | ||
|
||
// also some convenience definitions for existing conditions; some stolen from BlockLootSubProvider | ||
public static final LootItemCondition.Builder HAS_SILK_TOUCH = MatchTool.toolMatches(ItemPredicate.Builder.item().hasEnchantment(new EnchantmentPredicate(Enchantments.SILK_TOUCH, MinMaxBounds.Ints.atLeast(1)))); | ||
public static final LootItemCondition.Builder HAS_SHEARS = MatchTool.toolMatches(ItemPredicate.Builder.item().of(Items.SHEARS)); | ||
public static final LootItemCondition.Builder HAS_SHEARS_OR_SILK_TOUCH = HAS_SHEARS.or(HAS_SILK_TOUCH); | ||
public static final LootItemCondition.Builder HAS_NO_SHEARS_OR_SILK_TOUCH = HAS_SHEARS_OR_SILK_TOUCH.invert(); | ||
public static final LootItemCondition.Builder HAS_NETHERITE_HOE = MatchTool.toolMatches(ItemPredicate.Builder.item().of(Items.NETHERITE_HOE)); | ||
public static final LootItemCondition.Builder HAS_DIAMOND_HOE = MatchTool.toolMatches(ItemPredicate.Builder.item().of(Items.DIAMOND_HOE)); | ||
public static final LootItemCondition.Builder HAS_IRON_HOE = MatchTool.toolMatches(ItemPredicate.Builder.item().of(Items.IRON_HOE)); | ||
public static final LootItemCondition.Builder HAS_GOLDEN_HOE = MatchTool.toolMatches(ItemPredicate.Builder.item().of(Items.GOLDEN_HOE)); | ||
public static final LootItemCondition.Builder HAS_HOE = MatchTool.toolMatches(ItemPredicate.Builder.item().of(ItemTags.HOES)); | ||
|
||
public static void init() | ||
{ | ||
// just for classloading | ||
} | ||
|
||
static | ||
{ | ||
entityInBiomeTag = DEFERRED_REGISTER.register(ModLootConditions.ENTITY_IN_BIOME_TAG_ID.getPath(), | ||
() -> new LootItemConditionType(new EntityInBiomeTag.Serializer())); | ||
|
||
researchUnlocked = DEFERRED_REGISTER.register(ModLootConditions.RESEARCH_UNLOCKED_ID.getPath(), | ||
() -> new LootItemConditionType(new ResearchUnlocked.Serializer())); | ||
} | ||
|
||
|
||
private ModLootConditions() | ||
{ | ||
throw new IllegalStateException("Tried to initialize: ModLootConditions but this is a Utility class."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/main/resources/data/minecolonies/worldgen/structure/amazon_camp.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/resources/data/minecolonies/worldgen/structure/barbarian_camp.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters