This commit is contained in:
HuTao今天吃什么
2022-09-27 10:16:50 +08:00
parent 20185b3407
commit bbc600b128
65 changed files with 1688 additions and 111 deletions

View File

@@ -20,7 +20,7 @@ apply plugin: 'maven-publish'
// apply MixinGradle
apply plugin: 'org.spongepowered.mixin'
version = '1.18.2-0.1.6.1'
version = '1.18.2-0.1.7'
group = 'extrabotany' //'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'extrabotany'
@@ -173,8 +173,8 @@ dependencies {
compileOnly fg.deobf("vazkii.botania:Botania:1.18.2-${botania_version}")
runtimeOnly fg.deobf("vazkii.botania:Botania:1.18.2-${botania_version}")
//implementation fg.deobf("slimeknights.mantle:Mantle:1.18.2-${mantle_version}")
//implementation fg.deobf("slimeknights.tconstruct:TConstruct:1.18.2-${tcon_version}")
implementation fg.deobf("slimeknights.mantle:Mantle:1.18.2-${mantle_version}")
implementation fg.deobf("slimeknights.tconstruct:TConstruct:1.18.2-${tcon_version}")
// Real mod deobf dependency examples - these get remapped to your current mappings
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency

View File

@@ -182,6 +182,11 @@ d8de18119b36e72cfdbad5cb28e00751b52582ad assets/extrabotany/models/item/treasure
7a229a4b908ef50d0c73d16cf49a2fc6c819129f assets/extrabotany/models/item/true_shadow_katana.json
571aaac43e08a389314b216d5e371ee532411829 assets/extrabotany/models/item/true_terra_blade.json
fc34ebbfdef507b53d88ff6d99454b1bb7cdef10 assets/extrabotany/models/item/true_thunstar_caller.json
4ccd0b77bfce5511b636d0b1ff80d52b9f774945 assets/extrabotany/tinkering/materials/nightmare_fuel.json
43d4df4df2f9e1b833598ed43cf7e5279cd03195 assets/extrabotany/tinkering/materials/orichalcos.json
ee60b23fa2774102e87f5dbb7c6da56968dfc27f assets/extrabotany/tinkering/materials/photonium.json
f4838518bcfd60b744cb0e3e403ec06e104bb9ad assets/extrabotany/tinkering/materials/shadowium.json
95e5f6d6428d98364dfcd4d1e96e5bf5571a35bd assets/extrabotany/tinkering/materials/spirit_fuel.json
c9ff3b120bf0d1145a5f6e82846b8f449c734da9 data/botania/tags/blocks/functional_special_flowers.json
ddc834a139f949eccb001070727eabd4ff1ee8ce data/botania/tags/blocks/generating_special_flowers.json
e24955f0e3e0924ca0570a81ee2998680679b5ea data/botania/tags/blocks/special_floating_flowers.json
@@ -276,6 +281,8 @@ b17c8288e6931875d55a7f3f06c3bb95d4f41a36 data/extrabotany/loot_tables/blocks/flo
8b2aada4986b4e7a7026575355b625e8ba43cfc4 data/extrabotany/loot_tables/blocks/floating_sunshine_lily.json
98ded861d9c63366f7b60b27d6185787092a5aec data/extrabotany/loot_tables/blocks/floating_tinkle_flower.json
75706a7872fef7b4cff04cbc4ed30f6fcb65721d data/extrabotany/loot_tables/blocks/gemini_orchid.json
5c1df8443043b3fe3b665dba348e2ff188bcbe31 data/extrabotany/loot_tables/blocks/molten_photonium_fluid.json
5c1df8443043b3fe3b665dba348e2ff188bcbe31 data/extrabotany/loot_tables/blocks/molten_shadowium_fluid.json
e6b7f863b745184b30e321660b9238b07ca61634 data/extrabotany/loot_tables/blocks/moonlight_lily.json
9fefaceac0c031a44ac38972aabdfb13b2ed1652 data/extrabotany/loot_tables/blocks/omni_violet.json
791abb7154991dd555eeefb64033b8ddc5e6f867 data/extrabotany/loot_tables/blocks/power_frame.json
@@ -340,7 +347,26 @@ dbf40d12a66f31de36e06310e706fce4e0af36d5 data/extrabotany/recipes/runic_altar/po
ed07f4335d47b36c3f27e1117958956dc96978de data/extrabotany/recipes/runic_altar/shadowium2.json
1463595a483f0bdcdcb1df667003e6fa9b5b6cb0 data/extrabotany/recipes/terra_plate/aerialite.json
270f1553c4941f8ff091f3b4eb41cdc69c493ee5 data/extrabotany/recipes/terra_plate/the_universe.json
93c68d1864a58770a24d259bcf294195c96407a9 data/extrabotany/tags/fluids/molten_photonium.json
ece62548e29aa1604881dade3a79f4a73ee67b0f data/extrabotany/tags/fluids/molten_shadowium.json
b09ed7584b24ed794528e05e0415ff06451e5ccd data/extrabotany/tinkering/materials/definition/nightmare_fuel.json
1981d8e1ceda5c6155fd704784beb893c00d1703 data/extrabotany/tinkering/materials/definition/orichalcos.json
a4c6ff3d84b8311bc2288e15b6d41833bda7508f data/extrabotany/tinkering/materials/definition/photonium.json
a4c6ff3d84b8311bc2288e15b6d41833bda7508f data/extrabotany/tinkering/materials/definition/shadowium.json
b09ed7584b24ed794528e05e0415ff06451e5ccd data/extrabotany/tinkering/materials/definition/spirit_fuel.json
dd49fd5de5672c9b8d1f08536d4e1b751f459d5b data/extrabotany/tinkering/materials/stats/nightmare_fuel.json
ae9fc07ac74e27df7e5bac2e26bb4b5894db2513 data/extrabotany/tinkering/materials/stats/orichalcos.json
fc39acb70d5eb15f60dfe7badc86b2cc3f22080d data/extrabotany/tinkering/materials/stats/photonium.json
6830805e750e72d7d2e234a1b31cdf5d63221888 data/extrabotany/tinkering/materials/stats/shadowium.json
abfbc835e820d1b3e674428cbd056c0499ceb708 data/extrabotany/tinkering/materials/stats/spirit_fuel.json
8bc2d8e86e280450e5856388a9d7b915923c515c data/extrabotany/tinkering/materials/traits/nightmare_fuel.json
c23a0c5fcd7b12f8e38cc0d4ee33b2f0fbb0abb8 data/extrabotany/tinkering/materials/traits/orichalcos.json
7f039d6bad885e25a3b26a432e86a53f9ca2203e data/extrabotany/tinkering/materials/traits/photonium.json
8bc2d8e86e280450e5856388a9d7b915923c515c data/extrabotany/tinkering/materials/traits/shadowium.json
8bc2d8e86e280450e5856388a9d7b915923c515c data/extrabotany/tinkering/materials/traits/spirit_fuel.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/forge/tags/blocks/ores.json
231358b50cbe1e2d157b84d4b58055c1d4773853 data/forge/tags/fluids/molten_photonium.json
dbef9cf6c73761b1bbfe6c7c0b247638b9dc7033 data/forge/tags/fluids/molten_shadowium.json
aaf63aeec7e24f4d7f9df595ee69c3892dbdc96a data/forge/tags/items/ingots.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/forge/tags/items/ores.json
06918e9ffa8f9399710832988a33a954851241b4 data/minecraft/advancements/recipes/botania/rune_dupe_example.json
@@ -503,3 +529,17 @@ e0fab4d0e45d89968045736e83f785b55f58c4ca data/minecraft/tags/blocks/beacon_base_
e0fab4d0e45d89968045736e83f785b55f58c4ca data/minecraft/tags/blocks/mineable/pickaxe.json
1adaa9df3557d91bf0555edc70fcf18e3ac4fedf data/minecraft/tags/blocks/needs_diamond_tool.json
de8b606f5da6abd49836e25ac567060ee65219cd data/minecraft/tags/blocks/needs_iron_tool.json
5f2d825cb934058931ce02d86dc0320ad86e047b data/tconstruct/recipes/tools/materials/casting/photonium.json
1ade435d385359e251274bff97ccb7a965f56ed3 data/tconstruct/recipes/tools/materials/casting/shadowium.json
8bc61ca788dfa05e52da55bb76015029fb63bdec data/tconstruct/recipes/tools/materials/melting/photonium.json
90cf1f015943d771bdc005cf55160fca2d17e9b9 data/tconstruct/recipes/tools/materials/melting/shadowium.json
6974cef29c702334a9936eb3e13236d59fa772e8 data/tconstruct/recipes/tools/materials/nightmare_fuel.json
fdb7a1405a9ba50fb6409014baf417ab7428e5de data/tconstruct/recipes/tools/materials/photonium/block.json
6eb97a064d472c01997c3245a4e10c79f4b6a558 data/tconstruct/recipes/tools/materials/photonium/ingot.json
2e60012c7bdcbe3717178b73407697c159eba56a data/tconstruct/recipes/tools/materials/photonium/nugget.json
9bfd345a3ef798c6721fab4638647a54eb1350ec data/tconstruct/recipes/tools/materials/shadowium/block.json
e82615cbe9cea327a68c3cf035c8988adbf5aea3 data/tconstruct/recipes/tools/materials/shadowium/ingot.json
7b9652cdba534645d6573313ff94747864180bf9 data/tconstruct/recipes/tools/materials/shadowium/nugget.json
8a1b3a025909f8838b0afa086f36d05ac7b19220 data/tconstruct/recipes/tools/materials/spirit_fuel.json
9c4ea566e6b49972d16cdb566d0d234c030f5827 data/tconstruct/tags/fluids/spilling/metal/cheap.json
9c4ea566e6b49972d16cdb566d0d234c030f5827 data/tconstruct/tags/fluids/tooltips/metal.json

View File

@@ -0,0 +1,46 @@
{
"color": "325D25",
"luminosity": 0,
"generator": {
"transformer": {
"type": "tconstruct:recolor_sprite",
"color_mapping": {
"type": "tconstruct:grey_to_color",
"palette": [
{
"grey": 0,
"color": "FF000000"
},
{
"grey": 63,
"color": "FF0C1708"
},
{
"grey": 102,
"color": "00172911"
},
{
"grey": 140,
"color": "FF1B4B4E"
},
{
"grey": 178,
"color": "FF254B29"
},
{
"grey": 216,
"color": "FF325D25"
},
{
"grey": 255,
"color": "FF575E1C"
}
]
}
},
"supportedStats": [
"tconstruct:head"
],
"ignoreMaterialStats": false
}
}

View File

@@ -0,0 +1,7 @@
{
"fallbacks": [
"metal"
],
"color": "FFFFFFFF",
"luminosity": 0
}

View File

@@ -0,0 +1,48 @@
{
"fallbacks": [
"metal"
],
"color": "3A2424",
"luminosity": 15,
"generator": {
"transformer": {
"type": "tconstruct:recolor_sprite",
"color_mapping": {
"type": "tconstruct:grey_to_color",
"palette": [
{
"grey": 63,
"color": "FFFFD83A"
},
{
"grey": 102,
"color": "FFDA7600"
},
{
"grey": 140,
"color": "FF0B0507"
},
{
"grey": 178,
"color": "FF191313"
},
{
"grey": 216,
"color": "FF3A2424"
},
{
"grey": 255,
"color": "FF413333"
}
]
}
},
"supportedStats": [
"tconstruct:head",
"tconstruct:handle",
"tconstruct:extra",
"tconstruct:repair_kit"
],
"ignoreMaterialStats": false
}
}

View File

@@ -0,0 +1,52 @@
{
"fallbacks": [
"metal"
],
"color": "C4D6AE",
"luminosity": 0,
"generator": {
"transformer": {
"type": "tconstruct:recolor_sprite",
"color_mapping": {
"type": "tconstruct:grey_to_color",
"palette": [
{
"grey": 0,
"color": "FF000000"
},
{
"grey": 63,
"color": "FF505E4C"
},
{
"grey": 102,
"color": "FF5D7667"
},
{
"grey": 140,
"color": "FF81887D"
},
{
"grey": 178,
"color": "FFAFBAA1"
},
{
"grey": 216,
"color": "FFC4D6AE"
},
{
"grey": 255,
"color": "FFF9FFD6"
}
]
}
},
"supportedStats": [
"tconstruct:head",
"tconstruct:handle",
"tconstruct:extra",
"tconstruct:repair_kit"
],
"ignoreMaterialStats": false
}
}

View File

@@ -0,0 +1,49 @@
{
"color": "569243",
"luminosity": 0,
"generator": {
"transformer": {
"type": "tconstruct:recolor_sprite",
"color_mapping": {
"type": "tconstruct:grey_to_color",
"palette": [
{
"grey": 0,
"color": "FF000000"
},
{
"grey": 63,
"color": "FF081608"
},
{
"grey": 102,
"color": "FF1A2B11"
},
{
"grey": 140,
"color": "FF27401D"
},
{
"grey": 178,
"color": "FF345E27"
},
{
"grey": 216,
"color": "FF569243"
},
{
"grey": 255,
"color": "FF8CB05A"
}
]
}
},
"supportedStats": [
"tconstruct:head",
"tconstruct:handle",
"tconstruct:extra",
"tconstruct:repair_kit"
],
"ignoreMaterialStats": false
}
}

View File

@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:air"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:air"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@@ -0,0 +1,13 @@
{
"replace": false,
"values": [
{
"id": "extrabotany:molten_photonium",
"required": false
},
{
"id": "extrabotany:flowing_molten_photonium",
"required": false
}
]
}

View File

@@ -0,0 +1,13 @@
{
"replace": false,
"values": [
{
"id": "extrabotany:molten_shadowium",
"required": false
},
{
"id": "extrabotany:flowing_molten_shadowium",
"required": false
}
]
}

View File

@@ -0,0 +1,6 @@
{
"craftable": true,
"tier": 2,
"sortOrder": 2,
"hidden": false
}

View File

@@ -0,0 +1,6 @@
{
"craftable": false,
"tier": 4,
"sortOrder": 2,
"hidden": false
}

View File

@@ -0,0 +1,6 @@
{
"craftable": false,
"tier": 3,
"sortOrder": 2,
"hidden": false
}

View File

@@ -0,0 +1,6 @@
{
"craftable": false,
"tier": 3,
"sortOrder": 2,
"hidden": false
}

View File

@@ -0,0 +1,6 @@
{
"craftable": true,
"tier": 2,
"sortOrder": 2,
"hidden": false
}

View File

@@ -0,0 +1,10 @@
{
"stats": {
"tconstruct:head": {
"durability": 460,
"miningSpeed": 9.0,
"harvestTier": "minecraft:stone",
"attack": 2.0
}
}
}

View File

@@ -0,0 +1,17 @@
{
"stats": {
"tconstruct:extra": {},
"tconstruct:handle": {
"durability": 1.0,
"miningSpeed": 1.0,
"attackSpeed": 1.0,
"attackDamage": 1.0
},
"tconstruct:head": {
"durability": 1145,
"miningSpeed": 14.0,
"harvestTier": "minecraft:netherite",
"attack": 2.5
}
}
}

View File

@@ -0,0 +1,17 @@
{
"stats": {
"tconstruct:extra": {},
"tconstruct:handle": {
"durability": 1.0,
"miningSpeed": 1.0,
"attackSpeed": 1.0,
"attackDamage": 1.0
},
"tconstruct:head": {
"durability": 720,
"miningSpeed": 6.5,
"harvestTier": "minecraft:diamond",
"attack": 3.0
}
}
}

View File

@@ -0,0 +1,17 @@
{
"stats": {
"tconstruct:extra": {},
"tconstruct:handle": {
"durability": 1.0,
"miningSpeed": 1.0,
"attackSpeed": 1.0,
"attackDamage": 1.0
},
"tconstruct:head": {
"durability": 900,
"miningSpeed": 6.0,
"harvestTier": "minecraft:netherite",
"attack": 2.5
}
}
}

View File

@@ -0,0 +1,17 @@
{
"stats": {
"tconstruct:extra": {},
"tconstruct:handle": {
"durability": 1.0,
"miningSpeed": 1.0,
"attackSpeed": 1.0,
"attackDamage": 1.0
},
"tconstruct:head": {
"durability": 180,
"miningSpeed": 6.0,
"harvestTier": "minecraft:iron",
"attack": 2.5
}
}
}

View File

@@ -0,0 +1,12 @@
{
"default": [
{
"name": "tconstruct:axe_scrape",
"level": 1
},
{
"name": "tconstruct:axe_scrape",
"level": 1
}
]
}

View File

@@ -0,0 +1,20 @@
{
"default": [
{
"name": "tconstruct:experienced",
"level": 1
},
{
"name": "tconstruct:axe_scrape",
"level": 1
},
{
"name": "tconstruct:autosmelt",
"level": 1
},
{
"name": "tconstruct:fiery",
"level": 1
}
]
}

View File

@@ -0,0 +1,20 @@
{
"default": [
{
"name": "tconstruct:axe_scrape",
"level": 1
},
{
"name": "tconstruct:axe_scrape",
"level": 1
},
{
"name": "tconstruct:autosmelt",
"level": 1
},
{
"name": "tconstruct:fiery",
"level": 1
}
]
}

View File

@@ -0,0 +1,12 @@
{
"default": [
{
"name": "tconstruct:axe_scrape",
"level": 1
},
{
"name": "tconstruct:axe_scrape",
"level": 1
}
]
}

View File

@@ -0,0 +1,12 @@
{
"default": [
{
"name": "tconstruct:axe_scrape",
"level": 1
},
{
"name": "tconstruct:axe_scrape",
"level": 1
}
]
}

View File

@@ -0,0 +1,9 @@
{
"replace": false,
"values": [
{
"id": "#extrabotany:molten_photonium",
"required": false
}
]
}

View File

@@ -0,0 +1,9 @@
{
"replace": false,
"values": [
{
"id": "#extrabotany:molten_shadowium",
"required": false
}
]
}

View File

@@ -0,0 +1,15 @@
{
"type": "tconstruct:material_fluid",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"fluid": {
"tag": "forge:molten_shadowium",
"amount": 90
},
"temperature": 700,
"output": "extrabotany:photonium"
}

View File

@@ -0,0 +1,15 @@
{
"type": "tconstruct:material_fluid",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"fluid": {
"tag": "forge:molten_shadowium",
"amount": 90
},
"temperature": 700,
"output": "extrabotany:shadowium"
}

View File

@@ -0,0 +1,15 @@
{
"type": "tconstruct:material_melting",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"input": "extrabotany:photonium",
"temperature": 700,
"result": {
"fluid": "extrabotany:molten_shadowium",
"amount": 90
}
}

View File

@@ -0,0 +1,15 @@
{
"type": "tconstruct:material_melting",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"input": "extrabotany:shadowium",
"temperature": 700,
"result": {
"fluid": "extrabotany:molten_shadowium",
"amount": 90
}
}

View File

@@ -0,0 +1,15 @@
{
"type": "tconstruct:material",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"ingredient": {
"item": "extrabotany:nightmare_fuel"
},
"value": 1,
"needed": 1,
"material": "extrabotany:nightmare_fuel"
}

View File

@@ -0,0 +1,18 @@
{
"type": "tconstruct:material",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"ingredient": {
"tag": "forge:storage_blocks/photonium"
},
"value": 9,
"needed": 1,
"material": "extrabotany:photonium",
"leftover": {
"tag": "forge:ingots/photonium"
}
}

View File

@@ -0,0 +1,15 @@
{
"type": "tconstruct:material",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"ingredient": {
"tag": "forge:ingots/photonium"
},
"value": 1,
"needed": 1,
"material": "extrabotany:photonium"
}

View File

@@ -0,0 +1,15 @@
{
"type": "tconstruct:material",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"ingredient": {
"tag": "forge:nuggets/photonium"
},
"value": 1,
"needed": 9,
"material": "extrabotany:photonium"
}

View File

@@ -0,0 +1,18 @@
{
"type": "tconstruct:material",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"ingredient": {
"tag": "forge:storage_blocks/shadowium"
},
"value": 9,
"needed": 1,
"material": "extrabotany:shadowium",
"leftover": {
"tag": "forge:ingots/shadowium"
}
}

View File

@@ -0,0 +1,15 @@
{
"type": "tconstruct:material",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"ingredient": {
"tag": "forge:ingots/shadowium"
},
"value": 1,
"needed": 1,
"material": "extrabotany:shadowium"
}

View File

@@ -0,0 +1,15 @@
{
"type": "tconstruct:material",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"ingredient": {
"tag": "forge:nuggets/shadowium"
},
"value": 1,
"needed": 9,
"material": "extrabotany:shadowium"
}

View File

@@ -0,0 +1,15 @@
{
"type": "tconstruct:material",
"conditions": [
{
"modid": "tconstruct",
"type": "forge:mod_loaded"
}
],
"ingredient": {
"item": "extrabotany:spirit_frag"
},
"value": 1,
"needed": 1,
"material": "extrabotany:spirit_fuel"
}

View File

@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"#forge:molten_shadowium",
"#forge:molten_photonium"
]
}

