mirror of
https://github.com/TeamMidnightDust/ThisRocks.git
synced 2025-12-15 10:45:10 +01:00
Merge pull request #55 from TeamMidnightDust/1.21.1
feat: port recent improvements of 1.21.1 version to 1.21.4
This commit is contained in:
@@ -43,7 +43,6 @@ dependencies {
|
||||
modImplementation ("eu.pb4:polymer-core:${polymer_version}")
|
||||
modImplementation ("eu.pb4:polymer-blocks:${polymer_version}")
|
||||
modImplementation ("eu.pb4:polymer-resource-pack:${polymer_version}")
|
||||
modImplementation ("eu.pb4:polymer-resource-pack-extras:${polymer_version}")
|
||||
modImplementation ("eu.pb4:polymer-virtual-entity:${polymer_version}")
|
||||
modImplementation ("eu.pb4:polymer-autohost:${polymer_version}")
|
||||
modImplementation ("eu.pb4:factorytools:${factorytools_version}")
|
||||
|
||||
@@ -3,12 +3,12 @@ org.gradle.jvmargs=-Xmx2G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
minecraft_version=1.21.4
|
||||
yarn_mappings=1.21.4+build.4
|
||||
loader_version=0.16.9
|
||||
minecraft_version=1.21.1
|
||||
yarn_mappings=1.21.1+build.3
|
||||
loader_version=0.16.10
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.9.1
|
||||
mod_version = 1.9.3+1.21.1
|
||||
maven_group = eu.midnightdust.motschen
|
||||
archives_base_name = rocks
|
||||
release_type=release
|
||||
@@ -17,7 +17,7 @@ org.gradle.jvmargs=-Xmx2G
|
||||
|
||||
# Dependencies
|
||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||
fabric_version=0.113.0+1.21.4
|
||||
midnightlib_version=1.6.6-fabric
|
||||
polymer_version=0.11.3+1.21.4
|
||||
factorytools_version=0.5.0+1.21.4
|
||||
fabric_version=0.115.1+1.21.1
|
||||
midnightlib_version=1.6.9+1.21-fabric
|
||||
polymer_version=0.9.18+1.21.1
|
||||
factorytools_version= 0.3.2+1.21
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/acacia_stick"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/andesite_rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/andesite_splitter"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/bamboo_stick"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/birch_stick"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/cherry_stick"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/cobblestone_splitter"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/crimson_stick"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/dark_oak_stick"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/diorite_rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/diorite_splitter"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/end_stone_rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/end_stone_splitter"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/geyser"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/granite_rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/granite_splitter"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/gravel_rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/ice_rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/ice_splitter"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/jungle_stick"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/mangrove_stick"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/nether_geyser"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/netherrack_rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/netherrack_splitter"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/oak_stick"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/pale_oak_stick"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/pinecone"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/red_sand_rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/red_sandstone_splitter"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/sand_rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/sandstone_splitter"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/seashell"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/soul_soil_rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/soul_soil_splitter"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/spruce_stick"
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:select",
|
||||
"block_state_property": "variation",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:block/starfish_red"
|
||||
},
|
||||
"when": "red"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:block/starfish_pink"
|
||||
},
|
||||
"when": "pink"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:block/starfish_orange"
|
||||
},
|
||||
"when": "orange"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/starfish"
|
||||
},
|
||||
"property": "minecraft:block_state"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "rocks:item/warped_stick"
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@
|
||||
"block.rocks.nether_geyser": "Nether-Geysir",
|
||||
"block.rocks.netherrack_rock": "Netherrackbrocken",
|
||||
"block.rocks.oak_stick": "Eichenstock",
|
||||
"block.rocks.pale_oak_stick": "Blasseichenstock",
|
||||
"block.rocks.pinecone": "Tannenzapfen",
|
||||
"block.rocks.red_sand_rock": "Roter Sandsteinbrocken",
|
||||
"block.rocks.rock": "Steinbrocken",
|
||||
@@ -27,44 +26,16 @@
|
||||
"block.rocks.spruce_stick": "Fichtenstock",
|
||||
"block.rocks.starfish": "Seestern",
|
||||
"block.rocks.warped_stick": "Wirrstock",
|
||||
"item.rocks.acacia_stick": "Akazienstock",
|
||||
"item.rocks.andesite_rock": "Andesitbrocken",
|
||||
"item.rocks.andesite_splitter": "Andesitsplitter",
|
||||
"item.rocks.bamboo_stick": "Bambusstock",
|
||||
"item.rocks.birch_stick": "Birkenstock",
|
||||
"item.rocks.cherry_stick": "Kirschstock",
|
||||
"item.rocks.cobblestone_splitter": "Steinsplitter",
|
||||
"item.rocks.crimson_stick": "Karmesinstock",
|
||||
"item.rocks.dark_oak_stick": "Schwarzeichenstock",
|
||||
"item.rocks.diorite_rock": "Dioritbrocken",
|
||||
"item.rocks.cobblestone_splitter": "Bruchsteinsplitter",
|
||||
"item.rocks.diorite_splitter": "Dioritsplitter",
|
||||
"item.rocks.end_stone_rock": "Endsteinbrocken",
|
||||
"item.rocks.end_stone_splitter": "Endsteinsplitter",
|
||||
"item.rocks.geyser": "Geysir",
|
||||
"item.rocks.granite_rock": "Granitbrocken",
|
||||
"item.rocks.granite_splitter": "Granitsplitter",
|
||||
"item.rocks.gravel_rock": "Kiesbrocken",
|
||||
"item.rocks.ice_rock": "Eisbrocken",
|
||||
"item.rocks.ice_splitter": "Eissplitter",
|
||||
"item.rocks.jungle_stick": "Tropenstock",
|
||||
"item.rocks.mangrove_stick": "Mangrovenstock",
|
||||
"item.rocks.nether_geyser": "Nether-Geysir",
|
||||
"item.rocks.netherrack_rock": "Netherrackbrocken",
|
||||
"item.rocks.netherrack_splitter": "Netherracksplitter",
|
||||
"item.rocks.oak_stick": "Eichenstock",
|
||||
"item.rocks.pale_oak_stick": "Blasseichenstock",
|
||||
"item.rocks.pinecone": "Tannenzapfen",
|
||||
"item.rocks.red_sand_rock": "Roter Sandsteinbrocken",
|
||||
"item.rocks.red_sandstone_splitter": "Roter Sandsteinsplitter",
|
||||
"item.rocks.rock": "Steinbrocken",
|
||||
"item.rocks.sand_rock": "Sandsteinbrocken",
|
||||
"item.rocks.sandstone_splitter": "Sandsteinsplitter",
|
||||
"item.rocks.seashell": "Muschel",
|
||||
"item.rocks.soul_soil_rock": "Seelenerdebrocken",
|
||||
"item.rocks.soul_soil_splitter": "Seelenerdesplitter",
|
||||
"item.rocks.spruce_stick": "Fichtenstock",
|
||||
"item.rocks.starfish": "Seestern",
|
||||
"item.rocks.warped_stick": "Wirrstock",
|
||||
"itemGroup.rocks.rocks": "This Rocks!",
|
||||
"rocks.midnightconfig.biomeExclusions": "Ausgeschlosene Biome",
|
||||
"rocks.midnightconfig.biomeExclusions.tooltip": "In diesen Biomen werden keine Features der Mod generiert.\nFormat: modid:biome_name",
|
||||
@@ -74,6 +45,8 @@
|
||||
"rocks.midnightconfig.category.sticks": "Stöcke",
|
||||
"rocks.midnightconfig.enablePolymerMode": "Aktiviere Polymer-Modus",
|
||||
"rocks.midnightconfig.enablePolymerMode.tooltip": "Erlaubt der Mod, komplett serverseitig zu funktionieren, wenn Polymer und FactoryTools installiert sind",
|
||||
"rocks.midnightconfig.forcePolymerMode": "Erzwinge Polymer-Modus",
|
||||
"rocks.midnightconfig.forcePolymerMode.tooltip": "Aktiviert den Polymer-Modus auch für Clients, die die ThisRocks! installiert haben",
|
||||
"rocks.midnightconfig.geyserLevitation": "Geysir Schwebeeffekt",
|
||||
"rocks.midnightconfig.needs_restart": "§cStarte das Spiel neu, nachdem du Änderungen vorgenommen hast!",
|
||||
"rocks.midnightconfig.needs_restart1": "§cStarte das Spiel neu, nachdem du Änderungen vorgenommen hast!",
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
"block.rocks.nether_geyser": "Nether Geyser",
|
||||
"block.rocks.netherrack_rock": "Netherrack Rock",
|
||||
"block.rocks.oak_stick": "Oak Stick",
|
||||
"block.rocks.pale_oak_stick": "Pale Oak Stick",
|
||||
"block.rocks.pinecone": "Pinecone",
|
||||
"block.rocks.red_sand_rock": "Red Sandstone Rock",
|
||||
"block.rocks.rock": "Stone Rock",
|
||||
@@ -27,44 +26,16 @@
|
||||
"block.rocks.spruce_stick": "Spruce Stick",
|
||||
"block.rocks.starfish": "Starfish",
|
||||
"block.rocks.warped_stick": "Warped Stick",
|
||||
"item.rocks.acacia_stick": "Acacia Stick",
|
||||
"item.rocks.andesite_rock": "Andesite Rock",
|
||||
"item.rocks.andesite_splitter": "Andesite Splitter",
|
||||
"item.rocks.bamboo_stick": "Bamboo Stick",
|
||||
"item.rocks.birch_stick": "Birch Stick",
|
||||
"item.rocks.cherry_stick": "Cherry Stick",
|
||||
"item.rocks.cobblestone_splitter": "Stone Splitter",
|
||||
"item.rocks.crimson_stick": "Crimson Stick",
|
||||
"item.rocks.dark_oak_stick": "Dark Oak Stick",
|
||||
"item.rocks.diorite_rock": "Diorite Rock",
|
||||
"item.rocks.diorite_splitter": "Diorite Splitter",
|
||||
"item.rocks.end_stone_rock": "End Stone Rock",
|
||||
"item.rocks.end_stone_splitter": "End Stone Splitter",
|
||||
"item.rocks.geyser": "Geyser",
|
||||
"item.rocks.granite_rock": "Granite Rock",
|
||||
"item.rocks.granite_splitter": "Granite Splitter",
|
||||
"item.rocks.gravel_rock": "Gravel Rock",
|
||||
"item.rocks.ice_rock": "Ice Rock",
|
||||
"item.rocks.ice_splitter": "Ice Splitter",
|
||||
"item.rocks.jungle_stick": "Jungle Stick",
|
||||
"item.rocks.mangrove_stick": "Mangrove Stick",
|
||||
"item.rocks.nether_geyser": "Nether Geyser",
|
||||
"item.rocks.netherrack_rock": "Netherrack Rock",
|
||||
"item.rocks.netherrack_splitter": "Netherrack Splitter",
|
||||
"item.rocks.oak_stick": "Oak Stick",
|
||||
"item.rocks.pale_oak_stick": "Pale Oak Stick",
|
||||
"item.rocks.pinecone": "Pinecone",
|
||||
"item.rocks.red_sand_rock": "Red Sandstone Rock",
|
||||
"item.rocks.red_sandstone_splitter": "Red Sandstone Splitter",
|
||||
"item.rocks.rock": "Stone Rock",
|
||||
"item.rocks.sand_rock": "Sandstone Rock",
|
||||
"item.rocks.sandstone_splitter": "Sandstone Splitter",
|
||||
"item.rocks.seashell": "Seashell",
|
||||
"item.rocks.soul_soil_rock": "Soul Soil Rock",
|
||||
"item.rocks.soul_soil_splitter": "Soul Soil Splitter",
|
||||
"item.rocks.spruce_stick": "Spruce Stick",
|
||||
"item.rocks.starfish": "Starfish",
|
||||
"item.rocks.warped_stick": "Warped Stick",
|
||||
"item.rocks.andesite_splitter": "Andesite Fragment",
|
||||
"item.rocks.cobblestone_splitter": "Cobblestone Fragment",
|
||||
"item.rocks.diorite_splitter": "Diorite Fragment",
|
||||
"item.rocks.end_stone_splitter": "End Stone Fragment",
|
||||
"item.rocks.granite_splitter": "Granite Fragment",
|
||||
"item.rocks.ice_splitter": "Ice Fragment",
|
||||
"item.rocks.netherrack_splitter": "Netherrack Fragment",
|
||||
"item.rocks.red_sandstone_splitter": "Red Sandstone Fragment",
|
||||
"item.rocks.sandstone_splitter": "Sandstone Fragment",
|
||||
"item.rocks.soul_soil_splitter": "Soul Soil Fragment",
|
||||
"itemGroup.rocks.rocks": "This Rocks!",
|
||||
"rocks.midnightconfig.biomeExclusions": "Excluded biomes",
|
||||
"rocks.midnightconfig.biomeExclusions.tooltip": "No feature will generate in these biomes.\nFormat: modid:biome_name",
|
||||
@@ -74,6 +45,8 @@
|
||||
"rocks.midnightconfig.category.sticks": "Sticks",
|
||||
"rocks.midnightconfig.enablePolymerMode": "Enable Polymer Mode",
|
||||
"rocks.midnightconfig.enablePolymerMode.tooltip": "Allows the mod to work fully server-sided when used in combination with Polymer and FactoryTools",
|
||||
"rocks.midnightconfig.forcePolymerMode": "Force Polymer Mode",
|
||||
"rocks.midnightconfig.forcePolymerMode.tooltip": "Also enables Polymer mode for clients that have ThisRocks! installed",
|
||||
"rocks.midnightconfig.geyserLevitation": "Geyser Levitation",
|
||||
"rocks.midnightconfig.needs_restart": "§cRestart the game after changing options here!",
|
||||
"rocks.midnightconfig.needs_restart1": "§cRestart the game after changing options here!",
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:alternatives",
|
||||
"children": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:match_tool",
|
||||
"predicate": {
|
||||
"predicates": {
|
||||
"minecraft:enchantments": [
|
||||
{
|
||||
"enchantments": "minecraft:silk_touch",
|
||||
"levels": {
|
||||
"min": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": "rocks:pale_oak_stick"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "minecraft:stick"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,10 +2,18 @@
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "building",
|
||||
"ingredients": [
|
||||
"rocks:andesite_splitter",
|
||||
"rocks:andesite_splitter",
|
||||
"rocks:andesite_splitter",
|
||||
"rocks:andesite_splitter"
|
||||
{
|
||||
"item": "rocks:andesite_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:andesite_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:andesite_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:andesite_splitter"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
|
||||
@@ -2,10 +2,18 @@
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "building",
|
||||
"ingredients": [
|
||||
"rocks:diorite_splitter",
|
||||
"rocks:diorite_splitter",
|
||||
"rocks:diorite_splitter",
|
||||
"rocks:diorite_splitter"
|
||||
{
|
||||
"item": "rocks:diorite_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:diorite_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:diorite_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:diorite_splitter"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
|
||||
@@ -2,10 +2,18 @@
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "building",
|
||||
"ingredients": [
|
||||
"rocks:end_stone_splitter",
|
||||
"rocks:end_stone_splitter",
|
||||
"rocks:end_stone_splitter",
|
||||
"rocks:end_stone_splitter"
|
||||
{
|
||||
"item": "rocks:end_stone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:end_stone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:end_stone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:end_stone_splitter"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
|
||||
@@ -2,10 +2,18 @@
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "building",
|
||||
"ingredients": [
|
||||
"rocks:granite_splitter",
|
||||
"rocks:granite_splitter",
|
||||
"rocks:granite_splitter",
|
||||
"rocks:granite_splitter"
|
||||
{
|
||||
"item": "rocks:granite_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:granite_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:granite_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:granite_splitter"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
|
||||
@@ -2,10 +2,18 @@
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "building",
|
||||
"ingredients": [
|
||||
"rocks:ice_splitter",
|
||||
"rocks:ice_splitter",
|
||||
"rocks:ice_splitter",
|
||||
"rocks:ice_splitter"
|
||||
{
|
||||
"item": "rocks:ice_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:ice_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:ice_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:ice_splitter"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
|
||||
@@ -2,10 +2,18 @@
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "building",
|
||||
"ingredients": [
|
||||
"rocks:netherrack_splitter",
|
||||
"rocks:netherrack_splitter",
|
||||
"rocks:netherrack_splitter",
|
||||
"rocks:netherrack_splitter"
|
||||
{
|
||||
"item": "rocks:netherrack_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:netherrack_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:netherrack_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:netherrack_splitter"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
|
||||
@@ -2,10 +2,18 @@
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "building",
|
||||
"ingredients": [
|
||||
"rocks:red_sandstone_splitter",
|
||||
"rocks:red_sandstone_splitter",
|
||||
"rocks:red_sandstone_splitter",
|
||||
"rocks:red_sandstone_splitter"
|
||||
{
|
||||
"item": "rocks:red_sandstone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:red_sandstone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:red_sandstone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:red_sandstone_splitter"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
|
||||
@@ -2,10 +2,18 @@
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "building",
|
||||
"ingredients": [
|
||||
"rocks:sandstone_splitter",
|
||||
"rocks:sandstone_splitter",
|
||||
"rocks:sandstone_splitter",
|
||||
"rocks:sandstone_splitter"
|
||||
{
|
||||
"item": "rocks:sandstone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:sandstone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:sandstone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:sandstone_splitter"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
|
||||
@@ -2,10 +2,18 @@
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "building",
|
||||
"ingredients": [
|
||||
"rocks:soul_soil_splitter",
|
||||
"rocks:soul_soil_splitter",
|
||||
"rocks:soul_soil_splitter",
|
||||
"rocks:soul_soil_splitter"
|
||||
{
|
||||
"item": "rocks:soul_soil_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:soul_soil_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:soul_soil_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:soul_soil_splitter"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
|
||||
@@ -2,13 +2,21 @@
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "building",
|
||||
"ingredients": [
|
||||
"rocks:cobblestone_splitter",
|
||||
"rocks:cobblestone_splitter",
|
||||
"rocks:cobblestone_splitter",
|
||||
"rocks:cobblestone_splitter"
|
||||
{
|
||||
"item": "rocks:cobblestone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:cobblestone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:cobblestone_splitter"
|
||||
},
|
||||
{
|
||||
"item": "rocks:cobblestone_splitter"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
"id": "minecraft:stone"
|
||||
"id": "minecraft:cobblestone"
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:simple_block",
|
||||
"config": {
|
||||
"to_place": {
|
||||
"type": "minecraft:weighted_state_provider",
|
||||
"entries": [
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "small",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 7
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "medium",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "large",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
{
|
||||
"feature": {
|
||||
"type": "minecraft:simple_block",
|
||||
"config": {
|
||||
"to_place": {
|
||||
"type": "minecraft:weighted_state_provider",
|
||||
"entries": [
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "small",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 7
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "medium",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "large",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"placement": [
|
||||
{
|
||||
"type": "minecraft:count",
|
||||
"count": 20
|
||||
},
|
||||
{
|
||||
"type": "minecraft:rarity_filter",
|
||||
"chance": 1
|
||||
},
|
||||
{
|
||||
"type": "minecraft:in_square"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:heightmap",
|
||||
"heightmap": "WORLD_SURFACE_WG"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:biome"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:block_predicate_filter",
|
||||
"predicate": {
|
||||
"type": "minecraft:all_of",
|
||||
"predicates": [
|
||||
{
|
||||
"type": "minecraft:matching_blocks",
|
||||
"blocks": "minecraft:air"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:matching_blocks",
|
||||
"blocks": [
|
||||
"minecraft:grass_block",
|
||||
"minecraft:pale_moss_block"
|
||||
],
|
||||
"offset": [
|
||||
0,
|
||||
-1,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -4,8 +4,10 @@ import eu.midnightdust.motschen.rocks.blockstates.StarfishVariation;
|
||||
import eu.midnightdust.motschen.rocks.networking.HelloPayload;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
|
||||
import net.minecraft.client.item.ModelPredicateProviderRegistry;
|
||||
import net.minecraft.component.DataComponentTypes;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -16,10 +18,10 @@ public class RocksClient implements ClientModInitializer {
|
||||
public void onInitializeClient() {
|
||||
ClientPlayConnectionEvents.JOIN.register((handler, sender, client) -> sender.sendPacket(new HelloPayload()));
|
||||
|
||||
// for (StarfishVariation variation : StarfishVariation.values()) {
|
||||
// ModelPredicateProviderRegistry.register(RocksMain.Starfish.asItem(), Identifier.of(variation.toString()),
|
||||
// (stack, world, entity, seed) -> matchesVariation(stack, variation));
|
||||
// }
|
||||
for (StarfishVariation variation : StarfishVariation.values()) {
|
||||
ModelPredicateProviderRegistry.register(RocksMain.Starfish.asItem(), Identifier.of(variation.toString()),
|
||||
(stack, world, entity, seed) -> matchesVariation(stack, variation));
|
||||
}
|
||||
}
|
||||
private static Integer matchesVariation(ItemStack stack, StarfishVariation variation) {
|
||||
var blockStateData = stack.getComponents().get(DataComponentTypes.BLOCK_STATE);
|
||||
|
||||
@@ -25,8 +25,6 @@ public class RocksDataGen implements DataGeneratorEntrypoint {
|
||||
pack.addProvider(Recipes::new);
|
||||
pack.addProvider(Language.English::new);
|
||||
pack.addProvider(Language.German::new);
|
||||
|
||||
pack.addProvider(Models::new);
|
||||
}
|
||||
@Override
|
||||
public String getEffectiveModId() {
|
||||
@@ -54,8 +52,8 @@ public class RocksDataGen implements DataGeneratorEntrypoint {
|
||||
|
||||
@Override
|
||||
protected void configure(RegistryWrapper.WrapperLookup registries, Entries entries) {
|
||||
entries.addAll(registries.getOrThrow(RegistryKeys.CONFIGURED_FEATURE));
|
||||
entries.addAll(registries.getOrThrow(RegistryKeys.PLACED_FEATURE));
|
||||
entries.addAll(registries.getWrapperOrThrow(RegistryKeys.CONFIGURED_FEATURE));
|
||||
entries.addAll(registries.getWrapperOrThrow(RegistryKeys.PLACED_FEATURE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -73,12 +73,14 @@ public class RocksMain implements ModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
RocksConfig.init(MOD_ID, RocksConfig.class);
|
||||
if (polymerMode) polymerMode = RocksConfig.enablePolymerMode && !PlatformFunctions.isClientEnv();
|
||||
if (polymerMode) polymerMode = RocksConfig.enablePolymerMode && (RocksConfig.forcePolymerMode || !PlatformFunctions.isClientEnv());
|
||||
|
||||
PayloadTypeRegistry.playC2S().register(HelloPayload.PACKET_ID, HelloPayload.codec);
|
||||
ServerPlayNetworking.registerGlobalReceiver(HelloPayload.PACKET_ID, (payload, context) -> {
|
||||
playersWithMod.add(context.player());
|
||||
if (polymerMode) PolyUtil.hideElementHolders(context.player());
|
||||
if (!RocksConfig.forcePolymerMode) {
|
||||
playersWithMod.add(context.player());
|
||||
if (polymerMode) PolyUtil.hideElementHolders(context.player());
|
||||
}
|
||||
});
|
||||
ServerPlayConnectionEvents.DISCONNECT.register((playNetworkHandler, server) -> {
|
||||
playersWithMod.remove(playNetworkHandler.player);
|
||||
@@ -126,7 +128,7 @@ public class RocksMain implements ModInitializer {
|
||||
|
||||
public static Item simpleItem(Identifier id) {
|
||||
if (polymerMode) return PolyUtil.simplePolymerItem(id);
|
||||
return new Item(new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, id)));
|
||||
return new Item(new Item.Settings());
|
||||
}
|
||||
|
||||
public static void registerItemGroup() {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class NetherGeyser extends BlockWithEntity implements BlockEntityProvider
|
||||
public static final BooleanProperty ACTIVE = BooleanProperty.of("active");
|
||||
|
||||
public NetherGeyser(Identifier blockId) {
|
||||
super(AbstractBlock.Settings.copy(Blocks.STONE).registryKey(RegistryKey.of(RegistryKeys.BLOCK, blockId)).strength(10).noCollision().dynamicBounds().nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(AbstractBlock.Settings.copy(Blocks.STONE).strength(10).noCollision().dynamicBounds().nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(ACTIVE, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityTicker;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
@@ -34,7 +32,7 @@ public class OverworldGeyser extends BlockWithEntity implements BlockEntityProvi
|
||||
public static final BooleanProperty SNOWY = Properties.SNOWY;
|
||||
|
||||
public OverworldGeyser(Identifier blockId) {
|
||||
super(AbstractBlock.Settings.copy(Blocks.STONE).registryKey(RegistryKey.of(RegistryKeys.BLOCK, blockId)).strength(10).noCollision().dynamicBounds().nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(AbstractBlock.Settings.copy(Blocks.STONE).strength(10).noCollision().dynamicBounds().nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(ACTIVE, false).with(SNOWY, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,24 +2,21 @@ package eu.midnightdust.motschen.rocks.block;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.tick.ScheduledTickView;
|
||||
|
||||
public class Pinecone extends Block {
|
||||
|
||||
private static final VoxelShape SHAPE;
|
||||
|
||||
public Pinecone(Identifier blockId) {
|
||||
super(AbstractBlock.Settings.copy(Blocks.POPPY).registryKey(RegistryKey.of(RegistryKeys.BLOCK, blockId)).nonOpaque().dynamicBounds().sounds(BlockSoundGroup.WOOD));
|
||||
super(AbstractBlock.Settings.copy(Blocks.POPPY).nonOpaque().dynamicBounds().sounds(BlockSoundGroup.WOOD));
|
||||
this.setDefaultState(this.stateManager.getDefaultState());
|
||||
}
|
||||
|
||||
@@ -35,11 +32,11 @@ public class Pinecone extends Block {
|
||||
return world.getBlockState(pos.down()).isSideSolidFullSquare(world,pos,Direction.UP);
|
||||
}
|
||||
@Override
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, WorldView world, ScheduledTickView tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, Random random) {
|
||||
return !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, world, tickView, pos, direction, neighborPos, neighborState, random);
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
|
||||
return !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos);
|
||||
}
|
||||
@Override
|
||||
protected boolean isTransparent(BlockState state) {return true;}
|
||||
protected boolean isTransparent(BlockState state, BlockView world, BlockPos pos) {return true;}
|
||||
@Override
|
||||
protected boolean canReplace(BlockState state, ItemPlacementContext context) {return true;}
|
||||
}
|
||||
|
||||
@@ -5,24 +5,19 @@ import eu.midnightdust.motschen.rocks.blockstates.RockVariation;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.EnumProperty;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.tick.ScheduledTickView;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -33,7 +28,7 @@ public class Rock extends Block {
|
||||
private static final EnumProperty<RockVariation> ROCK_VARIATION = RocksMain.ROCK_VARIATION;
|
||||
|
||||
public Rock(Identifier blockId) {
|
||||
super(AbstractBlock.Settings.copy(Blocks.POPPY).registryKey(RegistryKey.of(RegistryKeys.BLOCK, blockId)).nonOpaque().dynamicBounds().sounds(BlockSoundGroup.STONE));
|
||||
super(AbstractBlock.Settings.copy(Blocks.POPPY).nonOpaque().dynamicBounds().sounds(BlockSoundGroup.STONE));
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(ROCK_VARIATION, RockVariation.TINY));
|
||||
}
|
||||
|
||||
@@ -69,11 +64,11 @@ public class Rock extends Block {
|
||||
return world.getBlockState(pos.down()).isSideSolidFullSquare(world,pos,Direction.UP);
|
||||
}
|
||||
@Override
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, WorldView world, ScheduledTickView tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, Random random) {
|
||||
return !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, world, tickView, pos, direction, neighborPos, neighborState, random);
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
|
||||
return !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos);
|
||||
}
|
||||
@Override
|
||||
protected boolean isTransparent(BlockState state) {return true;}
|
||||
protected boolean isTransparent(BlockState state, BlockView world, BlockPos pos) {return true;}
|
||||
@Override
|
||||
protected boolean canReplace(BlockState state, ItemPlacementContext context) {return true;}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
@@ -19,12 +17,11 @@ import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.tick.ScheduledTickView;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -35,7 +32,7 @@ public class Seashell extends Block implements Waterloggable {
|
||||
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
|
||||
|
||||
public Seashell(Identifier blockId) {
|
||||
super(AbstractBlock.Settings.copy(Blocks.POPPY).registryKey(RegistryKey.of(RegistryKeys.BLOCK, blockId)).nonOpaque().dynamicBounds().sounds(BlockSoundGroup.STONE));
|
||||
super(AbstractBlock.Settings.copy(Blocks.POPPY).nonOpaque().dynamicBounds().sounds(BlockSoundGroup.STONE));
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(SEASHELL_VARIATION, SeashellVariation.PINK).with(WATERLOGGED, false));
|
||||
}
|
||||
|
||||
@@ -78,8 +75,8 @@ public class Seashell extends Block implements Waterloggable {
|
||||
return world.getBlockState(pos.down()).isSideSolidFullSquare(world,pos,Direction.UP);
|
||||
}
|
||||
@Override
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, WorldView world, ScheduledTickView tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, Random random) {
|
||||
return !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, world, tickView, pos, direction, neighborPos, neighborState, random);
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
|
||||
return !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos);
|
||||
}
|
||||
@Override
|
||||
protected boolean canReplace(BlockState state, ItemPlacementContext context) {return true;}
|
||||
|
||||
@@ -11,8 +11,6 @@ import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
@@ -23,17 +21,14 @@ import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.tick.ScheduledTickView;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import static eu.midnightdust.motschen.rocks.RocksMain.id;
|
||||
|
||||
public class Starfish extends Block implements Waterloggable {
|
||||
|
||||
private static final VoxelShape SHAPE;
|
||||
@@ -41,7 +36,7 @@ public class Starfish extends Block implements Waterloggable {
|
||||
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
|
||||
|
||||
public Starfish(Identifier blockId) {
|
||||
super(AbstractBlock.Settings.copy(Blocks.POPPY).registryKey(RegistryKey.of(RegistryKeys.BLOCK, blockId)).nonOpaque().dynamicBounds().sounds(BlockSoundGroup.CORAL));
|
||||
super(AbstractBlock.Settings.copy(Blocks.POPPY).nonOpaque().dynamicBounds().sounds(BlockSoundGroup.CORAL));
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(STARFISH_VARIATION, StarfishVariation.RED).with(WATERLOGGED, false));
|
||||
}
|
||||
|
||||
@@ -58,9 +53,9 @@ public class Starfish extends Block implements Waterloggable {
|
||||
.with(WATERLOGGED, fluidState.getFluid() == Fluids.WATER);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getPickStack(WorldView world, BlockPos pos, BlockState state, boolean includeData) {
|
||||
public ItemStack getPickStack(WorldView world, BlockPos pos, BlockState state) {
|
||||
ItemStack stack = new ItemStack(this);
|
||||
stack.applyComponentsFrom(ComponentMap.builder().add(DataComponentTypes.ITEM_MODEL, id("starfish")).add(DataComponentTypes.BLOCK_STATE, BlockStateComponent.DEFAULT.with(STARFISH_VARIATION, state.get(STARFISH_VARIATION))).build());
|
||||
stack.applyComponentsFrom(ComponentMap.builder().add(DataComponentTypes.BLOCK_STATE, BlockStateComponent.DEFAULT.with(STARFISH_VARIATION, state.get(STARFISH_VARIATION))).build());
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -89,8 +84,8 @@ public class Starfish extends Block implements Waterloggable {
|
||||
return world.getBlockState(pos.down()).isSideSolidFullSquare(world,pos,Direction.UP);
|
||||
}
|
||||
@Override
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, WorldView world, ScheduledTickView tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, Random random) {
|
||||
return !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, world, tickView, pos, direction, neighborPos, neighborState, random);
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
|
||||
return !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos);
|
||||
}
|
||||
@Override
|
||||
protected boolean canReplace(BlockState state, ItemPlacementContext context) {return true;}
|
||||
|
||||
@@ -5,8 +5,6 @@ import eu.midnightdust.motschen.rocks.blockstates.StickVariation;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
@@ -17,12 +15,11 @@ import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.tick.ScheduledTickView;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -33,7 +30,7 @@ public class Stick extends Block {
|
||||
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
|
||||
|
||||
public Stick(Identifier blockId) {
|
||||
super(AbstractBlock.Settings.copy(Blocks.POPPY).registryKey(RegistryKey.of(RegistryKeys.BLOCK, blockId)).nonOpaque().dynamicBounds().sounds(BlockSoundGroup.WOOD));
|
||||
super(AbstractBlock.Settings.copy(Blocks.POPPY).nonOpaque().dynamicBounds().sounds(BlockSoundGroup.WOOD));
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(STICK_VARIATION, StickVariation.SMALL).with(WATERLOGGED, false));
|
||||
}
|
||||
|
||||
@@ -69,11 +66,11 @@ public class Stick extends Block {
|
||||
return world.getBlockState(pos.down()).isSideSolidFullSquare(world,pos,Direction.UP);
|
||||
}
|
||||
@Override
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, WorldView world, ScheduledTickView tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, Random random) {
|
||||
return !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, world, tickView, pos, direction, neighborPos, neighborState, random);
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
|
||||
return !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos);
|
||||
}
|
||||
@Override
|
||||
protected boolean isTransparent(BlockState state) {return true;}
|
||||
protected boolean isTransparent(BlockState state, BlockView world, BlockPos pos) {return true;}
|
||||
@Override
|
||||
protected boolean canReplace(BlockState state, ItemPlacementContext context) {return true;}
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ public class NetherGeyserBlockEntity extends BlockEntity {
|
||||
world.setBlockState(pos, state.with(NetherGeyser.ACTIVE, true));
|
||||
|
||||
if (RocksConfig.netherGeyserDamage && world instanceof ServerWorld serverWorld) {
|
||||
player.damage(serverWorld, world.getDamageSources().onFire(), 1);
|
||||
player.damage(world.getDamageSources().onFire(), 1);
|
||||
if (player2 != null) {
|
||||
player2.damage(serverWorld, world.getDamageSources().onFire(), 4);
|
||||
player2.damage(world.getDamageSources().onFire(), 4);
|
||||
}
|
||||
}
|
||||
blockEntity.countdown = 1000;
|
||||
|
||||
@@ -27,13 +27,13 @@ public class NetherGeyserPolymer extends NetherGeyser implements PolymerBlock, P
|
||||
return PolyUtil.SMALL_BLOCK;
|
||||
}
|
||||
@Override
|
||||
public BlockState getPolymerBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : getPolymerBlockState(state);
|
||||
public BlockState getPolymerBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : getPolymerBlockState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : Blocks.NETHERRACK.getDefaultState();
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : Blocks.NETHERRACK.getDefaultState();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -42,6 +42,6 @@ public class NetherGeyserPolymer extends NetherGeyser implements PolymerBlock, P
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSyncRawToClient(PacketContext context) {return hasModOnClient(context.getPlayer());}
|
||||
public boolean canSyncRawToClient(ServerPlayerEntity player) {return hasModOnClient(player);}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,13 +27,13 @@ public class OverworldGeyserPolymer extends OverworldGeyser implements PolymerBl
|
||||
return state.get(SNOWY) ? Blocks.SNOW.getDefaultState() : PolyUtil.SMALL_BLOCK;
|
||||
}
|
||||
@Override
|
||||
public BlockState getPolymerBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : getPolymerBlockState(state);
|
||||
public BlockState getPolymerBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : getPolymerBlockState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : Blocks.SNOW.getDefaultState();
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : Blocks.SNOW.getDefaultState();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -42,7 +42,7 @@ public class OverworldGeyserPolymer extends OverworldGeyser implements PolymerBl
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSyncRawToClient(PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer());
|
||||
public boolean canSyncRawToClient(ServerPlayerEntity player) {
|
||||
return hasModOnClient(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +29,13 @@ public class PineconePolymer extends Pinecone implements PolymerBlock, PolymerTe
|
||||
return PolyUtil.SMALL_BLOCK;
|
||||
}
|
||||
@Override
|
||||
public BlockState getPolymerBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : getPolymerBlockState(state);
|
||||
public BlockState getPolymerBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : getPolymerBlockState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : Blocks.SPRUCE_BUTTON.getDefaultState().with(Properties.BLOCK_FACE, BlockFace.FLOOR);
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : Blocks.SPRUCE_BUTTON.getDefaultState().with(Properties.BLOCK_FACE, BlockFace.FLOOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,7 +44,7 @@ public class PineconePolymer extends Pinecone implements PolymerBlock, PolymerTe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSyncRawToClient(PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer());
|
||||
public boolean canSyncRawToClient(ServerPlayerEntity player) {
|
||||
return hasModOnClient(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import xyz.nucleoid.packettweaker.PacketContext;
|
||||
|
||||
import static eu.midnightdust.motschen.rocks.util.polymer.PolyUtil.hasModOnClient;
|
||||
|
||||
@@ -29,13 +28,13 @@ public class RockPolymer extends Rock implements PolymerBlock, PolymerTexturedBl
|
||||
return PolyUtil.SMALL_BLOCK;
|
||||
}
|
||||
@Override
|
||||
public BlockState getPolymerBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : getPolymerBlockState(state);
|
||||
public BlockState getPolymerBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : getPolymerBlockState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : Blocks.STONE_BUTTON.getDefaultState().with(Properties.BLOCK_FACE, BlockFace.FLOOR);
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : Blocks.STONE_BUTTON.getDefaultState().with(Properties.BLOCK_FACE, BlockFace.FLOOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,7 +43,7 @@ public class RockPolymer extends Rock implements PolymerBlock, PolymerTexturedBl
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSyncRawToClient(PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer());
|
||||
public boolean canSyncRawToClient(ServerPlayerEntity player) {
|
||||
return hasModOnClient(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@ public class SeashellPolymer extends Seashell implements PolymerBlock, PolymerTe
|
||||
else return PolyUtil.SMALL_BLOCK;
|
||||
}
|
||||
@Override
|
||||
public BlockState getPolymerBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : getPolymerBlockState(state);
|
||||
public BlockState getPolymerBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : getPolymerBlockState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : Blocks.WHITE_CANDLE.getDefaultState();
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : Blocks.WHITE_CANDLE.getDefaultState();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,7 +43,7 @@ public class SeashellPolymer extends Seashell implements PolymerBlock, PolymerTe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSyncRawToClient(PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer());
|
||||
public boolean canSyncRawToClient(ServerPlayerEntity player) {
|
||||
return hasModOnClient(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@ public class StarfishPolymer extends Starfish implements PolymerBlock, PolymerTe
|
||||
else return PolyUtil.SMALL_BLOCK;
|
||||
}
|
||||
@Override
|
||||
public BlockState getPolymerBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : getPolymerBlockState(state);
|
||||
public BlockState getPolymerBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : getPolymerBlockState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : Blocks.SEA_PICKLE.getDefaultState();
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : Blocks.SEA_PICKLE.getDefaultState();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,7 +43,7 @@ public class StarfishPolymer extends Starfish implements PolymerBlock, PolymerTe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSyncRawToClient(PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer());
|
||||
public boolean canSyncRawToClient(ServerPlayerEntity player) {
|
||||
return hasModOnClient(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +29,13 @@ public class StickPolymer extends Stick implements PolymerBlock, PolymerTextured
|
||||
return PolyUtil.SMALL_BLOCK;
|
||||
}
|
||||
@Override
|
||||
public BlockState getPolymerBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : getPolymerBlockState(state);
|
||||
public BlockState getPolymerBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : getPolymerBlockState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer()) ? state : Blocks.OAK_BUTTON.getDefaultState().with(Properties.BLOCK_FACE, BlockFace.FLOOR);
|
||||
public BlockState getPolymerBreakEventBlockState(BlockState state, ServerPlayerEntity player) {
|
||||
return hasModOnClient(player) ? state : Blocks.OAK_BUTTON.getDefaultState().with(Properties.BLOCK_FACE, BlockFace.FLOOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,7 +44,7 @@ public class StickPolymer extends Stick implements PolymerBlock, PolymerTextured
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSyncRawToClient(PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer());
|
||||
public boolean canSyncRawToClient(ServerPlayerEntity player) {
|
||||
return hasModOnClient(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package eu.midnightdust.motschen.rocks.block.polymer.model;
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.block.NetherGeyser;
|
||||
import eu.midnightdust.motschen.rocks.config.RocksConfig;
|
||||
import eu.pb4.factorytools.api.resourcepack.BaseItemProvider;
|
||||
import eu.pb4.factorytools.api.virtualentity.ItemDisplayElementUtil;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.BlockAwareAttachment;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.HolderAttachment;
|
||||
@@ -22,7 +23,7 @@ public class ItemDisplayNetherGeyserModel extends ConditionalBlockModel {
|
||||
public static ItemStack NETHER;
|
||||
|
||||
public static void initModels() {
|
||||
NETHER = ItemDisplayElementUtil.getModel(RocksMain.id("block/nether_geyser_off"));
|
||||
NETHER = BaseItemProvider.requestModel(RocksMain.id("block/nether_geyser_off"));
|
||||
}
|
||||
|
||||
public ItemDisplayNetherGeyserModel(BlockState state, BlockPos pos) {
|
||||
@@ -30,7 +31,6 @@ public class ItemDisplayNetherGeyserModel extends ConditionalBlockModel {
|
||||
this.main.setDisplaySize(1, 1);
|
||||
this.main.setScale(new Vector3f(2));
|
||||
int rotation = pos.hashCode() % 360;
|
||||
System.out.println(pos.hashCode() + " " + rotation + " " + pos.hashCode() % 360);
|
||||
this.main.setRightRotation(RotationAxis.POSITIVE_Y.rotationDegrees(rotation));
|
||||
this.main.setViewRange(0.75f * (RocksConfig.polymerViewDistance / 100f));
|
||||
this.addElement(this.main);
|
||||
|
||||
@@ -3,6 +3,7 @@ package eu.midnightdust.motschen.rocks.block.polymer.model;
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.block.OverworldGeyser;
|
||||
import eu.midnightdust.motschen.rocks.config.RocksConfig;
|
||||
import eu.pb4.factorytools.api.resourcepack.BaseItemProvider;
|
||||
import eu.pb4.factorytools.api.virtualentity.ItemDisplayElementUtil;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.BlockAwareAttachment;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.HolderAttachment;
|
||||
@@ -23,7 +24,7 @@ public class ItemDisplayOverworldGeyserModel extends ConditionalBlockModel {
|
||||
public static ItemStack OVERWORLD;
|
||||
|
||||
public static void initModels() {
|
||||
OVERWORLD = ItemDisplayElementUtil.getModel(RocksMain.id("block/geyser_off"));
|
||||
OVERWORLD = BaseItemProvider.requestModel(RocksMain.id("block/geyser_off"));
|
||||
}
|
||||
|
||||
public ItemDisplayOverworldGeyserModel(BlockState state, BlockPos pos) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.rocks.block.polymer.model;
|
||||
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.config.RocksConfig;
|
||||
import eu.pb4.factorytools.api.resourcepack.BaseItemProvider;
|
||||
import eu.pb4.factorytools.api.virtualentity.ItemDisplayElementUtil;
|
||||
import eu.pb4.polymer.virtualentity.api.elements.ItemDisplayElement;
|
||||
import net.minecraft.block.BlockState;
|
||||
@@ -16,7 +17,7 @@ public class ItemDisplayPineconeModel extends ConditionalBlockModel {
|
||||
private static ItemStack PINECONE_MODEL;
|
||||
|
||||
public static void initModels() {
|
||||
PINECONE_MODEL = ItemDisplayElementUtil.getModel(RocksMain.id("block/pinecone"));
|
||||
PINECONE_MODEL = BaseItemProvider.requestModel(RocksMain.id("block/pinecone"));
|
||||
}
|
||||
|
||||
public ItemDisplayPineconeModel(BlockState state, BlockPos pos) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package eu.midnightdust.motschen.rocks.block.polymer.model;
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.config.RocksConfig;
|
||||
import eu.midnightdust.motschen.rocks.util.RockType;
|
||||
import eu.pb4.factorytools.api.resourcepack.BaseItemProvider;
|
||||
import eu.pb4.factorytools.api.virtualentity.ItemDisplayElementUtil;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.BlockAwareAttachment;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.HolderAttachment;
|
||||
@@ -24,7 +25,7 @@ public class ItemDisplayRockModel extends ConditionalBlockModel {
|
||||
for (RockType type : RockType.values()) {
|
||||
var stacks = new ItemStack[4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
stacks[i] = ItemDisplayElementUtil.getModel(RocksMain.id("block/"+type.getVariations()[i].getPath()));
|
||||
stacks[i] = BaseItemProvider.requestModel(RocksMain.id("block/"+type.getVariations()[i].getPath()));
|
||||
}
|
||||
models.put(type, stacks);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.rocks.block.polymer.model;
|
||||
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.config.RocksConfig;
|
||||
import eu.pb4.factorytools.api.resourcepack.BaseItemProvider;
|
||||
import eu.pb4.factorytools.api.virtualentity.ItemDisplayElementUtil;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.BlockAwareAttachment;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.HolderAttachment;
|
||||
@@ -19,9 +20,9 @@ public class ItemDisplaySeashellModel extends ConditionalBlockModel {
|
||||
public static ItemStack YELLOW;
|
||||
|
||||
public static void initModels() {
|
||||
PINK = ItemDisplayElementUtil.getModel(RocksMain.id("block/seashell_pink"));
|
||||
WHITE = ItemDisplayElementUtil.getModel(RocksMain.id("block/seashell_white"));
|
||||
YELLOW = ItemDisplayElementUtil.getModel(RocksMain.id("block/seashell_yellow"));
|
||||
PINK = BaseItemProvider.requestModel(RocksMain.id("block/seashell_pink"));
|
||||
WHITE = BaseItemProvider.requestModel(RocksMain.id("block/seashell_white"));
|
||||
YELLOW = BaseItemProvider.requestModel(RocksMain.id("block/seashell_yellow"));
|
||||
}
|
||||
|
||||
public ItemDisplaySeashellModel(BlockState state, BlockPos pos) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.rocks.block.polymer.model;
|
||||
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.config.RocksConfig;
|
||||
import eu.pb4.factorytools.api.resourcepack.BaseItemProvider;
|
||||
import eu.pb4.factorytools.api.virtualentity.ItemDisplayElementUtil;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.BlockAwareAttachment;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.HolderAttachment;
|
||||
@@ -28,12 +29,12 @@ public class ItemDisplayStarfishModel extends ConditionalBlockModel {
|
||||
public static ItemStack PINK_FIRST;
|
||||
|
||||
public static void initModels() {
|
||||
RED = ItemDisplayElementUtil.getModel(polymerId("block/starfish_red_arm"));
|
||||
ORANGE = ItemDisplayElementUtil.getModel(polymerId("block/starfish_orange_arm"));
|
||||
PINK = ItemDisplayElementUtil.getModel(polymerId("block/starfish_pink_arm"));
|
||||
RED_FIRST = ItemDisplayElementUtil.getModel(polymerId("block/starfish_red_first_arm"));
|
||||
ORANGE_FIRST = ItemDisplayElementUtil.getModel(polymerId("block/starfish_orange_first_arm"));
|
||||
PINK_FIRST = ItemDisplayElementUtil.getModel(polymerId("block/starfish_pink_first_arm"));
|
||||
RED = BaseItemProvider.requestModel(polymerId("block/starfish_red_arm"));
|
||||
ORANGE = BaseItemProvider.requestModel(polymerId("block/starfish_orange_arm"));
|
||||
PINK = BaseItemProvider.requestModel(polymerId("block/starfish_pink_arm"));
|
||||
RED_FIRST = BaseItemProvider.requestModel(polymerId("block/starfish_red_first_arm"));
|
||||
ORANGE_FIRST = BaseItemProvider.requestModel(polymerId("block/starfish_orange_first_arm"));
|
||||
PINK_FIRST = BaseItemProvider.requestModel(polymerId("block/starfish_pink_first_arm"));
|
||||
}
|
||||
|
||||
public ItemDisplayStarfishModel(BlockState state, BlockPos pos) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package eu.midnightdust.motschen.rocks.block.polymer.model;
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.config.RocksConfig;
|
||||
import eu.midnightdust.motschen.rocks.util.StickType;
|
||||
import eu.pb4.factorytools.api.resourcepack.BaseItemProvider;
|
||||
import eu.pb4.factorytools.api.virtualentity.ItemDisplayElementUtil;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.BlockAwareAttachment;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.HolderAttachment;
|
||||
@@ -24,7 +25,7 @@ public class ItemDisplayStickModel extends ConditionalBlockModel {
|
||||
for (StickType type : StickType.values()) {
|
||||
var stacks = new ItemStack[3];
|
||||
for (int i = 0; i < 3; i++) {
|
||||
stacks[i] = ItemDisplayElementUtil.getModel(RocksMain.id("block/"+type.getVariations()[i].getPath()));
|
||||
stacks[i] = BaseItemProvider.requestModel(RocksMain.id("block/"+type.getVariations()[i].getPath()));
|
||||
}
|
||||
models.put(type, stacks);
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ public class RocksConfig extends MidnightConfig {
|
||||
@Entry(category = effects) public static boolean netherGeyserDamage = true;
|
||||
|
||||
@Entry(category = effects) public static boolean enablePolymerMode = true;
|
||||
@Entry(category = effects) public static boolean forcePolymerMode = false;
|
||||
@Entry(category = effects, requiredMod = "factorytools", min = 0, max = 200, isSlider = true) public static int polymerViewDistance = 100;
|
||||
@Entry(category = effects) public static List<String> biomeExclusions = new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public abstract class Language extends FabricLanguageProvider {
|
||||
|
||||
protected static void addBlock(TranslationBuilder translationBuilder, Block block, String value) {
|
||||
translationBuilder.add(block, value);
|
||||
translationBuilder.add(block.asItem(), value);
|
||||
//translationBuilder.add(block.asItem(), value);
|
||||
}
|
||||
|
||||
protected static void midnightconfig(TranslationBuilder translationBuilder, String key, String value) {
|
||||
@@ -62,12 +62,14 @@ public abstract class Language extends FabricLanguageProvider {
|
||||
public void createRepeatedTranslations(TranslationBuilder translationBuilder, String rockWord, String splitterWord, String stickWord) {
|
||||
for (RockType type : RockType.values()) {
|
||||
Block block = Registries.BLOCK.get(RocksMain.id(type.getName()));
|
||||
String baseTranslation = langHelper.translate(type.getStoneBlock().getTranslationKey());
|
||||
String baseTranslation = langHelper.translate(Registries.BLOCK.get(Identifier.ofVanilla(type.name().toLowerCase())).getTranslationKey());
|
||||
|
||||
addBlock(translationBuilder, block, baseTranslation+rockWord);
|
||||
|
||||
if (type != RockType.GRAVEL) {
|
||||
Item splitter = Registries.ITEM.get(RocksMain.id(type.getSplitterName()));
|
||||
translationBuilder.add(splitter, baseTranslation+splitterWord);
|
||||
String splitterBaseTranslation = langHelper.translate(type.getStoneBlock().getTranslationKey());
|
||||
translationBuilder.add(splitter, splitterBaseTranslation+splitterWord);
|
||||
}
|
||||
}
|
||||
for (StickType type : StickType.values()) {
|
||||
@@ -94,7 +96,7 @@ public abstract class Language extends FabricLanguageProvider {
|
||||
public void generateTranslations(RegistryWrapper.WrapperLookup registryLookup, TranslationBuilder translationBuilder) {
|
||||
translationBuilder.add("itemGroup.rocks.rocks","This Rocks!");
|
||||
|
||||
createRepeatedTranslations(translationBuilder, " Rock", " Splitter", " Stick");
|
||||
createRepeatedTranslations(translationBuilder, " Rock", " Fragment", " Stick");
|
||||
|
||||
addBlock(translationBuilder, RocksMain.Geyser, "Geyser");
|
||||
addBlock(translationBuilder, RocksMain.NetherGeyser, "Nether Geyser");
|
||||
@@ -125,6 +127,8 @@ public abstract class Language extends FabricLanguageProvider {
|
||||
|
||||
midnightconfig(translationBuilder, "enablePolymerMode", "Enable Polymer Mode");
|
||||
midnightconfig(translationBuilder, "enablePolymerMode.tooltip", "Allows the mod to work fully server-sided when used in combination with Polymer and FactoryTools");
|
||||
midnightconfig(translationBuilder, "forcePolymerMode", "Force Polymer Mode");
|
||||
midnightconfig(translationBuilder, "forcePolymerMode.tooltip", "Also enables Polymer mode for clients that have ThisRocks! installed");
|
||||
midnightconfig(translationBuilder, "polymerViewDistance", "Polymer View Distance");
|
||||
}
|
||||
}
|
||||
@@ -170,6 +174,8 @@ public abstract class Language extends FabricLanguageProvider {
|
||||
|
||||
midnightconfig(translationBuilder, "enablePolymerMode", "Aktiviere Polymer-Modus");
|
||||
midnightconfig(translationBuilder, "enablePolymerMode.tooltip", "Erlaubt der Mod, komplett serverseitig zu funktionieren, wenn Polymer und FactoryTools installiert sind");
|
||||
midnightconfig(translationBuilder, "forcePolymerMode", "Erzwinge Polymer-Modus");
|
||||
midnightconfig(translationBuilder, "forcePolymerMode.tooltip", "Aktiviert den Polymer-Modus auch für Clients, die die ThisRocks! installiert haben");
|
||||
midnightconfig(translationBuilder, "polymerViewDistance", "Polymer-Sichtweite");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class LootTables {
|
||||
addDrop(block, this.dropsWithSilkTouch(block, ItemEntry.builder(alternative)));
|
||||
}
|
||||
public void addSilkTouchOrRareDrop(Block block, Item alternative, float... chances) {
|
||||
RegistryWrapper.Impl<Enchantment> impl = this.registries.getOrThrow(RegistryKeys.ENCHANTMENT);
|
||||
RegistryWrapper.Impl<Enchantment> impl = this.registryLookup.getWrapperOrThrow(RegistryKeys.ENCHANTMENT);
|
||||
addDrop(block, this.dropsWithSilkTouch(block, ItemEntry.builder(alternative).conditionally(TableBonusLootCondition.builder(impl.getOrThrow(Enchantments.FORTUNE), chances))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
package eu.midnightdust.motschen.rocks.datagen;
|
||||
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.blockstates.StarfishVariation;
|
||||
import eu.midnightdust.motschen.rocks.util.RockType;
|
||||
import eu.midnightdust.motschen.rocks.util.StickType;
|
||||
import net.fabricmc.fabric.api.client.datagen.v1.provider.FabricModelProvider;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.data.*;
|
||||
import net.minecraft.client.render.item.model.ItemModel;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Models extends FabricModelProvider {
|
||||
public static final TextureKey ZERO_TEXTURE_KEY = TextureKey.of("0");
|
||||
public Models(FabricDataOutput output) {
|
||||
super(output);
|
||||
}
|
||||
|
||||
public static Identifier getBlockId(String s) {
|
||||
return RocksMain.id("block/"+s);
|
||||
}
|
||||
public static Identifier getItemId(String s) {
|
||||
return RocksMain.id("item/"+s);
|
||||
}
|
||||
public static Model getSimpleParentModel(Identifier parentId, String variant) {
|
||||
return new Model(Optional.of(parentId), Optional.of(variant), ZERO_TEXTURE_KEY);
|
||||
}
|
||||
@Override
|
||||
public void generateBlockStateModels(BlockStateModelGenerator bsModelGenerator) {
|
||||
for (RockType type : RockType.values()) {
|
||||
Block block = Registries.BLOCK.get(RocksMain.id(type.getName()));
|
||||
RockModel.registerBlockModel(bsModelGenerator, block, type.getStoneBlock());
|
||||
}
|
||||
for (StickType type : StickType.values()) {
|
||||
Block block = Registries.BLOCK.get(RocksMain.id(type.getName()+"_stick"));
|
||||
StickModel.registerBlockModel(bsModelGenerator, block, type.getBaseBlock());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateItemModels(ItemModelGenerator itemModelGenerator) {
|
||||
for (RockType type : RockType.values()) {
|
||||
Item item = Registries.ITEM.get(RocksMain.id(type.getName()));
|
||||
registerParentedItemModel(itemModelGenerator, item, getItemId("rock_base"), type.getStoneBlock());
|
||||
|
||||
if (type != RockType.GRAVEL) {
|
||||
Item splitter = Registries.ITEM.get(RocksMain.id(type.getSplitterName()));
|
||||
registerParentedItemModel(itemModelGenerator, splitter, getItemId("splitter_base"), type.getStoneBlock());
|
||||
}
|
||||
}
|
||||
for (StickType type : StickType.values()) {
|
||||
Item item = Registries.ITEM.get(RocksMain.id(type.getName()+"_stick"));
|
||||
registerParentedItemModel(itemModelGenerator, item, getItemId("stick_base"), type.getBaseBlock());
|
||||
}
|
||||
itemModelGenerator.register(RocksMain.Geyser.asItem());
|
||||
itemModelGenerator.register(RocksMain.NetherGeyser.asItem());
|
||||
registerStarfishItemVariations(itemModelGenerator, RocksMain.Starfish);
|
||||
itemModelGenerator.register(RocksMain.Seashell.asItem());
|
||||
itemModelGenerator.register(RocksMain.Pinecone.asItem());
|
||||
}
|
||||
public static void registerParentedItemModel(ItemModelGenerator modelGenerator, Item item, Identifier parentId, Block textureSource) {
|
||||
TextureMap textureMap = TextureMap.of(ZERO_TEXTURE_KEY, TextureMap.getId(textureSource));
|
||||
|
||||
Identifier itemModel = getSimpleParentModel(parentId, "").upload(item, textureMap, modelGenerator.modelCollector);
|
||||
modelGenerator.output.accept(item, ItemModels.basic(itemModel));
|
||||
}
|
||||
public final void registerStarfishItemVariations(ItemModelGenerator modelGenerator, Block starfish) {
|
||||
Map<StarfishVariation, ItemModel.Unbaked> variantMap = new HashMap<>();
|
||||
for (StarfishVariation variation : StarfishVariation.values()) {
|
||||
variantMap.put(variation, ItemModels.basic(ModelIds.getBlockSubModelId(starfish, "_"+variation.toString())));
|
||||
}
|
||||
modelGenerator.output.accept(starfish.asItem(), ItemModels.select(RocksMain.STARFISH_VARIATION, ItemModels.basic(ModelIds.getItemModelId(starfish.asItem())), variantMap));
|
||||
}
|
||||
|
||||
public static <T> List<BlockStateVariant> getRandomRotationVariants(VariantSetting<T> baseSettings, T value) {
|
||||
List<BlockStateVariant> list = new ArrayList<>();
|
||||
for (VariantSettings.Rotation rotation : VariantSettings.Rotation.values()) {
|
||||
BlockStateVariant rotatedVariant = BlockStateVariant.create().put(baseSettings, value);
|
||||
list.add(rotatedVariant.put(VariantSettings.Y, rotation));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private static class RockModel {
|
||||
public static void registerBlockModel(BlockStateModelGenerator modelGenerator, Block rockBlock, Block textureSource) {
|
||||
TextureMap textureMap = TextureMap.of(ZERO_TEXTURE_KEY, TextureMap.getId(textureSource));
|
||||
|
||||
Identifier largeRock = getSimpleParentModel(getBlockId("large_rock"), "_large").upload(rockBlock, textureMap, modelGenerator.modelCollector);
|
||||
Identifier mediumRock = getSimpleParentModel(getBlockId("medium_rock"), "_medium").upload(rockBlock, textureMap, modelGenerator.modelCollector);
|
||||
Identifier smallRock = getSimpleParentModel(getBlockId("small_rock"), "_small").upload(rockBlock, textureMap, modelGenerator.modelCollector);
|
||||
Identifier tinyRock = getSimpleParentModel(getBlockId("tiny_rock"), "_tiny").upload(rockBlock, textureMap, modelGenerator.modelCollector);
|
||||
modelGenerator.blockStateCollector.accept(createBlockState(rockBlock, new Identifier[]{largeRock, mediumRock, smallRock, tinyRock}));
|
||||
}
|
||||
|
||||
private static BlockStateSupplier createBlockState(Block rockBlock, Identifier[] modelIds) {
|
||||
return VariantsBlockStateSupplier.create(rockBlock)
|
||||
.coordinate(BlockStateVariantMap.create(RocksMain.ROCK_VARIATION)
|
||||
.registerVariants(variation -> getRandomRotationVariants(VariantSettings.MODEL, modelIds[3 - variation.ordinal()]))
|
||||
);
|
||||
}
|
||||
}
|
||||
private static class StickModel {
|
||||
public static void registerBlockModel(BlockStateModelGenerator modelGenerator, Block stickBlock, Block textureSource) {
|
||||
TextureMap textureMap = TextureMap.of(ZERO_TEXTURE_KEY, TextureMap.getId(textureSource));
|
||||
|
||||
Identifier largeRock = getSimpleParentModel(getBlockId("large_stick"), "_large").upload(stickBlock, textureMap, modelGenerator.modelCollector);
|
||||
Identifier mediumRock = getSimpleParentModel(getBlockId("medium_stick"), "_medium").upload(stickBlock, textureMap, modelGenerator.modelCollector);
|
||||
Identifier smallRock = getSimpleParentModel(getBlockId("small_stick"), "_small").upload(stickBlock, textureMap, modelGenerator.modelCollector);
|
||||
modelGenerator.blockStateCollector.accept(createBlockState(stickBlock, new Identifier[]{largeRock, mediumRock, smallRock}));
|
||||
}
|
||||
|
||||
private static BlockStateSupplier createBlockState(Block stickBlock, Identifier[] modelIds) {
|
||||
return VariantsBlockStateSupplier.create(stickBlock)
|
||||
.coordinate(BlockStateVariantMap.create(RocksMain.STICK_VARIATION)
|
||||
.registerVariants(variation -> getRandomRotationVariants(VariantSettings.MODEL, modelIds[2 - variation.ordinal()]))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,10 @@ package eu.midnightdust.motschen.rocks.datagen;
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
|
||||
import net.minecraft.data.recipe.RecipeExporter;
|
||||
import net.minecraft.data.recipe.RecipeGenerator;
|
||||
import net.minecraft.data.recipe.ShapelessRecipeJsonBuilder;
|
||||
import net.minecraft.data.server.recipe.RecipeExporter;
|
||||
import net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder;
|
||||
import net.minecraft.recipe.book.RecipeCategory;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
@@ -24,31 +22,16 @@ public class Recipes extends FabricRecipeProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RecipeGenerator getRecipeGenerator(RegistryWrapper.WrapperLookup registries, RecipeExporter recipeExporter) {
|
||||
return new RocksRecipeGenerator(registries, recipeExporter);
|
||||
public void generate(RecipeExporter exporter) {
|
||||
generateCrafting(exporter);
|
||||
}
|
||||
private void generateCrafting(RecipeExporter exporter) {
|
||||
RocksMain.splittersByType.forEach(((rockType, splitter) -> {
|
||||
|
||||
public static class RocksRecipeGenerator extends RecipeGenerator {
|
||||
protected RocksRecipeGenerator(RegistryWrapper.WrapperLookup registries, RecipeExporter exporter) {
|
||||
super(registries, exporter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateCrafting(exporter);
|
||||
}
|
||||
private void generateCrafting(RecipeExporter exporter) {
|
||||
RocksMain.splittersByType.forEach(((rockType, splitter) -> {
|
||||
|
||||
ShapelessRecipeJsonBuilder.create(registries.getOrThrow(RegistryKeys.ITEM), RecipeCategory.BUILDING_BLOCKS, Registries.BLOCK.get(Identifier.ofVanilla(rockType.name().toLowerCase())).asItem())
|
||||
.input(splitter, 4)
|
||||
.criterion(RecipeGenerator.hasItem(splitter), this.conditionsFromItem(splitter))
|
||||
.offerTo(exporter, rockType.name().toLowerCase()+"_from_splitter");
|
||||
}));
|
||||
}
|
||||
ShapelessRecipeJsonBuilder.create(RecipeCategory.BUILDING_BLOCKS, rockType.getStoneBlock().asItem())
|
||||
.input(splitter, 4)
|
||||
.criterion(FabricRecipeProvider.hasItem(splitter), FabricRecipeProvider.conditionsFromItem(splitter))
|
||||
.offerTo(exporter, rockType.name().toLowerCase()+"_from_splitter");
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,22 +2,22 @@ package eu.midnightdust.motschen.rocks.item.polymer;
|
||||
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.blockstates.StarfishVariation;
|
||||
import eu.pb4.factorytools.api.item.AutoModeledPolymerItem;
|
||||
import eu.pb4.polymer.core.api.block.PolymerBlock;
|
||||
import eu.pb4.polymer.core.api.item.PolymerItem;
|
||||
import eu.pb4.polymer.resourcepack.extras.api.ResourcePackExtras;
|
||||
import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.component.DataComponentTypes;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import xyz.nucleoid.packettweaker.PacketContext;
|
||||
|
||||
import static eu.midnightdust.motschen.rocks.util.polymer.PolyUtil.hasModOnClient;
|
||||
import static eu.midnightdust.motschen.rocks.util.polymer.PolyUtil.polymerId;
|
||||
|
||||
public class StarfishItemPolymer extends BlockItem implements PolymerItem {
|
||||
public class StarfishItemPolymer extends BlockItem implements AutoModeledPolymerItem {
|
||||
private final Item polymerItem;
|
||||
|
||||
public <T extends Block & PolymerBlock> StarfishItemPolymer(T block, Settings settings, Item item) {
|
||||
@@ -26,22 +26,31 @@ public class StarfishItemPolymer extends BlockItem implements PolymerItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Identifier getPolymerItemModel(ItemStack itemStack, PacketContext context) {
|
||||
public Item getPolymerItem() {
|
||||
return polymerItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPolymerCustomModelData(ItemStack itemStack, @Nullable ServerPlayerEntity player) {
|
||||
var state = itemStack.getComponents().get(DataComponentTypes.BLOCK_STATE);
|
||||
if (state != null && !state.isEmpty()) {
|
||||
StarfishVariation variation = state.getValue(RocksMain.STARFISH_VARIATION);
|
||||
if (variation != null) return ResourcePackExtras.bridgeModel(polymerId("item/"+variation + "_starfish"));
|
||||
if (variation != null) return MODELS.get(variation).value();
|
||||
}
|
||||
return itemStack.get(DataComponentTypes.ITEM_MODEL);
|
||||
return MODELS.get(this).value();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSyncRawToClient(PacketContext context) {
|
||||
return hasModOnClient(context.getPlayer());
|
||||
public void onRegistered(Identifier selfId) {
|
||||
var item = Identifier.of(selfId.getNamespace(), "item/" + selfId.getPath());
|
||||
MODELS.put(this, PolymerResourcePackUtils.requestModel(this.getPolymerItem(), item));
|
||||
for (StarfishVariation variation : StarfishVariation.values()) {
|
||||
MODELS.put(variation, PolymerResourcePackUtils.requestModel(this.getPolymerItem(), polymerId("item/" + variation.toString() + "_" + selfId.getPath())));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getPolymerItem(ItemStack itemStack, PacketContext packetContext) {
|
||||
return polymerItem;
|
||||
public boolean canSyncRawToClient(@Nullable ServerPlayerEntity player) {
|
||||
return hasModOnClient(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class ParticleUtil {
|
||||
public static void spawnParticle(ServerPlayerEntity player, ParticleType<?> type, Vec3d pos, Vec3d offset, float speed) {
|
||||
ServerPlayNetworking.getSender(player).sendPacket(new ParticleS2CPacket((ParticleEffect) type, false, true, pos.x, pos.y, pos.z,
|
||||
ServerPlayNetworking.getSender(player).sendPacket(new ParticleS2CPacket((ParticleEffect) type, false, pos.x, pos.y, pos.z,
|
||||
(float) offset.x / 16f, (float) offset.y / 16f, (float) offset.z / 16f, speed, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class RegistryUtil {
|
||||
}
|
||||
public static Item blockItem(Block block, Identifier id) {
|
||||
if (polymerMode) return PolyUtil.polymerBlockItem(block, id);
|
||||
return new BlockItem(block, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, id)));
|
||||
return new BlockItem(block, new Item.Settings());
|
||||
}
|
||||
public static Item registerItem(Identifier id, Item item) {
|
||||
Registry.register(Registries.ITEM, id, item);
|
||||
|
||||
@@ -29,6 +29,7 @@ public enum RockType {
|
||||
return splitterName;
|
||||
}
|
||||
public Identifier getStoneId() {
|
||||
if (this==STONE) return Identifier.ofVanilla("cobblestone");
|
||||
return Identifier.ofVanilla(this.toString().toLowerCase());
|
||||
}
|
||||
public Block getStoneBlock() {
|
||||
|
||||
@@ -12,7 +12,7 @@ import static eu.midnightdust.motschen.rocks.RocksMain.id;
|
||||
public enum StickType {
|
||||
OAK("oak", Blocks.OAK_LOG), SPRUCE("spruce", Blocks.SPRUCE_LOG), BIRCH("birch", Blocks.BIRCH_LOG),
|
||||
JUNGLE("jungle", Blocks.JUNGLE_LOG), ACACIA("acacia", Blocks.ACACIA_LOG), DARK_OAK("dark_oak", Blocks.DARK_OAK_LOG),
|
||||
CHERRY("cherry", Blocks.CHERRY_LOG), MANGROVE("mangrove", Blocks.MANGROVE_LOG), PALE_OAK("pale_oak", Blocks.PALE_OAK_LOG),
|
||||
CHERRY("cherry", Blocks.CHERRY_LOG), MANGROVE("mangrove", Blocks.MANGROVE_LOG),
|
||||
|
||||
BAMBOO("bamboo", Blocks.BAMBOO_BLOCK), WARPED("warped", Blocks.WARPED_STEM), CRIMSON("crimson", Blocks.CRIMSON_STEM);
|
||||
|
||||
|
||||
@@ -9,15 +9,14 @@ import eu.midnightdust.motschen.rocks.block.polymer.model.*;
|
||||
import eu.midnightdust.motschen.rocks.item.polymer.StarfishItemPolymer;
|
||||
import eu.midnightdust.motschen.rocks.util.RockType;
|
||||
import eu.pb4.factorytools.api.item.FactoryBlockItem;
|
||||
import eu.pb4.factorytools.api.item.ModeledItem;
|
||||
import eu.pb4.polymer.blocks.api.BlockModelType;
|
||||
import eu.pb4.polymer.blocks.api.PolymerBlockResourceUtils;
|
||||
import eu.pb4.polymer.core.api.block.PolymerBlock;
|
||||
import eu.pb4.polymer.core.api.block.PolymerBlockUtils;
|
||||
import eu.pb4.polymer.core.api.item.PolymerItemGroupUtils;
|
||||
import eu.pb4.polymer.core.api.item.SimplePolymerItem;
|
||||
import eu.pb4.polymer.core.api.utils.PolymerSyncUtils;
|
||||
import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils;
|
||||
import eu.pb4.polymer.resourcepack.extras.api.ResourcePackExtras;
|
||||
import eu.pb4.polymer.virtualentity.api.ElementHolder;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.BlockBoundAttachment;
|
||||
import eu.pb4.polymer.virtualentity.impl.HolderHolder;
|
||||
@@ -28,8 +27,6 @@ import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
@@ -52,10 +49,6 @@ public class PolyUtil {
|
||||
if (PASSABLE_WATERLOGGED_BLOCK == null) SMALL_BLOCK = Blocks.BARRIER.getDefaultState().with(WATERLOGGED, true);
|
||||
|
||||
PolymerResourcePackUtils.addModAssets(MOD_ID);
|
||||
ResourcePackExtras.forDefault().addBridgedModelsFolder(id("block"), id("rocks"));
|
||||
ResourcePackExtras.forDefault().addBridgedModelsFolder(polymerId("block"), polymerId("polymer-rocks"));
|
||||
ResourcePackExtras.forDefault().addBridgedModelsFolder(polymerId("item"), polymerId("polymer-rocks"));
|
||||
|
||||
ItemDisplayNetherGeyserModel.initModels();
|
||||
ItemDisplayOverworldGeyserModel.initModels();
|
||||
ItemDisplayPineconeModel.initModels();
|
||||
@@ -73,13 +66,12 @@ public class PolyUtil {
|
||||
}
|
||||
|
||||
public static Item polymerBlockItem(Block block, Identifier id) {
|
||||
if (block instanceof Starfish) return new StarfishItemPolymer((Block & PolymerBlock) block, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, id)), Items.KELP);
|
||||
else return new FactoryBlockItem((Block & PolymerBlock) block, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, id)), Items.KELP);
|
||||
if (block instanceof Starfish) return new StarfishItemPolymer((Block & PolymerBlock) block, new Item.Settings(), Items.KELP);
|
||||
else return new FactoryBlockItem((Block & PolymerBlock) block, new Item.Settings(), Items.KELP);
|
||||
}
|
||||
|
||||
public static Item simplePolymerItem(Identifier id) {
|
||||
return new SimplePolymerItem(new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, id)), Items.FLINT, true);
|
||||
//return new ModeledItem(Items.FLINT, new Item.Settings());
|
||||
return new ModeledItem(Items.FLINT, new Item.Settings());
|
||||
}
|
||||
|
||||
public static void registerPolymerGroup() {
|
||||
|
||||
@@ -69,7 +69,6 @@ public class FeatureInjector {
|
||||
|
||||
if (RocksConfig.jungleStick) BiomeModifications.addFeature(ctx -> isNotExcluded(ctx) && ctx.hasTag(BiomeTags.IS_JUNGLE), GenerationStep.Feature.TOP_LAYER_MODIFICATION, getKey("jungle_stick"));
|
||||
if (RocksConfig.bambooStick) BiomeModifications.addFeature(ctx -> isNotExcluded(ctx) && ctx.hasTag(BiomeTags.IS_JUNGLE), GenerationStep.Feature.TOP_LAYER_MODIFICATION, getKey("bamboo_stick"));
|
||||
if (RocksConfig.paleOakStick) BiomeModifications.addFeature(ctx -> isNotExcluded(ctx) && ctx.getBiomeKey().equals(BiomeKeys.PALE_GARDEN), GenerationStep.Feature.TOP_LAYER_MODIFICATION, getKey("pale_oak_stick"));
|
||||
|
||||
Predicate<BiomeSelectionContext> dark_oak_sticks = (ctx -> {
|
||||
String name = ctx.getBiomeKey().getValue().toString();
|
||||
|
||||
@@ -61,7 +61,6 @@ public class StickFeatures {
|
||||
PlacedFeature STICK_PLACED_FEATURE = switch (type) {
|
||||
case CRIMSON -> new PlacedFeature(RegistryEntry.of(CONFIGURED_FEATURES.get(type)), getNetherModifiers(90, 1, Blocks.CRIMSON_NYLIUM));
|
||||
case WARPED -> new PlacedFeature(RegistryEntry.of(CONFIGURED_FEATURES.get(type)), getNetherModifiers(90, 1, Blocks.WARPED_NYLIUM));
|
||||
case PALE_OAK -> new PlacedFeature(RegistryEntry.of(CONFIGURED_FEATURES.get(type)), getModifiers(20, 1, Blocks.GRASS_BLOCK, Blocks.PALE_MOSS_BLOCK));
|
||||
case SPRUCE -> new PlacedFeature(RegistryEntry.of(CONFIGURED_FEATURES.get(type)), getModifiers(3, 1, Blocks.GRASS_BLOCK, Blocks.SNOW_BLOCK, Blocks.PODZOL));
|
||||
default -> new PlacedFeature(RegistryEntry.of(CONFIGURED_FEATURES.get(type)), getModifiers(3, 1, Blocks.GRASS_BLOCK, Blocks.MUD, Blocks.PODZOL));
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user