Skip to content

Commit

Permalink
Add Lithostitched support
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsoltMolnarrr committed Jan 2, 2025
1 parent 8e5a4cb commit f3870c3
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.2.2

- Add support to Lithostitched village structure injection

# 2.2.1

- Adjust burning duration of Fireball and Scorch spells
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fabric_api_version=0.102.0+1.21.1
# Mod
maven_group=net
archives_base_name=wizards
mod_version=2.2.1
mod_version=2.2.2
minecraft_compat_version=1.21

# Dependencies
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/net/wizards/villager/WizardVillagers.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.fabric_extras.structure_pool.api.StructurePoolAPI;
import net.fabricmc.fabric.api.object.builder.v1.trade.TradeOfferHelper;
import net.fabricmc.fabric.api.object.builder.v1.world.poi.PointOfInterestHelper;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
Expand Down Expand Up @@ -77,7 +78,10 @@ public static VillagerProfession registerProfession(String name, RegistryKey<Poi
// }

public static void register() {
StructurePoolAPI.injectAll(WizardsMod.villageConfig.value);
if (!FabricLoader.getInstance().isModLoaded("lithostitched")) {
// Only inject the village if the Lithostitched is not present
StructurePoolAPI.injectAll(WizardsMod.villageConfig.value);
}
var poi = registerPOI(WIZARD_MERCHANT, RuneCraftingBlock.INSTANCE);
var profession = registerProfession(
WIZARD_MERCHANT,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"type": "lithostitched:add_template_pool_elements",
"fabric:load_conditions": {
"condition": "fabric:all_mods_loaded",
"values": [
"wizards"
]
},
"neoforge:conditions": [
{
"type": "neoforge:mod_loaded",
"modid": "wizards"
}
],
"template_pool": "minecraft:village/desert/houses",
"elements": [
{
"weight": 5,
"element": {
"element_type": "lithostitched:limited",
"delegate": {
"element_type": "minecraft:single_pool_element",
"projection": "rigid",
"processors": "minecraft:empty",
"location": "wizards:village/desert/wizard_tower_2"
},
"limit": 1
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"type": "lithostitched:add_template_pool_elements",
"fabric:load_conditions": {
"condition": "fabric:all_mods_loaded",
"values": [
"wizards"
]
},
"neoforge:conditions": [
{
"type": "neoforge:mod_loaded",
"modid": "wizards"
}
],
"template_pool": "minecraft:village/plains/houses",
"elements": [
{
"weight": 5,
"element": {
"element_type": "lithostitched:limited",
"delegate": {
"element_type": "minecraft:single_pool_element",
"projection": "rigid",
"processors": "minecraft:empty",
"location": "wizards:village/plains/wizard_tower"
},
"limit": 1
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"type": "lithostitched:add_template_pool_elements",
"fabric:load_conditions": {
"condition": "fabric:all_mods_loaded",
"values": [
"wizards"
]
},
"neoforge:conditions": [
{
"type": "neoforge:mod_loaded",
"modid": "wizards"
}
],
"template_pool": "minecraft:village/savanna/houses",
"elements": [
{
"weight": 5,
"element": {
"element_type": "lithostitched:limited",
"delegate": {
"element_type": "minecraft:single_pool_element",
"projection": "rigid",
"processors": "minecraft:empty",
"location": "wizards:village/savanna/wizard_tower"
},
"limit": 1
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"type": "lithostitched:add_template_pool_elements",
"fabric:load_conditions": {
"condition": "fabric:all_mods_loaded",
"values": [
"wizards"
]
},
"neoforge:conditions": [
{
"type": "neoforge:mod_loaded",
"modid": "wizards"
}
],
"template_pool": "minecraft:village/snowy/houses",
"elements": [
{
"weight": 5,
"element": {
"element_type": "lithostitched:limited",
"delegate": {
"element_type": "minecraft:single_pool_element",
"projection": "rigid",
"processors": "minecraft:empty",
"location": "wizards:village/snowy/wizard_tower_2"
},
"limit": 1
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"type": "lithostitched:add_template_pool_elements",
"fabric:load_conditions": {
"condition": "fabric:all_mods_loaded",
"values": [
"wizards"
]
},
"neoforge:conditions": [
{
"type": "neoforge:mod_loaded",
"modid": "wizards"
}
],
"template_pool": "minecraft:village/taiga/houses",
"elements": [
{
"weight": 5,
"element": {
"element_type": "lithostitched:limited",
"delegate": {
"element_type": "minecraft:single_pool_element",
"projection": "rigid",
"processors": "minecraft:empty",
"location": "wizards:village/taiga/wizard_tower"
},
"limit": 1
}
}
]
}

0 comments on commit f3870c3

Please sign in to comment.