View File

@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"#forge:molten_shadowium",
"#forge:molten_photonium"
]
}

View File

@@ -2,17 +2,20 @@ package chick.extrabotany;
import chick.extrabotany.common.ModItems;
import chick.extrabotany.common.base.ConfigHandler;
import chick.extrabotany.common.optional.EXBOTCompat;
import chick.extrabotany.forge.ForgeCommonInitializer;
import com.mojang.logging.LogUtils;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
// The value here should match an entry in the META-INF/mods.toml file
@Mod(ExtraBotany.MODID)
@@ -22,7 +25,7 @@ public class ExtraBotany
public static final String TAB_NAME = "extrabotany";//Name in creative inventury
public static final Logger LOGGER = LogUtils.getLogger();
public static final Logger LOGGER = LogManager.getLogger(MODID);
public static final CreativeModeTab ITEM_GROUP = (new CreativeModeTab(TAB_NAME)
{
@@ -55,8 +58,51 @@ public class ExtraBotany
//create config
ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, ConfigHandler.CLIENT_SPEC);
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, ConfigHandler.COMMON_SPEC);
if (ConfigHandler.COMMON.doCompat.get())
{
try
{
EXBOTCompat.preInitCompat();
} catch (Exception e)
{
ConfigHandler.COMMON.doCompat.set(false);
LOGGER.error("Had an error loading preInit compatibility!");
LOGGER.catching(e.fillInStackTrace());
}
} else
{
LOGGER.warn("Skipping compatibility!");
}
}
@SubscribeEvent
public static void initCompat(FMLCommonSetupEvent evt)
{
if (ConfigHandler.COMMON.doCompat.get())
{
try
{
EXBOTCompat.initCompat(evt);
} catch (Exception e)
{
ConfigHandler.COMMON.doCompat.set(false);
LOGGER.error("Had an error loading init compatibility!");
LOGGER.catching(e.fillInStackTrace());
}
try
{
EXBOTCompat.postInitCompat();
} catch (Exception e)
{
ConfigHandler.COMMON.doCompat.set(false);
LOGGER.error("Had an error loading postInit compatibility!");
LOGGER.catching(e.fillInStackTrace());
}
}
}
public static String prefix(String string)
{
return MODID + ":" + string;

View File

@@ -8,9 +8,9 @@ import vazkii.botania.api.mana.IManaItem;
/**
* it has nothing now lol
*/
public class ExtraBotanyCapabilities
public class EXBOTCapabilities
{
public static final Capability<IPassiveFlowerCap> PASSIVE_FLOWER = CapabilityManager.get(new CapabilityToken<>() {});
public static final Capability<IManaItem> NATURE_ORB = CapabilityManager.get(new CapabilityToken<>() {});
public static final Capability<INatureOrbItem> NATURE_ORB = CapabilityManager.get(new CapabilityToken<>() {});
}

View File

@@ -0,0 +1,26 @@
package chick.extrabotany.api.cap;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.BlockEntity;
/**
* An item that has this capability can contain nature.
*/
public interface INatureOrbItem
{
int getNature();
int getMaxNature();
void addNature(int x);
boolean canReceiveNatureFromNatureAdder(BlockEntity adder);
boolean canReceiveManaFromItem(ItemStack otherStack);
boolean canExportManaToPool(BlockEntity pool);
boolean canExportManaToItem(ItemStack otherStack);
boolean isNoExport();
}

View File

@@ -33,14 +33,18 @@ public class ConfigHandler
public static class Common
{
public final ForgeConfigSpec.BooleanValue doCompat;
public final ForgeConfigSpec.BooleanValue disableDisarm;
public final ForgeConfigSpec.BooleanValue doProjectileBreakBlock;
public final ForgeConfigSpec.DoubleValue gaiaDamageTimes;
public Common(ForgeConfigSpec.Builder builder)
{
//TODO:为什么要禁用缴械捏noob
builder.push("common");
doCompat = builder.comment("Whether to compact other mod, like TConstruct. Default is true")
.define("doCompat",false);
//TODO:为什么要禁用缴械捏noob
disableDisarm = builder
.comment("Whether to disable the Ego's disarm. Default is false(Not Recommend).")
.define("disableDisarm", false);
@@ -52,6 +56,7 @@ public class ConfigHandler
gaiaDamageTimes = builder
.comment("How many times damage will EGO(Gaia III) do when it use weapons.")
.defineInRange("gaiaDamageTimes", 2.0D, 0D, 10D);
builder.pop();
}
}

View File

@@ -1,6 +1,8 @@
package chick.extrabotany.common.baubles;
import chick.extrabotany.api.cap.INatureOrbItem;
import chick.extrabotany.common.entities.ego.EntityEGO;
import chick.extrabotany.xplat.IXplatAbstractions;
import net.minecraft.ChatFormatting;
import net.minecraft.core.NonNullList;
import net.minecraft.network.chat.Component;
@@ -18,33 +20,37 @@ import net.minecraft.world.item.Items;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import org.jetbrains.annotations.NotNull;
import vazkii.botania.api.mana.ManaItemHandler;
import vazkii.botania.common.helper.ItemNBTHelper;
import vazkii.botania.common.item.equipment.bauble.ItemBauble;
import vazkii.botania.common.item.equipment.bauble.ItemManaRing;
import java.util.List;
//TODO:to be checked
public class NatureOrb extends ItemBauble
{
protected static final String TAG_NATURE = "tag_nature";
protected static final int MAX_NATURE = 500000;
public NatureOrb(Properties props)
{
super(props);
}
public static final String TAG_XP = "xp";
//Same as ManaRing
public static final int MAX_XP = 500000;
@Override
public void appendHoverText(ItemStack stack, Level world, List<Component> tooltip, TooltipFlag flags)
{
super.appendHoverText(stack, world, tooltip, flags);
tooltip.add(new TranslatableComponent("extrabotany.nature_orb", getXP(stack), getMaxXP()).withStyle(ChatFormatting.GRAY));
tooltip.add(new TranslatableComponent("extrabotany.nature_orb_effect1").withStyle(getXP(stack) >= 100000 ? ChatFormatting.AQUA : ChatFormatting.GRAY));
tooltip.add(new TranslatableComponent("extrabotany.nature_orb_effect2").withStyle(getXP(stack) >= 300000 ? ChatFormatting.DARK_RED : ChatFormatting.GRAY));
tooltip.add(new TranslatableComponent("extrabotany.nature_orb_effect3").withStyle(getXP(stack) >= 400000 ? ChatFormatting.DARK_GREEN : ChatFormatting.GRAY));
var manaItem = IXplatAbstractions.INSTANCE.findNatureOrbItem(stack);
if (manaItem != null)
{
tooltip.add(new TranslatableComponent("extrabotany.nature_orb", manaItem.getNature(), manaItem.getMaxNature()).withStyle(ChatFormatting.GRAY));
tooltip.add(new TranslatableComponent("extrabotany.nature_orb_effect1").withStyle(manaItem.getNature() >= 100000 ? ChatFormatting.AQUA : ChatFormatting.GRAY));
tooltip.add(new TranslatableComponent("extrabotany.nature_orb_effect2").withStyle(manaItem.getNature() >= 300000 ? ChatFormatting.DARK_RED : ChatFormatting.GRAY));
tooltip.add(new TranslatableComponent("extrabotany.nature_orb_effect3").withStyle(manaItem.getNature() >= 400000 ? ChatFormatting.DARK_GREEN : ChatFormatting.GRAY));
}
}
@Override
@@ -62,7 +68,9 @@ public class NatureOrb extends ItemBauble
stacks.add(new ItemStack(this));
ItemStack full = new ItemStack(this);
ItemManaRing.setMana(full, MAX_XP);
ItemNBTHelper.setInt(full, TAG_NATURE, MAX_NATURE);
stacks.add(full);
}
}
@@ -71,17 +79,18 @@ public class NatureOrb extends ItemBauble
public void onWornTick(ItemStack stack, LivingEntity entity)
{
super.onWornTick(stack, entity);
if (entity instanceof Player player)
if (entity instanceof Player player && !player.level.isClientSide)
{
if (!player.level.isClientSide)
var manaItem = IXplatAbstractions.INSTANCE.findNatureOrbItem(stack);
if (manaItem != null)
{
if (player.tickCount % 5 == 0)
{
if (getXP(stack) > 100000)
if (manaItem.getNature() > 100000)
ManaItemHandler.instance().dispatchManaExact(stack, player, 5, true);
if (getXP(stack) > 200000)
if (manaItem.getNature() > 200000)
ManaItemHandler.instance().dispatchManaExact(stack, player, 5, true);
if (getXP(stack) > 300000)
if (manaItem.getMaxNature() > 300000)
{
ManaItemHandler.instance().dispatchManaExact(stack, player, 5, true);
if (player.tickCount % 60 == 0)
@@ -90,7 +99,7 @@ public class NatureOrb extends ItemBauble
}
}
}
if (getXP(stack) > 400000)
if (manaItem.getNature() > 400000)
{
if (player.tickCount % 40 == 0)
{
@@ -101,27 +110,100 @@ public class NatureOrb extends ItemBauble
}
}
public int getXP(ItemStack stack)
{
return ItemNBTHelper.getInt(stack, TAG_XP, 0);
}
public int getMaxXP()
{
return MAX_XP;
}
public void clearPotions(ItemStack stack, Player player)
{
player.getActiveEffects().stream()
.filter(effect -> !effect.getEffect().isBeneficial())
.filter(effect -> effect.getCurativeItems().stream().anyMatch(e -> e.is(Items.MILK_BUCKET)))
.map(MobEffectInstance::getEffect)
.distinct().forEach(potion ->
{
player.removeEffect(potion);
//addXP(stack, -50);
((ServerLevel) player.level).getChunkSource().broadcastAndSend(player, new ClientboundRemoveMobEffectPacket(player.getId(), potion));
});
var orb = IXplatAbstractions.INSTANCE.findNatureOrbItem(stack);
if (orb != null)
{
player.getActiveEffects().stream()
.filter(effect -> !effect.getEffect().isBeneficial())
.filter(effect -> effect.getCurativeItems().stream().anyMatch(e -> e.is(Items.MILK_BUCKET)))
.map(MobEffectInstance::getEffect)
.distinct().forEach(potion ->
{
player.removeEffect(potion);
orb.addNature(-1000);
player.getCooldowns().addCooldown(this, 3);
((ServerLevel) player.level).getChunkSource().broadcastAndSend(player, new ClientboundRemoveMobEffectPacket(player.getId(), potion));
});
}
}
@Override
public boolean isBarVisible(ItemStack stack)
{
return true;
}
@Override
public int getBarWidth(ItemStack stack)
{
var manaItem = IXplatAbstractions.INSTANCE.findNatureOrbItem(stack);
return Math.round(13 * manaItem.getNature() / (float) manaItem.getMaxNature());
}
@Override
public int getBarColor(ItemStack stack)
{
var manaItem = IXplatAbstractions.INSTANCE.findNatureOrbItem(stack);
return Mth.hsvToRgb(manaItem.getNature() / (float) manaItem.getMaxNature() / 3.0F, 1.0F, 1.0F);
}
public static class NatureOrbItem implements INatureOrbItem
{
protected final ItemStack stack;
public NatureOrbItem(ItemStack stack)
{
this.stack = stack;
}
@Override
public int getNature()
{
return ItemNBTHelper.getInt(stack, TAG_NATURE, 0) * stack.getCount();
}
@Override
public int getMaxNature()
{
return MAX_NATURE * stack.getCount();
}
@Override
public void addNature(int x)
{
ItemNBTHelper.setInt(stack, TAG_NATURE, Math.min(getMaxNature(), getNature() + x) / stack.getCount());
}
@Override
public boolean canReceiveNatureFromNatureAdder(BlockEntity adder)
{
return true;
}
@Override
public boolean canReceiveManaFromItem(ItemStack otherStack)
{
return true;
}
@Override
public boolean canExportManaToPool(BlockEntity pool)
{
return true;
}
@Override
public boolean canExportManaToItem(ItemStack otherStack)
{
return true;
}
@Override
public boolean isNoExport()
{
return false;
}
}
}

View File

@@ -1,14 +1,11 @@
package chick.extrabotany.common.blocks;
import chick.extrabotany.common.ModItems;
import chick.extrabotany.common.blocks.tile.TilePowerFrame;
import net.minecraft.core.BlockPos;
import net.minecraft.world.Containers;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.EntityBlock;
@@ -38,16 +35,19 @@ public class PowerFrame extends BlockModWaterloggable implements EntityBlock
ItemStack stack = player.getItemInHand(hand);
if (frame != null)
{
if (player.isShiftKeyDown())
if (!stack.isEmpty() && (IXplatAbstractions.INSTANCE.findManaItem(stack) != null || chick.extrabotany.xplat.IXplatAbstractions.INSTANCE.findNatureOrbItem(stack) != null))
{
InventoryHelper.withdrawFromInventory(frame, player);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(frame);
return InteractionResult.SUCCESS;
} else if (!stack.isEmpty() && (IXplatAbstractions.INSTANCE.findManaItem(stack) != null || stack.is(ModItems.NATURE_ORB.get())))
{
boolean result = frame.addItem(player, stack, hand);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(frame);
return result ? InteractionResult.SUCCESS : InteractionResult.PASS;
if (frame.getItemHandler().isEmpty())
{
boolean result = frame.addItem(player, stack, hand);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(frame);
return result ? InteractionResult.SUCCESS : InteractionResult.PASS;
} else
{
InventoryHelper.withdrawFromInventory(frame, player);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(frame);
return InteractionResult.SUCCESS;
}
}
}
return InteractionResult.PASS;

View File

@@ -3,6 +3,7 @@ package chick.extrabotany.common.blocks.tile;
import chick.extrabotany.common.ModItems;
import chick.extrabotany.common.baubles.NatureOrb;
import chick.extrabotany.common.blocks.ModTiles;
import com.google.common.base.Suppliers;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
@@ -12,6 +13,7 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
@@ -31,6 +33,8 @@ import vazkii.patchouli.api.IMultiblock;
import vazkii.patchouli.api.PatchouliAPI;
import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
public class TilePowerFrame extends TileSimpleInventory
@@ -170,6 +174,9 @@ public class TilePowerFrame extends TileSimpleInventory
public static void serverTick(Level level, BlockPos worldPosition, BlockState state, TilePowerFrame self)
{
boolean multi = MULTIBLOCK_ADV.get().validate(level, worldPosition) != null;
int redstoneSignal = 0;
for (Direction dir : Direction.values())
{
@@ -178,7 +185,7 @@ public class TilePowerFrame extends TileSimpleInventory
int speed = TRANSFER_SPEED;
if (MULTIBLOCK_ADV.get().validate(level, worldPosition) != null)
if (multi)
{
speed *= 2;
}
@@ -187,41 +194,60 @@ public class TilePowerFrame extends TileSimpleInventory
{
var manaItem = IXplatAbstractions.INSTANCE.findManaItem(stack);
int chargeModifier = 100;
if (manaItem == null)
{
manaItem = chick.extrabotany.xplat.IXplatAbstractions.INSTANCE.findNatureOrb(stack);
chargeModifier = 1;
}
int current = 0;
if (manaItem != null)
{
if (level.getBlockEntity(worldPosition.offset(0, 1, 0)) instanceof TilePool p)
{
int current;
if (redstoneSignal == 0)
if (redstoneSignal == 0 && manaItem.canReceiveManaFromPool(p))
{
int manaToGet = Math.min(speed, p.getCurrentMana());
int space = Math.max(0, manaItem.getMaxMana() - manaItem.getMana());
int space = manaItem.getMaxMana() - manaItem.getMana();
current = Math.min(space, manaToGet);
} else
} else if (redstoneSignal > 0 && manaItem.canExportManaToPool(p))
{
int manaToGet = Math.min(speed, manaItem.getMana());
int space = Math.max(0, p.manaCap - p.getCurrentMana());
current = -Math.min(space, manaToGet);
}
p.receiveMana(-current * chargeModifier / 100);
manaItem.addMana(current * chargeModifier / 100);
if (current > 0)
p.receiveMana(-current);
manaItem.addMana(current);
}
} else
{
var orb = chick.extrabotany.xplat.IXplatAbstractions.INSTANCE.findNatureOrbItem(stack);
if (orb != null && multi && level.dayTime() % 20 == 0)
{
if (level.getBlockEntity(worldPosition.offset(0, 1, 0)) instanceof TilePool p)
{
self.setTransferring(true);
int natureToGet;
if (redstoneSignal == 0)
{
natureToGet = Math.min(speed / 100, p.getCurrentMana());
int space = orb.getMaxNature() - orb.getNature();
current = Math.min(space, natureToGet);
} else
{
natureToGet = Math.min(speed / 100, orb.getNature());
int space = Math.max(0, p.manaCap - p.getCurrentMana());
current = -Math.min(space, natureToGet);
}
p.receiveMana(-current * 50);
orb.addNature(current);
}
if (current >= 0 && orb.getNature() < orb.getMaxNature())
{
current = 20;
orb.addNature(current);
}
}
}
if (current > 0)
{
self.setTransferring(true);
}
}
}
@@ -255,10 +281,14 @@ public class TilePowerFrame extends TileSimpleInventory
{
String name = new ItemStack(frame.getBlockState().getBlock()).getHoverName().getString();
int color = 0x1e90ff;
var stack = frame.getItemHandler().getItem(0);
int color = 0x32cd32;
if (COLOR.get().containsKey(stack.getItem()))
{
color = COLOR.get().get(stack.getItem());
}
int curr = 0;
int max = 500000;
@@ -267,13 +297,25 @@ public class TilePowerFrame extends TileSimpleInventory
{
curr = manaItem.getMana();
max = manaItem.getMaxMana();
} else if (stack.getItem() instanceof NatureOrb orb)
} else
{
curr = orb.getXP(stack);
var orb = chick.extrabotany.xplat.IXplatAbstractions.INSTANCE.findNatureOrbItem(stack);
if (orb != null)
{
curr = orb.getNature();
max = orb.getMaxNature();
}
}
BotaniaAPIClient.instance().drawSimpleManaHUD(ms, color, curr, max, name);
RenderSystem.setShaderColor(1F, 1F, 1F, 1F);
}
}
protected static Supplier<Map<Item, Integer>> COLOR = Suppliers.memoize(() -> Map.of(
vazkii.botania.common.item.ModItems.manaRing, 0x1e90ff,
vazkii.botania.common.item.ModItems.manaRingGreater, 0x7cfc00,
ModItems.NATURE_ORB.get(), 0x7fff00,
ModItems.SAGES_MANA_RING.get(), 0xffff00
));
}

View File

@@ -189,26 +189,23 @@ public class EntityEGO extends Monster implements IEntityAdditionalSpawnData
return false;
}
//TODO:自然宝珠
/*
if (stack.getItem() == ModItems.natureorb)
var orb = chick.extrabotany.xplat.IXplatAbstractions.INSTANCE.findNatureOrbItem(stack);
if (orb != null)
{
ItemNatureOrb orb = (ItemNatureOrb) stack.getItem();
if (orb.getXP(stack) < 200000)
if (orb.getNature() < 200000 || !orb.canExportManaToPool(level.getBlockEntity(pos)))
return false;
}
*/
//all checks ok, spawn the boss
if (!level.isClientSide)
{
//if (stack.getItem() == ModItems.natureorb)
//{
// ItemNatureOrb orb = (ItemNatureOrb) stack.getItem();
// orb.setXP(stack, orb.getXP(stack) - 200000);
//} else
stack.shrink(1);
if (orb != null)
{
orb.addNature(-200000);
} else
{
stack.shrink(1);
}
EntityEGO e = ModEntities.EGO.create(level);
e.tpDelay = SPAWN_TICKS;

View File

@@ -0,0 +1,159 @@
package chick.extrabotany.common.optional;
import chick.extrabotany.ExtraBotany;
import chick.extrabotany.common.optional.tconstruct.TConCompat;
import net.minecraft.world.item.Item;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* <b style=color:rgb(0,255,255)>copied from twilight forest</b><p>
* I was having an issue where the game refused to load with the enum method and I couldnt figure it out, so I moved to a new method of registering compat
* </p>It works the same as it used to, but all the content for each mod should be in its own class.
**/
public abstract class EXBOTCompat
{
public static final String TCON_ID = "tconstruct";
public static final String TWILIGHT_FOREST = "twilightforest";
public static HashMap<String, Class<? extends EXBOTCompat>> classes = new HashMap<>();
public static Set<EXBOTCompat> modules = new HashSet<>();
static
{
classes.put(TCON_ID, TConCompat.class);
}
protected EXBOTCompat(String modName)
{
this.modName = modName;
}
public static void preInitCompat()
{
for (Map.Entry<String, Class<? extends EXBOTCompat>> entry : classes.entrySet())
{
if (ModList.get().isLoaded(entry.getKey()))
{
try
{
EXBOTCompat compat = entry.getValue().newInstance();
modules.add(compat);
compat.isActivated = compat.preInit();
if (compat.isActivated)
{
ExtraBotany.LOGGER.info("Loaded compatibility for mod {}.", compat.modName);
} else
{
ExtraBotany.LOGGER.warn("Couldn't activate compatibility for mod {}!", compat.modName);
}
} catch (Exception e)
{
ExtraBotany.LOGGER.error("Had a {} error loading {} compatibility in preInit!", e.getLocalizedMessage(), entry.getKey());
ExtraBotany.LOGGER.catching(e.fillInStackTrace());
}
} else
{
ExtraBotany.LOGGER.info("Skipped compatibility for mod {}.", entry.getKey());
}
}
}
public static void initCompat(FMLCommonSetupEvent event)
{
for (EXBOTCompat compat : modules)
{
if (compat.isActivated)
{
try
{
compat.init(event);
} catch (Exception e)
{
compat.isActivated = false;
ExtraBotany.LOGGER.error("Had a {} error loading {} compatibility in init!", e.getLocalizedMessage(), compat.modName);
ExtraBotany.LOGGER.catching(e.fillInStackTrace());
}
}
}
}
public static void initCompatItems(RegistryEvent.Register<Item> evt)
{
for (EXBOTCompat compat : modules)
{
if (compat.isActivated)
{
try
{
compat.initItems(evt);
} catch (Exception e)
{
compat.isActivated = false;
ExtraBotany.LOGGER.error("Had a {} error loading {} compatibility in initializing items!", e.getLocalizedMessage(), compat.modName);
ExtraBotany.LOGGER.catching(e.fillInStackTrace());
}
}
}
}
public static void postInitCompat()
{
for (EXBOTCompat compat : modules)
{
if (compat.isActivated)
{
try
{
compat.postInit();
} catch (Exception e)
{
compat.isActivated = false;
ExtraBotany.LOGGER.error("Had a {} error loading {} compatibility in postInit!", e.getLocalizedMessage(), compat.modName);
ExtraBotany.LOGGER.catching(e.fillInStackTrace());
}
}
}
}
public static void sendIMCs()
{
for (EXBOTCompat compat : modules)
{
if (compat.isActivated)
{
try
{
compat.handleIMCs();
} catch (Exception e)
{
compat.isActivated = false;
ExtraBotany.LOGGER.error("Had a {} error loading {} compatibility in sending IMCs!", e.getLocalizedMessage(), compat.modName);
ExtraBotany.LOGGER.catching(e.fillInStackTrace());
}
}
}
}
protected abstract boolean preInit();
protected abstract void init(FMLCommonSetupEvent event);
protected abstract void postInit();
protected abstract void handleIMCs();
protected abstract void initItems(RegistryEvent.Register<Item> evt);
public final String modName;
private boolean isActivated = false;
}

View File

@@ -0,0 +1,119 @@
package chick.extrabotany.common.optional.tconstruct;
import chick.extrabotany.ExtraBotany;
import chick.extrabotany.common.libs.LibItemNames;
import chick.extrabotany.common.optional.EXBOTCompat;
import chick.extrabotany.common.optional.tconstruct.data.TConDataGenerator;
import net.minecraft.data.DataGenerator;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.material.Material;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fluids.ForgeFlowingFluid;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.forge.event.lifecycle.GatherDataEvent;
import slimeknights.mantle.registration.ModelFluidAttributes;
import slimeknights.mantle.registration.deferred.FluidDeferredRegister;
import slimeknights.mantle.registration.object.FluidObject;
import slimeknights.tconstruct.library.client.data.material.AbstractMaterialSpriteProvider;
import slimeknights.tconstruct.library.data.material.AbstractMaterialDataProvider;
import slimeknights.tconstruct.library.materials.definition.MaterialId;
import slimeknights.tconstruct.library.modifiers.util.ModifierDeferredRegister;
public class TConCompat extends EXBOTCompat
{
protected TConCompat()
{
super("Tinkers Construct");
}
@Override
protected boolean preInit()
{
return true;
}
@Override
protected void init(FMLCommonSetupEvent event)
{
}
@Override
protected void postInit()
{
}
@Override
protected void handleIMCs()
{
}
@Override
protected void initItems(RegistryEvent.Register<Item> evt)
{
}
public static void tConDatagen(GatherDataEvent event)
{
DataGenerator generator = event.getGenerator();
ExistingFileHelper helper = event.getExistingFileHelper();
generator.addProvider(new TConDataGenerator.TConFluidTagGenerator(generator, helper));
generator.addProvider(new TConDataGenerator.EXBOTMaterialRecipes(generator));
generator.addProvider(new TConDataGenerator.EXBOTSmelteryRecipes(generator));
AbstractMaterialSpriteProvider sprites = new TConDataGenerator.EXBOTMaterialSprites();
generator.addProvider(new TConDataGenerator.EXBOTMaterialRenders(generator, sprites));
AbstractMaterialDataProvider materials = new TConDataGenerator.EXBOTMaterialDatagen(generator);
generator.addProvider(materials);
generator.addProvider(new TConDataGenerator.EXBOTMaterialStats(generator, materials));
generator.addProvider(new TConDataGenerator.EXBOTMaterialTraits(generator, materials));
}
//REGISTERED in ForgeCommonInitializer
//fluids
public static final FluidDeferredRegister FLUIDS = new FluidDeferredRegister(ExtraBotany.MODID);
public static final FluidObject<ForgeFlowingFluid> MOLTEN_SHADOWIUM = FLUIDS.register("molten_" + LibItemNames.SHADOW_INGOT, ModelFluidAttributes.builder().temperature(1000).luminosity(0).sound(SoundEvents.BUCKET_FILL_LAVA, SoundEvents.BUCKET_EMPTY_LAVA), Material.LAVA, 15);
public static final FluidObject<ForgeFlowingFluid> MOLTEN_PHOTONIUM = FLUIDS.register("molten_" + LibItemNames.PHOTON_INGOT, ModelFluidAttributes.builder().temperature(1000).luminosity(15).sound(SoundEvents.BUCKET_FILL_LAVA, SoundEvents.BUCKET_EMPTY_LAVA), Material.LAVA, 15);
//modifiers
public static final ModifierDeferredRegister MODIFIERS = ModifierDeferredRegister.create(ExtraBotany.MODID);
//materials
public static final MaterialId NIGHTMARE = id(LibItemNames.NIGHTMARE_FUEL);
public static final MaterialId SPIRIT = id(LibItemNames.SPIRIT_FUEL);
public static final MaterialId SHADOWIUM = id(LibItemNames.SHADOW_INGOT);
public static final MaterialId PHOTONIUM = id(LibItemNames.PHOTON_INGOT);
public static final MaterialId ORICHALCOS = id(LibItemNames.ORICHALCOS);
/*
//Modifiers
public static final StaticModifier<PrecipitateModifier> PRECIPITATE = MODIFIERS.register("precipitate", PrecipitateModifier::new);
public static final StaticModifier<StalwartModifier> STALWART = MODIFIERS.register("stalwart", StalwartModifier::new);
public static final StaticModifier<SuperheatModifier> SUPERHEAT = MODIFIERS.register("superheat", SuperheatModifier::new);
public static final StaticModifier<SynergyModifier> SYNERGY = MODIFIERS.register("synergy", SynergyModifier::new);
public static final StaticModifier<TwilitModifier> TWILIT = MODIFIERS.register("twilit", TwilitModifier::new);
/**
* Creates a new material ID
*
* @param name ID name
* @return Material ID object
*/
private static MaterialId id(String name)
{
return new MaterialId(ExtraBotany.MODID, name);
}
}

View File

@@ -0,0 +1,12 @@
package chick.extrabotany.common.optional.tconstruct.data;
import chick.extrabotany.ExtraBotany;
import slimeknights.tconstruct.TConstruct;
import slimeknights.tconstruct.library.materials.definition.MaterialId;
public class MaterialIds
{
}

View File

@@ -0,0 +1,318 @@
package chick.extrabotany.common.optional.tconstruct.data;
import chick.extrabotany.ExtraBotany;
import chick.extrabotany.common.ModItems;
import chick.extrabotany.common.libs.LibItemNames;
import chick.extrabotany.common.optional.EXBOTCompat;
import chick.extrabotany.common.optional.tconstruct.TConCompat;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.tags.FluidTagsProvider;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraftforge.common.crafting.conditions.ModLoadedCondition;
import net.minecraftforge.common.data.ExistingFileHelper;
import org.jetbrains.annotations.NotNull;
import slimeknights.mantle.registration.object.FluidObject;
import slimeknights.tconstruct.common.TinkerTags;
import slimeknights.tconstruct.common.data.BaseRecipeProvider;
import slimeknights.tconstruct.library.client.data.material.AbstractMaterialRenderInfoProvider;
import slimeknights.tconstruct.library.client.data.material.AbstractMaterialSpriteProvider;
import slimeknights.tconstruct.library.client.data.spritetransformer.GreyToColorMapping;
import slimeknights.tconstruct.library.data.material.AbstractMaterialDataProvider;
import slimeknights.tconstruct.library.data.material.AbstractMaterialStatsDataProvider;
import slimeknights.tconstruct.library.data.material.AbstractMaterialTraitDataProvider;
import slimeknights.tconstruct.library.data.recipe.ICommonRecipeHelper;
import slimeknights.tconstruct.library.data.recipe.IMaterialRecipeHelper;
import slimeknights.tconstruct.library.data.recipe.ISmelteryRecipeHelper;
import slimeknights.tconstruct.tools.TinkerModifiers;
import slimeknights.tconstruct.tools.stats.ExtraMaterialStats;
import slimeknights.tconstruct.tools.stats.HandleMaterialStats;
import slimeknights.tconstruct.tools.stats.HeadMaterialStats;
import javax.annotation.Nullable;
import java.util.function.Consumer;
public class TConDataGenerator
{
public static class TConFluidTagGenerator extends FluidTagsProvider
{
public TConFluidTagGenerator(DataGenerator generator, @Nullable ExistingFileHelper existingFileHelper)
{
super(generator, ExtraBotany.MODID, existingFileHelper);
}
@Override
protected void addTags()
{
tagAll(TConCompat.MOLTEN_SHADOWIUM);
tagAll(TConCompat.MOLTEN_PHOTONIUM);
// tagLocal(TConCompat.FIERY_ESSENCE);
this.tag(TinkerTags.Fluids.METAL_TOOLTIPS)
.addTag(TConCompat.MOLTEN_SHADOWIUM.getForgeTag())
.addTag(TConCompat.MOLTEN_PHOTONIUM.getForgeTag());
this.tag(TinkerTags.Fluids.CHEAP_METAL_SPILLING)
.addTag(TConCompat.MOLTEN_SHADOWIUM.getForgeTag())
.addTag(TConCompat.MOLTEN_PHOTONIUM.getForgeTag());
}
private void tagLocal(FluidObject<?> fluid)
{
tag(fluid.getLocalTag())
.addOptional(fluid.getStill().getRegistryName())
.addOptional(fluid.getFlowing().getRegistryName());
}
private void tagAll(FluidObject<?> fluid)
{
tagLocal(fluid);
tag(fluid.getForgeTag()).addOptionalTag(fluid.getLocalTag().location());
}
}
public static class EXBOTMaterialDatagen extends AbstractMaterialDataProvider
{
public EXBOTMaterialDatagen(DataGenerator gen)
{
super(gen);
}
@Override
protected void addMaterials()
{
addMaterial(TConCompat.NIGHTMARE, 2, ORDER_WEAPON, true);
addMaterial(TConCompat.SPIRIT, 2, ORDER_WEAPON, true);
addMaterial(TConCompat.SHADOWIUM, 3, ORDER_WEAPON, false);
addMaterial(TConCompat.PHOTONIUM, 3, ORDER_WEAPON, false);
addMaterial(TConCompat.ORICHALCOS, 4, ORDER_WEAPON, false);
}
@Override
public @NotNull String getName()
{
return "Extrabotany Materials";
}
}
public static class EXBOTMaterialRecipes extends BaseRecipeProvider implements IMaterialRecipeHelper
{
public EXBOTMaterialRecipes(DataGenerator generator)
{
super(generator);
}
@Override
protected void buildCraftingRecipes(Consumer<FinishedRecipe> consumer)
{
materialMeltingCasting(withCondition(consumer, new ModLoadedCondition(EXBOTCompat.TCON_ID)), TConCompat.SHADOWIUM, TConCompat.MOLTEN_SHADOWIUM, true, "tools/materials/");
materialMeltingCasting(withCondition(consumer, new ModLoadedCondition(EXBOTCompat.TCON_ID)), TConCompat.PHOTONIUM, TConCompat.MOLTEN_SHADOWIUM, true, "tools/materials/");
metalMaterialRecipe(withCondition(consumer, new ModLoadedCondition(EXBOTCompat.TCON_ID)), TConCompat.SHADOWIUM, "tools/materials/", LibItemNames.SHADOW_INGOT, false);
metalMaterialRecipe(withCondition(consumer, new ModLoadedCondition(EXBOTCompat.TCON_ID)), TConCompat.PHOTONIUM, "tools/materials/", LibItemNames.PHOTON_INGOT, false);
materialRecipe(withCondition(consumer, new ModLoadedCondition(EXBOTCompat.TCON_ID)), TConCompat.NIGHTMARE, Ingredient.of(ModItems.NIGHTMARE_FUEL.get()), 1, 1, "tools/materials/" + LibItemNames.NIGHTMARE_FUEL);
materialRecipe(withCondition(consumer, new ModLoadedCondition(EXBOTCompat.TCON_ID)), TConCompat.SPIRIT, Ingredient.of(ModItems.SPIRIT_FRAG.get()), 1, 1, "tools/materials/" + LibItemNames.SPIRIT_FUEL);
}
@Override
public @NotNull String getName()
{
return "Extrabotany Material Recipes";
}
}
public static class EXBOTMaterialRenders extends AbstractMaterialRenderInfoProvider
{
public EXBOTMaterialRenders(DataGenerator gen, @Nullable AbstractMaterialSpriteProvider materialSprites)
{
super(gen, materialSprites);
}
@Override
protected void addMaterialRenderInfo()
{
buildRenderInfo(TConCompat.ORICHALCOS).fallbacks("metal");
buildRenderInfo(TConCompat.SHADOWIUM).fallbacks("metal");
buildRenderInfo(TConCompat.PHOTONIUM).luminosity(15).fallbacks("metal");
buildRenderInfo(TConCompat.NIGHTMARE);
buildRenderInfo(TConCompat.SPIRIT);
}
@Override
public @NotNull String getName()
{
return "Extrabotany Material Renders";
}
}
public static class EXBOTMaterialSprites extends AbstractMaterialSpriteProvider
{
@Override
public @NotNull String getName()
{
return "Extrabotany Material Sprites";
}
@Override
protected void addAllMaterials()
{
buildMaterial(TConCompat.PHOTONIUM)
.meleeHarvest()
.colorMapper(GreyToColorMapping.builder()
.addARGB(63, 0xFFFFD83A)
.addARGB(102, 0xFFDA7600)
.addARGB(140, 0xFF0B0507)
.addARGB(178, 0xFF191313)
.addARGB(216, 0xFF3A2424)
.addARGB(255, 0xFF413333)
.build());
buildMaterial(TConCompat.SHADOWIUM)
.meleeHarvest()
.colorMapper(GreyToColorMapping.builderFromBlack()
.addARGB(63, 0xFF505E4C)
.addARGB(102, 0xFF5D7667)
.addARGB(140, 0xFF81887D)
.addARGB(178, 0xFFAFBAA1)
.addARGB(216, 0xFFC4D6AE)
.addARGB(255, 0xFFF9FFD6)
.build());
buildMaterial(TConCompat.NIGHTMARE)
.statType(HeadMaterialStats.ID)
.colorMapper(GreyToColorMapping.builderFromBlack()
.addARGB(63, 0xFF0C1708)
.addARGB(102, 0x172911)
.addARGB(140, 0xFF1B4B4E)
.addARGB(178, 0xFF254B29)
.addARGB(216, 0xFF325D25)
.addARGB(255, 0xFF575E1C)
.build());
buildMaterial(TConCompat.SPIRIT)
.meleeHarvest()
.colorMapper(GreyToColorMapping.builderFromBlack()
.addARGB(63, 0xFF081608)
.addARGB(102, 0xFF1A2B11)
.addARGB(140, 0xFF27401D)
.addARGB(178, 0xFF345E27)
.addARGB(216, 0xFF569243)
.addARGB(255, 0xFF8CB05A)
.build());
}
}
public static class EXBOTMaterialStats extends AbstractMaterialStatsDataProvider
{
public EXBOTMaterialStats(DataGenerator gen, AbstractMaterialDataProvider materials)
{
super(gen, materials);
}
@Override
public @NotNull String getName()
{
return "Extrabotany Material Stats";
}
@Override
protected void addMaterialStats()
{
addMaterialStats(TConCompat.ORICHALCOS,
new HeadMaterialStats(1145, 14.0F, Tiers.NETHERITE, 2.5F),
ExtraMaterialStats.DEFAULT,
HandleMaterialStats.DEFAULT);
addMaterialStats(TConCompat.PHOTONIUM,
new HeadMaterialStats(720, 6.5F, Tiers.DIAMOND, 3.0F),
ExtraMaterialStats.DEFAULT,
HandleMaterialStats.DEFAULT);
addMaterialStats(TConCompat.SHADOWIUM,
new HeadMaterialStats(900, 6.0F, Tiers.NETHERITE, 2.5F),
ExtraMaterialStats.DEFAULT,
HandleMaterialStats.DEFAULT);
addMaterialStats(TConCompat.NIGHTMARE,
new HeadMaterialStats(460, 9.0F, Tiers.STONE, 2.0F));
addMaterialStats(TConCompat.SPIRIT,
new HeadMaterialStats(180, 6.0F, Tiers.IRON, 2.5F),
ExtraMaterialStats.DEFAULT,
HandleMaterialStats.DEFAULT);
}
}
public static class EXBOTMaterialTraits extends AbstractMaterialTraitDataProvider
{
public EXBOTMaterialTraits(DataGenerator gen, AbstractMaterialDataProvider materials)
{
super(gen, materials);
}
@Override
protected void addMaterialTraits()
{
addDefaultTraits(TConCompat.ORICHALCOS, TinkerModifiers.experienced, TinkerModifiers.axeScrape, TinkerModifiers.autosmelt, TinkerModifiers.fiery);
addDefaultTraits(TConCompat.PHOTONIUM, TinkerModifiers.axeScrape, TinkerModifiers.axeScrape, TinkerModifiers.autosmelt, TinkerModifiers.fiery);
addDefaultTraits(TConCompat.SHADOWIUM, TinkerModifiers.axeScrape, TinkerModifiers.axeScrape);
addDefaultTraits(TConCompat.NIGHTMARE, TinkerModifiers.axeScrape, TinkerModifiers.axeScrape);
addDefaultTraits(TConCompat.SPIRIT, TinkerModifiers.axeScrape, TinkerModifiers.axeScrape);
}
@Override
public @NotNull String getName()
{
return "Extrabotany Traits";
}
}
public static class EXBOTSmelteryRecipes extends BaseRecipeProvider implements ISmelteryRecipeHelper, ICommonRecipeHelper
{
public EXBOTSmelteryRecipes(DataGenerator generator)
{
super(generator);
}
@Override
protected void buildCraftingRecipes(Consumer<FinishedRecipe> consumer)
{
// this.metalTagCasting(withCondition(consumer, new ModLoadedCondition(EXBOTCompat.TCON_ID)), TConCompat.MOLTEN_KNIGHTMETAL, "knightmetal", "smeltery/casting/metal/", true);
// this.metalMelting(withCondition(consumer, new ModLoadedCondition(EXBOTCompat.TCON_ID)), TConCompat.MOLTEN_KNIGHTMETAL.get(), "knightmetal", false, "smeltery/melting/metal", false);
// this.metalTagCasting(withCondition(consumer, new ModLoadedCondition(EXBOTCompat.TCON_ID)), TConCompat.MOLTEN_FIERY, "fiery", "smeltery/casting/metal/", true);
// this.metalMelting(withCondition(consumer, new ModLoadedCondition(EXBOTCompat.TCON_ID)), TConCompat.MOLTEN_FIERY.get(), "fiery", false, "smeltery/melting/metal", false);
// MeltingFuelBuilder.fuel(new FluidStack(TConCompat.FIERY_ESSENCE.get(), 50), 300)
// .save(withCondition(consumer, new ModLoadedCondition(EXBOTCompat.TCON_ID)), modResource("smeltery/melting/fuel/fiery_essence"));
}
@Override
public String getModId()
{
return ExtraBotany.MODID;
}
@Override
public String getName()
{
return "Extrabotany Smeltery Recipes";
}
}
}

View File

@@ -0,0 +1,5 @@
package chick.extrabotany.common.optional.tconstruct.libs;
public final class TCLibNames
{
}

View File

@@ -1,11 +1,14 @@
package chick.extrabotany.datagen;
import chick.extrabotany.ExtraBotany;
import chick.extrabotany.common.optional.EXBOTCompat;
import chick.extrabotany.common.optional.tconstruct.TConCompat;
import chick.extrabotany.datagen.lang.EN_USLanguageProvider;
import chick.extrabotany.datagen.lang.ZH_CNLanguageProvider;
import chick.extrabotany.datagen.recipes.*;
import net.minecraft.data.DataGenerator;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.forge.event.lifecycle.GatherDataEvent;
@@ -36,6 +39,11 @@ public class DataGenerators
generator.addProvider(new EN_USLanguageProvider(generator, "en_us"));
generator.addProvider(new ZH_CNLanguageProvider(generator, "zh_cn"));
}
if (ModList.get().isLoaded(EXBOTCompat.TCON_ID))
{
TConCompat.tConDatagen(event);
}
}
private static void RecipeData(GatherDataEvent event, DataGenerator generator)

View File

@@ -8,9 +8,11 @@ import net.minecraft.core.Registry;
import net.minecraft.data.DataGenerator;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.client.model.generators.BlockStateProvider;
import net.minecraftforge.client.model.generators.ConfiguredModel;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.fluids.ForgeFlowingFluid;
import vazkii.botania.common.block.BlockFloatingSpecialFlower;
import vazkii.botania.common.block.BlockSpecialFlower;
@@ -40,7 +42,11 @@ public class ModBlockStates extends BlockStateProvider
} else if (block instanceof BlockFloatingSpecialFlower)
{
simpleFloatingFlowerTexture(block);
} else //simple block
} else if (block.getRegistryName().getPath().startsWith("molten"))
{
} else
//simple block
{
simpleBlock(block);
}

View File

@@ -35,6 +35,7 @@ public class ModItemModels extends ItemModelProvider
.filter(p -> !(p instanceof ShieldItem))
.filter(p -> !(p instanceof SwordItem))
.filter(p -> !(p instanceof ProjectileWeaponItem))
.filter(p -> !(p.getRegistryName().getPath().startsWith("molten")))
.toList());
//write in ModItemOverrideModel
list.remove(ModItems.MINI_TORNADO_ROD.get());

View File

@@ -134,6 +134,7 @@ public class EN_USLanguageProvider extends LanguageProvider
add(ModItems.FIRST_FRACTAL.get(), "First Fractal");
add(ModItems.FAILNAUGHT.get(), "Failnaught");
add(ModItems.EXCALIBER.get(), "Excaliber");
add(ModItems.JUDAH_OATH.get(), "Judah of Oath");
add(ModItems.SHADOW_WARRIOR_HELM.get(), "Shadow Warrior Helmet");
add(ModItems.SHADOW_WARRIOR_CHEST.get(), "Shadow Warrior Chestplate");

View File

@@ -134,6 +134,7 @@ public class ZH_CNLanguageProvider extends LanguageProvider
add(ModItems.FIRST_FRACTAL.get(), "最初分型");
add(ModItems.FAILNAUGHT.get(), "百中弓");
add(ModItems.EXCALIBER.get(), "王者圣剑");
add(ModItems.JUDAH_OATH.get(), "犹大的誓约");
add(ModItems.SHADOW_WARRIOR_HELM.get(), "暗影武士头盔");

View File

@@ -1,7 +1,8 @@
package chick.extrabotany.forge;
import chick.extrabotany.ExtraBotany;
import chick.extrabotany.api.cap.ExtraBotanyCapabilities;
import chick.extrabotany.api.cap.EXBOTCapabilities;
import chick.extrabotany.api.cap.INatureOrbItem;
import chick.extrabotany.api.cap.IPassiveFlowerCap;
import chick.extrabotany.common.ModItems;
import chick.extrabotany.common.baubles.NatureOrb;
@@ -9,7 +10,6 @@ import chick.extrabotany.common.baubles.relic.MoonPendant;
import chick.extrabotany.common.baubles.relic.SagesManaRing;
import chick.extrabotany.common.baubles.relic.SunRing;
import chick.extrabotany.common.blocks.ModSubtiles;
import chick.extrabotany.common.blocks.ModTiles;
import chick.extrabotany.common.tools.weapons.*;
import chick.extrabotany.common.tools.weapons.ranged.Failnaught;
import chick.extrabotany.forge.impl.IPassiveFlowerCapImpl;
@@ -21,28 +21,22 @@ import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraftforge.event.AttachCapabilitiesEvent;
import vazkii.botania.api.BotaniaForgeCapabilities;
import vazkii.botania.api.BotaniaForgeClientCapabilities;
import vazkii.botania.api.block.IWandHUD;
import vazkii.botania.api.item.IRelic;
import vazkii.botania.api.mana.IManaItem;
import vazkii.botania.common.item.equipment.bauble.ItemManaRing;
import vazkii.botania.forge.CapabilityUtil;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.function.Function;
import java.util.function.Supplier;
import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;
public class CommonCapabilityInit
{
private static final Supplier<Map<Item, Function<ItemStack, IManaItem>>> MANA_ITEM = Suppliers.memoize(() -> Map.of(
ModItems.SAGES_MANA_RING.get(), SagesManaRing.GreaterManaItem::new
));
private static final Supplier<Map<Item, Function<ItemStack, IManaItem>>> NATURE_ORB = Suppliers.memoize(() -> Map.of(
ModItems.NATURE_ORB.get(), ItemManaRing.ManaItem::new
private static final Supplier<Map<Item, Function<ItemStack, INatureOrbItem>>> NATURE_ORB = Suppliers.memoize(() -> Map.of(
ModItems.NATURE_ORB.get(), NatureOrb.NatureOrbItem::new
));
private static final Supplier<Map<Item, Function<ItemStack, IRelic>>> RELIC = Suppliers.memoize(() -> Map.of(
@@ -75,7 +69,7 @@ public class CommonCapabilityInit
if (makeNatureOrb != null)
{
e.addCapability(new ResourceLocation(ExtraBotany.MODID, "nature_orb"),
CapabilityUtil.makeProvider(ExtraBotanyCapabilities.NATURE_ORB, makeNatureOrb.apply(stack)));
CapabilityUtil.makeProvider(EXBOTCapabilities.NATURE_ORB, makeNatureOrb.apply(stack)));
}
var makeRelic = RELIC.get().get(stack.getItem());
@@ -105,7 +99,7 @@ public class CommonCapabilityInit
if (passiveFlower != null)
{
e.addCapability(new ResourceLocation(ExtraBotany.MODID, "passive_flower"),
CapabilityUtil.makeProvider(ExtraBotanyCapabilities.PASSIVE_FLOWER, passiveFlower.apply(be)));
CapabilityUtil.makeProvider(EXBOTCapabilities.PASSIVE_FLOWER, passiveFlower.apply(be)));
}
}

View File

@@ -7,10 +7,13 @@ import chick.extrabotany.common.blocks.ModSubtiles;
import chick.extrabotany.common.blocks.ModTiles;
import chick.extrabotany.common.blocks.tile.TileDimensionCatalyst;
import chick.extrabotany.common.brews.ModBrews;
import chick.extrabotany.common.optional.EXBOTCompat;
import chick.extrabotany.common.optional.tconstruct.TConCompat;
import chick.extrabotany.network.NetworkHandler;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraftforge.api.distmarker.Dist;
@@ -19,8 +22,11 @@ import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.event.entity.EntityAttributeCreationEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.IForgeRegistry;
@@ -50,7 +56,7 @@ public class ForgeCommonInitializer
NetworkHandler.registerMessage();
bus.addListener((PlayerEvent.PlayerLoggedOutEvent e) -> CoreGod.playerLoggedOut((ServerPlayer) e.getPlayer()));
}
}
public static void registryInit()
{
@@ -64,6 +70,15 @@ public class ForgeCommonInitializer
//potions and brews
ModBrews.registerBrews();
if (ModList.get().isLoaded(EXBOTCompat.TCON_ID))
{
TConCompat.FLUIDS.register(bus);
TConCompat.MODIFIERS.register(bus);
}
//compat mod sends IMCs
bus.addListener(ForgeCommonInitializer::sendIMCs);
//tiles
bind(ForgeRegistries.BLOCK_ENTITIES, ModTiles::registerTiles);
//flowers(subtiles)
@@ -84,6 +99,17 @@ public class ForgeCommonInitializer
//bus.addGenericListener(Block.class, (RegistryEvent.Register<Block> e) -> ModLootModifiers.init());
}
public static void sendIMCs(InterModEnqueueEvent evt)
{
EXBOTCompat.sendIMCs();
}
@SubscribeEvent
public static void registerCompatItems(RegistryEvent.Register<Item> evt)
{
EXBOTCompat.initCompatItems(evt);
}
public static <T extends IForgeRegistryEntry<T>> void bind(IForgeRegistry<T> registry, Consumer<BiConsumer<T, ResourceLocation>> source)
{
FMLJavaModLoadingContext.get().getModEventBus().addGenericListener(registry.getRegistrySuperType(),

View File

@@ -1,7 +1,8 @@
package chick.extrabotany.forge.xplat;
import chick.extrabotany.ExtraBotany;
import chick.extrabotany.api.cap.ExtraBotanyCapabilities;
import chick.extrabotany.api.cap.EXBOTCapabilities;
import chick.extrabotany.api.cap.INatureOrbItem;
import chick.extrabotany.api.cap.IPassiveFlowerCap;
import chick.extrabotany.xplat.IXplatAbstractions;
import net.minecraft.world.item.ItemStack;
@@ -48,14 +49,14 @@ public class ForgeXplatImpl implements IXplatAbstractions
@Override
public IPassiveFlowerCap findPassiveFlower(BlockEntity blockEntity)
{
return blockEntity.getCapability(ExtraBotanyCapabilities.PASSIVE_FLOWER).orElse(null);
return blockEntity.getCapability(EXBOTCapabilities.PASSIVE_FLOWER).orElse(null);
}
@Nullable
@Override
public IManaItem findNatureOrb(ItemStack stack)
public INatureOrbItem findNatureOrbItem(ItemStack stack)
{
return stack.getCapability(ExtraBotanyCapabilities.NATURE_ORB).orElse(null);
return stack.getCapability(EXBOTCapabilities.NATURE_ORB).orElse(null);
}
}

View File

@@ -1,6 +1,7 @@
package chick.extrabotany.xplat;
import chick.extrabotany.ExtraBotany;
import chick.extrabotany.api.cap.INatureOrbItem;
import chick.extrabotany.api.cap.IPassiveFlowerCap;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.BlockEntity;
@@ -35,7 +36,7 @@ public interface IXplatAbstractions
IPassiveFlowerCap findPassiveFlower(BlockEntity blockEntity);
@Nullable
IManaItem findNatureOrb(ItemStack stack);
INatureOrbItem findNatureOrbItem(ItemStack stack);
IXplatAbstractions INSTANCE = find();

View File

@@ -0,0 +1,17 @@
{
"name": "extrabotany.entry.potato_chip",
"category": "extrabotany:extrabotany",
"icon": "extrabotany:potato_chip",
"advancement": "botania:main/runic_altar_pickup",
"pages": [
{
"type": "text",
"text": "extrabotany.page.potato_chip0"
},
{
"type": "botania:runic_altar",
"text": "extrabotany.page.potato_chip1",
"recipe": "extrabotany:runic_altar/potato_chip"
}
]
}