diff --git a/CHANGELOG.md b/CHANGELOG.md index b67fc68b86..36a8b438aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,44 +1,31 @@ # ChangeLog -Version: 1.2.1 +Version: 1.2.2 ### ADDITIONS: -- Ported decorative blocks from 1.12 -- Added filtering to Output Hatches -- Added several utility functions to KJS -- Added more ore generator types (Classic & Cuboid) -- Added partial NBT support for recipe inputs -- Added Wood Cutter recipes +- Ported Powder Barrels, Industrial TNT and Dynamite from 1.12 +- Ported Armor from 1.12 ### CHANGES: -- Reworked Bedrock Ores - - Note that it is now entirely up to pack developers to register Bedrock Ore Veins! -- Added certain fluid blocks to the minecraft:replaceable tag - Updated Russian translation +- Moved coils, filters, PSS battery maps out of GTBlocks, to make it easier for addons to add to them ### FIXES: -- Fixed some Multiblock builders not working in KJS -- Fixed Turbine Rotors not being damaged -- Fixed Shutter Covers not being registered -- Fixed missing Multiblock Tank recipes -- Fixed GCyM Multiblocks using Perfect Overclocking -- Fixed crash related to the Network Switch Multiblock -- Fixed Data Bank chaining -- Fixed HPCA energy consumption for energy that wasn't input recently -- Fixed Kinetic Output Boxes never stopping -- Fixed World Accelerators using too much energy and always accelerating Block Entities -- Fixed connectivity for Long Distance Pipes -- Fixed Item Collector (now works after reload, no longer requires KJS, fixed tooltip) -- Fixed Research items not rendering in JEI when playing on a server -- Fixed recipes randomly not working after server restarts -- Fixed recipes for ABS & Large Electrolyzer using the wrong wires -- Fixed sounds for Arc Furnace & Boilers not being registered properly -- Fixed Parallel Control Hatch behavior when the recipe voltage matches the machine voltage -- Fixed Wrench interactions in certain situations -- Fixed recipe for Treated Wood -- Fixed KJS Research recipes not registering -- Fixed machines and pipes causing excessive updates to neighboring blocks -- Fixed language entry for Iron III Chloride -- Fixed recycling recipe for Titanium Fluid Cells -- Fixed recipe for Engine Intake Casing -- Fixed any custom recipe capabilities being removed when KJS is installed \ No newline at end of file +- Made natural decor blocks obtainable +- Fixed compression recipes being generated for ignored materials +- Fixed fluid locking +- Fixed items being voided when Multiblock auto-building fails +- Fixed missing drops for Laser Pipes and Optical Pipes +- Fixed missing harder chest recipes +- Fixed setting the dimension for Bedrock Ore Veins and Fluid Veins in KJS +- Fixed energy transfer display in the Portable Scanner +- Fixed parallel issues, multi smelter not overclocking +- Fixed Overclocking display for ULV in recipe viewers +- Fixed parallel processing for steam machines +- Fixed machine controllers not working for indirectly powered blocks +- Fixed raw ores being smeltable into ingots even with the NO_SMELTING flag +- Fixed language entries for treated/rubber wood signs +- Fixed sign rendering +- Fixed wire throughput counting +- Fixed chainsaw durability usage +- Fixed recipe conflict between mud and fertilizer recipes \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 5c497b3926..c62686fa0b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx6G # Mod Info mod_id = gtceu mod_name = GregTech -mod_version = 1.2.1 +mod_version = 1.2.2 mod_description = GregTech CE Unofficial, ported from 1.12.2 mod_license = LGPL-3.0 license mod_url = https://github.com/GregTechCEu/GregTech-Modern/ diff --git a/settings.gradle b/settings.gradle index 45a69e18a3..defcb5f979 100644 --- a/settings.gradle +++ b/settings.gradle @@ -42,7 +42,7 @@ dependencyResolutionManagement { def architecturyPluginVersion = "3.4-SNAPSHOT" def architecturyLoomVersion = "1.5-SNAPSHOT" def macheteVersion = "1.+" - def ldLibVersion = "1.0.25.f" + def ldLibVersion = "1.0.25.g" def mixinextrasVersion = "0.2.0" forge { diff --git a/src/generated/resources/assets/gtceu/blockstates/dark_concrete_windmill_a.json b/src/generated/resources/assets/gtceu/blockstates/dark_concrete_windmill_a.json new file mode 100644 index 0000000000..4603cb2062 --- /dev/null +++ b/src/generated/resources/assets/gtceu/blockstates/dark_concrete_windmill_a.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "gtceu:block/dark_concrete_windmill_a" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/dark_concrete_windmill_b.json b/src/generated/resources/assets/gtceu/blockstates/dark_concrete_windmill_b.json new file mode 100644 index 0000000000..0c7490ee09 --- /dev/null +++ b/src/generated/resources/assets/gtceu/blockstates/dark_concrete_windmill_b.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "gtceu:block/dark_concrete_windmill_b" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/industrial_tnt.json b/src/generated/resources/assets/gtceu/blockstates/industrial_tnt.json new file mode 100644 index 0000000000..8d62cb9b1e --- /dev/null +++ b/src/generated/resources/assets/gtceu/blockstates/industrial_tnt.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "gtceu:block/industrial_tnt" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/light_concrete_windmill_a.json b/src/generated/resources/assets/gtceu/blockstates/light_concrete_windmill_a.json new file mode 100644 index 0000000000..02a997a338 --- /dev/null +++ b/src/generated/resources/assets/gtceu/blockstates/light_concrete_windmill_a.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "gtceu:block/light_concrete_windmill_a" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/light_concrete_windmill_b.json b/src/generated/resources/assets/gtceu/blockstates/light_concrete_windmill_b.json new file mode 100644 index 0000000000..ed013d1c2b --- /dev/null +++ b/src/generated/resources/assets/gtceu/blockstates/light_concrete_windmill_b.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "gtceu:block/light_concrete_windmill_b" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/marble_windmill_a.json b/src/generated/resources/assets/gtceu/blockstates/marble_windmill_a.json new file mode 100644 index 0000000000..1e48d56347 --- /dev/null +++ b/src/generated/resources/assets/gtceu/blockstates/marble_windmill_a.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "gtceu:block/marble_windmill_a" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/marble_windmill_b.json b/src/generated/resources/assets/gtceu/blockstates/marble_windmill_b.json new file mode 100644 index 0000000000..26f4305fb1 --- /dev/null +++ b/src/generated/resources/assets/gtceu/blockstates/marble_windmill_b.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "gtceu:block/marble_windmill_b" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/powderbarrel.json b/src/generated/resources/assets/gtceu/blockstates/powderbarrel.json new file mode 100644 index 0000000000..54b788cc3e --- /dev/null +++ b/src/generated/resources/assets/gtceu/blockstates/powderbarrel.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "gtceu:block/powderbarrel" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/red_granite_windmill_a.json b/src/generated/resources/assets/gtceu/blockstates/red_granite_windmill_a.json new file mode 100644 index 0000000000..def9ad680f --- /dev/null +++ b/src/generated/resources/assets/gtceu/blockstates/red_granite_windmill_a.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "gtceu:block/red_granite_windmill_a" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/red_granite_windmill_b.json b/src/generated/resources/assets/gtceu/blockstates/red_granite_windmill_b.json new file mode 100644 index 0000000000..53cc620b3b --- /dev/null +++ b/src/generated/resources/assets/gtceu/blockstates/red_granite_windmill_b.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "gtceu:block/red_granite_windmill_b" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/rubber_trapdoor.json b/src/generated/resources/assets/gtceu/blockstates/rubber_trapdoor.json index 31c4d5bb8b..be00df16e9 100644 --- a/src/generated/resources/assets/gtceu/blockstates/rubber_trapdoor.json +++ b/src/generated/resources/assets/gtceu/blockstates/rubber_trapdoor.json @@ -1,7 +1,68 @@ { "variants": { - "": { - "model": "gtceu:block/rubber_trapdoor" + "facing=east,half=bottom,open=false": { + "model": "gtceu:block/rubber_trapdoor_bottom", + "y": 90 + }, + "facing=east,half=bottom,open=true": { + "model": "gtceu:block/rubber_trapdoor_open", + "y": 90 + }, + "facing=east,half=top,open=false": { + "model": "gtceu:block/rubber_trapdoor_top", + "y": 90 + }, + "facing=east,half=top,open=true": { + "model": "gtceu:block/rubber_trapdoor_open", + "x": 180, + "y": 270 + }, + "facing=north,half=bottom,open=false": { + "model": "gtceu:block/rubber_trapdoor_bottom" + }, + "facing=north,half=bottom,open=true": { + "model": "gtceu:block/rubber_trapdoor_open" + }, + "facing=north,half=top,open=false": { + "model": "gtceu:block/rubber_trapdoor_top" + }, + "facing=north,half=top,open=true": { + "model": "gtceu:block/rubber_trapdoor_open", + "x": 180, + "y": 180 + }, + "facing=south,half=bottom,open=false": { + "model": "gtceu:block/rubber_trapdoor_bottom", + "y": 180 + }, + "facing=south,half=bottom,open=true": { + "model": "gtceu:block/rubber_trapdoor_open", + "y": 180 + }, + "facing=south,half=top,open=false": { + "model": "gtceu:block/rubber_trapdoor_top", + "y": 180 + }, + "facing=south,half=top,open=true": { + "model": "gtceu:block/rubber_trapdoor_open", + "x": 180 + }, + "facing=west,half=bottom,open=false": { + "model": "gtceu:block/rubber_trapdoor_bottom", + "y": 270 + }, + "facing=west,half=bottom,open=true": { + "model": "gtceu:block/rubber_trapdoor_open", + "y": 270 + }, + "facing=west,half=top,open=false": { + "model": "gtceu:block/rubber_trapdoor_top", + "y": 270 + }, + "facing=west,half=top,open=true": { + "model": "gtceu:block/rubber_trapdoor_open", + "x": 180, + "y": 90 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/rubber_wall_sign.json b/src/generated/resources/assets/gtceu/blockstates/rubber_wall_sign.json index 37161f7870..732881c3cc 100644 --- a/src/generated/resources/assets/gtceu/blockstates/rubber_wall_sign.json +++ b/src/generated/resources/assets/gtceu/blockstates/rubber_wall_sign.json @@ -1,7 +1,7 @@ { "variants": { "": { - "model": "gtceu:block/rubber_wall_sign" + "model": "gtceu:block/rubber_sign" } } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/smooth_dark_concrete.json b/src/generated/resources/assets/gtceu/blockstates/smooth_dark_concrete.json deleted file mode 100644 index ab595aac47..0000000000 --- a/src/generated/resources/assets/gtceu/blockstates/smooth_dark_concrete.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "gtceu:block/smooth_dark_concrete" - } - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/smooth_light_concrete.json b/src/generated/resources/assets/gtceu/blockstates/smooth_light_concrete.json deleted file mode 100644 index d22f262caf..0000000000 --- a/src/generated/resources/assets/gtceu/blockstates/smooth_light_concrete.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "gtceu:block/smooth_light_concrete" - } - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/smooth_marble.json b/src/generated/resources/assets/gtceu/blockstates/smooth_marble.json deleted file mode 100644 index 9b0c24e9af..0000000000 --- a/src/generated/resources/assets/gtceu/blockstates/smooth_marble.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "gtceu:block/smooth_marble" - } - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/smooth_red_granite.json b/src/generated/resources/assets/gtceu/blockstates/smooth_red_granite.json deleted file mode 100644 index fcf26f5434..0000000000 --- a/src/generated/resources/assets/gtceu/blockstates/smooth_red_granite.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "gtceu:block/smooth_red_granite" - } - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/treated_wood_trapdoor.json b/src/generated/resources/assets/gtceu/blockstates/treated_wood_trapdoor.json index 72fde9de6b..72d155bac5 100644 --- a/src/generated/resources/assets/gtceu/blockstates/treated_wood_trapdoor.json +++ b/src/generated/resources/assets/gtceu/blockstates/treated_wood_trapdoor.json @@ -1,7 +1,68 @@ { "variants": { - "": { - "model": "gtceu:block/treated_wood_trapdoor" + "facing=east,half=bottom,open=false": { + "model": "gtceu:block/treated_wood_trapdoor_bottom", + "y": 90 + }, + "facing=east,half=bottom,open=true": { + "model": "gtceu:block/treated_wood_trapdoor_open", + "y": 90 + }, + "facing=east,half=top,open=false": { + "model": "gtceu:block/treated_wood_trapdoor_top", + "y": 90 + }, + "facing=east,half=top,open=true": { + "model": "gtceu:block/treated_wood_trapdoor_open", + "x": 180, + "y": 270 + }, + "facing=north,half=bottom,open=false": { + "model": "gtceu:block/treated_wood_trapdoor_bottom" + }, + "facing=north,half=bottom,open=true": { + "model": "gtceu:block/treated_wood_trapdoor_open" + }, + "facing=north,half=top,open=false": { + "model": "gtceu:block/treated_wood_trapdoor_top" + }, + "facing=north,half=top,open=true": { + "model": "gtceu:block/treated_wood_trapdoor_open", + "x": 180, + "y": 180 + }, + "facing=south,half=bottom,open=false": { + "model": "gtceu:block/treated_wood_trapdoor_bottom", + "y": 180 + }, + "facing=south,half=bottom,open=true": { + "model": "gtceu:block/treated_wood_trapdoor_open", + "y": 180 + }, + "facing=south,half=top,open=false": { + "model": "gtceu:block/treated_wood_trapdoor_top", + "y": 180 + }, + "facing=south,half=top,open=true": { + "model": "gtceu:block/treated_wood_trapdoor_open", + "x": 180 + }, + "facing=west,half=bottom,open=false": { + "model": "gtceu:block/treated_wood_trapdoor_bottom", + "y": 270 + }, + "facing=west,half=bottom,open=true": { + "model": "gtceu:block/treated_wood_trapdoor_open", + "y": 270 + }, + "facing=west,half=top,open=false": { + "model": "gtceu:block/treated_wood_trapdoor_top", + "y": 270 + }, + "facing=west,half=top,open=true": { + "model": "gtceu:block/treated_wood_trapdoor_open", + "x": 180, + "y": 90 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/blockstates/treated_wood_wall_sign.json b/src/generated/resources/assets/gtceu/blockstates/treated_wood_wall_sign.json index a31fd4eea6..237da600bd 100644 --- a/src/generated/resources/assets/gtceu/blockstates/treated_wood_wall_sign.json +++ b/src/generated/resources/assets/gtceu/blockstates/treated_wood_wall_sign.json @@ -1,7 +1,7 @@ { "variants": { "": { - "model": "gtceu:block/treated_wood_wall_sign" + "model": "gtceu:block/treated_wood_sign" } } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/compass/nodes/generation/basalt.json b/src/generated/resources/assets/gtceu/compass/nodes/generation/basalt.json index 481316acee..68ab05ead3 100644 --- a/src/generated/resources/assets/gtceu/compass/nodes/generation/basalt.json +++ b/src/generated/resources/assets/gtceu/compass/nodes/generation/basalt.json @@ -117,7 +117,7 @@ ], "page": "gtceu:generation/basalt", "position": [ - -250, + -150, 150 ], "pre_nodes": [ diff --git a/src/generated/resources/assets/gtceu/compass/nodes/generation/deepslate.json b/src/generated/resources/assets/gtceu/compass/nodes/generation/deepslate.json index 6d65ceb249..593ae09a46 100644 --- a/src/generated/resources/assets/gtceu/compass/nodes/generation/deepslate.json +++ b/src/generated/resources/assets/gtceu/compass/nodes/generation/deepslate.json @@ -117,7 +117,7 @@ ], "page": "gtceu:generation/deepslate", "position": [ - -250, + -150, 100 ], "pre_nodes": [ diff --git a/src/generated/resources/assets/gtceu/compass/nodes/generation/endstone.json b/src/generated/resources/assets/gtceu/compass/nodes/generation/endstone.json index ba85f49288..af1a8793ee 100644 --- a/src/generated/resources/assets/gtceu/compass/nodes/generation/endstone.json +++ b/src/generated/resources/assets/gtceu/compass/nodes/generation/endstone.json @@ -117,7 +117,7 @@ ], "page": "gtceu:generation/endstone", "position": [ - -150, + -50, 150 ], "pre_nodes": [ diff --git a/src/generated/resources/assets/gtceu/compass/nodes/generation/gravel.json b/src/generated/resources/assets/gtceu/compass/nodes/generation/gravel.json index 851cb01c4d..c54c07dc70 100644 --- a/src/generated/resources/assets/gtceu/compass/nodes/generation/gravel.json +++ b/src/generated/resources/assets/gtceu/compass/nodes/generation/gravel.json @@ -117,8 +117,8 @@ ], "page": "gtceu:generation/gravel", "position": [ - -50, - 100 + -200, + 150 ], "pre_nodes": [ "gtceu:generation/ore" diff --git a/src/generated/resources/assets/gtceu/compass/nodes/generation/marble.json b/src/generated/resources/assets/gtceu/compass/nodes/generation/marble.json new file mode 100644 index 0000000000..2f7518d361 --- /dev/null +++ b/src/generated/resources/assets/gtceu/compass/nodes/generation/marble.json @@ -0,0 +1,127 @@ +{ + "button_texture": { + "type": "item", + "res": "gtceu:marble_aluminium_ore" + }, + "items": [ + "gtceu:marble_aluminium_ore", + "gtceu:marble_beryllium_ore", + "gtceu:marble_cobalt_ore", + "gtceu:marble_copper_ore", + "gtceu:marble_gold_ore", + "gtceu:marble_iron_ore", + "gtceu:marble_lead_ore", + "gtceu:marble_lithium_ore", + "gtceu:marble_molybdenum_ore", + "gtceu:marble_neodymium_ore", + "gtceu:marble_nickel_ore", + "gtceu:marble_palladium_ore", + "gtceu:marble_platinum_ore", + "gtceu:marble_plutonium_ore", + "gtceu:marble_silver_ore", + "gtceu:marble_sulfur_ore", + "gtceu:marble_thorium_ore", + "gtceu:marble_tin_ore", + "gtceu:marble_naquadah_ore", + "gtceu:marble_almandine_ore", + "gtceu:marble_asbestos_ore", + "gtceu:marble_hematite_ore", + "gtceu:marble_blue_topaz_ore", + "gtceu:marble_goethite_ore", + "gtceu:marble_calcite_ore", + "gtceu:marble_cassiterite_ore", + "gtceu:marble_cassiterite_sand_ore", + "gtceu:marble_chalcopyrite_ore", + "gtceu:marble_chromite_ore", + "gtceu:marble_cinnabar_ore", + "gtceu:marble_coal_ore", + "gtceu:marble_cobaltite_ore", + "gtceu:marble_cooperite_ore", + "gtceu:marble_diamond_ore", + "gtceu:marble_emerald_ore", + "gtceu:marble_galena_ore", + "gtceu:marble_garnierite_ore", + "gtceu:marble_green_sapphire_ore", + "gtceu:marble_grossular_ore", + "gtceu:marble_ilmenite_ore", + "gtceu:marble_bauxite_ore", + "gtceu:marble_lazurite_ore", + "gtceu:marble_magnesite_ore", + "gtceu:marble_magnetite_ore", + "gtceu:marble_molybdenite_ore", + "gtceu:marble_powellite_ore", + "gtceu:marble_pyrite_ore", + "gtceu:marble_pyrolusite_ore", + "gtceu:marble_pyrope_ore", + "gtceu:marble_rock_salt_ore", + "gtceu:marble_ruby_ore", + "gtceu:marble_salt_ore", + "gtceu:marble_saltpeter_ore", + "gtceu:marble_sapphire_ore", + "gtceu:marble_scheelite_ore", + "gtceu:marble_sodalite_ore", + "gtceu:marble_tantalite_ore", + "gtceu:marble_spessartine_ore", + "gtceu:marble_sphalerite_ore", + "gtceu:marble_stibnite_ore", + "gtceu:marble_tetrahedrite_ore", + "gtceu:marble_topaz_ore", + "gtceu:marble_tungstate_ore", + "gtceu:marble_uraninite_ore", + "gtceu:marble_wulfenite_ore", + "gtceu:marble_yellow_limonite_ore", + "gtceu:marble_nether_quartz_ore", + "gtceu:marble_certus_quartz_ore", + "gtceu:marble_quartzite_ore", + "gtceu:marble_graphite_ore", + "gtceu:marble_bornite_ore", + "gtceu:marble_chalcocite_ore", + "gtceu:marble_realgar_ore", + "gtceu:marble_bastnasite_ore", + "gtceu:marble_pentlandite_ore", + "gtceu:marble_spodumene_ore", + "gtceu:marble_lepidolite_ore", + "gtceu:marble_glauconite_sand_ore", + "gtceu:marble_malachite_ore", + "gtceu:marble_mica_ore", + "gtceu:marble_barite_ore", + "gtceu:marble_alunite_ore", + "gtceu:marble_talc_ore", + "gtceu:marble_soapstone_ore", + "gtceu:marble_kyanite_ore", + "gtceu:marble_pyrochlore_ore", + "gtceu:marble_oilsands_ore", + "gtceu:marble_olivine_ore", + "gtceu:marble_opal_ore", + "gtceu:marble_amethyst_ore", + "gtceu:marble_lapis_ore", + "gtceu:marble_apatite_ore", + "gtceu:marble_tricalcium_phosphate_ore", + "gtceu:marble_red_garnet_ore", + "gtceu:marble_yellow_garnet_ore", + "gtceu:marble_vanadium_magnetite_ore", + "gtceu:marble_pollucite_ore", + "gtceu:marble_bentonite_ore", + "gtceu:marble_fullers_earth_ore", + "gtceu:marble_pitchblende_ore", + "gtceu:marble_monazite_ore", + "gtceu:marble_trona_ore", + "gtceu:marble_gypsum_ore", + "gtceu:marble_zeolite_ore", + "gtceu:marble_redstone_ore", + "gtceu:marble_electrotine_ore", + "gtceu:marble_diatomite_ore", + "gtceu:marble_granitic_mineral_sand_ore", + "gtceu:marble_garnet_sand_ore", + "gtceu:marble_basaltic_mineral_sand_ore" + ], + "page": "gtceu:generation/marble", + "position": [ + -200, + 100 + ], + "pre_nodes": [ + "gtceu:generation/ore" + ], + "section": "gtceu:generation" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/compass/nodes/generation/netherrack.json b/src/generated/resources/assets/gtceu/compass/nodes/generation/netherrack.json index 27b5c18351..554656725c 100644 --- a/src/generated/resources/assets/gtceu/compass/nodes/generation/netherrack.json +++ b/src/generated/resources/assets/gtceu/compass/nodes/generation/netherrack.json @@ -117,7 +117,7 @@ ], "page": "gtceu:generation/netherrack", "position": [ - -200, + -100, 150 ], "pre_nodes": [ diff --git a/src/generated/resources/assets/gtceu/compass/nodes/generation/red_granite.json b/src/generated/resources/assets/gtceu/compass/nodes/generation/red_granite.json new file mode 100644 index 0000000000..af3ff88f99 --- /dev/null +++ b/src/generated/resources/assets/gtceu/compass/nodes/generation/red_granite.json @@ -0,0 +1,127 @@ +{ + "button_texture": { + "type": "item", + "res": "gtceu:red_granite_aluminium_ore" + }, + "items": [ + "gtceu:red_granite_aluminium_ore", + "gtceu:red_granite_beryllium_ore", + "gtceu:red_granite_cobalt_ore", + "gtceu:red_granite_copper_ore", + "gtceu:red_granite_gold_ore", + "gtceu:red_granite_iron_ore", + "gtceu:red_granite_lead_ore", + "gtceu:red_granite_lithium_ore", + "gtceu:red_granite_molybdenum_ore", + "gtceu:red_granite_neodymium_ore", + "gtceu:red_granite_nickel_ore", + "gtceu:red_granite_palladium_ore", + "gtceu:red_granite_platinum_ore", + "gtceu:red_granite_plutonium_ore", + "gtceu:red_granite_silver_ore", + "gtceu:red_granite_sulfur_ore", + "gtceu:red_granite_thorium_ore", + "gtceu:red_granite_tin_ore", + "gtceu:red_granite_naquadah_ore", + "gtceu:red_granite_almandine_ore", + "gtceu:red_granite_asbestos_ore", + "gtceu:red_granite_hematite_ore", + "gtceu:red_granite_blue_topaz_ore", + "gtceu:red_granite_goethite_ore", + "gtceu:red_granite_calcite_ore", + "gtceu:red_granite_cassiterite_ore", + "gtceu:red_granite_cassiterite_sand_ore", + "gtceu:red_granite_chalcopyrite_ore", + "gtceu:red_granite_chromite_ore", + "gtceu:red_granite_cinnabar_ore", + "gtceu:red_granite_coal_ore", + "gtceu:red_granite_cobaltite_ore", + "gtceu:red_granite_cooperite_ore", + "gtceu:red_granite_diamond_ore", + "gtceu:red_granite_emerald_ore", + "gtceu:red_granite_galena_ore", + "gtceu:red_granite_garnierite_ore", + "gtceu:red_granite_green_sapphire_ore", + "gtceu:red_granite_grossular_ore", + "gtceu:red_granite_ilmenite_ore", + "gtceu:red_granite_bauxite_ore", + "gtceu:red_granite_lazurite_ore", + "gtceu:red_granite_magnesite_ore", + "gtceu:red_granite_magnetite_ore", + "gtceu:red_granite_molybdenite_ore", + "gtceu:red_granite_powellite_ore", + "gtceu:red_granite_pyrite_ore", + "gtceu:red_granite_pyrolusite_ore", + "gtceu:red_granite_pyrope_ore", + "gtceu:red_granite_rock_salt_ore", + "gtceu:red_granite_ruby_ore", + "gtceu:red_granite_salt_ore", + "gtceu:red_granite_saltpeter_ore", + "gtceu:red_granite_sapphire_ore", + "gtceu:red_granite_scheelite_ore", + "gtceu:red_granite_sodalite_ore", + "gtceu:red_granite_tantalite_ore", + "gtceu:red_granite_spessartine_ore", + "gtceu:red_granite_sphalerite_ore", + "gtceu:red_granite_stibnite_ore", + "gtceu:red_granite_tetrahedrite_ore", + "gtceu:red_granite_topaz_ore", + "gtceu:red_granite_tungstate_ore", + "gtceu:red_granite_uraninite_ore", + "gtceu:red_granite_wulfenite_ore", + "gtceu:red_granite_yellow_limonite_ore", + "gtceu:red_granite_nether_quartz_ore", + "gtceu:red_granite_certus_quartz_ore", + "gtceu:red_granite_quartzite_ore", + "gtceu:red_granite_graphite_ore", + "gtceu:red_granite_bornite_ore", + "gtceu:red_granite_chalcocite_ore", + "gtceu:red_granite_realgar_ore", + "gtceu:red_granite_bastnasite_ore", + "gtceu:red_granite_pentlandite_ore", + "gtceu:red_granite_spodumene_ore", + "gtceu:red_granite_lepidolite_ore", + "gtceu:red_granite_glauconite_sand_ore", + "gtceu:red_granite_malachite_ore", + "gtceu:red_granite_mica_ore", + "gtceu:red_granite_barite_ore", + "gtceu:red_granite_alunite_ore", + "gtceu:red_granite_talc_ore", + "gtceu:red_granite_soapstone_ore", + "gtceu:red_granite_kyanite_ore", + "gtceu:red_granite_pyrochlore_ore", + "gtceu:red_granite_oilsands_ore", + "gtceu:red_granite_olivine_ore", + "gtceu:red_granite_opal_ore", + "gtceu:red_granite_amethyst_ore", + "gtceu:red_granite_lapis_ore", + "gtceu:red_granite_apatite_ore", + "gtceu:red_granite_tricalcium_phosphate_ore", + "gtceu:red_granite_red_garnet_ore", + "gtceu:red_granite_yellow_garnet_ore", + "gtceu:red_granite_vanadium_magnetite_ore", + "gtceu:red_granite_pollucite_ore", + "gtceu:red_granite_bentonite_ore", + "gtceu:red_granite_fullers_earth_ore", + "gtceu:red_granite_pitchblende_ore", + "gtceu:red_granite_monazite_ore", + "gtceu:red_granite_trona_ore", + "gtceu:red_granite_gypsum_ore", + "gtceu:red_granite_zeolite_ore", + "gtceu:red_granite_redstone_ore", + "gtceu:red_granite_electrotine_ore", + "gtceu:red_granite_diatomite_ore", + "gtceu:red_granite_granitic_mineral_sand_ore", + "gtceu:red_granite_garnet_sand_ore", + "gtceu:red_granite_basaltic_mineral_sand_ore" + ], + "page": "gtceu:generation/red_granite", + "position": [ + -250, + 100 + ], + "pre_nodes": [ + "gtceu:generation/ore" + ], + "section": "gtceu:generation" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/compass/nodes/generation/red_sand.json b/src/generated/resources/assets/gtceu/compass/nodes/generation/red_sand.json index 2473a14428..e90b2bb6f2 100644 --- a/src/generated/resources/assets/gtceu/compass/nodes/generation/red_sand.json +++ b/src/generated/resources/assets/gtceu/compass/nodes/generation/red_sand.json @@ -117,8 +117,8 @@ ], "page": "gtceu:generation/red_sand", "position": [ - -100, - 100 + -250, + 150 ], "pre_nodes": [ "gtceu:generation/ore" diff --git a/src/generated/resources/assets/gtceu/compass/nodes/generation/sand.json b/src/generated/resources/assets/gtceu/compass/nodes/generation/sand.json index 83e5f82d8d..32ebda4c75 100644 --- a/src/generated/resources/assets/gtceu/compass/nodes/generation/sand.json +++ b/src/generated/resources/assets/gtceu/compass/nodes/generation/sand.json @@ -117,7 +117,7 @@ ], "page": "gtceu:generation/sand", "position": [ - -150, + -50, 100 ], "pre_nodes": [ diff --git a/src/generated/resources/assets/gtceu/compass/nodes/generation/tuff.json b/src/generated/resources/assets/gtceu/compass/nodes/generation/tuff.json index cfc5cc064c..890f3b4f56 100644 --- a/src/generated/resources/assets/gtceu/compass/nodes/generation/tuff.json +++ b/src/generated/resources/assets/gtceu/compass/nodes/generation/tuff.json @@ -117,7 +117,7 @@ ], "page": "gtceu:generation/tuff", "position": [ - -200, + -100, 100 ], "pre_nodes": [ diff --git a/src/generated/resources/assets/gtceu/lang/en_ud.json b/src/generated/resources/assets/gtceu/lang/en_ud.json index f7599eece6..3cc3fdccdf 100644 --- a/src/generated/resources/assets/gtceu/lang/en_ud.json +++ b/src/generated/resources/assets/gtceu/lang/en_ud.json @@ -3,7 +3,7 @@ "behavior.data_item.assemblyline.title": ":ɐʇɐᗡ uoıʇɔnɹʇsuoƆ ǝuıꞀ ʎןqɯǝssⱯu§", "behavior.item_magnet.disabled": "pǝןqɐsıᗡ pןǝıℲ ɔıʇǝubɐWɔ§", "behavior.item_magnet.enabled": "pǝןqɐuƎ pןǝıℲ ɔıʇǝubɐWɐ§", - "behavior.portable_scanner.amp_per_sec": "Ɐ %s puoɔǝS ʇsɐꞀ", + "behavior.portable_scanner.amp_per_sec": "Ɐ %s :)puoɔǝs ʇsɐן( ǝbɐɹǝʌⱯ", "behavior.portable_scanner.bedrock_fluid.amount": "%s%% - %s %s :ʇısodǝᗡ uI pınןℲ", "behavior.portable_scanner.bedrock_fluid.amount_unknown": "%s%% :ʇısodǝᗡ uI pınןℲ", "behavior.portable_scanner.bedrock_fluid.nothing": "ɹ§buıɥʇoN9§ :ʇısodǝᗡ uI pınןℲ", @@ -20,7 +20,7 @@ "behavior.portable_scanner.energy_container_in": "Ɐ %s ʇɐ ∩Ǝ )%s( %s :NI xɐW", "behavior.portable_scanner.energy_container_out": "Ɐ %s ʇɐ ∩Ǝ )%s( %s :⟘∩O xɐW", "behavior.portable_scanner.energy_container_storage": "∩Ǝ %s / ∩Ǝ %s :ʎbɹǝuƎ", - "behavior.portable_scanner.eu_per_sec": "∩Ǝ %s puoɔǝS ʇsɐꞀ", + "behavior.portable_scanner.eu_per_sec": "ʇ/∩Ǝ %s :)puoɔǝs ʇsɐן( ǝbɐɹǝʌⱯ", "behavior.portable_scanner.machine_disabled": "˙pǝןqɐsıᗡ", "behavior.portable_scanner.machine_power_loss": "˙ssoן ɹǝʍod oʇ ǝnp uʍop ʇnɥS", "behavior.portable_scanner.machine_progress": "%s / %s :pɐoꞀ/ssǝɹboɹԀ", @@ -142,6 +142,8 @@ "block.gtceu.dark_concrete_cobblestone": "ǝuoʇsǝןqqoƆ ǝʇǝɹɔuoƆ ʞɹɐᗡ", "block.gtceu.dark_concrete_small_tile": "ǝןı⟘ ןןɐɯS ǝʇǝɹɔuoƆ ʞɹɐᗡ", "block.gtceu.dark_concrete_tile": "ǝןı⟘ ǝʇǝɹɔuoƆ ʞɹɐᗡ", + "block.gtceu.dark_concrete_windmill_a": "Ɐ ןןıɯpuıM ǝʇǝɹɔuoƆ ʞɹɐᗡ", + "block.gtceu.dark_concrete_windmill_b": "ᗺ ןןıɯpuıM ǝʇǝɹɔuoƆ ʞɹɐᗡ", "block.gtceu.data_access_hatch": "ɥɔʇɐH ssǝɔɔⱯ ɐʇɐᗡ", "block.gtceu.data_bank": "ʞuɐᗺ ɐʇɐᗡ", "block.gtceu.data_receiver_hatch": "ɥɔʇɐH uoıʇdǝɔǝᴚ ɐʇɐᗡ ןɐɔıʇdO", @@ -238,6 +240,8 @@ "block.gtceu.ev_wiremill": "ɹ§III ןןıɯǝɹıM pǝɔuɐʌpⱯϛ§", "block.gtceu.ev_world_accelerator": "ɹ§III ɹoʇɐɹǝןǝɔɔⱯ pןɹoM pǝɔuɐʌpⱯϛ§", "block.gtceu.explosion_hazard_sign_block": "ʞɔoןᗺ ubıS pɹɐzɐH uoısoןdxƎ", + "block.gtceu.explosive.breaking_tooltip": "dn ʞɔɐq ʞɔıd oʇ ǝuıɯ ʞɐǝus 'pǝuıɯ uǝɥʍ uoısoןdxǝ sǝɯıɹԀ", + "block.gtceu.explosive.lighting_tooltip": "ǝuoʇspǝᴚ ɥʇıʍ ʇıן ǝq ʇouuɐƆ", "block.gtceu.extreme_combustion_engine": "ǝuıbuƎ uoıʇsnqɯoƆ ǝɯǝɹʇxƎ", "block.gtceu.extreme_engine_intake_casing": "buısɐƆ ǝʞɐʇuI ǝuıbuƎ ǝɯǝɹʇxƎ", "block.gtceu.filter_casing": "buısɐƆ ɹǝʇןıℲ", @@ -360,7 +364,9 @@ "block.gtceu.hv_world_accelerator": "ɹ§II ɹoʇɐɹǝןǝɔɔⱯ pןɹoM pǝɔuɐʌpⱯ9§", "block.gtceu.implosion_compressor": "ɹossǝɹdɯoƆ uoısoןdɯI", "block.gtceu.industrial_steam_casing": "buısɐƆ ɯɐǝʇS ןɐıɹʇsnpuI", + "block.gtceu.industrial_tnt": "⟘N⟘ ןɐıɹʇsnpuI", "block.gtceu.inert_machine_casing": "buısɐƆ ǝuıɥɔɐW ƎℲ⟘Ԁ ʇɹǝuI ʎןןɐɔıɯǝɥƆ", + "block.gtceu.itnt.drops_tooltip": "sɯǝʇI sɐ sʞɔoןᗺ pǝʎoɹʇsǝp ןןɐ sdoɹp '⟘N⟘ uɐɥʇ ɹǝbɹɐן ɥɔnW", "block.gtceu.iv_1024a_laser_source_hatch": "ɥɔʇɐH ǝɔɹnoS ɹǝsɐꞀ Ɐㄣᄅ0'Ɩ ΛI6§", "block.gtceu.iv_1024a_laser_target_hatch": "ɥɔʇɐH ʇǝbɹɐ⟘ ɹǝsɐꞀ Ɐㄣᄅ0'Ɩ ΛI6§", "block.gtceu.iv_16a_energy_converter": "ɹǝʇɹǝʌuoƆ ʎbɹǝuƎ Ɐ9Ɩ ΛI", @@ -481,6 +487,8 @@ "block.gtceu.light_concrete_cobblestone": "ǝuoʇsǝןqqoƆ ǝʇǝɹɔuoƆ ʇɥbıꞀ", "block.gtceu.light_concrete_small_tile": "ǝןı⟘ ןןɐɯS ǝʇǝɹɔuoƆ ʇɥbıꞀ", "block.gtceu.light_concrete_tile": "ǝןı⟘ ǝʇǝɹɔuoƆ ʇɥbıꞀ", + "block.gtceu.light_concrete_windmill_a": "Ɐ ןןıɯpuıM ǝʇǝɹɔuoƆ ʇɥbıꞀ", + "block.gtceu.light_concrete_windmill_b": "ᗺ ןןıɯpuıM ǝʇǝɹɔuoƆ ʇɥbıꞀ", "block.gtceu.light_gray_lamp": "dɯɐꞀ ʎɐɹ⅁ ʇɥbıꞀ", "block.gtceu.lime_lamp": "dɯɐꞀ ǝɯıꞀ", "block.gtceu.long_distance_fluid_pipeline": "ǝuıןǝdıԀ pınןℲ ǝɔuɐʇsıᗡ buoꞀ", @@ -673,6 +681,8 @@ "block.gtceu.marble_cobblestone": "ǝuoʇsǝןqqoƆ ǝןqɹɐW", "block.gtceu.marble_small_tile": "ǝןı⟘ ןןɐɯS ǝןqɹɐW", "block.gtceu.marble_tile": "ǝןı⟘ ǝןqɹɐW", + "block.gtceu.marble_windmill_a": "Ɐ ןןıɯpuıM ǝןqɹɐW", + "block.gtceu.marble_windmill_b": "ᗺ ןןıɯpuıM ǝןqɹɐW", "block.gtceu.max_16a_energy_converter": "ɹǝʇɹǝʌuoƆ ʎbɹǝuƎ Ɐ9Ɩ XⱯW", "block.gtceu.max_1a_energy_converter": "ɹǝʇɹǝʌuoƆ ʎbɹǝuƎ ⱯƖ XⱯW", "block.gtceu.max_4a_energy_converter": "ɹǝʇɹǝʌuoƆ ʎbɹǝuƎ Ɐㄣ XⱯW", @@ -877,6 +887,8 @@ "block.gtceu.polished_light_concrete": "ǝʇǝɹɔuoƆ ʇɥbıꞀ pǝɥsıןoԀ", "block.gtceu.polished_marble": "ǝןqɹɐW pǝɥsıןoԀ", "block.gtceu.polished_red_granite": "ǝʇıuɐɹ⅁ pǝᴚ pǝɥsıןoԀ", + "block.gtceu.powderbarrel": "ןǝɹɹɐqɹǝpʍoԀ", + "block.gtceu.powderbarrel.drops_tooltip": "sɯǝʇI sɐ sʞɔoןᗺ pǝʎoɹʇsǝp ןןɐ sdoɹp '⟘N⟘ uɐɥʇ ɹǝbɹɐן ʎןʇɥbıןS", "block.gtceu.power_substation": "uoıʇɐʇsqnS ɹǝʍoԀ", "block.gtceu.primitive_blast_furnace": "ǝɔɐuɹnℲ ʇsɐןᗺ ǝʌıʇıɯıɹԀ", "block.gtceu.primitive_pump": "dɯnԀ ǝʌıʇıɯıɹԀ", @@ -892,6 +904,8 @@ "block.gtceu.red_granite_cobblestone": "ǝuoʇsǝןqqoƆ ǝʇıuɐɹ⅁ pǝᴚ", "block.gtceu.red_granite_small_tile": "ǝןı⟘ ןןɐɯS ǝʇıuɐɹ⅁ pǝᴚ", "block.gtceu.red_granite_tile": "ǝןı⟘ ǝʇıuɐɹ⅁ pǝᴚ", + "block.gtceu.red_granite_windmill_a": "Ɐ ןןıɯpuıM ǝʇıuɐɹ⅁ pǝᴚ", + "block.gtceu.red_granite_windmill_b": "ᗺ ןןıɯpuıM ǝʇıuɐɹ⅁ pǝᴚ", "block.gtceu.red_lamp": "dɯɐꞀ pǝᴚ", "block.gtceu.reinforced_stone": "ǝuoʇS pǝɔɹoɟuıǝᴚ", "block.gtceu.research_station": "uoıʇɐʇS ɥɔɹɐǝsǝᴚ", @@ -906,6 +920,7 @@ "block.gtceu.rubber_planks": "sʞuɐןԀ ɹǝqqnᴚ", "block.gtceu.rubber_pressure_plate": "ǝʇɐןԀ ǝɹnssǝɹԀ ɹǝqqnᴚ", "block.gtceu.rubber_sapling": "buıןdɐS ɹǝqqnᴚ", + "block.gtceu.rubber_sign": "ubıS ןןɐM ɹǝqqnᴚ", "block.gtceu.rubber_slab": "qɐןS ɹǝqqnᴚ", "block.gtceu.rubber_stairs": "sɹıɐʇS ɹǝqqnᴚ", "block.gtceu.rubber_trapdoor": "ɹoopdɐɹ⟘ ɹǝqqnᴚ", @@ -917,10 +932,6 @@ "block.gtceu.small_light_concrete_bricks": "sʞɔıɹᗺ ǝʇǝɹɔuoƆ ʇɥbıꞀ ןןɐɯS", "block.gtceu.small_marble_bricks": "sʞɔıɹᗺ ǝןqɹɐW ןןɐɯS", "block.gtceu.small_red_granite_bricks": "sʞɔıɹᗺ ǝʇıuɐɹ⅁ pǝᴚ ןןɐɯS", - "block.gtceu.smooth_dark_concrete": "ǝʇǝɹɔuoƆ ʞɹɐᗡ ɥʇooɯS", - "block.gtceu.smooth_light_concrete": "ǝʇǝɹɔuoƆ ʇɥbıꞀ ɥʇooɯS", - "block.gtceu.smooth_marble": "ǝןqɹɐW ɥʇooɯS", - "block.gtceu.smooth_red_granite": "ǝʇıuɐɹ⅁ pǝᴚ ɥʇooɯS", "block.gtceu.solid_machine_casing": "buısɐƆ ǝuıɥɔɐW pıןoS", "block.gtceu.spatial_storage_hazard_sign_block": "ʞɔoןᗺ ubıS pɹɐzɐH ǝbɐɹoʇS ןɐıʇɐdS", "block.gtceu.square_dark_concrete_bricks": "sʞɔıɹᗺ ǝʇǝɹɔuoƆ ʞɹɐᗡ ǝɹɐnbS", @@ -981,6 +992,7 @@ "block.gtceu.treated_wood_fence_gate": "ǝʇɐ⅁ ǝɔuǝℲ pooM pǝʇɐǝɹ⟘", "block.gtceu.treated_wood_planks": "sʞuɐןԀ pooM pǝʇɐǝɹ⟘", "block.gtceu.treated_wood_pressure_plate": "ǝʇɐןԀ ǝɹnssǝɹԀ pooM pǝʇɐǝɹ⟘", + "block.gtceu.treated_wood_sign": "ubıS ןןɐM pooM pǝʇɐǝɹ⟘", "block.gtceu.treated_wood_slab": "qɐןS pooM pǝʇɐǝɹ⟘", "block.gtceu.treated_wood_stairs": "sɹıɐʇS pooM pǝʇɐǝɹ⟘", "block.gtceu.treated_wood_trapdoor": "ɹoopdɐɹ⟘ pooM pǝʇɐǝɹ⟘", @@ -1606,8 +1618,10 @@ "compass.node.gtceu.generation/endstone": "ǝuoʇspuƎ", "compass.node.gtceu.generation/granite": "ǝʇıuɐɹ⅁", "compass.node.gtceu.generation/gravel": "ןǝʌɐɹ⅁", + "compass.node.gtceu.generation/marble": "ǝןqɹɐW", "compass.node.gtceu.generation/netherrack": "ʞɔɐɹɹǝɥʇǝN", "compass.node.gtceu.generation/ore": "¿ǝɹO puıɟ oʇ ʍoH", + "compass.node.gtceu.generation/red_granite": "ǝʇıuɐɹ⅁ pǝᴚ", "compass.node.gtceu.generation/red_sand": "puɐspǝᴚ", "compass.node.gtceu.generation/rubber_leaves": "sǝʌɐǝꞀ ɹǝqqnᴚ", "compass.node.gtceu.generation/rubber_log": "boꞀ ɹǝqqnᴚ", @@ -1962,6 +1976,7 @@ "config.gtceu.option.addLoot": "ʇooꞀppɐ", "config.gtceu.option.allUniqueStoneTypes": "sǝdʎ⟘ǝuoʇSǝnbıu∩ןןɐ", "config.gtceu.option.animationTime": "ǝɯı⟘uoıʇɐɯıuɐ", + "config.gtceu.option.armorHud": "pnHɹoɯɹɐ", "config.gtceu.option.bedrockOreDistance": "ǝɔuɐʇsıᗡǝɹOʞɔoɹpǝq", "config.gtceu.option.bedrockOreDropTagPrefix": "xıɟǝɹԀbɐ⟘doɹᗡǝɹOʞɔoɹpǝq", "config.gtceu.option.casingsPerCraft": "ʇɟɐɹƆɹǝԀsbuısɐɔ", @@ -2008,6 +2023,9 @@ "config.gtceu.option.hideFacadesInJEI": "IƎſuIsǝpɐɔɐℲǝpıɥ", "config.gtceu.option.hideFilledCellsInJEI": "IƎſuIsןןǝƆpǝןןıℲǝpıɥ", "config.gtceu.option.highTierContent": "ʇuǝʇuoƆɹǝı⟘ɥbıɥ", + "config.gtceu.option.hudLocation": "uoıʇɐɔoꞀpnɥ", + "config.gtceu.option.hudOffsetX": "XʇǝsɟɟOpnɥ", + "config.gtceu.option.hudOffsetY": "ʎʇǝsɟɟOpnɥ", "config.gtceu.option.inWorldPreviewDuration": "uoıʇɐɹnᗡʍǝıʌǝɹԀpןɹoMuı", "config.gtceu.option.increaseDungeonLoot": "ʇooꞀuoǝbunᗡǝsɐǝɹɔuı", "config.gtceu.option.infiniteBedrockOresFluids": "spınןℲsǝɹOʞɔoɹpǝᗺǝʇıuıɟuı", @@ -2256,6 +2274,9 @@ "enchantment.gtceu.disjunction.desc": "˙sqoɯ pǝʇɐןǝɹ-ɹǝpuƎ oʇ ssǝuʍoןS puɐ ssǝuʞɐǝM sǝıןddⱯ", "enchantment.gtceu.hard_hammer.desc": "˙ɹǝɯɯɐH ɥɔǝ⟘bǝɹ⅁ ɐ ɥʇıʍ pǝuıɯ ǝɹǝʍ ʎǝɥʇ ɟı sɐ sʞɔoןq sʞɐǝɹᗺ", "enchantment.hard_hammer": "buıɹǝɯɯɐH", + "entity.gtceu.dynamite": "ǝʇıɯɐuʎᗡ", + "entity.gtceu.industrial_tnt": "⟘N⟘ ןɐıɹʇsnpuI", + "entity.gtceu.powderbarrel": "ןǝɹɹɐqɹǝpʍoԀ", "fluid.empty": "ʎʇdɯƎ", "fluid.spawnlocation.name": "uoıʇɐɯɹoɟuI uıǝΛ pınןℲ", "fluid.tile.lava": "ɐʌɐꞀ", @@ -3573,6 +3594,7 @@ "item.gtceu.activity_detector_cover.tooltip": "˙ㄥ§ɹǝʌoƆɟ§ sɐ ǝuoʇspǝᴚ sɐ ㄥ§snʇɐʇS ʎʇıʌıʇɔⱯɟ§ ʇno sǝʌı⅁ㄥ§", "item.gtceu.advanced_activity_detector_cover": "ɹoʇɔǝʇǝᗡ ʎʇıʌıʇɔⱯ pǝɔuɐʌpⱯ", "item.gtceu.advanced_activity_detector_cover.tooltip": "˙ㄥ§ɹǝʌoƆɟ§ sɐ ǝuoʇspǝᴚ sɐ ㄥ§ssǝɹboɹԀ ǝuıɥɔɐWɟ§ ʇno sǝʌı⅁ㄥ§", + "item.gtceu.advanced_electric_jetpack": "ʞɔɐdʇǝſ ɔıɹʇɔǝןƎ pǝɔuɐʌpⱯ", "item.gtceu.advanced_energy_detector_cover": "ɹoʇɔǝʇǝᗡ ʎbɹǝuƎ pǝɔuɐʌpⱯ", "item.gtceu.advanced_energy_detector_cover.tooltip": "˙ㄥ§ɹǝʌoƆɟ§ sɐ ǝuoʇspǝᴚ sɐ ㄥ§snʇɐʇS ʎbɹǝuƎɟ§ pǝןןoɹʇuoɔ ㄥ§ɥɔʇɐꞀ-Sᴚɟ§ sǝʌı⅁ㄥ§", "item.gtceu.advanced_fluid_detector_cover": "ɹoʇɔǝʇǝᗡ pınןℲ pǝɔuɐʌpⱯ", @@ -3589,6 +3611,7 @@ "item.gtceu.advanced_item_voiding_cover.tooltip.0": "˙ㄥ§ɹǝʌoƆɟ§ sɐ ןoɹʇuoɔ ʇunoɯɐ ɥʇıʍ ㄥ§sɯǝʇIɟ§ spıoΛㄥ§", "item.gtceu.advanced_item_voiding_cover.tooltip.1": "˙ʇuǝɯǝɔɐןd ɹǝʇɟɐ ㄥ§ʇǝןןɐW ʇɟoSɟ§ ɥʇıʍ ǝʇɐʌıʇɔⱯ", "item.gtceu.advanced_power_thruster": "ɹǝʇsnɹɥ⟘ ɹǝʍoԀ pǝɔuɐʌpⱯ", + "item.gtceu.advanced_quarktech_chestplate": "ǝʇɐןdʇsǝɥƆ ǝʇınS ™ɥɔǝ⟘ʞɹɐnὉ pǝɔuɐʌpⱯ", "item.gtceu.advanced_smd_capacitor": "ɹoʇıɔɐdɐƆ ᗡWS pǝɔuɐʌpⱯ", "item.gtceu.advanced_smd_capacitor.tooltip": "ʇuǝuodɯoƆ ɔıuoɹʇɔǝןƎ pǝɔuɐʌpⱯㄥ§", "item.gtceu.advanced_smd_diode": "ǝpoıᗡ ᗡWS pǝɔuɐʌpⱯ", @@ -3609,6 +3632,7 @@ "item.gtceu.anvil_casting_mold": ")ןıʌuⱯ( pןoW buıʇsɐƆ", "item.gtceu.anvil_casting_mold.tooltip": "sןıʌuⱯ buıdɐɥs ɹoɟ pןoWㄥ§", "item.gtceu.ash_dust": "sǝɥsⱯ", + "item.gtceu.avanced_nanomuscle_chestplate": "ǝʇɐןdʇsǝɥƆ ǝʇınS ™ǝןɔsnWouɐN pǝɔuɐʌpⱯ", "item.gtceu.axe_extruder_mold.tooltip": "sǝxⱯ buıʞɐɯ ɹoɟ ǝdɐɥS ɹǝpnɹʇxƎㄥ§", "item.gtceu.ball_casting_mold": ")ןןɐᗺ( pןoW buıʇsɐƆ", "item.gtceu.ball_casting_mold.tooltip": "sןןɐᗺ buıʞɐɯ ɹoɟ pןoWㄥ§", @@ -3737,7 +3761,9 @@ "item.gtceu.doge_coin.tooltip": "ʍoʍ ʎɔuǝʍʍnɔ ʎʍǝʌ ɥɔıʍ ʌ ǝʎuıɯ zʍd oʇdʎʍɔ os ʎǝʎuoɯ ʍoɥ uıoɔ ɥɔnɯ ʍoʍㄥ§", "item.gtceu.duct_tape": "ㄣ8-ꞀⱯℲ ǝdɐ⟘ ʇɔnᗡ pǝɔɹoɟuıǝᴚ pǝɔuɐʌpⱯ ǝɔɐdsoɹǝⱯ ɥɔǝ⟘uıɐɹᗺ", "item.gtceu.duct_tape.tooltip": "¡ʇı ɟo ǝɹoɯ ǝsn 'sıɥʇ ɥʇıʍ ʇı xıɟ ʇ,uɐɔ noʎ ɟIㄥ§", + "item.gtceu.dynamite": "ǝʇıɯɐuʎᗡ", "item.gtceu.electric.pump.tooltip": "˙ㄥ§ɹǝʌoƆɟ§ sɐ sǝʇɐɹ ɔıɟıɔǝds ʇɐ ㄥ§spınןℲɟ§ sɹǝɟsuɐɹ⟘ㄥ§", + "item.gtceu.electric_jetpack": "ʞɔɐdʇǝſ ɔıɹʇɔǝןƎ", "item.gtceu.empty_mold": "pןoW ʎʇdɯƎ", "item.gtceu.empty_mold.tooltip": "sǝdɐɥS ǝpnɹʇxƎ puɐ spןoW ǝʞɐɯ oʇ ǝʇɐןԀ ʍɐᴚㄥ§", "item.gtceu.empty_spray_can": ")ʎʇdɯƎ( uɐƆ ʎɐɹdS", @@ -3938,6 +3964,7 @@ "item.gtceu.light_gray_glass_lens": ")ʎɐɹ⅁ ʇɥbıꞀ( suǝꞀ ssɐן⅁", "item.gtceu.lime_dye_spray_can": ")ǝɯıꞀ( uɐƆ ʎɐɹdS", "item.gtceu.lime_glass_lens": ")ǝɯıꞀ( suǝꞀ ssɐן⅁", + "item.gtceu.liquid_fuel_jetpack": "ʞɔɐdʇǝſ ןǝnℲ pınbıꞀ", "item.gtceu.long_rod_extruder_mold": ")poᴚ buoꞀ( pןoW ɹǝpnɹʇxƎ", "item.gtceu.long_treated_wood_rod": "ʞɔıʇS pooM pǝʇɐǝɹ⟘ buoꞀ", "item.gtceu.long_wood_rod": "ʞɔıʇS pooM buoꞀ", @@ -4064,6 +4091,10 @@ "item.gtceu.nano_processor_mainframe.tooltip.0": "ɹǝʌǝ uɐɥʇ ɹǝןןɐɯSㄥ§", "item.gtceu.nano_processor_mainframe.tooltip.1": "ʇınɔɹıƆ ɹǝı⟘-ΛnꞀq§", "item.gtceu.nano_saber.tooltip": "¡ǝɐɹnʞ oʍ uǝʞ ou uıظnʎᴚㄥ§", + "item.gtceu.nanomuscle_boots": "sʇooᗺ ǝʇınS ™ǝןɔsnWouɐN", + "item.gtceu.nanomuscle_chestplate": "ǝʇɐןdʇsǝɥƆ ǝʇınS ™ǝןɔsnWouɐN", + "item.gtceu.nanomuscle_helmet": "ʇǝɯןǝH ǝʇınS ™ǝןɔsnWouɐN", + "item.gtceu.nanomuscle_leggings": "sbuıbbǝꞀ ǝʇınS ™ǝןɔsnWouɐN", "item.gtceu.naquadah_boule": "ǝןnoᗺ uoɔıןıS ǝuıןןɐʇsʎɹɔouoW pǝdop-ɥɐpɐnbɐN", "item.gtceu.naquadah_boule.tooltip": "ʇınɔɹıƆ ʍɐᴚㄥ§", "item.gtceu.naquadah_credit": "ʇıpǝɹƆ ɥɐpɐnbɐN", @@ -4080,6 +4111,7 @@ "item.gtceu.neutronium_credit.tooltip": "sʇıpǝɹƆ ㄣㄣƖᄅ9ᄅㄥ§", "item.gtceu.neutronium_wafer": "ɹǝɟɐM pǝdop-ɯnıuoɹʇnǝN", "item.gtceu.neutronium_wafer.tooltip": "ʇınɔɹıƆ ʍɐᴚㄥ§", + "item.gtceu.nightvision_goggles": "sǝןbbo⅁ uoısıʌʇɥbıN", "item.gtceu.nor_memory_chip": "dıɥƆ ʎɹoɯǝW ᴚON", "item.gtceu.nor_memory_chip.tooltip": "ǝʇɐ⅁ ɔıboꞀ ᴚONㄥ§", "item.gtceu.nor_memory_wafer": "ɹǝɟɐM ʎɹoɯǝW ᴚON", @@ -4179,6 +4211,10 @@ "item.gtceu.quantum_processor_mainframe.tooltip.1": "ʇınɔɹıƆ ɹǝı⟘-WԀZɐ§", "item.gtceu.quantum_star": "ɹɐʇS ɯnʇuɐnὉ", "item.gtceu.quantum_star.tooltip": "ɹɐʇS ɹǝɥʇǝN pǝʌoɹdɯIㄥ§", + "item.gtceu.quarktech_boots": "sbuıbbǝꞀ ǝʇınS ™ɥɔǝ⟘ʞɹɐnὉ", + "item.gtceu.quarktech_chestplate": "ǝʇɐןdʇsǝɥƆ ǝʇınS ™ɥɔǝ⟘ʞɹɐnὉ", + "item.gtceu.quarktech_helmet": "ʇǝɯןǝH ǝʇınS ™ɥɔǝ⟘ʞɹɐnὉ", + "item.gtceu.quarktech_leggings": "sbuıbbǝꞀ ǝʇınS ™ɥɔǝ⟘ʞɹɐnὉ", "item.gtceu.quartz_sand_dust": "puɐS zʇɹɐnὉ", "item.gtceu.ram_chip": "dıɥƆ WⱯᴚ", "item.gtceu.ram_chip.tooltip": "ʎɹoɯǝW ssǝɔɔⱯ ɯopuɐᴚㄥ§", @@ -4290,6 +4326,8 @@ "item.gtceu.stem_cells.tooltip": "ǝɔuǝbıןןǝʇuI ʍɐᴚㄥ§", "item.gtceu.sticky_resin": "uısǝᴚ ʎʞɔıʇS", "item.gtceu.sugar_gem": "ǝqnƆ ɹɐbnS", + "item.gtceu.sus_record": "ɔsıᗡ ɔısnW", + "item.gtceu.sus_record.desc": "¡ʎssns", "item.gtceu.sword_extruder_mold.tooltip": "spɹoʍS buıʞɐɯ ɹoɟ ǝdɐɥS ɹǝpnɹʇxƎㄥ§", "item.gtceu.talc_dust": "ɔןɐ⟘", "item.gtceu.tantalum_capacitor": "ɹoʇıɔɐdɐƆ ɯnןɐʇuɐ⟘", @@ -5313,6 +5351,7 @@ "tagprefix.lens": "suǝꞀ %s", "tagprefix.log": "boꞀ %s", "tagprefix.long_rod": "poᴚ %s buoꞀ", + "tagprefix.marble": "ǝɹO %s ǝʇıuɐɹ⅁ pǝᴚ", "tagprefix.netherrack": "ǝɹO %s ɹǝɥʇǝN", "tagprefix.nugget": "ʇǝbbnN %s", "tagprefix.pipe_huge_fluid": "ǝdıԀ pınןℲ %s ǝbnH", @@ -5345,6 +5384,7 @@ "tagprefix.purified_ore": "ǝɹO %s pǝıɟıɹnԀ", "tagprefix.raw": "%s ʍɐᴚ", "tagprefix.raw_ore_block": "%s ʍɐᴚ ɟo ʞɔoןᗺ", + "tagprefix.red_granite": "ǝɹO %s ǝʇıuɐɹ⅁ pǝᴚ", "tagprefix.red_sand": "ǝɹO %s puɐS pǝᴚ", "tagprefix.refined_ore": "ǝɹO %s pǝuıɟǝᴚ", "tagprefix.ring": "buıᴚ %s", diff --git a/src/generated/resources/assets/gtceu/lang/en_us.json b/src/generated/resources/assets/gtceu/lang/en_us.json index 75b34bff02..2ff801a142 100644 --- a/src/generated/resources/assets/gtceu/lang/en_us.json +++ b/src/generated/resources/assets/gtceu/lang/en_us.json @@ -3,7 +3,7 @@ "behavior.data_item.assemblyline.title": "§nAssembly Line Construction Data:", "behavior.item_magnet.disabled": "§cMagnetic Field Disabled", "behavior.item_magnet.enabled": "§aMagnetic Field Enabled", - "behavior.portable_scanner.amp_per_sec": "Last Second %s A", + "behavior.portable_scanner.amp_per_sec": "Average (last second): %s A", "behavior.portable_scanner.bedrock_fluid.amount": "Fluid In Deposit: %s %s - %s%%", "behavior.portable_scanner.bedrock_fluid.amount_unknown": "Fluid In Deposit: %s%%", "behavior.portable_scanner.bedrock_fluid.nothing": "Fluid In Deposit: §6Nothing§r", @@ -20,7 +20,7 @@ "behavior.portable_scanner.energy_container_in": "Max IN: %s (%s) EU at %s A", "behavior.portable_scanner.energy_container_out": "Max OUT: %s (%s) EU at %s A", "behavior.portable_scanner.energy_container_storage": "Energy: %s EU / %s EU", - "behavior.portable_scanner.eu_per_sec": "Last Second %s EU", + "behavior.portable_scanner.eu_per_sec": "Average (last second): %s EU/t", "behavior.portable_scanner.machine_disabled": "Disabled.", "behavior.portable_scanner.machine_power_loss": "Shut down due to power loss.", "behavior.portable_scanner.machine_progress": "Progress/Load: %s / %s", @@ -142,6 +142,8 @@ "block.gtceu.dark_concrete_cobblestone": "Dark Concrete Cobblestone", "block.gtceu.dark_concrete_small_tile": "Dark Concrete Small Tile", "block.gtceu.dark_concrete_tile": "Dark Concrete Tile", + "block.gtceu.dark_concrete_windmill_a": "Dark Concrete Windmill A", + "block.gtceu.dark_concrete_windmill_b": "Dark Concrete Windmill B", "block.gtceu.data_access_hatch": "Data Access Hatch", "block.gtceu.data_bank": "Data Bank", "block.gtceu.data_receiver_hatch": "Optical Data Reception Hatch", @@ -238,6 +240,8 @@ "block.gtceu.ev_wiremill": "§5Advanced Wiremill III§r", "block.gtceu.ev_world_accelerator": "§5Advanced World Accelerator III§r", "block.gtceu.explosion_hazard_sign_block": "Explosion Hazard Sign Block", + "block.gtceu.explosive.breaking_tooltip": "Primes explosion when mined, sneak mine to pick back up", + "block.gtceu.explosive.lighting_tooltip": "Cannot be lit with Redstone", "block.gtceu.extreme_combustion_engine": "Extreme Combustion Engine", "block.gtceu.extreme_engine_intake_casing": "Extreme Engine Intake Casing", "block.gtceu.filter_casing": "Filter Casing", @@ -360,7 +364,9 @@ "block.gtceu.hv_world_accelerator": "§6Advanced World Accelerator II§r", "block.gtceu.implosion_compressor": "Implosion Compressor", "block.gtceu.industrial_steam_casing": "Industrial Steam Casing", + "block.gtceu.industrial_tnt": "Industrial TNT", "block.gtceu.inert_machine_casing": "Chemically Inert PTFE Machine Casing", + "block.gtceu.itnt.drops_tooltip": "Much larger than TNT, drops all destroyed Blocks as Items", "block.gtceu.iv_1024a_laser_source_hatch": "§9IV 1,024A Laser Source Hatch", "block.gtceu.iv_1024a_laser_target_hatch": "§9IV 1,024A Laser Target Hatch", "block.gtceu.iv_16a_energy_converter": "IV 16A Energy Converter", @@ -481,6 +487,8 @@ "block.gtceu.light_concrete_cobblestone": "Light Concrete Cobblestone", "block.gtceu.light_concrete_small_tile": "Light Concrete Small Tile", "block.gtceu.light_concrete_tile": "Light Concrete Tile", + "block.gtceu.light_concrete_windmill_a": "Light Concrete Windmill A", + "block.gtceu.light_concrete_windmill_b": "Light Concrete Windmill B", "block.gtceu.light_gray_lamp": "Light Gray Lamp", "block.gtceu.lime_lamp": "Lime Lamp", "block.gtceu.long_distance_fluid_pipeline": "Long Distance Fluid Pipeline", @@ -673,6 +681,8 @@ "block.gtceu.marble_cobblestone": "Marble Cobblestone", "block.gtceu.marble_small_tile": "Marble Small Tile", "block.gtceu.marble_tile": "Marble Tile", + "block.gtceu.marble_windmill_a": "Marble Windmill A", + "block.gtceu.marble_windmill_b": "Marble Windmill B", "block.gtceu.max_16a_energy_converter": "MAX 16A Energy Converter", "block.gtceu.max_1a_energy_converter": "MAX 1A Energy Converter", "block.gtceu.max_4a_energy_converter": "MAX 4A Energy Converter", @@ -877,6 +887,8 @@ "block.gtceu.polished_light_concrete": "Polished Light Concrete", "block.gtceu.polished_marble": "Polished Marble", "block.gtceu.polished_red_granite": "Polished Red Granite", + "block.gtceu.powderbarrel": "Powderbarrel", + "block.gtceu.powderbarrel.drops_tooltip": "Slightly larger than TNT, drops all destroyed Blocks as Items", "block.gtceu.power_substation": "Power Substation", "block.gtceu.primitive_blast_furnace": "Primitive Blast Furnace", "block.gtceu.primitive_pump": "Primitive Pump", @@ -892,6 +904,8 @@ "block.gtceu.red_granite_cobblestone": "Red Granite Cobblestone", "block.gtceu.red_granite_small_tile": "Red Granite Small Tile", "block.gtceu.red_granite_tile": "Red Granite Tile", + "block.gtceu.red_granite_windmill_a": "Red Granite Windmill A", + "block.gtceu.red_granite_windmill_b": "Red Granite Windmill B", "block.gtceu.red_lamp": "Red Lamp", "block.gtceu.reinforced_stone": "Reinforced Stone", "block.gtceu.research_station": "Research Station", @@ -906,6 +920,7 @@ "block.gtceu.rubber_planks": "Rubber Planks", "block.gtceu.rubber_pressure_plate": "Rubber Pressure Plate", "block.gtceu.rubber_sapling": "Rubber Sapling", + "block.gtceu.rubber_sign": "Rubber Wall Sign", "block.gtceu.rubber_slab": "Rubber Slab", "block.gtceu.rubber_stairs": "Rubber Stairs", "block.gtceu.rubber_trapdoor": "Rubber Trapdoor", @@ -917,10 +932,6 @@ "block.gtceu.small_light_concrete_bricks": "Small Light Concrete Bricks", "block.gtceu.small_marble_bricks": "Small Marble Bricks", "block.gtceu.small_red_granite_bricks": "Small Red Granite Bricks", - "block.gtceu.smooth_dark_concrete": "Smooth Dark Concrete", - "block.gtceu.smooth_light_concrete": "Smooth Light Concrete", - "block.gtceu.smooth_marble": "Smooth Marble", - "block.gtceu.smooth_red_granite": "Smooth Red Granite", "block.gtceu.solid_machine_casing": "Solid Machine Casing", "block.gtceu.spatial_storage_hazard_sign_block": "Spatial Storage Hazard Sign Block", "block.gtceu.square_dark_concrete_bricks": "Square Dark Concrete Bricks", @@ -981,6 +992,7 @@ "block.gtceu.treated_wood_fence_gate": "Treated Wood Fence Gate", "block.gtceu.treated_wood_planks": "Treated Wood Planks", "block.gtceu.treated_wood_pressure_plate": "Treated Wood Pressure Plate", + "block.gtceu.treated_wood_sign": "Treated Wood Wall Sign", "block.gtceu.treated_wood_slab": "Treated Wood Slab", "block.gtceu.treated_wood_stairs": "Treated Wood Stairs", "block.gtceu.treated_wood_trapdoor": "Treated Wood Trapdoor", @@ -1606,8 +1618,10 @@ "compass.node.gtceu.generation/endstone": "Endstone", "compass.node.gtceu.generation/granite": "Granite", "compass.node.gtceu.generation/gravel": "Gravel", + "compass.node.gtceu.generation/marble": "Marble", "compass.node.gtceu.generation/netherrack": "Netherrack", "compass.node.gtceu.generation/ore": "How to find Ore?", + "compass.node.gtceu.generation/red_granite": "Red Granite", "compass.node.gtceu.generation/red_sand": "Redsand", "compass.node.gtceu.generation/rubber_leaves": "Rubber Leaves", "compass.node.gtceu.generation/rubber_log": "Rubber Log", @@ -1962,6 +1976,7 @@ "config.gtceu.option.addLoot": "addLoot", "config.gtceu.option.allUniqueStoneTypes": "allUniqueStoneTypes", "config.gtceu.option.animationTime": "animationTime", + "config.gtceu.option.armorHud": "armorHud", "config.gtceu.option.bedrockOreDistance": "bedrockOreDistance", "config.gtceu.option.bedrockOreDropTagPrefix": "bedrockOreDropTagPrefix", "config.gtceu.option.casingsPerCraft": "casingsPerCraft", @@ -2008,6 +2023,9 @@ "config.gtceu.option.hideFacadesInJEI": "hideFacadesInJEI", "config.gtceu.option.hideFilledCellsInJEI": "hideFilledCellsInJEI", "config.gtceu.option.highTierContent": "highTierContent", + "config.gtceu.option.hudLocation": "hudLocation", + "config.gtceu.option.hudOffsetX": "hudOffsetX", + "config.gtceu.option.hudOffsetY": "hudOffsetY", "config.gtceu.option.inWorldPreviewDuration": "inWorldPreviewDuration", "config.gtceu.option.increaseDungeonLoot": "increaseDungeonLoot", "config.gtceu.option.infiniteBedrockOresFluids": "infiniteBedrockOresFluids", @@ -2256,6 +2274,9 @@ "enchantment.gtceu.disjunction.desc": "Applies Weakness and Slowness to Ender-related mobs.", "enchantment.gtceu.hard_hammer.desc": "Breaks blocks as if they were mined with a GregTech Hammer.", "enchantment.hard_hammer": "Hammering", + "entity.gtceu.dynamite": "Dynamite", + "entity.gtceu.industrial_tnt": "Industrial TNT", + "entity.gtceu.powderbarrel": "Powderbarrel", "fluid.empty": "Empty", "fluid.spawnlocation.name": "Fluid Vein Information", "fluid.tile.lava": "Lava", @@ -3573,6 +3594,7 @@ "item.gtceu.activity_detector_cover.tooltip": "§7Gives out §fActivity Status§7 as Redstone as §fCover§7.", "item.gtceu.advanced_activity_detector_cover": "Advanced Activity Detector", "item.gtceu.advanced_activity_detector_cover.tooltip": "§7Gives out §fMachine Progress§7 as Redstone as §fCover§7.", + "item.gtceu.advanced_electric_jetpack": "Advanced Electric Jetpack", "item.gtceu.advanced_energy_detector_cover": "Advanced Energy Detector", "item.gtceu.advanced_energy_detector_cover.tooltip": "§7Gives §fRS-Latch§7 controlled §fEnergy Status§7 as Redstone as §fCover§7.", "item.gtceu.advanced_fluid_detector_cover": "Advanced Fluid Detector", @@ -3589,6 +3611,7 @@ "item.gtceu.advanced_item_voiding_cover.tooltip.0": "§7Voids §fItems§7 with amount control as §fCover§7.", "item.gtceu.advanced_item_voiding_cover.tooltip.1": "Activate with §fSoft Mallet§7 after placement.", "item.gtceu.advanced_power_thruster": "Advanced Power Thruster", + "item.gtceu.advanced_quarktech_chestplate": "Advanced QuarkTech™ Suite Chestplate", "item.gtceu.advanced_smd_capacitor": "Advanced SMD Capacitor", "item.gtceu.advanced_smd_capacitor.tooltip": "§7Advanced Electronic Component", "item.gtceu.advanced_smd_diode": "Advanced SMD Diode", @@ -3609,6 +3632,7 @@ "item.gtceu.anvil_casting_mold": "Casting Mold (Anvil)", "item.gtceu.anvil_casting_mold.tooltip": "§7Mold for shaping Anvils", "item.gtceu.ash_dust": "Ashes", + "item.gtceu.avanced_nanomuscle_chestplate": "Advanced NanoMuscle™ Suite Chestplate", "item.gtceu.axe_extruder_mold.tooltip": "§7Extruder Shape for making Axes", "item.gtceu.ball_casting_mold": "Casting Mold (Ball)", "item.gtceu.ball_casting_mold.tooltip": "§7Mold for making Balls", @@ -3737,7 +3761,9 @@ "item.gtceu.doge_coin.tooltip": "§7wow much coin how monyey so cwypto pwz minye v wich vewy cuwwency wow", "item.gtceu.duct_tape": "BrainTech Aerospace Advanced Reinforced Duct Tape FAL-84", "item.gtceu.duct_tape.tooltip": "§7If you can't fix it with this, use more of it!", + "item.gtceu.dynamite": "Dynamite", "item.gtceu.electric.pump.tooltip": "§7Transfers §fFluids§7 at specific rates as §fCover§7.", + "item.gtceu.electric_jetpack": "Electric Jetpack", "item.gtceu.empty_mold": "Empty Mold", "item.gtceu.empty_mold.tooltip": "§7Raw Plate to make Molds and Extrude Shapes", "item.gtceu.empty_spray_can": "Spray Can (Empty)", @@ -3938,6 +3964,7 @@ "item.gtceu.light_gray_glass_lens": "Glass Lens (Light Gray)", "item.gtceu.lime_dye_spray_can": "Spray Can (Lime)", "item.gtceu.lime_glass_lens": "Glass Lens (Lime)", + "item.gtceu.liquid_fuel_jetpack": "Liquid Fuel Jetpack", "item.gtceu.long_rod_extruder_mold": "Extruder Mold (Long Rod)", "item.gtceu.long_treated_wood_rod": "Long Treated Wood Stick", "item.gtceu.long_wood_rod": "Long Wood Stick", @@ -4064,6 +4091,10 @@ "item.gtceu.nano_processor_mainframe.tooltip.0": "§7Smaller than ever", "item.gtceu.nano_processor_mainframe.tooltip.1": "§bLuV-Tier Circuit", "item.gtceu.nano_saber.tooltip": "§7Ryujin no ken wo kurae!", + "item.gtceu.nanomuscle_boots": "NanoMuscle™ Suite Boots", + "item.gtceu.nanomuscle_chestplate": "NanoMuscle™ Suite Chestplate", + "item.gtceu.nanomuscle_helmet": "NanoMuscle™ Suite Helmet", + "item.gtceu.nanomuscle_leggings": "NanoMuscle™ Suite Leggings", "item.gtceu.naquadah_boule": "Naquadah-doped Monocrystalline Silicon Boule", "item.gtceu.naquadah_boule.tooltip": "§7Raw Circuit", "item.gtceu.naquadah_credit": "Naquadah Credit", @@ -4080,6 +4111,7 @@ "item.gtceu.neutronium_credit.tooltip": "§7262144 Credits", "item.gtceu.neutronium_wafer": "Neutronium-doped Wafer", "item.gtceu.neutronium_wafer.tooltip": "§7Raw Circuit", + "item.gtceu.nightvision_goggles": "Nightvision Goggles", "item.gtceu.nor_memory_chip": "NOR Memory Chip", "item.gtceu.nor_memory_chip.tooltip": "§7NOR Logic Gate", "item.gtceu.nor_memory_wafer": "NOR Memory Wafer", @@ -4179,6 +4211,10 @@ "item.gtceu.quantum_processor_mainframe.tooltip.1": "§aZPM-Tier Circuit", "item.gtceu.quantum_star": "Quantum Star", "item.gtceu.quantum_star.tooltip": "§7Improved Nether Star", + "item.gtceu.quarktech_boots": "QuarkTech™ Suite Leggings", + "item.gtceu.quarktech_chestplate": "QuarkTech™ Suite Chestplate", + "item.gtceu.quarktech_helmet": "QuarkTech™ Suite Helmet", + "item.gtceu.quarktech_leggings": "QuarkTech™ Suite Leggings", "item.gtceu.quartz_sand_dust": "Quartz Sand", "item.gtceu.ram_chip": "RAM Chip", "item.gtceu.ram_chip.tooltip": "§7Random Access Memory", @@ -4290,6 +4326,8 @@ "item.gtceu.stem_cells.tooltip": "§7Raw Intelligence", "item.gtceu.sticky_resin": "Sticky Resin", "item.gtceu.sugar_gem": "Sugar Cube", + "item.gtceu.sus_record": "Music Disc", + "item.gtceu.sus_record.desc": "sussy!", "item.gtceu.sword_extruder_mold.tooltip": "§7Extruder Shape for making Swords", "item.gtceu.talc_dust": "Talc", "item.gtceu.tantalum_capacitor": "Tantalum Capacitor", @@ -5313,6 +5351,7 @@ "tagprefix.lens": "%s Lens", "tagprefix.log": "%s Log", "tagprefix.long_rod": "Long %s Rod", + "tagprefix.marble": "Red Granite %s Ore", "tagprefix.netherrack": "Nether %s Ore", "tagprefix.nugget": "%s Nugget", "tagprefix.pipe_huge_fluid": "Huge %s Fluid Pipe", @@ -5345,6 +5384,7 @@ "tagprefix.purified_ore": "Purified %s Ore", "tagprefix.raw": "Raw %s", "tagprefix.raw_ore_block": "Block of Raw %s", + "tagprefix.red_granite": "Red Granite %s Ore", "tagprefix.red_sand": "Red Sand %s Ore", "tagprefix.refined_ore": "Refined %s Ore", "tagprefix.ring": "%s Ring", diff --git a/src/generated/resources/assets/gtceu/models/block/dark_concrete_windmill_a.json b/src/generated/resources/assets/gtceu/models/block/dark_concrete_windmill_a.json new file mode 100644 index 0000000000..73a2c83bfb --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/block/dark_concrete_windmill_a.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "gtceu:block/stones/dark_concrete/windmill_a" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/dark_concrete_windmill_b.json b/src/generated/resources/assets/gtceu/models/block/dark_concrete_windmill_b.json new file mode 100644 index 0000000000..4c3cb49fcd --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/block/dark_concrete_windmill_b.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "gtceu:block/stones/dark_concrete/windmill_b" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/industrial_tnt.json b/src/generated/resources/assets/gtceu/models/block/industrial_tnt.json new file mode 100644 index 0000000000..21734bfa6a --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/block/industrial_tnt.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "minecraft:block/tnt_bottom", + "side": "gtceu:block/industrial_tnt_side", + "top": "minecraft:block/tnt_top" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/light_concrete_windmill_a.json b/src/generated/resources/assets/gtceu/models/block/light_concrete_windmill_a.json new file mode 100644 index 0000000000..bc60bcfc25 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/block/light_concrete_windmill_a.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "gtceu:block/stones/light_concrete/windmill_a" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/light_concrete_windmill_b.json b/src/generated/resources/assets/gtceu/models/block/light_concrete_windmill_b.json new file mode 100644 index 0000000000..06e79f1e43 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/block/light_concrete_windmill_b.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "gtceu:block/stones/light_concrete/windmill_b" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/rubber_wall_sign.json b/src/generated/resources/assets/gtceu/models/block/marble_windmill_a.json similarity index 55% rename from src/generated/resources/assets/gtceu/models/block/rubber_wall_sign.json rename to src/generated/resources/assets/gtceu/models/block/marble_windmill_a.json index 913d7c0d1b..7262c50593 100644 --- a/src/generated/resources/assets/gtceu/models/block/rubber_wall_sign.json +++ b/src/generated/resources/assets/gtceu/models/block/marble_windmill_a.json @@ -1,6 +1,6 @@ { "parent": "minecraft:block/cube_all", "textures": { - "all": "gtceu:block/rubber_wall_sign" + "all": "gtceu:block/stones/marble/windmill_a" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor.json b/src/generated/resources/assets/gtceu/models/block/marble_windmill_b.json similarity index 55% rename from src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor.json rename to src/generated/resources/assets/gtceu/models/block/marble_windmill_b.json index 8bad4accc3..23e9a210f0 100644 --- a/src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor.json +++ b/src/generated/resources/assets/gtceu/models/block/marble_windmill_b.json @@ -1,6 +1,6 @@ { "parent": "minecraft:block/cube_all", "textures": { - "all": "gtceu:block/treated_wood_trapdoor" + "all": "gtceu:block/stones/marble/windmill_b" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/rubber_trapdoor.json b/src/generated/resources/assets/gtceu/models/block/powderbarrel.json similarity index 60% rename from src/generated/resources/assets/gtceu/models/block/rubber_trapdoor.json rename to src/generated/resources/assets/gtceu/models/block/powderbarrel.json index fd524066dc..21954ab914 100644 --- a/src/generated/resources/assets/gtceu/models/block/rubber_trapdoor.json +++ b/src/generated/resources/assets/gtceu/models/block/powderbarrel.json @@ -1,6 +1,6 @@ { "parent": "minecraft:block/cube_all", "textures": { - "all": "gtceu:block/rubber_trapdoor" + "all": "gtceu:block/powderbarrel" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/smooth_dark_concrete.json b/src/generated/resources/assets/gtceu/models/block/red_granite_windmill_a.json similarity index 53% rename from src/generated/resources/assets/gtceu/models/block/smooth_dark_concrete.json rename to src/generated/resources/assets/gtceu/models/block/red_granite_windmill_a.json index d1da1c50dc..19eff6eda6 100644 --- a/src/generated/resources/assets/gtceu/models/block/smooth_dark_concrete.json +++ b/src/generated/resources/assets/gtceu/models/block/red_granite_windmill_a.json @@ -1,6 +1,6 @@ { "parent": "minecraft:block/cube_all", "textures": { - "all": "gtceu:block/stones/dark_concrete/smooth" + "all": "gtceu:block/stones/red_granite/windmill_a" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/smooth_light_concrete.json b/src/generated/resources/assets/gtceu/models/block/red_granite_windmill_b.json similarity index 53% rename from src/generated/resources/assets/gtceu/models/block/smooth_light_concrete.json rename to src/generated/resources/assets/gtceu/models/block/red_granite_windmill_b.json index 699dc05d84..be755df479 100644 --- a/src/generated/resources/assets/gtceu/models/block/smooth_light_concrete.json +++ b/src/generated/resources/assets/gtceu/models/block/red_granite_windmill_b.json @@ -1,6 +1,6 @@ { "parent": "minecraft:block/cube_all", "textures": { - "all": "gtceu:block/stones/light_concrete/smooth" + "all": "gtceu:block/stones/red_granite/windmill_b" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/rubber_sign.json b/src/generated/resources/assets/gtceu/models/block/rubber_sign.json index 9791a71075..ec70ccc985 100644 --- a/src/generated/resources/assets/gtceu/models/block/rubber_sign.json +++ b/src/generated/resources/assets/gtceu/models/block/rubber_sign.json @@ -1,6 +1,5 @@ { - "parent": "minecraft:block/cube_all", "textures": { - "all": "gtceu:block/rubber_sign" + "particle": "gtceu:block/rubber_planks" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/rubber_trapdoor_bottom.json b/src/generated/resources/assets/gtceu/models/block/rubber_trapdoor_bottom.json new file mode 100644 index 0000000000..9a871fdd67 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/block/rubber_trapdoor_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_orientable_trapdoor_bottom", + "textures": { + "texture": "gtceu:block/rubber_trapdoor" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/rubber_trapdoor_open.json b/src/generated/resources/assets/gtceu/models/block/rubber_trapdoor_open.json new file mode 100644 index 0000000000..ba2edec8db --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/block/rubber_trapdoor_open.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_orientable_trapdoor_open", + "textures": { + "texture": "gtceu:block/rubber_trapdoor" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/rubber_trapdoor_top.json b/src/generated/resources/assets/gtceu/models/block/rubber_trapdoor_top.json new file mode 100644 index 0000000000..e00845f530 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/block/rubber_trapdoor_top.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_orientable_trapdoor_top", + "textures": { + "texture": "gtceu:block/rubber_trapdoor" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/smooth_marble.json b/src/generated/resources/assets/gtceu/models/block/smooth_marble.json deleted file mode 100644 index a63de58142..0000000000 --- a/src/generated/resources/assets/gtceu/models/block/smooth_marble.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:block/cube_all", - "textures": { - "all": "gtceu:block/stones/marble/smooth" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/smooth_red_granite.json b/src/generated/resources/assets/gtceu/models/block/smooth_red_granite.json deleted file mode 100644 index 18bbac5d2c..0000000000 --- a/src/generated/resources/assets/gtceu/models/block/smooth_red_granite.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:block/cube_all", - "textures": { - "all": "gtceu:block/stones/red_granite/smooth" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_left.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_left.json index 5a458a3ae4..55ea0cb857 100644 --- a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_left.json +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_left.json @@ -1,7 +1,7 @@ { "parent": "minecraft:block/door_bottom_left", "textures": { - "bottom": "gtceu:block/rubber_door_bottom", - "top": "gtceu:block/rubber_door_top" + "bottom": "gtceu:block/treated_wood_door_bottom", + "top": "gtceu:block/treated_wood_door_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_left_open.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_left_open.json index ca5908f26f..7512ff6969 100644 --- a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_left_open.json +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_left_open.json @@ -1,7 +1,7 @@ { "parent": "minecraft:block/door_bottom_left_open", "textures": { - "bottom": "gtceu:block/rubber_door_bottom", - "top": "gtceu:block/rubber_door_top" + "bottom": "gtceu:block/treated_wood_door_bottom", + "top": "gtceu:block/treated_wood_door_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_right.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_right.json index 5178628ce9..411b217a2d 100644 --- a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_right.json +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_right.json @@ -1,7 +1,7 @@ { "parent": "minecraft:block/door_bottom_right", "textures": { - "bottom": "gtceu:block/rubber_door_bottom", - "top": "gtceu:block/rubber_door_top" + "bottom": "gtceu:block/treated_wood_door_bottom", + "top": "gtceu:block/treated_wood_door_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_right_open.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_right_open.json index f7b5e85a7f..8153754666 100644 --- a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_right_open.json +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_bottom_right_open.json @@ -1,7 +1,7 @@ { "parent": "minecraft:block/door_bottom_right_open", "textures": { - "bottom": "gtceu:block/rubber_door_bottom", - "top": "gtceu:block/rubber_door_top" + "bottom": "gtceu:block/treated_wood_door_bottom", + "top": "gtceu:block/treated_wood_door_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_left.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_left.json index 12461c3665..7618fb2546 100644 --- a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_left.json +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_left.json @@ -1,7 +1,7 @@ { "parent": "minecraft:block/door_top_left", "textures": { - "bottom": "gtceu:block/rubber_door_bottom", - "top": "gtceu:block/rubber_door_top" + "bottom": "gtceu:block/treated_wood_door_bottom", + "top": "gtceu:block/treated_wood_door_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_left_open.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_left_open.json index 33c8d3c92c..8d9e14c87f 100644 --- a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_left_open.json +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_left_open.json @@ -1,7 +1,7 @@ { "parent": "minecraft:block/door_top_left_open", "textures": { - "bottom": "gtceu:block/rubber_door_bottom", - "top": "gtceu:block/rubber_door_top" + "bottom": "gtceu:block/treated_wood_door_bottom", + "top": "gtceu:block/treated_wood_door_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_right.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_right.json index 2167a8ef4e..849de2cd26 100644 --- a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_right.json +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_right.json @@ -1,7 +1,7 @@ { "parent": "minecraft:block/door_top_right", "textures": { - "bottom": "gtceu:block/rubber_door_bottom", - "top": "gtceu:block/rubber_door_top" + "bottom": "gtceu:block/treated_wood_door_bottom", + "top": "gtceu:block/treated_wood_door_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_right_open.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_right_open.json index 5af622fddc..444a6285d6 100644 --- a/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_right_open.json +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_door_top_right_open.json @@ -1,7 +1,7 @@ { "parent": "minecraft:block/door_top_right_open", "textures": { - "bottom": "gtceu:block/rubber_door_bottom", - "top": "gtceu:block/rubber_door_top" + "bottom": "gtceu:block/treated_wood_door_bottom", + "top": "gtceu:block/treated_wood_door_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_sign.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_sign.json index 2d48afc4a9..ea0a5e0b9f 100644 --- a/src/generated/resources/assets/gtceu/models/block/treated_wood_sign.json +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_sign.json @@ -1,6 +1,5 @@ { - "parent": "minecraft:block/cube_all", "textures": { - "all": "gtceu:block/treated_wood_sign" + "particle": "gtceu:block/treated_wood_planks" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor_bottom.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor_bottom.json new file mode 100644 index 0000000000..479023b4c1 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_orientable_trapdoor_bottom", + "textures": { + "texture": "gtceu:block/treated_wood_trapdoor" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor_open.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor_open.json new file mode 100644 index 0000000000..e057c1cd6e --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor_open.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_orientable_trapdoor_open", + "textures": { + "texture": "gtceu:block/treated_wood_trapdoor" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor_top.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor_top.json new file mode 100644 index 0000000000..fb77d3c8c8 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/block/treated_wood_trapdoor_top.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_orientable_trapdoor_top", + "textures": { + "texture": "gtceu:block/treated_wood_trapdoor" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/block/treated_wood_wall_sign.json b/src/generated/resources/assets/gtceu/models/block/treated_wood_wall_sign.json deleted file mode 100644 index f20c7ffd33..0000000000 --- a/src/generated/resources/assets/gtceu/models/block/treated_wood_wall_sign.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:block/cube_all", - "textures": { - "all": "gtceu:block/treated_wood_wall_sign" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/aluminium_fluid_cell_empty.json b/src/generated/resources/assets/gtceu/models/item/advanced_electric_jetpack.json similarity index 54% rename from src/generated/resources/assets/gtceu/models/item/aluminium_fluid_cell_empty.json rename to src/generated/resources/assets/gtceu/models/item/advanced_electric_jetpack.json index 9bcee35656..a97e72506a 100644 --- a/src/generated/resources/assets/gtceu/models/item/aluminium_fluid_cell_empty.json +++ b/src/generated/resources/assets/gtceu/models/item/advanced_electric_jetpack.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "gtceu:item/aluminium_fluid_cell/base" + "layer0": "gtceu:item/advanced_electric_jetpack" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/advanced_quarktech_chestplate.json b/src/generated/resources/assets/gtceu/models/item/advanced_quarktech_chestplate.json new file mode 100644 index 0000000000..fcad5cfe5e --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/advanced_quarktech_chestplate.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/advanced_quarktech_chestplate" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/aluminium_fluid_cell.json b/src/generated/resources/assets/gtceu/models/item/aluminium_fluid_cell.json deleted file mode 100644 index 91484895d0..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/aluminium_fluid_cell.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "overrides": [ - { - "model": "gtceu:item/aluminium_fluid_cell_empty", - "predicate": { - "gtceu:fluid_cell": 0.0 - } - }, - { - "model": "gtceu:item/aluminium_fluid_cell_filled", - "predicate": { - "gtceu:fluid_cell": 1.0 - } - } - ], - "textures": { - "layer0": "gtceu:item/aluminium_fluid_cell/base" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/aluminium_fluid_cell_filled.json b/src/generated/resources/assets/gtceu/models/item/aluminium_fluid_cell_filled.json deleted file mode 100644 index 1149a2eb8e..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/aluminium_fluid_cell_filled.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "gtceu:item/aluminium_fluid_cell/base", - "layer1": "gtceu:item/aluminium_fluid_cell/overlay" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/avanced_nanomuscle_chestplate.json b/src/generated/resources/assets/gtceu/models/item/avanced_nanomuscle_chestplate.json new file mode 100644 index 0000000000..eb85c6d7e3 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/avanced_nanomuscle_chestplate.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/avanced_nanomuscle_chestplate" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/dark_concrete_windmill_a.json b/src/generated/resources/assets/gtceu/models/item/dark_concrete_windmill_a.json new file mode 100644 index 0000000000..3d49302f5b --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/dark_concrete_windmill_a.json @@ -0,0 +1,3 @@ +{ + "parent": "gtceu:block/dark_concrete_windmill_a" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/dark_concrete_windmill_b.json b/src/generated/resources/assets/gtceu/models/item/dark_concrete_windmill_b.json new file mode 100644 index 0000000000..f863af4d14 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/dark_concrete_windmill_b.json @@ -0,0 +1,3 @@ +{ + "parent": "gtceu:block/dark_concrete_windmill_b" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/fluid_cell_empty.json b/src/generated/resources/assets/gtceu/models/item/dynamite.json similarity index 59% rename from src/generated/resources/assets/gtceu/models/item/fluid_cell_empty.json rename to src/generated/resources/assets/gtceu/models/item/dynamite.json index d062b5ed62..54e6b7a526 100644 --- a/src/generated/resources/assets/gtceu/models/item/fluid_cell_empty.json +++ b/src/generated/resources/assets/gtceu/models/item/dynamite.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "gtceu:item/fluid_cell/base" + "layer0": "gtceu:item/dynamite" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/electric_jetpack.json b/src/generated/resources/assets/gtceu/models/item/electric_jetpack.json new file mode 100644 index 0000000000..47daaa33d8 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/electric_jetpack.json @@ -0,0 +1,56 @@ +{ + "parent": "minecraft:item/generated", + "overrides": [ + { + "model": "gtceu:item/electric_jetpack/0", + "predicate": { + "gtceu:electric_jetpack": 0.0 + } + }, + { + "model": "gtceu:item/electric_jetpack/1", + "predicate": { + "gtceu:electric_jetpack": 0.01 + } + }, + { + "model": "gtceu:item/electric_jetpack/2", + "predicate": { + "gtceu:electric_jetpack": 0.02 + } + }, + { + "model": "gtceu:item/electric_jetpack/3", + "predicate": { + "gtceu:electric_jetpack": 0.03 + } + }, + { + "model": "gtceu:item/electric_jetpack/4", + "predicate": { + "gtceu:electric_jetpack": 0.04 + } + }, + { + "model": "gtceu:item/electric_jetpack/5", + "predicate": { + "gtceu:electric_jetpack": 0.05 + } + }, + { + "model": "gtceu:item/electric_jetpack/6", + "predicate": { + "gtceu:electric_jetpack": 0.06 + } + }, + { + "model": "gtceu:item/electric_jetpack/7", + "predicate": { + "gtceu:electric_jetpack": 0.07 + } + } + ], + "textures": { + "layer0": "gtceu:item/electric_jetpack/1" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/steel_fluid_cell_empty.json b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/0.json similarity index 56% rename from src/generated/resources/assets/gtceu/models/item/steel_fluid_cell_empty.json rename to src/generated/resources/assets/gtceu/models/item/electric_jetpack/0.json index ce94116efa..b6b8d3ae01 100644 --- a/src/generated/resources/assets/gtceu/models/item/steel_fluid_cell_empty.json +++ b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/0.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "gtceu:item/steel_fluid_cell/base" + "layer0": "gtceu:item/electric_jetpack/1" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/titanium_fluid_cell_empty.json b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/1.json similarity index 54% rename from src/generated/resources/assets/gtceu/models/item/titanium_fluid_cell_empty.json rename to src/generated/resources/assets/gtceu/models/item/electric_jetpack/1.json index 96ceba1527..c60b80b480 100644 --- a/src/generated/resources/assets/gtceu/models/item/titanium_fluid_cell_empty.json +++ b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/1.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "gtceu:item/titanium_fluid_cell/base" + "layer0": "gtceu:item/electric_jetpack/2" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/electric_jetpack/2.json b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/2.json new file mode 100644 index 0000000000..bc24dcf09f --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/2.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/electric_jetpack/3" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/electric_jetpack/3.json b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/3.json new file mode 100644 index 0000000000..791a0c15ae --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/3.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/electric_jetpack/4" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/electric_jetpack/4.json b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/4.json new file mode 100644 index 0000000000..877e598a3a --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/4.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/electric_jetpack/5" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/electric_jetpack/5.json b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/5.json new file mode 100644 index 0000000000..42b04cf50e --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/5.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/electric_jetpack/6" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/electric_jetpack/6.json b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/6.json new file mode 100644 index 0000000000..086bc51e61 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/6.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/electric_jetpack/7" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/electric_jetpack/7.json b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/7.json new file mode 100644 index 0000000000..007c900448 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/electric_jetpack/7.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/electric_jetpack/8" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/fluid_cell.json b/src/generated/resources/assets/gtceu/models/item/fluid_cell.json deleted file mode 100644 index 268fd9b675..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/fluid_cell.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "overrides": [ - { - "model": "gtceu:item/fluid_cell_empty", - "predicate": { - "gtceu:fluid_cell": 0.0 - } - }, - { - "model": "gtceu:item/fluid_cell_filled", - "predicate": { - "gtceu:fluid_cell": 1.0 - } - } - ], - "textures": { - "layer0": "gtceu:item/fluid_cell/base" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/fluid_cell_filled.json b/src/generated/resources/assets/gtceu/models/item/fluid_cell_filled.json deleted file mode 100644 index bb674b09d7..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/fluid_cell_filled.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "gtceu:item/fluid_cell/base", - "layer1": "gtceu:item/fluid_cell/overlay" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/glass_vial.json b/src/generated/resources/assets/gtceu/models/item/glass_vial.json deleted file mode 100644 index 1bf5a33583..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/glass_vial.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "overrides": [ - { - "model": "gtceu:item/glass_vial_empty", - "predicate": { - "gtceu:fluid_cell": 0.0 - } - }, - { - "model": "gtceu:item/glass_vial_filled", - "predicate": { - "gtceu:fluid_cell": 1.0 - } - } - ], - "textures": { - "layer0": "gtceu:item/glass_vial/base" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/glass_vial_filled.json b/src/generated/resources/assets/gtceu/models/item/glass_vial_filled.json deleted file mode 100644 index c0945d9e24..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/glass_vial_filled.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "gtceu:item/glass_vial/base", - "layer1": "gtceu:item/glass_vial/overlay" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/industrial_tnt.json b/src/generated/resources/assets/gtceu/models/item/industrial_tnt.json new file mode 100644 index 0000000000..82cfdfff07 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/industrial_tnt.json @@ -0,0 +1,3 @@ +{ + "parent": "gtceu:block/industrial_tnt" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/light_concrete_windmill_a.json b/src/generated/resources/assets/gtceu/models/item/light_concrete_windmill_a.json new file mode 100644 index 0000000000..d3a8d0d3f1 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/light_concrete_windmill_a.json @@ -0,0 +1,3 @@ +{ + "parent": "gtceu:block/light_concrete_windmill_a" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/light_concrete_windmill_b.json b/src/generated/resources/assets/gtceu/models/item/light_concrete_windmill_b.json new file mode 100644 index 0000000000..a9de0c96b5 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/light_concrete_windmill_b.json @@ -0,0 +1,3 @@ +{ + "parent": "gtceu:block/light_concrete_windmill_b" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/marble_windmill_a.json b/src/generated/resources/assets/gtceu/models/item/marble_windmill_a.json new file mode 100644 index 0000000000..1e29d596f3 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/marble_windmill_a.json @@ -0,0 +1,3 @@ +{ + "parent": "gtceu:block/marble_windmill_a" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/marble_windmill_b.json b/src/generated/resources/assets/gtceu/models/item/marble_windmill_b.json new file mode 100644 index 0000000000..98a3925514 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/marble_windmill_b.json @@ -0,0 +1,3 @@ +{ + "parent": "gtceu:block/marble_windmill_b" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/nanomuscle_boots.json b/src/generated/resources/assets/gtceu/models/item/nanomuscle_boots.json new file mode 100644 index 0000000000..9228e4b5dc --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/nanomuscle_boots.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/nanomuscle_boots" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/nanomuscle_chestplate.json b/src/generated/resources/assets/gtceu/models/item/nanomuscle_chestplate.json new file mode 100644 index 0000000000..b17fe82d0c --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/nanomuscle_chestplate.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/nanomuscle_chestplate" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/nanomuscle_helmet.json b/src/generated/resources/assets/gtceu/models/item/nanomuscle_helmet.json new file mode 100644 index 0000000000..35f8234130 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/nanomuscle_helmet.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/nanomuscle_helmet" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/nanomuscle_leggings.json b/src/generated/resources/assets/gtceu/models/item/nanomuscle_leggings.json new file mode 100644 index 0000000000..eb5268318c --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/nanomuscle_leggings.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/nanomuscle_leggings" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/nightvision_goggles.json b/src/generated/resources/assets/gtceu/models/item/nightvision_goggles.json new file mode 100644 index 0000000000..141cfa3afb --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/nightvision_goggles.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/nightvision_goggles" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/powderbarrel.json b/src/generated/resources/assets/gtceu/models/item/powderbarrel.json new file mode 100644 index 0000000000..e271d3e8f2 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/powderbarrel.json @@ -0,0 +1,3 @@ +{ + "parent": "gtceu:block/powderbarrel" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/glass_vial_empty.json b/src/generated/resources/assets/gtceu/models/item/quarktech_boots.json similarity index 59% rename from src/generated/resources/assets/gtceu/models/item/glass_vial_empty.json rename to src/generated/resources/assets/gtceu/models/item/quarktech_boots.json index c930997e0b..b825470e0b 100644 --- a/src/generated/resources/assets/gtceu/models/item/glass_vial_empty.json +++ b/src/generated/resources/assets/gtceu/models/item/quarktech_boots.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "gtceu:item/glass_vial/base" + "layer0": "gtceu:item/quarktech_boots" } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/quarktech_chestplate.json b/src/generated/resources/assets/gtceu/models/item/quarktech_chestplate.json new file mode 100644 index 0000000000..3373c10b01 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/quarktech_chestplate.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/quarktech_chestplate" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/quarktech_helmet.json b/src/generated/resources/assets/gtceu/models/item/quarktech_helmet.json new file mode 100644 index 0000000000..a974e88f83 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/quarktech_helmet.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/quarktech_helmet" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/quarktech_leggings.json b/src/generated/resources/assets/gtceu/models/item/quarktech_leggings.json new file mode 100644 index 0000000000..47eeb6b218 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/quarktech_leggings.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/quarktech_leggings" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/red_granite_windmill_a.json b/src/generated/resources/assets/gtceu/models/item/red_granite_windmill_a.json new file mode 100644 index 0000000000..4fe4bf07f9 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/red_granite_windmill_a.json @@ -0,0 +1,3 @@ +{ + "parent": "gtceu:block/red_granite_windmill_a" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/red_granite_windmill_b.json b/src/generated/resources/assets/gtceu/models/item/red_granite_windmill_b.json new file mode 100644 index 0000000000..bf689a40d7 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/red_granite_windmill_b.json @@ -0,0 +1,3 @@ +{ + "parent": "gtceu:block/red_granite_windmill_b" +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/rubber_button.json b/src/generated/resources/assets/gtceu/models/item/rubber_button.json index ac15af2a4e..0c7c6281b7 100644 --- a/src/generated/resources/assets/gtceu/models/item/rubber_button.json +++ b/src/generated/resources/assets/gtceu/models/item/rubber_button.json @@ -1,3 +1,6 @@ { - "parent": "gtceu:block/rubber_button" + "parent": "minecraft:block/button_inventory", + "textures": { + "texture": "gtceu:block/rubber_planks" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/rubber_door.json b/src/generated/resources/assets/gtceu/models/item/rubber_door.json index 2c8a2621d1..614328bed6 100644 --- a/src/generated/resources/assets/gtceu/models/item/rubber_door.json +++ b/src/generated/resources/assets/gtceu/models/item/rubber_door.json @@ -1,3 +1,6 @@ { - "parent": "gtceu:block/rubber_door" + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/rubber_door" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/rubber_fence.json b/src/generated/resources/assets/gtceu/models/item/rubber_fence.json index d530dc11c0..dba2589176 100644 --- a/src/generated/resources/assets/gtceu/models/item/rubber_fence.json +++ b/src/generated/resources/assets/gtceu/models/item/rubber_fence.json @@ -1,3 +1,6 @@ { - "parent": "gtceu:block/rubber_fence" + "parent": "minecraft:block/fence_inventory", + "textures": { + "texture": "gtceu:block/rubber_planks" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/rubber_sign.json b/src/generated/resources/assets/gtceu/models/item/rubber_sign.json index 8f001c3916..8ea3200868 100644 --- a/src/generated/resources/assets/gtceu/models/item/rubber_sign.json +++ b/src/generated/resources/assets/gtceu/models/item/rubber_sign.json @@ -1,3 +1,6 @@ { - "parent": "gtceu:block/rubber_sign" + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/rubber_sign" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/rubber_trapdoor.json b/src/generated/resources/assets/gtceu/models/item/rubber_trapdoor.json index 2a2d201498..9a871fdd67 100644 --- a/src/generated/resources/assets/gtceu/models/item/rubber_trapdoor.json +++ b/src/generated/resources/assets/gtceu/models/item/rubber_trapdoor.json @@ -1,3 +1,6 @@ { - "parent": "gtceu:block/rubber_trapdoor" + "parent": "minecraft:block/template_orientable_trapdoor_bottom", + "textures": { + "texture": "gtceu:block/rubber_trapdoor" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/smooth_dark_concrete.json b/src/generated/resources/assets/gtceu/models/item/smooth_dark_concrete.json deleted file mode 100644 index 6b0806d048..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/smooth_dark_concrete.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "gtceu:block/smooth_dark_concrete" -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/smooth_light_concrete.json b/src/generated/resources/assets/gtceu/models/item/smooth_light_concrete.json deleted file mode 100644 index 76f116d1c3..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/smooth_light_concrete.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "gtceu:block/smooth_light_concrete" -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/smooth_marble.json b/src/generated/resources/assets/gtceu/models/item/smooth_marble.json deleted file mode 100644 index bd8441464c..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/smooth_marble.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "gtceu:block/smooth_marble" -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/smooth_red_granite.json b/src/generated/resources/assets/gtceu/models/item/smooth_red_granite.json deleted file mode 100644 index 8c7c9eb839..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/smooth_red_granite.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "gtceu:block/smooth_red_granite" -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/stainless_steel_fluid_cell.json b/src/generated/resources/assets/gtceu/models/item/stainless_steel_fluid_cell.json deleted file mode 100644 index 33ef24dcba..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/stainless_steel_fluid_cell.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "overrides": [ - { - "model": "gtceu:item/stainless_steel_fluid_cell_empty", - "predicate": { - "gtceu:fluid_cell": 0.0 - } - }, - { - "model": "gtceu:item/stainless_steel_fluid_cell_filled", - "predicate": { - "gtceu:fluid_cell": 1.0 - } - } - ], - "textures": { - "layer0": "gtceu:item/stainless_steel_fluid_cell/base" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/stainless_steel_fluid_cell_empty.json b/src/generated/resources/assets/gtceu/models/item/stainless_steel_fluid_cell_empty.json deleted file mode 100644 index 66f4b2c0ef..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/stainless_steel_fluid_cell_empty.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "gtceu:item/stainless_steel_fluid_cell/base" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/stainless_steel_fluid_cell_filled.json b/src/generated/resources/assets/gtceu/models/item/stainless_steel_fluid_cell_filled.json deleted file mode 100644 index 124216841d..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/stainless_steel_fluid_cell_filled.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "gtceu:item/stainless_steel_fluid_cell/base", - "layer1": "gtceu:item/stainless_steel_fluid_cell/overlay" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/steel_fluid_cell.json b/src/generated/resources/assets/gtceu/models/item/steel_fluid_cell.json deleted file mode 100644 index 5e1aa162bc..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/steel_fluid_cell.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "overrides": [ - { - "model": "gtceu:item/steel_fluid_cell_empty", - "predicate": { - "gtceu:fluid_cell": 0.0 - } - }, - { - "model": "gtceu:item/steel_fluid_cell_filled", - "predicate": { - "gtceu:fluid_cell": 1.0 - } - } - ], - "textures": { - "layer0": "gtceu:item/steel_fluid_cell/base" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/steel_fluid_cell_filled.json b/src/generated/resources/assets/gtceu/models/item/steel_fluid_cell_filled.json deleted file mode 100644 index 44d5c4cb8f..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/steel_fluid_cell_filled.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "gtceu:item/steel_fluid_cell/base", - "layer1": "gtceu:item/steel_fluid_cell/overlay" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/sus_record.json b/src/generated/resources/assets/gtceu/models/item/sus_record.json new file mode 100644 index 0000000000..29babbcb46 --- /dev/null +++ b/src/generated/resources/assets/gtceu/models/item/sus_record.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/sus_record" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/titanium_fluid_cell.json b/src/generated/resources/assets/gtceu/models/item/titanium_fluid_cell.json deleted file mode 100644 index 6d432692a3..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/titanium_fluid_cell.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "overrides": [ - { - "model": "gtceu:item/titanium_fluid_cell_empty", - "predicate": { - "gtceu:fluid_cell": 0.0 - } - }, - { - "model": "gtceu:item/titanium_fluid_cell_filled", - "predicate": { - "gtceu:fluid_cell": 1.0 - } - } - ], - "textures": { - "layer0": "gtceu:item/titanium_fluid_cell/base" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/titanium_fluid_cell_filled.json b/src/generated/resources/assets/gtceu/models/item/titanium_fluid_cell_filled.json deleted file mode 100644 index 75ffa88b15..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/titanium_fluid_cell_filled.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "gtceu:item/titanium_fluid_cell/base", - "layer1": "gtceu:item/titanium_fluid_cell/overlay" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/treated_wood_button.json b/src/generated/resources/assets/gtceu/models/item/treated_wood_button.json index d06f211a34..a56c2392f6 100644 --- a/src/generated/resources/assets/gtceu/models/item/treated_wood_button.json +++ b/src/generated/resources/assets/gtceu/models/item/treated_wood_button.json @@ -1,3 +1,6 @@ { - "parent": "gtceu:block/treated_wood_button" + "parent": "minecraft:block/button_inventory", + "textures": { + "texture": "gtceu:block/treated_wood_planks" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/treated_wood_door.json b/src/generated/resources/assets/gtceu/models/item/treated_wood_door.json index 27888e7e43..f582eccfa7 100644 --- a/src/generated/resources/assets/gtceu/models/item/treated_wood_door.json +++ b/src/generated/resources/assets/gtceu/models/item/treated_wood_door.json @@ -1,3 +1,6 @@ { - "parent": "gtceu:block/treated_wood_door" + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/treated_wood_door" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/treated_wood_fence.json b/src/generated/resources/assets/gtceu/models/item/treated_wood_fence.json index c285d0117a..ece07fd0b1 100644 --- a/src/generated/resources/assets/gtceu/models/item/treated_wood_fence.json +++ b/src/generated/resources/assets/gtceu/models/item/treated_wood_fence.json @@ -1,3 +1,6 @@ { - "parent": "gtceu:block/treated_wood_fence" + "parent": "minecraft:block/fence_inventory", + "textures": { + "texture": "gtceu:block/treated_wood_planks" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/treated_wood_sign.json b/src/generated/resources/assets/gtceu/models/item/treated_wood_sign.json index dc4d3e1917..dcc4873b3a 100644 --- a/src/generated/resources/assets/gtceu/models/item/treated_wood_sign.json +++ b/src/generated/resources/assets/gtceu/models/item/treated_wood_sign.json @@ -1,3 +1,6 @@ { - "parent": "gtceu:block/treated_wood_sign" + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gtceu:item/treated_wood_sign" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/treated_wood_trapdoor.json b/src/generated/resources/assets/gtceu/models/item/treated_wood_trapdoor.json index 2d3625ff62..479023b4c1 100644 --- a/src/generated/resources/assets/gtceu/models/item/treated_wood_trapdoor.json +++ b/src/generated/resources/assets/gtceu/models/item/treated_wood_trapdoor.json @@ -1,3 +1,6 @@ { - "parent": "gtceu:block/treated_wood_trapdoor" + "parent": "minecraft:block/template_orientable_trapdoor_bottom", + "textures": { + "texture": "gtceu:block/treated_wood_trapdoor" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/tungstensteel_fluid_cell.json b/src/generated/resources/assets/gtceu/models/item/tungstensteel_fluid_cell.json deleted file mode 100644 index 6b9f1cf556..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/tungstensteel_fluid_cell.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "overrides": [ - { - "model": "gtceu:item/tungstensteel_fluid_cell_empty", - "predicate": { - "gtceu:fluid_cell": 0.0 - } - }, - { - "model": "gtceu:item/tungstensteel_fluid_cell_filled", - "predicate": { - "gtceu:fluid_cell": 1.0 - } - } - ], - "textures": { - "layer0": "gtceu:item/tungstensteel_fluid_cell/base" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/tungstensteel_fluid_cell_empty.json b/src/generated/resources/assets/gtceu/models/item/tungstensteel_fluid_cell_empty.json deleted file mode 100644 index 6eeba913a3..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/tungstensteel_fluid_cell_empty.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "gtceu:item/tungstensteel_fluid_cell/base" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/tungstensteel_fluid_cell_filled.json b/src/generated/resources/assets/gtceu/models/item/tungstensteel_fluid_cell_filled.json deleted file mode 100644 index c4ae692337..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/tungstensteel_fluid_cell_filled.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "gtceu:item/tungstensteel_fluid_cell/base", - "layer1": "gtceu:item/tungstensteel_fluid_cell/overlay" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/universal_fluid_cell.json b/src/generated/resources/assets/gtceu/models/item/universal_fluid_cell.json deleted file mode 100644 index 7afab499b6..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/universal_fluid_cell.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "overrides": [ - { - "model": "gtceu:item/universal_fluid_cell_empty", - "predicate": { - "gtceu:fluid_cell": 0.0 - } - }, - { - "model": "gtceu:item/universal_fluid_cell_filled", - "predicate": { - "gtceu:fluid_cell": 1.0 - } - } - ], - "textures": { - "layer0": "gtceu:item/universal_fluid_cell/base" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/universal_fluid_cell_empty.json b/src/generated/resources/assets/gtceu/models/item/universal_fluid_cell_empty.json deleted file mode 100644 index a405f135eb..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/universal_fluid_cell_empty.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "gtceu:item/universal_fluid_cell/base" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/models/item/universal_fluid_cell_filled.json b/src/generated/resources/assets/gtceu/models/item/universal_fluid_cell_filled.json deleted file mode 100644 index e3678e83aa..0000000000 --- a/src/generated/resources/assets/gtceu/models/item/universal_fluid_cell_filled.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "gtceu:item/universal_fluid_cell/base", - "layer1": "gtceu:item/universal_fluid_cell/overlay" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/gtceu/sounds.json b/src/generated/resources/assets/gtceu/sounds.json index a35663ce0f..9318d8e902 100644 --- a/src/generated/resources/assets/gtceu/sounds.json +++ b/src/generated/resources/assets/gtceu/sounds.json @@ -161,6 +161,15 @@ ], "subtitle": "gtceu.subtitle.furnace" }, + "jet_engine": { + "sounds": [ + { + "type": "file", + "name": "gtceu:jet_engine" + } + ], + "subtitle": "gtceu.subtitle.jet_engine" + }, "macerator": { "sounds": [ { diff --git a/src/generated/resources/data/forge/tags/blocks/needs_wood_tool.json b/src/generated/resources/data/forge/tags/blocks/needs_wood_tool.json index 6592f7cb72..705b6b75ca 100644 --- a/src/generated/resources/data/forge/tags/blocks/needs_wood_tool.json +++ b/src/generated/resources/data/forge/tags/blocks/needs_wood_tool.json @@ -1,7 +1,6 @@ { "values": [ "gtceu:red_granite", - "gtceu:smooth_red_granite", "gtceu:red_granite_cobblestone", "gtceu:mossy_red_granite_cobblestone", "gtceu:polished_red_granite", @@ -11,10 +10,11 @@ "gtceu:chiseled_red_granite", "gtceu:red_granite_tile", "gtceu:red_granite_small_tile", + "gtceu:red_granite_windmill_a", + "gtceu:red_granite_windmill_b", "gtceu:small_red_granite_bricks", "gtceu:square_red_granite_bricks", "gtceu:marble", - "gtceu:smooth_marble", "gtceu:marble_cobblestone", "gtceu:mossy_marble_cobblestone", "gtceu:polished_marble", @@ -24,10 +24,11 @@ "gtceu:chiseled_marble", "gtceu:marble_tile", "gtceu:marble_small_tile", + "gtceu:marble_windmill_a", + "gtceu:marble_windmill_b", "gtceu:small_marble_bricks", "gtceu:square_marble_bricks", "gtceu:light_concrete", - "gtceu:smooth_light_concrete", "gtceu:light_concrete_cobblestone", "gtceu:mossy_light_concrete_cobblestone", "gtceu:polished_light_concrete", @@ -37,10 +38,11 @@ "gtceu:chiseled_light_concrete", "gtceu:light_concrete_tile", "gtceu:light_concrete_small_tile", + "gtceu:light_concrete_windmill_a", + "gtceu:light_concrete_windmill_b", "gtceu:small_light_concrete_bricks", "gtceu:square_light_concrete_bricks", "gtceu:dark_concrete", - "gtceu:smooth_dark_concrete", "gtceu:dark_concrete_cobblestone", "gtceu:mossy_dark_concrete_cobblestone", "gtceu:polished_dark_concrete", @@ -50,6 +52,8 @@ "gtceu:chiseled_dark_concrete", "gtceu:dark_concrete_tile", "gtceu:dark_concrete_small_tile", + "gtceu:dark_concrete_windmill_a", + "gtceu:dark_concrete_windmill_b", "gtceu:small_dark_concrete_bricks", "gtceu:square_dark_concrete_bricks" ] diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/dark_concrete_windmill_a.json b/src/generated/resources/data/gtceu/loot_tables/blocks/dark_concrete_windmill_a.json new file mode 100644 index 0000000000..6747a46423 --- /dev/null +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/dark_concrete_windmill_a.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "gtceu:dark_concrete_windmill_a" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/dark_concrete_windmill_b.json b/src/generated/resources/data/gtceu/loot_tables/blocks/dark_concrete_windmill_b.json new file mode 100644 index 0000000000..9711b86380 --- /dev/null +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/dark_concrete_windmill_b.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "gtceu:dark_concrete_windmill_b" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/smooth_red_granite.json b/src/generated/resources/data/gtceu/loot_tables/blocks/industrial_tnt.json similarity index 86% rename from src/generated/resources/data/gtceu/loot_tables/blocks/smooth_red_granite.json rename to src/generated/resources/data/gtceu/loot_tables/blocks/industrial_tnt.json index c6990f60d3..19ac9aadfc 100644 --- a/src/generated/resources/data/gtceu/loot_tables/blocks/smooth_red_granite.json +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/industrial_tnt.json @@ -11,7 +11,7 @@ "entries": [ { "type": "minecraft:item", - "name": "gtceu:smooth_red_granite" + "name": "gtceu:industrial_tnt" } ], "rolls": 1.0 diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/light_concrete_windmill_a.json b/src/generated/resources/data/gtceu/loot_tables/blocks/light_concrete_windmill_a.json new file mode 100644 index 0000000000..b2f59f3489 --- /dev/null +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/light_concrete_windmill_a.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "gtceu:light_concrete_windmill_a" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/light_concrete_windmill_b.json b/src/generated/resources/data/gtceu/loot_tables/blocks/light_concrete_windmill_b.json new file mode 100644 index 0000000000..5d0b8bfbfb --- /dev/null +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/light_concrete_windmill_b.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "gtceu:light_concrete_windmill_b" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/smooth_dark_concrete.json b/src/generated/resources/data/gtceu/loot_tables/blocks/marble_windmill_a.json similarity index 86% rename from src/generated/resources/data/gtceu/loot_tables/blocks/smooth_dark_concrete.json rename to src/generated/resources/data/gtceu/loot_tables/blocks/marble_windmill_a.json index c23df589bb..9881285164 100644 --- a/src/generated/resources/data/gtceu/loot_tables/blocks/smooth_dark_concrete.json +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/marble_windmill_a.json @@ -11,7 +11,7 @@ "entries": [ { "type": "minecraft:item", - "name": "gtceu:smooth_dark_concrete" + "name": "gtceu:marble_windmill_a" } ], "rolls": 1.0 diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/smooth_light_concrete.json b/src/generated/resources/data/gtceu/loot_tables/blocks/marble_windmill_b.json similarity index 86% rename from src/generated/resources/data/gtceu/loot_tables/blocks/smooth_light_concrete.json rename to src/generated/resources/data/gtceu/loot_tables/blocks/marble_windmill_b.json index 92b845196f..6d6a267b34 100644 --- a/src/generated/resources/data/gtceu/loot_tables/blocks/smooth_light_concrete.json +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/marble_windmill_b.json @@ -11,7 +11,7 @@ "entries": [ { "type": "minecraft:item", - "name": "gtceu:smooth_light_concrete" + "name": "gtceu:marble_windmill_b" } ], "rolls": 1.0 diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/normal_laser_pipe.json b/src/generated/resources/data/gtceu/loot_tables/blocks/normal_laser_pipe.json new file mode 100644 index 0000000000..ac7553ffd4 --- /dev/null +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/normal_laser_pipe.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "gtceu:normal_laser_pipe" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/normal_optical_pipe.json b/src/generated/resources/data/gtceu/loot_tables/blocks/normal_optical_pipe.json new file mode 100644 index 0000000000..1990b1d838 --- /dev/null +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/normal_optical_pipe.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "gtceu:normal_optical_pipe" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/smooth_marble.json b/src/generated/resources/data/gtceu/loot_tables/blocks/powderbarrel.json similarity index 88% rename from src/generated/resources/data/gtceu/loot_tables/blocks/smooth_marble.json rename to src/generated/resources/data/gtceu/loot_tables/blocks/powderbarrel.json index 62e4f88562..644c5a5663 100644 --- a/src/generated/resources/data/gtceu/loot_tables/blocks/smooth_marble.json +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/powderbarrel.json @@ -11,7 +11,7 @@ "entries": [ { "type": "minecraft:item", - "name": "gtceu:smooth_marble" + "name": "gtceu:powderbarrel" } ], "rolls": 1.0 diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/red_granite_windmill_a.json b/src/generated/resources/data/gtceu/loot_tables/blocks/red_granite_windmill_a.json new file mode 100644 index 0000000000..6bd00d43ff --- /dev/null +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/red_granite_windmill_a.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "gtceu:red_granite_windmill_a" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/gtceu/loot_tables/blocks/red_granite_windmill_b.json b/src/generated/resources/data/gtceu/loot_tables/blocks/red_granite_windmill_b.json new file mode 100644 index 0000000000..ef1e8d0b83 --- /dev/null +++ b/src/generated/resources/data/gtceu/loot_tables/blocks/red_granite_windmill_b.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "gtceu:red_granite_windmill_b" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json index 3888576aaf..1fa47f52af 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -1,5 +1,7 @@ { "values": [ - "gtceu:pump_deck" + "gtceu:pump_deck", + "gtceu:powderbarrel", + "gtceu:industrial_tnt" ] } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index e7aad2be5c..04a9b24af7 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -136,7 +136,6 @@ "gtceu:yellow_stripes_block_a", "gtceu:yellow_stripes_block_b", "gtceu:red_granite", - "gtceu:smooth_red_granite", "gtceu:red_granite_cobblestone", "gtceu:mossy_red_granite_cobblestone", "gtceu:polished_red_granite", @@ -146,10 +145,11 @@ "gtceu:chiseled_red_granite", "gtceu:red_granite_tile", "gtceu:red_granite_small_tile", + "gtceu:red_granite_windmill_a", + "gtceu:red_granite_windmill_b", "gtceu:small_red_granite_bricks", "gtceu:square_red_granite_bricks", "gtceu:marble", - "gtceu:smooth_marble", "gtceu:marble_cobblestone", "gtceu:mossy_marble_cobblestone", "gtceu:polished_marble", @@ -159,10 +159,11 @@ "gtceu:chiseled_marble", "gtceu:marble_tile", "gtceu:marble_small_tile", + "gtceu:marble_windmill_a", + "gtceu:marble_windmill_b", "gtceu:small_marble_bricks", "gtceu:square_marble_bricks", "gtceu:light_concrete", - "gtceu:smooth_light_concrete", "gtceu:light_concrete_cobblestone", "gtceu:mossy_light_concrete_cobblestone", "gtceu:polished_light_concrete", @@ -172,10 +173,11 @@ "gtceu:chiseled_light_concrete", "gtceu:light_concrete_tile", "gtceu:light_concrete_small_tile", + "gtceu:light_concrete_windmill_a", + "gtceu:light_concrete_windmill_b", "gtceu:small_light_concrete_bricks", "gtceu:square_light_concrete_bricks", "gtceu:dark_concrete", - "gtceu:smooth_dark_concrete", "gtceu:dark_concrete_cobblestone", "gtceu:mossy_dark_concrete_cobblestone", "gtceu:polished_dark_concrete", @@ -185,6 +187,8 @@ "gtceu:chiseled_dark_concrete", "gtceu:dark_concrete_tile", "gtceu:dark_concrete_small_tile", + "gtceu:dark_concrete_windmill_a", + "gtceu:dark_concrete_windmill_b", "gtceu:small_dark_concrete_bricks", "gtceu:square_dark_concrete_bricks" ] diff --git a/src/generated/resources/data/minecraft/tags/entity_types/impact_projectiles.json b/src/generated/resources/data/minecraft/tags/entity_types/impact_projectiles.json new file mode 100644 index 0000000000..9c0672c447 --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/entity_types/impact_projectiles.json @@ -0,0 +1,5 @@ +{ + "values": [ + "gtceu:dynamite" + ] +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/api/GTCEuAPI.java b/src/main/java/com/gregtechceu/gtceu/api/GTCEuAPI.java index 1b8001fb81..504b0396c2 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/GTCEuAPI.java +++ b/src/main/java/com/gregtechceu/gtceu/api/GTCEuAPI.java @@ -3,16 +3,26 @@ import com.gregtechceu.gtceu.GTCEu; import com.gregtechceu.gtceu.api.addon.AddonFinder; import com.gregtechceu.gtceu.api.addon.IGTAddon; +import com.gregtechceu.gtceu.api.block.ICoilType; +import com.gregtechceu.gtceu.api.block.IFilterType; import com.gregtechceu.gtceu.api.data.chemical.material.IMaterialRegistryManager; +import com.gregtechceu.gtceu.api.machine.multiblock.IBatteryData; import com.gregtechceu.gtceu.api.registry.GTRegistry; +import com.gregtechceu.gtceu.common.block.BatteryBlock; +import com.gregtechceu.gtceu.common.block.CoilBlock; import com.gregtechceu.gtceu.config.ConfigHolder; import com.lowdragmc.lowdraglib.Platform; import lombok.Getter; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.block.Block; import net.minecraftforge.eventbus.api.GenericEvent; import net.minecraftforge.fml.event.IModBusEvent; import org.jetbrains.annotations.ApiStatus; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; + public class GTCEuAPI { /** Will always be available */ @@ -25,6 +35,10 @@ public class GTCEuAPI { private static boolean highTier; private static boolean highTierInitialized; + public static final Map> HEATING_COILS = new HashMap<>(); + public static final Map> CLEANROOM_FILTERS = new HashMap<>(); + public static final Map> PSS_BATTERIES = new HashMap<>(); + /** * Initializes High-Tier. Internal use only, do not attempt to call this. */ diff --git a/src/main/java/com/gregtechceu/gtceu/api/block/ICoilType.java b/src/main/java/com/gregtechceu/gtceu/api/block/ICoilType.java index b0cc26def2..76e73d03ca 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/block/ICoilType.java +++ b/src/main/java/com/gregtechceu/gtceu/api/block/ICoilType.java @@ -1,7 +1,7 @@ package com.gregtechceu.gtceu.api.block; +import com.gregtechceu.gtceu.api.GTCEuAPI; import com.gregtechceu.gtceu.api.data.chemical.material.Material; -import com.gregtechceu.gtceu.common.data.GTBlocks; import net.minecraft.resources.ResourceLocation; import org.jetbrains.annotations.NotNull; @@ -55,7 +55,7 @@ public interface ICoilType { ResourceLocation getTexture(); - ICoilType[] ALL_COILS_TEMPERATURE_SORTED = GTBlocks.ALL_COILS.keySet().stream() + ICoilType[] ALL_COILS_TEMPERATURE_SORTED = GTCEuAPI.HEATING_COILS.keySet().stream() .sorted(Comparator.comparing(ICoilType::getCoilTemperature)) .toArray(ICoilType[]::new); diff --git a/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/EURecipeCapability.java b/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/EURecipeCapability.java index 7a10f95e0b..873ebe958a 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/EURecipeCapability.java +++ b/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/EURecipeCapability.java @@ -1,10 +1,18 @@ package com.gregtechceu.gtceu.api.capability.recipe; +import com.gregtechceu.gtceu.api.GTValues; +import com.gregtechceu.gtceu.api.capability.IEnergyContainer; +import com.gregtechceu.gtceu.api.machine.feature.IOverclockMachine; +import com.gregtechceu.gtceu.api.machine.feature.ITieredMachine; +import com.gregtechceu.gtceu.api.recipe.GTRecipe; +import com.gregtechceu.gtceu.api.recipe.RecipeHelper; import com.gregtechceu.gtceu.api.recipe.content.ContentModifier; import com.gregtechceu.gtceu.api.recipe.content.SerializerLong; import java.util.Collection; +import java.util.Collections; import java.util.List; +import java.util.Objects; /** * @author KilaBash @@ -33,4 +41,30 @@ public Long copyWithModifier(Long content, ContentModifier modifier) { public List compressIngredients(Collection ingredients) { return List.of(ingredients.stream().map(Long.class::cast).reduce(0L, Long::sum)); } + + @Override + public int limitParallel(GTRecipe recipe, IRecipeCapabilityHolder holder, int multiplier) { + long maxVoltage = Long.MAX_VALUE; + if (holder instanceof IOverclockMachine overclockMachine) { + maxVoltage = overclockMachine.getOverclockVoltage(); + } else if (holder instanceof ITieredMachine tieredMachine) { + maxVoltage = GTValues.V[tieredMachine.getTier()]; + } + + long recipeEUt = RecipeHelper.getInputEUt(recipe); + if (recipeEUt == 0) { + recipeEUt = RecipeHelper.getOutputEUt(recipe); + } + return Math.abs((int) (maxVoltage / recipeEUt)); + } + + @Override + public int getMaxParallelRatio(IRecipeCapabilityHolder holder, GTRecipe recipe, int parallelAmount) { + long needed = RecipeHelper.getInputEUt(recipe); + long available = Objects.requireNonNullElseGet(holder.getCapabilitiesProxy().get(IO.IN, EURecipeCapability.CAP), Collections::>emptyList) + .stream() + .map(handler -> Double.valueOf(handler.getTotalContentAmount()).longValue()) + .reduce(0L, Long::sum); + return (int) Math.min(parallelAmount, available / needed); + } } diff --git a/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/FluidRecipeCapability.java b/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/FluidRecipeCapability.java index fd766e7b4e..3d36bd6b57 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/FluidRecipeCapability.java +++ b/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/FluidRecipeCapability.java @@ -9,18 +9,24 @@ import com.gregtechceu.gtceu.api.recipe.lookup.AbstractMapIngredient; import com.gregtechceu.gtceu.api.recipe.lookup.MapFluidIngredient; import com.gregtechceu.gtceu.api.recipe.lookup.MapFluidTagIngredient; +import com.gregtechceu.gtceu.api.recipe.modifier.ParallelLogic; import com.gregtechceu.gtceu.api.recipe.ui.GTRecipeTypeUI; import com.gregtechceu.gtceu.integration.GTRecipeWidget; +import com.gregtechceu.gtceu.utils.FluidKey; +import com.gregtechceu.gtceu.utils.GTHashMaps; +import com.gregtechceu.gtceu.utils.OverlayedFluidHandler; import com.gregtechceu.gtceu.utils.OverlayingFluidStorage; import com.lowdragmc.lowdraglib.gui.texture.ProgressTexture; import com.lowdragmc.lowdraglib.gui.widget.TankWidget; import com.lowdragmc.lowdraglib.gui.widget.Widget; import com.lowdragmc.lowdraglib.jei.IngredientIO; +import com.lowdragmc.lowdraglib.misc.FluidTransferList; import com.lowdragmc.lowdraglib.side.fluid.FluidStack; import com.lowdragmc.lowdraglib.side.fluid.IFluidTransfer; import com.lowdragmc.lowdraglib.utils.TagOrCycleFluidTransfer; import com.mojang.datafixers.util.Either; import com.mojang.datafixers.util.Pair; +import it.unimi.dsi.fastutil.objects.Object2LongLinkedOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; @@ -30,9 +36,7 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.UnknownNullability; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -77,6 +81,7 @@ public List convertToMapIngredient(Object obj) { } } else if (obj instanceof FluidStack stack) { ingredients.add(new MapFluidIngredient(stack)); + //noinspection deprecation stack.getFluid().builtInRegistryHolder().tags().forEach(tag -> ingredients.add(new MapFluidTagIngredient(tag))); } @@ -131,6 +136,140 @@ public boolean isRecipeSearchFilter() { return true; } + @Override + public int limitParallel(GTRecipe recipe, IRecipeCapabilityHolder holder, int multiplier) { + int minMultiplier = 0; + int maxMultiplier = multiplier; + + OverlayedFluidHandler overlayedFluidHandler = new OverlayedFluidHandler(new FluidTransferList( + Objects.requireNonNullElseGet(holder.getCapabilitiesProxy().get(IO.OUT, FluidRecipeCapability.CAP), Collections::emptyList) + .stream() + .filter(IFluidTransfer.class::isInstance) + .map(IFluidTransfer.class::cast) + .toList() + )); + + while (minMultiplier != maxMultiplier) { + overlayedFluidHandler.reset(); + + long amountLeft = 0; + + for (FluidStack fluidStack : recipe.getOutputContents(FluidRecipeCapability.CAP).stream().map(FluidRecipeCapability.CAP::of).map(ingredient -> ingredient.getStacks()[0]).toList()) { + if (fluidStack.getAmount() <= 0) continue; + // Since multiplier starts at Int.MAX, check here for integer overflow + if (multiplier > Integer.MAX_VALUE / fluidStack.getAmount()) { + amountLeft = Integer.MAX_VALUE; + } else { + amountLeft = fluidStack.getAmount() * multiplier; + } + long inserted = overlayedFluidHandler.insertFluid(fluidStack, amountLeft); + if (inserted > 0) { + amountLeft -= inserted; + } + if (amountLeft > 0) { + break; + } + } + + int[] bin = ParallelLogic.adjustMultiplier(amountLeft == 0, minMultiplier, multiplier, maxMultiplier); + minMultiplier = bin[0]; + multiplier = bin[1]; + maxMultiplier = bin[2]; + + } + return multiplier; + } + + @Override + public int getMaxParallelRatio(IRecipeCapabilityHolder holder, GTRecipe recipe, int parallelAmount) { + // Find all the fluids in the combined Fluid Input inventories and create oversized FluidStacks + Map fluidStacks = Objects.requireNonNullElseGet(holder.getCapabilitiesProxy().get(IO.IN, ItemRecipeCapability.CAP), Collections::>emptyList) + .stream() + .map(container -> container.getContents().stream().filter(FluidStack.class::isInstance).map(FluidStack.class::cast).toList()) + .flatMap(container -> GTHashMaps.fromFluidCollection(container).entrySet().stream()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, Long::sum, Object2LongLinkedOpenHashMap::new)); + + int minMultiplier = Integer.MAX_VALUE; + // map the recipe input fluids to account for duplicated fluids, + // so their sum is counted against the total of fluids available in the input + Map fluidCountMap = new HashMap<>(); + Map notConsumableMap = new HashMap<>(); + for (Content content : recipe.getInputContents(FluidRecipeCapability.CAP)) { + FluidIngredient fluidInput = FluidRecipeCapability.CAP.of(content.content); + long fluidAmount = fluidInput.getAmount(); + if (content.chance == 0.0f) { + notConsumableMap.computeIfPresent(new FluidKey(fluidInput.getStacks()[0]), + (k, v) -> v + fluidAmount); + notConsumableMap.putIfAbsent(new FluidKey(fluidInput.getStacks()[0]), fluidAmount); + } else { + fluidCountMap.computeIfPresent(new FluidKey(fluidInput.getStacks()[0]), + (k, v) -> v + fluidAmount); + fluidCountMap.putIfAbsent(new FluidKey(fluidInput.getStacks()[0]), fluidAmount); + } + } + + // Iterate through the recipe inputs, excluding the not consumable fluids from the fluid inventory map + for (Map.Entry notConsumableFluid : notConsumableMap.entrySet()) { + long needed = notConsumableFluid.getValue(); + long available = 0; + // For every fluid gathered from the fluid inputs. + for (Map.Entry inputFluid : fluidStacks.entrySet()) { + // Strip the Non-consumable tags here, as FluidKey compares the tags, which causes finding matching + // fluids + // in the input tanks to fail, because there is nothing in those hatches with a non-consumable tag + if (notConsumableFluid.getKey().equals(inputFluid.getKey())) { + available = inputFluid.getValue(); + if (available > needed) { + inputFluid.setValue(available - needed); + needed -= available; + break; + } else { + inputFluid.setValue(0L); + notConsumableFluid.setValue(needed - available); + needed -= available; + } + } + } + // We need to check >= available here because of Non-Consumable inputs with stack size. If there is a NC + // input + // with size 1000, and only 500 in the input, needed will be equal to available, but this situation should + // still fail + // as not all inputs are present + if (needed >= available) { + return 0; + } + } + + // Return the maximum parallel limit here if there are only non-consumed inputs, which are all found in the + // input bus + // At this point, we would have already returned 0 if we were missing any non-consumable inputs, so we can omit + // that check + if (fluidCountMap.isEmpty() && !notConsumableMap.isEmpty()) { + return parallelAmount; + } + + // Iterate through the fluid inputs in the recipe + for (Map.Entry fs : fluidCountMap.entrySet()) { + long needed = fs.getValue(); + long available = 0; + // For every fluid gathered from the fluid inputs. + for (Map.Entry inputFluid : fluidStacks.entrySet()) { + if (fs.getKey().equals(inputFluid.getKey())) { + available += inputFluid.getValue(); + } + } + if (available >= needed) { + int ratio = (int) Math.min(parallelAmount, available / needed); + if (ratio < minMultiplier) { + minMultiplier = ratio; + } + } else { + return 0; + } + } + return minMultiplier; + } + @Override public @NotNull List createXEIContainerContents(List contents, GTRecipe recipe, IO io) { return contents.stream().map(content -> content.content) diff --git a/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/ItemRecipeCapability.java b/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/ItemRecipeCapability.java index 4e4b53103e..f11d447b5e 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/ItemRecipeCapability.java +++ b/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/ItemRecipeCapability.java @@ -12,6 +12,7 @@ import com.gregtechceu.gtceu.api.recipe.ingredient.IntCircuitIngredient; import com.gregtechceu.gtceu.api.recipe.ingredient.SizedIngredient; import com.gregtechceu.gtceu.api.recipe.lookup.*; +import com.gregtechceu.gtceu.api.recipe.modifier.ParallelLogic; import com.gregtechceu.gtceu.api.recipe.ui.GTRecipeTypeUI; import com.gregtechceu.gtceu.common.recipe.ResearchCondition; import com.gregtechceu.gtceu.config.ConfigHolder; @@ -19,16 +20,19 @@ import com.gregtechceu.gtceu.core.mixins.IntersectionIngredientAccessor; import com.gregtechceu.gtceu.core.mixins.TagValueAccessor; import com.gregtechceu.gtceu.integration.GTRecipeWidget; -import com.gregtechceu.gtceu.utils.IngredientEquality; -import com.gregtechceu.gtceu.utils.ResearchManager; +import com.gregtechceu.gtceu.utils.*; import com.lowdragmc.lowdraglib.gui.widget.SlotWidget; import com.lowdragmc.lowdraglib.gui.widget.Widget; import com.lowdragmc.lowdraglib.jei.IngredientIO; +import com.lowdragmc.lowdraglib.misc.ItemTransferList; import com.lowdragmc.lowdraglib.side.item.IItemTransfer; import com.lowdragmc.lowdraglib.utils.CycleItemStackHandler; import com.lowdragmc.lowdraglib.utils.TagOrCycleItemStackTransfer; import com.mojang.datafixers.util.Either; import com.mojang.datafixers.util.Pair; +import it.unimi.dsi.fastutil.objects.Object2IntMap; +import it.unimi.dsi.fastutil.objects.Object2IntOpenCustomHashMap; +import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.core.Registry; import net.minecraft.network.chat.Component; @@ -186,6 +190,140 @@ public boolean isRecipeSearchFilter() { return true; } + @Override + public int limitParallel(GTRecipe recipe, IRecipeCapabilityHolder holder, int multiplier) { + int minMultiplier = 0; + int maxMultiplier = multiplier; + + OverlayedItemHandler itemHandler = new OverlayedItemHandler(new ItemTransferList( + Objects.requireNonNullElseGet(holder.getCapabilitiesProxy().get(IO.OUT, ItemRecipeCapability.CAP), Collections::emptyList) + .stream() + .filter(IItemTransfer.class::isInstance) + .map(IItemTransfer.class::cast) + .toList() + )); + + Object2IntMap recipeOutputs = GTHashMaps.fromItemStackCollection(recipe.getOutputContents(ItemRecipeCapability.CAP) + .stream() + .map(ItemRecipeCapability.CAP::of) + .filter(ingredient -> !ingredient.isEmpty()) + .map(ingredient -> ingredient.getItems()[0]) + .toList() + ); + + while (minMultiplier != maxMultiplier) { + itemHandler.reset(); + + int returnedAmount = 0; + int amountToInsert; + + for (Object2IntMap.Entry entry : recipeOutputs.object2IntEntrySet()) { + // Since multiplier starts at Int.MAX, check here for integer overflow + if (entry.getIntValue() != 0 && multiplier > Integer.MAX_VALUE / entry.getIntValue()) { + amountToInsert = Integer.MAX_VALUE; + } else { + amountToInsert = entry.getIntValue() * multiplier; + } + returnedAmount = itemHandler.insertStackedItemStack(entry.getKey(), amountToInsert); + if (returnedAmount > 0) { + break; + } + } + + int[] bin = ParallelLogic.adjustMultiplier(returnedAmount == 0, minMultiplier, multiplier, maxMultiplier); + minMultiplier = bin[0]; + multiplier = bin[1]; + maxMultiplier = bin[2]; + + } + return multiplier; + } + + @Override + public int getMaxParallelRatio(IRecipeCapabilityHolder holder, GTRecipe recipe, int parallelAmount) { + // Find all the items in the combined Item Input inventories and create oversized ItemStacks + Object2IntMap ingredientStacks = Objects.requireNonNullElseGet(holder.getCapabilitiesProxy().get(IO.IN, ItemRecipeCapability.CAP), Collections::>emptyList) + .stream() + .map(container -> container.getContents().stream().filter(ItemStack.class::isInstance).map(ItemStack.class::cast).toList()) + .flatMap(container -> GTHashMaps.fromItemStackCollection(container).object2IntEntrySet().stream()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, Integer::sum, () -> new Object2IntOpenCustomHashMap<>(ItemStackHashStrategy.comparingAllButCount()))); + + int minMultiplier = Integer.MAX_VALUE; + // map the recipe ingredients to account for duplicated and notConsumable ingredients. + // notConsumable ingredients are not counted towards the max ratio + Object2IntOpenHashMap notConsumableMap = new Object2IntOpenHashMap<>(); + Object2IntOpenHashMap countableMap = new Object2IntOpenHashMap<>(); + for (Content content : recipe.getInputContents(ItemRecipeCapability.CAP)) { + Ingredient recipeIngredient = ItemRecipeCapability.CAP.of(content.content); + int ingredientCount = recipeIngredient instanceof SizedIngredient sizedIngredient ? sizedIngredient.getAmount() : 1; + if (content.chance == 0.0f) { + notConsumableMap.computeIfPresent(recipeIngredient, (k, v) -> v + ingredientCount); + notConsumableMap.putIfAbsent(recipeIngredient, ingredientCount); + } else { + countableMap.computeIfPresent(recipeIngredient, (k, v) -> v + ingredientCount); + countableMap.putIfAbsent(recipeIngredient, ingredientCount); + } + } + + // Iterate through the recipe inputs, excluding the not consumable ingredients from the inventory map + for (Object2IntMap.Entry recipeInputEntry : notConsumableMap.object2IntEntrySet()) { + int needed = recipeInputEntry.getIntValue(); + int available = 0; + // For every stack in the ingredients gathered from the input bus. + for (Object2IntMap.Entry inventoryEntry : ingredientStacks.object2IntEntrySet()) { + if (recipeInputEntry.getKey().test(inventoryEntry.getKey())) { + available = inventoryEntry.getIntValue(); + if (available > needed) { + inventoryEntry.setValue(available - needed); + needed -= available; + break; + } else { + inventoryEntry.setValue(0); + recipeInputEntry.setValue(needed - available); + needed -= available; + } + } + } + // We need to check >= available here because of Non-Consumable inputs with stack size. If there is a NC + // input + // with size 2, and only 1 in the input, needed will be equal to available, but this situation should still + // fail + // as not all inputs are present + if (needed >= available) { + return 0; + } + } + + // Return the maximum parallel limit here if there are only non-consumed inputs, which are all found in the + // input bus + // At this point, we would have already returned 0 if we were missing any non-consumable inputs, so we can omit + // that check + if (countableMap.isEmpty() && !notConsumableMap.isEmpty()) { + return parallelAmount; + } + + // Iterate through the recipe inputs + for (Object2IntMap.Entry recipeInputEntry : countableMap.object2IntEntrySet()) { + int needed = recipeInputEntry.getIntValue(); + int available = 0; + // For every stack in the ingredients gathered from the input bus. + for (Object2IntMap.Entry inventoryEntry : ingredientStacks.object2IntEntrySet()) { + if (recipeInputEntry.getKey().test(inventoryEntry.getKey())) { + available += inventoryEntry.getIntValue(); + } + } + if (available >= needed) { + int ratio = Math.min(parallelAmount, available / needed); + if (ratio < minMultiplier) { + minMultiplier = ratio; + } + } else { + return 0; + } + } + return minMultiplier; + } + @Override public @NotNull List createXEIContainerContents(List contents, GTRecipe recipe, IO io) { var outputStacks = contents.stream().map(content -> content.content) diff --git a/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/RecipeCapability.java b/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/RecipeCapability.java index b4232f5cd0..e697a0820e 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/RecipeCapability.java +++ b/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/RecipeCapability.java @@ -6,6 +6,7 @@ import com.gregtechceu.gtceu.api.recipe.content.ContentModifier; import com.gregtechceu.gtceu.api.recipe.content.IContentSerializer; import com.gregtechceu.gtceu.api.recipe.lookup.AbstractMapIngredient; +import com.gregtechceu.gtceu.api.recipe.modifier.ParallelLogic; import com.gregtechceu.gtceu.api.recipe.ui.GTRecipeTypeUI; import com.lowdragmc.lowdraglib.gui.widget.Widget; import com.lowdragmc.lowdraglib.gui.widget.WidgetGroup; @@ -15,7 +16,6 @@ import org.apache.commons.lang3.mutable.MutableInt; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.UnknownNullability; import java.util.*; @@ -65,19 +65,6 @@ public final T copyContent(Object content, ContentModifier modifier) { return copyWithModifier((T) content, modifier); } - /** - * Convert the passed object to a list of recipe lookup filters. - * @param ingredient ingredient. e.g. for ITEM, this can be Ingredient or ItemStack - * @return a list of recipe lookup filters. - */ - public List convertToMapIngredient(Object ingredient) { - return List.of(); - } - - public List compressIngredients(Collection ingredients) { - return new ArrayList<>(ingredients); - } - /** * used for recipe builder via KubeJs. */ @@ -101,13 +88,54 @@ public boolean isRecipeSearchFilter() { return false; } + /** + * Convert the passed object to a list of recipe lookup filters. + * @param ingredient ingredient. e.g. for ITEM, this can be Ingredient or ItemStack + * @return a list of recipe lookup filters. + */ + public List convertToMapIngredient(Object ingredient) { + return List.of(); + } + + public List compressIngredients(Collection ingredients) { + return new ArrayList<>(ingredients); + } + /** * Does the recipe test if this capability is workable? if not, you should test validity somewhere else. */ + @SuppressWarnings("BooleanMethodIsAlwaysInverted") public boolean doMatchInRecipe() { return true; } + /** + * maximum parallel amount based on the inputs (and possibly outputs) provided. + * + * @param recipe the recipe from which we get the input to product ratio + * @param holder the {@link IRecipeCapabilityHolder} that contains all the inputs and outputs of the machine. + * @param multiplier the maximum possible multiplied we can get from the input inventory + * see {@link ParallelLogic#getMaxRecipeMultiplier(GTRecipe, IRecipeCapabilityHolder, int)} + * @return the amount of times a {@link GTRecipe} outputs can be merged into an inventory without voiding products. + */ + // returns Integer.MAX_VALUE by default, to skip processing. + public int limitParallel(GTRecipe recipe, IRecipeCapabilityHolder holder, int multiplier) { + return Integer.MAX_VALUE; + } + + /** + * Finds the maximum number of GTRecipes that can be performed at the same time based on the contents of input inventories + * + * @param holder The {@link IRecipeCapabilityHolder} that contains all the inputs and outputs of the machine. + * @param recipe The {@link GTRecipe} for which to find the maximum that can be run simultaneously + * @param parallelAmount The limit on the amount of recipes that can be performed at one time + * @return The Maximum number of GTRecipes that can be performed at a single time based on the available Items + */ + // returns Integer.MAX_VALUE by default, to skip processing. + public int getMaxParallelRatio(IRecipeCapabilityHolder holder, GTRecipe recipe, int parallelAmount) { + return Integer.MAX_VALUE; + } + public boolean doAddGuiSlots() { return isRecipeSearchFilter(); } @@ -126,7 +154,7 @@ public Object createXEIContainer(List contents) { return null; } - @UnknownNullability("null when getWidgetClass() == null") + @Nullable("null when getWidgetClass() == null") public Widget createWidget() { return null; } @@ -140,9 +168,9 @@ public void applyWidgetInfo(@NotNull Widget widget, int index, boolean isXEI, IO io, - GTRecipeTypeUI.@UnknownNullability("null when storage == null") RecipeHolder recipeHolder, + @Nullable("null when storage == null") GTRecipeTypeUI.RecipeHolder recipeHolder, @NotNull GTRecipeType recipeType, - @UnknownNullability("null when content == null") GTRecipe recipe, + @Nullable("null when content == null") GTRecipe recipe, @Nullable Content content, @Nullable Object storage) { diff --git a/src/main/java/com/gregtechceu/gtceu/api/cover/filter/FluidFilter.java b/src/main/java/com/gregtechceu/gtceu/api/cover/filter/FluidFilter.java index 349ee888b9..205982224b 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/cover/filter/FluidFilter.java +++ b/src/main/java/com/gregtechceu/gtceu/api/cover/filter/FluidFilter.java @@ -5,6 +5,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.ItemLike; import org.apache.commons.lang3.NotImplementedException; import java.util.HashMap; @@ -19,7 +20,7 @@ */ public interface FluidFilter extends Filter { - Map> FILTERS = new HashMap<>(); + Map> FILTERS = new HashMap<>(); static FluidFilter loadFilter(ItemStack itemStack) { return FILTERS.get(itemStack.getItem()).apply(itemStack); diff --git a/src/main/java/com/gregtechceu/gtceu/api/cover/filter/ItemFilter.java b/src/main/java/com/gregtechceu/gtceu/api/cover/filter/ItemFilter.java index b3321c59b0..2c82713ade 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/cover/filter/ItemFilter.java +++ b/src/main/java/com/gregtechceu/gtceu/api/cover/filter/ItemFilter.java @@ -4,6 +4,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.ItemLike; import org.apache.commons.lang3.NotImplementedException; import java.util.HashMap; @@ -18,7 +19,7 @@ */ public interface ItemFilter extends Filter { - Map> FILTERS = new HashMap<>(); + Map> FILTERS = new HashMap<>(); static ItemFilter loadFilter(ItemStack itemStack) { return FILTERS.get(itemStack.getItem()).apply(itemStack); diff --git a/src/main/java/com/gregtechceu/gtceu/api/cover/filter/SimpleFluidFilter.java b/src/main/java/com/gregtechceu/gtceu/api/cover/filter/SimpleFluidFilter.java index 931fd9a58e..e8b807ec6a 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/cover/filter/SimpleFluidFilter.java +++ b/src/main/java/com/gregtechceu/gtceu/api/cover/filter/SimpleFluidFilter.java @@ -101,7 +101,7 @@ public WidgetGroup openConfigurator(int x, int y) { fluidStorageSlots[index] = new FluidStorage(maxStackSize); fluidStorageSlots[index].setFluid(matches[index]); - var tank = new ScrollablePhantomFluidWidget(fluidStorageSlots[index], i * 18, j * 18) { + var tank = new ScrollablePhantomFluidWidget(fluidStorageSlots[index], 0, i * 18, j * 18, 18, 18, () -> fluidStorageSlots[index].getFluid(), (fluid) -> fluidStorageSlots[index].setFluid(fluid)) { @Override public void updateScreen() { super.updateScreen(); diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/chemical/ChemicalHelper.java b/src/main/java/com/gregtechceu/gtceu/api/data/chemical/ChemicalHelper.java index 57a507f401..6402658a9e 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/chemical/ChemicalHelper.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/chemical/ChemicalHelper.java @@ -100,7 +100,7 @@ public static void registerUnificationItems(UnificationEntry unificationEntry, S } @SafeVarargs - public static void registerUnificationItems(TagPrefix tagPrefix, @Nullable Material material, Supplier... items) { + public static void registerUnificationItems(TagPrefix tagPrefix, @Nullable Material material, Supplier... items) { registerUnificationItems(new UnificationEntry(tagPrefix, material), items); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagPrefix.java b/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagPrefix.java index ec0a9b3726..2912197a9f 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagPrefix.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagPrefix.java @@ -34,6 +34,7 @@ import lombok.experimental.Accessors; import net.minecraft.client.renderer.RenderType; import net.minecraft.core.Registry; +import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; @@ -48,7 +49,6 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.NoteBlockInstrument; import net.minecraft.world.level.material.MaterialColor; -import org.apache.logging.log4j.util.TriConsumer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -93,6 +93,14 @@ public static TagPrefix get(String name) { .langValue("Andesite %s Ore") .registerOre(Blocks.ANDESITE::defaultBlockState, () -> GTMaterials.Andesite, BlockBehaviour.Properties.of(net.minecraft.world.level.material.Material.DIRT).color(MaterialColor.DIRT).requiresCorrectToolForDrops().strength(3.0F, 3.0F), new ResourceLocation("block/andesite")); + public static final TagPrefix oreRedGranite = oreTagPrefix("red_granite", BlockTags.MINEABLE_WITH_PICKAXE) + .langValue("Red Granite %s Ore") + .registerOre(() -> GTBlocks.RED_GRANITE.getDefaultState(), () -> GTMaterials.GraniteRed, BlockBehaviour.Properties.of(net.minecraft.world.level.material.Material.STONE).color(MaterialColor.TERRACOTTA_RED).requiresCorrectToolForDrops().strength(3.0F, 3.0F), GTCEu.id("block/red_granite")); + + public static final TagPrefix oreMarble = oreTagPrefix("marble", BlockTags.MINEABLE_WITH_PICKAXE) + .langValue("Red Granite %s Ore") + .registerOre(() -> GTBlocks.MARBLE.getDefaultState(), () -> GTMaterials.Marble, BlockBehaviour.Properties.of(net.minecraft.world.level.material.Material.STONE).color(MaterialColor.QUARTZ).requiresCorrectToolForDrops().strength(3.0F, 3.0F), GTCEu.id("block/marble")); + public static final TagPrefix oreDeepslate = oreTagPrefix("deepslate", BlockTags.MINEABLE_WITH_PICKAXE) .langValue("Deepslate %s Ore") .registerOre(Blocks.DEEPSLATE::defaultBlockState, () -> GTMaterials.Deepslate, BlockBehaviour.Properties.of(net.minecraft.world.level.material.Material.STONE).color(MaterialColor.DEEPSLATE).requiresCorrectToolForDrops().strength(4.5F, 3.0F), new ResourceLocation("block/deepslate"), false, false, true); @@ -721,7 +729,7 @@ public record BlockProperties(Supplier> renderType, UnaryOp @Setter private BiConsumer> tooltip; - private final Map[]> ignoredMaterials = new HashMap<>(); + private final Map[]> ignoredMaterials = new HashMap<>(); private final Object2FloatMap materialAmounts = new Object2FloatOpenHashMap<>(); @Getter @@ -893,10 +901,15 @@ public boolean doGenerateBlock(Material material) { return generateBlock && !isIgnored(material) && (generationCondition == null || generationCondition.test(material)) || hasItemTable() && this.itemTable.get() != null && getItemFromTable(material) != null; } - public > void executeHandler(PropertyKey propertyKey, TriConsumer handler) { + @FunctionalInterface + public interface MaterialRecipeHandler> { + void accept(TagPrefix prefix, Material material, T property, Consumer provider); + } + + public > void executeHandler(Consumer provider, PropertyKey propertyKey, MaterialRecipeHandler handler) { for (Material material : GTCEuAPI.materialManager.getRegisteredMaterials()) { if (material.hasProperty(propertyKey) && !material.hasFlag(MaterialFlags.NO_UNIFICATION) && !ChemicalHelper.get(this, material).isEmpty()) { - handler.accept(this, material, material.getProperty(propertyKey)); + handler.accept(this, material, material.getProperty(propertyKey), provider); } } } @@ -931,7 +944,7 @@ public boolean isIgnored(Material material) { } @SafeVarargs - public final void setIgnored(Material material, Supplier... items) { + public final void setIgnored(Material material, Supplier... items) { ignoredMaterials.put(material, items); if (items.length > 0) { ChemicalHelper.registerUnificationItems(this, material, items); @@ -962,7 +975,7 @@ public void removeIgnored(Material material) { ignoredMaterials.remove(material); } - public Map[]> getIgnored() { + public Map[]> getIgnored() { return new HashMap<>(ignoredMaterials); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/GTOreDefinition.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/GTOreDefinition.java index d046d2fd53..8bbb746c29 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/GTOreDefinition.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/GTOreDefinition.java @@ -1,13 +1,11 @@ package com.gregtechceu.gtceu.api.data.worldgen; -import com.gregtechceu.gtceu.api.data.chemical.material.Material; import com.gregtechceu.gtceu.api.data.worldgen.generator.IndicatorGenerator; import com.gregtechceu.gtceu.api.data.worldgen.generator.VeinGenerator; import com.gregtechceu.gtceu.api.data.worldgen.generator.indicators.SurfaceIndicatorGenerator; import com.gregtechceu.gtceu.api.data.worldgen.generator.veins.*; import com.gregtechceu.gtceu.api.data.worldgen.ores.OreVeinUtil; import com.gregtechceu.gtceu.api.registry.GTRegistries; -import com.gregtechceu.gtceu.config.ConfigHolder; import com.mojang.datafixers.util.Pair; import com.mojang.serialization.Codec; import com.mojang.serialization.DataResult; @@ -25,6 +23,8 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; +import net.minecraft.util.valueproviders.ConstantInt; +import net.minecraft.util.valueproviders.IntProvider; import net.minecraft.world.level.Level; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.levelgen.VerticalAnchor; @@ -44,6 +44,7 @@ * @date 2023/6/14 * @implNote GTOreDefinition */ +@SuppressWarnings("unused") @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault @Accessors(chain = true, fluent = true) @@ -57,7 +58,7 @@ public class GTOreDefinition { .orElseGet(() -> DataResult.error("GTOreDefinition " + obj + " not registered"))); public static final Codec FULL_CODEC = RecordCodecBuilder.create( instance -> instance.group( - Codec.INT.fieldOf("cluster_size").forGetter(ft -> ft.clusterSize), + IntProvider.NON_NEGATIVE_CODEC.fieldOf("cluster_size").forGetter(ft -> ft.clusterSize), Codec.floatRange(0.0F, 1.0F).fieldOf("density").forGetter(ft -> ft.density), Codec.INT.fieldOf("weight").forGetter(ft -> ft.weight), IWorldGenLayer.CODEC.fieldOf("layer").forGetter(ft -> ft.layer), @@ -75,7 +76,7 @@ public class GTOreDefinition { private final InferredProperties inferredProperties = new InferredProperties(); @Getter - private int clusterSize; + private IntProvider clusterSize; @Getter private float density; @Getter @@ -99,11 +100,6 @@ public class GTOreDefinition { @Getter @Setter private List indicatorGenerators; - @Getter @Setter - private int minimumYield, maximumYield, depletedYield, depletionChance, depletionAmount = 1; - @Setter - private List> bedrockVeinMaterial; - public GTOreDefinition(GTOreDefinition other) { this( other.clusterSize, other.density, other.weight, other.layer, @@ -112,7 +108,7 @@ public GTOreDefinition(GTOreDefinition other) { ); } - public GTOreDefinition(int clusterSize, float density, int weight, IWorldGenLayer layer, Set> dimensionFilter, HeightRangePlacement range, float discardChanceOnAirExposure, @Nullable Supplier> biomes, @Nullable BiomeWeightModifier biomeWeightModifier, @Nullable VeinGenerator veinGenerator, @Nullable List indicatorGenerators) { + public GTOreDefinition(IntProvider clusterSize, float density, int weight, IWorldGenLayer layer, Set> dimensionFilter, HeightRangePlacement range, float discardChanceOnAirExposure, @Nullable Supplier> biomes, @Nullable BiomeWeightModifier biomeWeightModifier, @Nullable VeinGenerator veinGenerator, @Nullable List indicatorGenerators) { this.clusterSize = clusterSize; this.density = density; this.weight = weight; @@ -124,8 +120,6 @@ public GTOreDefinition(int clusterSize, float density, int weight, IWorldGenLaye this.biomeWeightModifier = biomeWeightModifier; this.veinGenerator = veinGenerator; this.indicatorGenerators = Objects.requireNonNullElseGet(indicatorGenerators, ArrayList::new); - - recomputeBedrockOres(); } @HideFromJS @@ -133,31 +127,23 @@ public void register(ResourceLocation id) { GTRegistries.ORE_VEINS.registerOrOverride(id, this); } - private void recomputeBedrockOres() { - this.maximumYield = (int) (density * 100) * clusterSize; - this.minimumYield = this.maximumYield / 7; - this.depletedYield = (int) (clusterSize / density / 10); - this.depletionChance = (int) (weight * density / 5); + public GTOreDefinition clusterSize(IntProvider clusterSize) { + this.clusterSize = clusterSize; + return this; } public GTOreDefinition clusterSize(int clusterSize) { - this.clusterSize = clusterSize; - recomputeBedrockOres(); - + this.clusterSize = ConstantInt.of(clusterSize); return this; } public GTOreDefinition density(float density) { this.density = density; - recomputeBedrockOres(); - return this; } public GTOreDefinition weight(int weight) { this.weight = weight; - recomputeBedrockOres(); - return this; } @@ -166,7 +152,6 @@ public GTOreDefinition layer(IWorldGenLayer layer) { if (this.dimensionFilter == null || this.dimensionFilter.isEmpty()) { dimensions(layer.getLevels().toArray(ResourceLocation[]::new)); } - return this; } @@ -313,18 +298,6 @@ private T getOrCreateIndicatorGenerator(Class return generator; } - @HideFromJS - public List> getBedrockVeinMaterials() { - if (bedrockVeinMaterial == null) { - if (ConfigHolder.INSTANCE.machines.doBedrockOres) { - bedrockVeinMaterial = this.veinGenerator().getValidMaterialsChances(); - } else { - bedrockVeinMaterial = List.of(); - } - } - return bedrockVeinMaterial; - } - private static class InferredProperties { public Pair heightRange = null; } diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/BedrockFluidDefinition.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/BedrockFluidDefinition.java index bd2961427a..258cb4e1f8 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/BedrockFluidDefinition.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/BedrockFluidDefinition.java @@ -3,10 +3,12 @@ import com.gregtechceu.gtceu.api.data.worldgen.BiomeWeightModifier; import com.gregtechceu.gtceu.api.registry.GTRegistries; import com.gregtechceu.gtceu.common.data.GTBedrockFluids; +import com.gregtechceu.gtceu.utils.RegistryUtil; import com.mojang.datafixers.util.Pair; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import dev.latvian.mods.rhino.util.HideFromJS; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; @@ -25,6 +27,7 @@ import java.util.*; import java.util.function.Supplier; +import java.util.stream.Collectors; public class BedrockFluidDefinition { public static final MapCodec> YIELD = Codec.mapPair(Codec.INT.fieldOf("min"), Codec.INT.fieldOf("max")); @@ -124,7 +127,6 @@ public static class Builder { private int depletedYield; // yield after the vein is depleted @Setter private Supplier fluid; // the fluid which the vein contains - @Setter private Set> dimensions; private final List biomes = new LinkedList<>(); @@ -164,6 +166,16 @@ public Builder biomes(int weight, HolderSet biomes) { return this; } + @HideFromJS + public Builder dimensions(Set> dimensions) { + this.dimensions = dimensions; + return this; + } + + public Builder dimensions(String... dimensions) { + return this.dimensions(new HashSet<>(RegistryUtil.resolveResourceKeys(Registry.DIMENSION_REGISTRY, dimensions))); + } + public BedrockFluidDefinition register() { var definition = new BedrockFluidDefinition(weight, minimumYield, maximumYield, depletionAmount, depletionChance, depletedYield, fluid, biomes, dimensions); GTBedrockFluids.toReRegister.put(name, definition); diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/BedrockOreDefinition.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/BedrockOreDefinition.java index 74473e4b6d..fbc853e417 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/BedrockOreDefinition.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/BedrockOreDefinition.java @@ -5,10 +5,12 @@ import com.gregtechceu.gtceu.api.data.worldgen.BiomeWeightModifier; import com.gregtechceu.gtceu.api.registry.GTRegistries; import com.gregtechceu.gtceu.common.data.GTOres; +import com.gregtechceu.gtceu.utils.RegistryUtil; import com.mojang.datafixers.util.Pair; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import dev.latvian.mods.rhino.util.HideFromJS; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; @@ -130,7 +132,6 @@ public static class Builder { private int depletedYield; // yield after the vein is depleted @Setter private List> materials; // the ores which the vein contains - @Setter private Set> dimensions; private final List biomes = new LinkedList<>(); @@ -177,6 +178,16 @@ public Builder biomes(int weight, HolderSet biomes) { return this; } + @HideFromJS + public Builder dimensions(Set> dimensions) { + this.dimensions = dimensions; + return this; + } + + public Builder dimensions(String... dimensions) { + return this.dimensions(new HashSet<>(RegistryUtil.resolveResourceKeys(Registry.DIMENSION_REGISTRY, dimensions))); + } + public BedrockOreDefinition register() { var definition = new BedrockOreDefinition(weight, size, yield, depletionAmount, depletionChance, depletedYield, materials, biomes, dimensions); GTOres.toReRegisterBedrock.put(name, definition); diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/BedrockOreVeinSavedData.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/BedrockOreVeinSavedData.java index 8ce3af83ca..8e564bf454 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/BedrockOreVeinSavedData.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/BedrockOreVeinSavedData.java @@ -113,6 +113,11 @@ public OreVeinWorldEntry getOreVeinWorldEntry(int chunkX, int chunkZ) { createVein(pos, definition); setDirty(); } + if (!veinOres.containsKey(pos)) { + OreVeinWorldEntry entry = new OreVeinWorldEntry(null, 0, MAXIMUM_VEIN_OPERATIONS); + veinOres.put(pos, entry); + return entry; + } return veinOres.get(pos); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/ClassicVeinGenerator.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/ClassicVeinGenerator.java index 0c4d645688..69b1142be6 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/ClassicVeinGenerator.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/ClassicVeinGenerator.java @@ -100,7 +100,7 @@ public List, Integer>> getAllEntries() { public Map generate(WorldGenLevel level, RandomSource random, GTOreDefinition entry, BlockPos origin) { Map generatedBlocks = new Object2ObjectOpenHashMap<>(); - int radius = entry.clusterSize(); + int radius = entry.clusterSize().sample(random); int ySize = radius / 2; int xy2 = radius * radius * ySize * ySize; int xz2 = radius * radius * radius * radius; diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/CuboidVeinGenerator.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/CuboidVeinGenerator.java index 78c83820ad..797041bfd6 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/CuboidVeinGenerator.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/CuboidVeinGenerator.java @@ -77,7 +77,7 @@ public List, Integer>> getAllEntries() { public Map generate(WorldGenLevel level, RandomSource random, GTOreDefinition entry, BlockPos origin) { Map generatedBlocks = new Object2ObjectOpenHashMap<>(); - int size = entry.clusterSize(); + int size = entry.clusterSize().sample(random); int westBound = origin.getX() - random.nextInt(size); int eastBound = origin.getX() + random.nextInt(size); diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/DikeVeinGenerator.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/DikeVeinGenerator.java index 280814f710..075ed447c6 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/DikeVeinGenerator.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/DikeVeinGenerator.java @@ -77,7 +77,7 @@ public Map generate(WorldGenLevel level, RandomSource ChunkPos chunkPos = new ChunkPos(origin); float density = entry.density(); - int size = entry.clusterSize(); + int size = entry.clusterSize().sample(random); int radius = Mth.ceil(size / 2f); diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/LayeredVeinGenerator.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/LayeredVeinGenerator.java index 0f73c2bb66..00134e7faa 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/LayeredVeinGenerator.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/LayeredVeinGenerator.java @@ -75,7 +75,7 @@ public Map generate(WorldGenLevel level, RandomSource GTLayerPattern layerPattern = patternPool.get(random.nextInt(patternPool.size())); - int size = entry.clusterSize(); + int size = entry.clusterSize().sample(random); float density = entry.density(); int radius = Mth.ceil(size / 2f); diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/StandardVeinGenerator.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/StandardVeinGenerator.java index 04428fcada..c81a078fb2 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/StandardVeinGenerator.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/StandardVeinGenerator.java @@ -134,9 +134,10 @@ public Codec codec() { public Map generate(WorldGenLevel level, RandomSource random, GTOreDefinition entry, BlockPos origin) { Map generatedBlocks = new Object2ObjectOpenHashMap<>(); + int size = entry.clusterSize().sample(random); float f = random.nextFloat() * (float) Math.PI; - float f1 = (float) entry.clusterSize() / 8.0F; - int i = Mth.ceil(((float) entry.clusterSize() / 16.0F * 2.0F + 1.0F) / 2.0F); + float f1 = size / 8.0F; + int i = Mth.ceil((size / 16.0F * 2.0F + 1.0F) / 2.0F); double minX = origin.getX() + Math.sin(f) * f1; double maxX = origin.getX() - Math.sin(f) * f1; double minZ = origin.getZ() + Math.cos(f) * f1; @@ -169,7 +170,7 @@ protected void doPlaceNormal(Map generatedBlocks, Rand MutableInt placedAmount = new MutableInt(1); BitSet placedBlocks = new BitSet(pWidth * pHeight * pWidth); BlockPos.MutableBlockPos posCursor = new BlockPos.MutableBlockPos(); - int size = entry.clusterSize(); + int size = entry.clusterSize().sample(random); float density = entry.density(); double[] shape = new double[size * 4]; diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/VeinedVeinGenerator.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/VeinedVeinGenerator.java index 8f53373914..7e6414b228 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/VeinedVeinGenerator.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/generator/veins/VeinedVeinGenerator.java @@ -133,7 +133,7 @@ public Map generate(WorldGenLevel level, RandomSource DensityFunction veinToggle = mapToNoise(BuiltinRegistries.DENSITY_FUNCTION.get(GTFeatures.NEW_ORE_VEIN_TOGGLE), randomState); DensityFunction veinRidged = mapToNoise(BuiltinRegistries.DENSITY_FUNCTION.get(GTFeatures.NEW_ORE_VEIN_RIDGED), randomState); - int size = entry.clusterSize(); + int size = entry.clusterSize().sample(random); int radius = Mth.ceil(size / 2f); diff --git a/src/main/java/com/gregtechceu/gtceu/api/gui/widget/ProspectingMapWidget.java b/src/main/java/com/gregtechceu/gtceu/api/gui/widget/ProspectingMapWidget.java index ff3f3b4e57..906e0789a5 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/gui/widget/ProspectingMapWidget.java +++ b/src/main/java/com/gregtechceu/gtceu/api/gui/widget/ProspectingMapWidget.java @@ -4,7 +4,7 @@ import com.gregtechceu.gtceu.api.gui.misc.PacketProspecting; import com.gregtechceu.gtceu.api.gui.misc.ProspectorMode; import com.gregtechceu.gtceu.api.gui.texture.ProspectingTexture; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.common.item.ProspectorScannerBehavior; import com.lowdragmc.lowdraglib.gui.editor.ColorPattern; import com.lowdragmc.lowdraglib.gui.texture.IGuiTexture; @@ -143,7 +143,7 @@ public void detectAndSendChanges() { chunkIndex++; } var held = player.getItemInHand(InteractionHand.MAIN_HAND); - if (held.getItem() instanceof ComponentItem componentItem) { + if (held.getItem() instanceof IComponentItem componentItem) { for (var component : componentItem.getComponents()) { if (component instanceof ProspectorScannerBehavior prospector) { if (!player.isCreative() && !prospector.drainEnergy(held, false)) { diff --git a/src/main/java/com/gregtechceu/gtceu/api/gui/widget/ScrollablePhantomFluidWidget.java b/src/main/java/com/gregtechceu/gtceu/api/gui/widget/ScrollablePhantomFluidWidget.java index a825f4f466..b7b2089769 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/gui/widget/ScrollablePhantomFluidWidget.java +++ b/src/main/java/com/gregtechceu/gtceu/api/gui/widget/ScrollablePhantomFluidWidget.java @@ -4,28 +4,22 @@ import com.lowdragmc.lowdraglib.gui.widget.PhantomFluidWidget; import com.lowdragmc.lowdraglib.side.fluid.FluidHelper; import com.lowdragmc.lowdraglib.side.fluid.FluidStack; -import com.lowdragmc.lowdraglib.side.fluid.IFluidStorage; import com.lowdragmc.lowdraglib.side.fluid.IFluidTransfer; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.util.Mth; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import org.jetbrains.annotations.Nullable; +import java.util.function.Consumer; +import java.util.function.Supplier; + public class ScrollablePhantomFluidWidget extends PhantomFluidWidget { private static final int SCROLL_ACTION_ID = 0x0001_0001; private static final long MILLIBUCKETS = FluidHelper.getBucket() / 1000; - public ScrollablePhantomFluidWidget() { - } - - public ScrollablePhantomFluidWidget(IFluidStorage fluidTank, int x, int y) { - super(fluidTank, x, y); - } - - public ScrollablePhantomFluidWidget(@Nullable IFluidStorage fluidTank, int x, int y, int width, int height) { - super(fluidTank, x, y, width, height); + public ScrollablePhantomFluidWidget(@Nullable IFluidTransfer fluidTank, int tank, int x, int y, int width, int height, Supplier phantomFluidGetter, Consumer phantomFluidSetter) { + super(fluidTank, tank, x, y, width, height, phantomFluidGetter, phantomFluidSetter); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/api/gui/widget/directional/handlers/CoverableConfigHandler.java b/src/main/java/com/gregtechceu/gtceu/api/gui/widget/directional/handlers/CoverableConfigHandler.java index 411bb6239d..ae637d24ee 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/gui/widget/directional/handlers/CoverableConfigHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/api/gui/widget/directional/handlers/CoverableConfigHandler.java @@ -9,7 +9,7 @@ import com.gregtechceu.gtceu.api.gui.widget.CoverConfigurator; import com.gregtechceu.gtceu.api.gui.widget.PredicatedButtonWidget; import com.gregtechceu.gtceu.api.gui.widget.directional.IDirectionalConfigHandler; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.component.IItemComponent; import com.gregtechceu.gtceu.common.item.CoverPlaceBehavior; import com.lowdragmc.lowdraglib.gui.texture.GuiTextureGroup; @@ -96,7 +96,7 @@ private void coverItemChanged() { } if (!item.isEmpty() && machine.getCoverAtSide(side) == null) { - if (item.getItem() instanceof ComponentItem componentItem) { + if (item.getItem() instanceof IComponentItem componentItem) { for (IItemComponent component : componentItem.getComponents()) { if (component instanceof CoverPlaceBehavior placeBehavior) { machine.placeCoverOnSide(side, item, placeBehavior.coverDefinition(), serverPlayer); diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/ComponentItem.java b/src/main/java/com/gregtechceu/gtceu/api/item/ComponentItem.java index 9e865d8e07..ba6520370f 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/ComponentItem.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/ComponentItem.java @@ -42,7 +42,7 @@ */ @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -public class ComponentItem extends Item implements HeldItemUIFactory.IHeldItemUIHolder, IItemRendererProvider { +public class ComponentItem extends Item implements HeldItemUIFactory.IHeldItemUIHolder, IItemRendererProvider, IComponentItem { protected int burnTime = -1; @@ -58,6 +58,11 @@ public static ComponentItem create(Properties properties) { return new ComponentItem(properties); } + public void attachComponents(IItemComponent component) { + this.components.add(component); + component.onAttached(this); + } + public void attachComponents(IItemComponent... components) { this.components.addAll(Arrays.asList(components)); for (IItemComponent component : components) { @@ -245,6 +250,7 @@ public boolean hasCraftingRemainingItem(ItemStack stack) { return super.hasCraftingRemainingItem(stack); } + @Override public LazyOptional getCapability(@NotNull final ItemStack itemStack, @NotNull final Capability cap) { for (IItemComponent component : components) { if (component instanceof IComponentCapability componentCapability) { diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/IComponentItem.java b/src/main/java/com/gregtechceu/gtceu/api/item/IComponentItem.java new file mode 100644 index 0000000000..46b637c440 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/api/item/IComponentItem.java @@ -0,0 +1,27 @@ +package com.gregtechceu.gtceu.api.item; + +import com.gregtechceu.gtceu.api.item.component.IItemComponent; +import net.minecraft.core.NonNullList; +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.ItemLike; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.util.LazyOptional; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public interface IComponentItem extends ItemLike { + + List getComponents(); + + void attachComponents(IItemComponent... components); + + default LazyOptional getCapability(@NotNull final ItemStack itemStack, @NotNull final Capability cap) { + return LazyOptional.empty(); + } + + default void fillItemCategory(CreativeModeTab category, NonNullList items) { + + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java b/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java index ca91945523..742857cd48 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java @@ -383,7 +383,7 @@ default int getTotalHarvestLevel(ItemStack stack) { } else { if (result == -1) { if (getBehaviorsTag(stack).getBoolean(TREE_FELLING_KEY) && state.is(BlockTags.LOGS)) { - new TreeFellingHelper().fellTree(stack, player.level, state, pos, player); + TreeFellingHelper.fellTree(stack, player.level, state, pos, player); } if (playSoundOnBlockDestroy()) playSound(player); } else { diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/TagPrefixItem.java b/src/main/java/com/gregtechceu/gtceu/api/item/TagPrefixItem.java index 144a387050..d27ce5ba5c 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/TagPrefixItem.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/TagPrefixItem.java @@ -6,6 +6,7 @@ import com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey; import com.gregtechceu.gtceu.api.data.damagesource.DamageSources; import com.gregtechceu.gtceu.api.data.tag.TagPrefix; +import com.gregtechceu.gtceu.api.item.armor.ArmorComponentItem; import com.gregtechceu.gtceu.client.renderer.item.TagPrefixItemRenderer; import com.lowdragmc.lowdraglib.Platform; import net.minecraft.MethodsReturnNonnullByDefault; @@ -103,10 +104,9 @@ public void inventoryTick(ItemStack stack, Level level, Entity entity, int slotI float heatDamage = ((material.getBlastTemperature() - 1750) / 1000.0F) + 2; ItemStack armor = livingEntity.getItemBySlot(EquipmentSlot.CHEST); - // TODO armor -// if (!armor.isEmpty() && armor.getItem() instanceof ArmorMetaItem) { -// heatDamage *= ((ArmorMetaItem) armor.getItem()).getItem(armor).getArmorLogic().getHeatResistance(); -// } + if (!armor.isEmpty() && armor.getItem() instanceof ArmorComponentItem armorItem) { + heatDamage *= armorItem.getArmorLogic().getHeatResistance(); + } if (heatDamage > 0.0) { livingEntity.hurt(DamageSources.getHeatDamage().bypassArmor(), heatDamage); } else if (heatDamage < 0.0) { diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/armor/ArmorComponentItem.java b/src/main/java/com/gregtechceu/gtceu/api/item/armor/ArmorComponentItem.java new file mode 100644 index 0000000000..66e6e5b0e4 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/api/item/armor/ArmorComponentItem.java @@ -0,0 +1,288 @@ +package com.gregtechceu.gtceu.api.item.armor; + +import com.google.common.base.Preconditions; +import com.google.common.collect.*; +import com.gregtechceu.gtceu.api.item.IComponentItem; +import com.gregtechceu.gtceu.api.item.component.*; +import com.gregtechceu.gtceu.api.item.component.forge.IComponentCapability; +import lombok.Getter; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.core.NonNullList; +import net.minecraft.network.chat.Component; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.ai.attributes.Attribute; +import net.minecraft.world.entity.ai.attributes.AttributeModifier; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.*; +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.level.Level; +import net.minecraftforge.client.extensions.common.IClientItemExtensions; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.util.LazyOptional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.function.Consumer; + +public class ArmorComponentItem extends ArmorItem implements IComponentItem { + @Getter + private IArmorLogic armorLogic = new DummyArmorLogic(); + @Getter + protected List components; + + public ArmorComponentItem(ArmorMaterial material, EquipmentSlot type, Properties properties) { + super(material, type, properties); + components = new ArrayList<>(); + } + + public ArmorComponentItem setArmorLogic(IArmorLogic armorLogic) { + Preconditions.checkNotNull(armorLogic, "Cannot set ArmorLogic to null"); + this.armorLogic = armorLogic; + this.armorLogic.addToolComponents(this); + return this; + } + + public void attachComponents(IItemComponent... components) { + this.components.addAll(Arrays.asList(components)); + for (IItemComponent component : components) { + component.onAttached(this); + } + } + + @Override + public Multimap getAttributeModifiers(EquipmentSlot slot, ItemStack stack) { + Multimap multimap = ArrayListMultimap.create(); + IArmorLogic armorLogic = getArmorLogic(); + multimap.putAll(armorLogic.getAttributeModifiers(slot, stack)); + multimap.putAll(super.getAttributeModifiers(slot, stack)); + return multimap; + } + + @Override + public @Nullable EquipmentSlot getEquipmentSlot(ItemStack stack) { + return armorLogic.getArmorType(); + } + + @Override + public void onArmorTick(ItemStack stack, Level level, Player player) { + super.onArmorTick(stack, level, player); + this.armorLogic.onArmorTick(level, player, stack); + } + + @Override + public boolean isValidRepairItem(ItemStack stack, ItemStack repairCandidate) { + return false; + } + + @Override + public boolean isEnchantable(ItemStack stack) { + return true; + } + + @Override + public int getEnchantmentValue() { + return 50; + } + + public int getArmorDisplay(Player player, @NotNull ItemStack armor, EquipmentSlot slot) { + return armorLogic.getArmorDisplay(player, armor, slot); + } + + public void damageArmor(LivingEntity entity, @NotNull ItemStack stack, DamageSource source, int damage, EquipmentSlot slot) { + armorLogic.damageArmor(entity, stack, source, damage, slot); + } + + @Override + public void initializeClient(Consumer consumer) { + consumer.accept(new IClientItemExtensions() { + @Override + public @NotNull HumanoidModel getHumanoidArmorModel(LivingEntity livingEntity, ItemStack itemStack, EquipmentSlot equipmentSlot, HumanoidModel original) { + return armorLogic.getArmorModel(livingEntity, itemStack, equipmentSlot, original); + } + }); + } + + @Nullable + @Override + public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { + return armorLogic.getArmorTexture(stack, entity, slot, type).toString(); + } + + /////////////////////////////////////////// + ///// ALL component item things /////// + /////////////////////////////////////////// + + public void fillItemCategory(CreativeModeTab category, NonNullList items) { + boolean found = false; + for (IItemComponent component : components) { + if (component instanceof ISubItemHandler subItemHandler) { + subItemHandler.fillItemCategory(this, category, items); + found = true; + } + } + if (found) return; + items.add(new ItemStack(this)); + } + + @Override + public void appendHoverText(ItemStack stack, @Nullable Level level, List tooltipComponents, TooltipFlag isAdvanced) { + for (IItemComponent component : components) { + if (component instanceof IAddInformation addInformation) { + addInformation.appendHoverText(stack, level, tooltipComponents, isAdvanced); + } + } + } + + @Override + public boolean isBarVisible(ItemStack stack) { + for (IItemComponent component : components) { + if (component instanceof IDurabilityBar durabilityBar) { + return durabilityBar.isBarVisible(stack); + } + } + return super.isBarVisible(stack); + } + + @Override + public int getBarWidth(ItemStack stack) { + for (IItemComponent component : components) { + if (component instanceof IDurabilityBar durabilityBar) { + return durabilityBar.getBarWidth(stack); + } + } + return super.getBarWidth(stack); + } + + @Override + public int getBarColor(ItemStack stack) { + for (IItemComponent component : components) { + if (component instanceof IDurabilityBar durabilityBar) { + return durabilityBar.getBarColor(stack); + } + } + return super.getBarColor(stack); + } + + @Override + public InteractionResult useOn(UseOnContext context) { + for (IItemComponent component : components) { + if (component instanceof IInteractionItem interactionItem) { + var result = interactionItem.useOn(context); + if (result != InteractionResult.PASS) { + return result; + } + } + } + return super.useOn(context); + } + + @Override + public InteractionResultHolder use(Level level, Player player, InteractionHand usedHand) { + for (IItemComponent component : components) { + if (component instanceof IInteractionItem interactionItem) { + var result = interactionItem.use(this, level, player, usedHand); + if (result.getResult() != InteractionResult.PASS) { + return result; + } + } + } + return super.use(level, player, usedHand); + } + + @Override + public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity livingEntity) { + for (IItemComponent component : components) { + if (component instanceof IInteractionItem interactionItem) { + stack = interactionItem.finishUsingItem(stack, level, livingEntity); + } + } + return super.finishUsingItem(stack, level, livingEntity); + } + + @Override + public InteractionResult onItemUseFirst(ItemStack itemStack, UseOnContext context) { + for (IItemComponent component : components) { + if (component instanceof IInteractionItem interactionItem) { + var result = interactionItem.onItemUseFirst(itemStack, context); + if (result != InteractionResult.PASS) { + return result; + } + } + } + return InteractionResult.PASS; + } + + @Override + public InteractionResult interactLivingEntity(ItemStack stack, Player player, LivingEntity interactionTarget, InteractionHand usedHand) { + for (IItemComponent component : components) { + if (component instanceof IInteractionItem interactionItem) { + var result = interactionItem.interactLivingEntity(stack, player, interactionTarget, usedHand); + if (result != InteractionResult.PASS) { + return result; + } + } + } + return InteractionResult.PASS; + } + + @Override + public String getDescriptionId(ItemStack stack) { + for (IItemComponent component : components) { + if (component instanceof ICustomDescriptionId customDescriptionId) { + return customDescriptionId.getItemStackDisplayName(stack); + } + } + return super.getDescriptionId(stack); + } + + @Override + public void inventoryTick(ItemStack stack, Level level, Entity entity, int slotId, boolean isSelected) { + for (IItemComponent component : components) { + if (component instanceof IItemLifeCycle lifeCycle) { + lifeCycle.inventoryTick(stack, level, entity, slotId, isSelected); + } + } + } + + @Override + public ItemStack getCraftingRemainingItem(ItemStack itemStack) { + for (IItemComponent component : components) { + if (component instanceof IRecipeRemainder recipeRemainder) { + return recipeRemainder.getRecipeRemained(itemStack); + } + } + return super.getCraftingRemainingItem(itemStack); + } + + @Override + public boolean hasCraftingRemainingItem(ItemStack stack) { + for (IItemComponent component : components) { + if (component instanceof IRecipeRemainder recipeRemainder) { + return recipeRemainder.getRecipeRemained(stack) != ItemStack.EMPTY; + } + } + return super.hasCraftingRemainingItem(stack); + } + + @Override + public LazyOptional getCapability(@NotNull final ItemStack itemStack, @NotNull final Capability cap) { + for (IItemComponent component : components) { + if (component instanceof IComponentCapability componentCapability) { + var value = componentCapability.getCapability(itemStack, cap); + if (value.isPresent()) { + return value; + } + } + } + return LazyOptional.empty(); + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/armor/ArmorLogicSuite.java b/src/main/java/com/gregtechceu/gtceu/api/item/armor/ArmorLogicSuite.java new file mode 100644 index 0000000000..f07c4b5c2c --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/api/item/armor/ArmorLogicSuite.java @@ -0,0 +1,141 @@ +package com.gregtechceu.gtceu.api.item.armor; + +import com.google.common.collect.ImmutableMultimap; +import com.google.common.collect.Multimap; +import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; +import com.gregtechceu.gtceu.api.capability.IElectricItem; +import com.gregtechceu.gtceu.api.item.component.ElectricStats; +import com.gregtechceu.gtceu.api.item.component.IItemHUDProvider; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.ai.attributes.Attribute; +import net.minecraft.world.entity.ai.attributes.AttributeModifier; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ArmorItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.UUID; + +public abstract class ArmorLogicSuite implements IArmorLogic, IItemHUDProvider { + + protected final int energyPerUse; + protected final int tier; + protected final long maxCapacity; + protected final EquipmentSlot type; + + protected ArmorLogicSuite(int energyPerUse, long maxCapacity, int tier, EquipmentSlot type) { + this.energyPerUse = energyPerUse; + this.maxCapacity = maxCapacity; + this.tier = tier; + this.type = type; + } + + @Override + public abstract void onArmorTick(Level Level, Player player, ItemStack itemStack); + + @Override + public int getArmorDisplay(Player player, @NotNull ItemStack armor, EquipmentSlot slot) { + IElectricItem item = GTCapabilityHelper.getElectricItem(armor); + if (item == null) return 0; + if (item.getCharge() >= energyPerUse) { + return (int) Math.round(20.0F * this.getAbsorption() * this.getDamageAbsorption()); + } else { + return (int) Math.round(4.0F * this.getAbsorption() * this.getDamageAbsorption()); + } + } + + @Override + public Multimap getAttributeModifiers(EquipmentSlot slot, ItemStack stack) { + if (slot != this.type) return ImmutableMultimap.of(); + IElectricItem item = GTCapabilityHelper.getElectricItem(stack); + UUID uuid = IArmorLogic.ARMOR_MODIFIER_UUID_PER_TYPE.get(type); + if (item == null) return ImmutableMultimap.of(); + if (item.getCharge() >= energyPerUse) { + return ImmutableMultimap.of(Attributes.ARMOR, new AttributeModifier(uuid, "Armor modifier", 20.0F * this.getAbsorption() * this.getDamageAbsorption(), AttributeModifier.Operation.ADDITION)); + } else { + return ImmutableMultimap.of(Attributes.ARMOR, new AttributeModifier(uuid, "Armor modifier", 4.0F * this.getAbsorption() * this.getDamageAbsorption(), AttributeModifier.Operation.ADDITION)); + } + } + + @Override + public void addToolComponents(ArmorComponentItem mvi) { + mvi.attachComponents(new ElectricStats(maxCapacity, tier, true, false) { + @Override + public InteractionResultHolder use(Item item, Level level, Player player, InteractionHand usedHand) { + return onRightClick(level, player, usedHand); + } + + @Override + public void appendHoverText(ItemStack stack, @Nullable Level level, List tooltipComponents, TooltipFlag isAdvanced) { + addInfo(stack, tooltipComponents); + } + }); + } + + public void addInfo(ItemStack itemStack, List lines) { + + } + + public InteractionResultHolder onRightClick(Level Level, Player player, InteractionHand hand) { + return InteractionResultHolder.pass(player.getItemInHand(hand)); + } + + @Override + public EquipmentSlot getArmorType() { + return type; + } + + @Override + public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { + return null; + } + + public double getDamageAbsorption() { + return 0; + } + + @OnlyIn(Dist.CLIENT) + protected static void addCapacityHUD(ItemStack stack, ArmorUtils.ModularHUD hud) { + IElectricItem cont = GTCapabilityHelper.getElectricItem(stack); + if (cont == null) return; + if (cont.getCharge() == 0) return; + float energyMultiplier = cont.getCharge() * 100.0F / cont.getMaxCharge(); + hud.newString(Component.translatable("metaarmor.hud.energy_lvl", String.format("%.1f", energyMultiplier) + "%")); + } + + @OnlyIn(Dist.CLIENT) + @Override + public boolean shouldDrawHUD() { + return this.type == EquipmentSlot.CHEST; + } + + public int getEnergyPerUse() { + return this.energyPerUse; + } + + protected float getAbsorption() { + return switch (this.getArmorType()) { + case HEAD, FEET -> + 0.15F; + case CHEST -> + 0.4F; + case LEGS -> + 0.3F; + default -> + 0.0F; + }; + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/armor/ArmorUtils.java b/src/main/java/com/gregtechceu/gtceu/api/item/armor/ArmorUtils.java new file mode 100644 index 0000000000..02da40f968 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/api/item/armor/ArmorUtils.java @@ -0,0 +1,272 @@ +package com.gregtechceu.gtceu.api.item.armor; + +import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; +import com.gregtechceu.gtceu.api.capability.IElectricItem; +import com.gregtechceu.gtceu.common.data.GTSoundEntries; +import com.gregtechceu.gtceu.config.ConfigHolder; +import com.gregtechceu.gtceu.core.mixins.ServerGamePacketListenerImplAccessor; +import com.gregtechceu.gtceu.utils.ItemStackHashStrategy; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.datafixers.util.Pair; +import it.unimi.dsi.fastutil.objects.Object2IntMap; +import it.unimi.dsi.fastutil.objects.Object2IntOpenCustomHashMap; +import net.minecraft.client.Minecraft; +import net.minecraft.core.NonNullList; +import net.minecraft.core.particles.ParticleOptions; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.util.Mth; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.food.FoodProperties; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +import javax.annotation.Nonnull; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class ArmorUtils { + + /** + * Check is possible to charge item + */ + public static boolean isPossibleToCharge(ItemStack chargeable) { + IElectricItem container = GTCapabilityHelper.getElectricItem(chargeable); + if (container != null) { + return container.getCharge() < container.getMaxCharge() && (container.getCharge() + container.getTransferLimit()) <= container.getMaxCharge(); + } + return false; + } + + /** + * Searches all three player inventories for items that can be charged + * + * @param tier of charger + * @return Map of the inventory and a list of the index of a chargable item + */ + public static List, List>> getChargeableItem(Player player, int tier) { + List, List>> inventorySlotMap = new ArrayList<>(); + + List openMainSlots = new ArrayList<>(); + for (int i = 0; i < player.getInventory().items.size(); i++) { + ItemStack current = player.getInventory().items.get(i); + IElectricItem item = GTCapabilityHelper.getElectricItem(current); + if (item == null) continue; + + if (isPossibleToCharge(current) && item.getTier() <= tier) { + openMainSlots.add(i); + } + } + + if(!openMainSlots.isEmpty()) { + inventorySlotMap.add(Pair.of(player.getInventory().items, openMainSlots)); + } + + + List openArmorSlots = new ArrayList<>(); + for(int i = 0; i < player.getInventory().armor.size(); i++) { + ItemStack current = player.getInventory().armor.get(i); + IElectricItem item = GTCapabilityHelper.getElectricItem(current); + if(item == null) { + continue; + } + + if(isPossibleToCharge(current) && item.getTier() <= tier) { + openArmorSlots.add(i); + } + } + + if(!openArmorSlots.isEmpty()) { + inventorySlotMap.add(Pair.of(player.getInventory().armor, openArmorSlots)); + } + + ItemStack offHand = player.getInventory().offhand.get(0); + IElectricItem offHandItem = GTCapabilityHelper.getElectricItem(offHand); + if(offHandItem == null) { + return inventorySlotMap; + } + + if(isPossibleToCharge(offHand) && offHandItem.getTier() <= tier) { + inventorySlotMap.add(Pair.of(player.getInventory().offhand, Collections.singletonList(0))); + } + + return inventorySlotMap; + } + + /** + * Spawn particle behind player with speedY speed + */ + public static void spawnParticle(Level world, Player player, ParticleOptions type, double speedY) { + if (type != null) { + Vec3 forward = player.getForward(); + world.addParticle(type, player.getX() - forward.x, player.getY() + 0.5D, player.getZ() - forward.z, 0.0D, speedY, 0.0D); + } + } + + public static void playJetpackSound(@Nonnull Player player) { + if (player.level.isClientSide()) { + float cons = (float) player.getDeltaMovement().y + player.moveDist; + cons = Mth.clamp(cons, 0.6F, 1.0F); + + if (player.getDeltaMovement().y > 0.05F) { + cons += 0.1F; + } + + if (player.getDeltaMovement().y < -0.05F) { + cons -= 0.4F; + } + + player.playSound(GTSoundEntries.JET_ENGINE.getMainEvent(), 0.3F, cons); + } + } + + /** + * Resets private field, amount of ticks player in the sky + */ + public static void resetPlayerFloatingTime(Player player) { + if (player instanceof ServerPlayer serverPlayer) { + ((ServerGamePacketListenerImplAccessor)serverPlayer.connection).setAboveGroundTickCount(0); + } + } + + /** + * This method feeds player with food, if food heal amount more than + * empty food gaps, then reminder adds to saturation + * + * @return result of eating food + */ + public static InteractionResultHolder canEat(Player player, ItemStack food) { + if (!food.isEdible()) { + return InteractionResultHolder.fail(food); + } + + FoodProperties foodItem = food.getItem().getFoodProperties(); + if (foodItem != null && player.getFoodData().needsFood()) { + if(!player.isCreative()) { + food.setCount(food.getCount() - 1); + } + + // Find the saturation of the food + float saturation = foodItem.getSaturationModifier(); + + // The amount of empty food haunches of the player + int hunger = 20 - player.getFoodData().getFoodLevel(); + + // Increase the saturation of the food if the food replenishes more than the amount of missing haunches + saturation += (hunger - foodItem.getNutrition()) < 0 ? foodItem.getNutrition() - hunger : 1.0F; + + // Use this method to add stats for compat with TFC, who overrides addStats(int amount, float saturation) for their food and does nothing + player.getFoodData().eat(hunger, saturation); + + return InteractionResultHolder.success(food); + } else { + return InteractionResultHolder.fail(food); + } + } + + /** + * Format itemstacks list from [1xitem@1, 1xitem@1, 1xitem@2] to + * [2xitem@1, 1xitem@2] + * + * @return Formated list + */ + public static List format(List input) { + Object2IntMap items = new Object2IntOpenCustomHashMap<>(ItemStackHashStrategy.comparingAllButCount()); + List output = new ArrayList<>(); + for (ItemStack itemStack : input) { + if (items.containsKey(itemStack)) { + int amount = items.get(itemStack); + items.replace(itemStack, ++amount); + } else { + items.put(itemStack, 1); + } + } + for (Object2IntMap.Entry entry : items.object2IntEntrySet()) { + ItemStack stack = entry.getKey().copy(); + stack.setCount(entry.getIntValue()); + output.add(stack); + } + return output; + } + + + @Nonnull + public static String format(long value) { + return new DecimalFormat("###,###.##").format(value); + } + + public static String format(double value) { + return new DecimalFormat("###,###.##").format(value); + } + + /** + * Modular HUD class for armor + * now available only string rendering, if will be needed, + * may be will add some additional functions + */ + @OnlyIn(Dist.CLIENT) + public static class ModularHUD { + private byte stringAmount = 0; + private final List stringList; + private static final Minecraft mc = Minecraft.getInstance(); + + public ModularHUD() { + this.stringList = new ArrayList<>(); + } + + public void newString(Component string) { + this.stringAmount++; + this.stringList.add(string); + } + + public void draw(PoseStack poseStack) { + for (int i = 0; i < stringAmount; i++) { + Pair coords = this.getStringCoord(i); + mc.font.draw(poseStack, stringList.get(i), coords.getFirst(), coords.getSecond(), 0xFFFFFF); + } + } + + @Nonnull + private Pair getStringCoord(int index) { + int posX; + int posY; + int fontHeight = mc.font.lineHeight; + int windowHeight = mc.getWindow().getGuiScaledHeight(); + int windowWidth = mc.getWindow().getGuiScaledWidth(); + int stringWidth = mc.font.width(stringList.get(index)); + switch (ConfigHolder.INSTANCE.client.armorHud.hudLocation) { + case 1 -> { + posX = 1 + ConfigHolder.INSTANCE.client.armorHud.hudOffsetX; + posY = 1 + ConfigHolder.INSTANCE.client.armorHud.hudOffsetY + (fontHeight * index); + } + case 2 -> { + posX = windowWidth - (1 + ConfigHolder.INSTANCE.client.armorHud.hudOffsetX) - stringWidth; + posY = 1 + ConfigHolder.INSTANCE.client.armorHud.hudOffsetY + (fontHeight * index); + } + case 3 -> { + posX = 1 + ConfigHolder.INSTANCE.client.armorHud.hudOffsetX; + posY = windowHeight - fontHeight * (stringAmount - index) - 1 - ConfigHolder.INSTANCE.client.armorHud.hudOffsetY; + } + case 4 -> { + posX = windowWidth - (1 + ConfigHolder.INSTANCE.client.armorHud.hudOffsetX) - stringWidth; + posY = windowHeight - fontHeight * (stringAmount - index) - 1 - ConfigHolder.INSTANCE.client.armorHud.hudOffsetY; + } + default -> + throw new IllegalArgumentException("Armor Hud config hudLocation is improperly configured. Allowed values: [1,2,3,4]"); + } + return Pair.of(posX, posY); + } + + public void reset() { + this.stringAmount = 0; + this.stringList.clear(); + } + + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/armor/DummyArmorLogic.java b/src/main/java/com/gregtechceu/gtceu/api/item/armor/DummyArmorLogic.java new file mode 100644 index 0000000000..8bedba962c --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/api/item/armor/DummyArmorLogic.java @@ -0,0 +1,31 @@ +package com.gregtechceu.gtceu.api.item.armor; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ArmorItem; +import net.minecraft.world.item.ItemStack; +import org.jetbrains.annotations.NotNull; + +public class DummyArmorLogic implements IArmorLogic { + @Override + public EquipmentSlot getArmorType() { + return EquipmentSlot.HEAD; + } + + @Override + public int getArmorDisplay(Player player, @NotNull ItemStack armor, EquipmentSlot slot) { + return 0; + } + + @Override + public boolean isValidArmor(ItemStack itemStack, Entity entity, EquipmentSlot equipmentSlot) { + return false; + } + + @Override + public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { + return new ResourceLocation("minecraft", "textures/armor/diamond_layer_0.png"); + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/armor/IArmorLogic.java b/src/main/java/com/gregtechceu/gtceu/api/item/armor/IArmorLogic.java new file mode 100644 index 0000000000..ffe70537b7 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/api/item/armor/IArmorLogic.java @@ -0,0 +1,95 @@ +package com.gregtechceu.gtceu.api.item.armor; + +import com.google.common.collect.ImmutableMultimap; +import com.google.common.collect.Multimap; +import net.minecraft.Util; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.ai.attributes.Attribute; +import net.minecraft.world.entity.ai.attributes.AttributeModifier; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ArmorItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.EnumMap; +import java.util.UUID; + +public interface IArmorLogic { + + UUID ATTACK_DAMAGE_MODIFIER = UUID.fromString("648D7064-6A60-4F59-8ABE-C2C23A6DD7A9"); + UUID ATTACK_SPEED_MODIFIER = UUID.fromString("FA233E1C-4180-4288-B05C-BCCE9785ACA3"); + EnumMap ARMOR_MODIFIER_UUID_PER_TYPE = Util.make(new EnumMap<>(EquipmentSlot.class), map -> { + map.put(EquipmentSlot.FEET, UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B")); + map.put(EquipmentSlot.LEGS, UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D")); + map.put(EquipmentSlot.CHEST, UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E")); + map.put(EquipmentSlot.HEAD, UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")); + }); + + default void addToolComponents(ArmorComponentItem item) { + } + + EquipmentSlot getArmorType(); + + /** + * Get the displayed effective armor. + * + * @return The number of armor points for display, 2 per shield. + */ + int getArmorDisplay(Player player, @NotNull ItemStack armor, EquipmentSlot slot); + + default boolean canBreakWithDamage(ItemStack stack) { + return false; + } + + default void damageArmor(LivingEntity entity, ItemStack itemStack, DamageSource source, int damage, EquipmentSlot equipmentSlot) { + + } + + default Multimap getAttributeModifiers(EquipmentSlot slot, ItemStack stack) { + return ImmutableMultimap.of(); + } + + default boolean isValidArmor(ItemStack itemStack, Entity entity, EquipmentSlot equipmentSlot) { + return getArmorType() == equipmentSlot; + } + + default void onArmorTick(Level world, Player player, ItemStack itemStack) { + } + + @OnlyIn(Dist.CLIENT) + default void renderHelmetOverlay(ItemStack itemStack, Player player, float partialTicks) { + } + + default int getArmorLayersAmount(ItemStack itemStack) { + return 1; + } + + default int getArmorLayerColor(ItemStack itemStack, int layerIndex) { + return 0xFFFFFF; + } + + @Nullable + ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type); + + @NotNull + default HumanoidModel getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlot armorSlot, HumanoidModel defaultModel) { + return defaultModel; + } + + /** + * + * @return the value to multiply heat damage by + */ + default float getHeatResistance() { + return 1.0f; + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/ElectricStats.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/ElectricStats.java index cf1d2f2aef..294520704f 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/component/ElectricStats.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/component/ElectricStats.java @@ -4,9 +4,9 @@ import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; import com.gregtechceu.gtceu.api.capability.IElectricItem; import com.gregtechceu.gtceu.api.capability.forge.GTCapability; -import com.gregtechceu.gtceu.api.item.ComponentItem; import com.gregtechceu.gtceu.api.item.capability.ElectricItem; import com.gregtechceu.gtceu.api.item.component.forge.IComponentCapability; +import com.gregtechceu.gtceu.core.mixins.ItemAccessor; import com.lowdragmc.lowdraglib.utils.LocalizationUtils; import net.minecraft.core.NonNullList; import net.minecraft.network.chat.Component; @@ -164,8 +164,8 @@ private static boolean isInDischargeMode(ItemStack itemStack) { } @Override - public void fillItemCategory(ComponentItem item, CreativeModeTab category, NonNullList items) { - if (item.allowedIn(category)) { + public void fillItemCategory(Item item, CreativeModeTab category, NonNullList items) { + if (((ItemAccessor)item).invokeAllowedIn(category)) { items.add(new ItemStack(item)); var stack = new ItemStack(item); var electricItem = GTCapabilityHelper.getElectricItem(stack); diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/IInteractionItem.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/IInteractionItem.java index fc83f54c36..f482a5b5a7 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/component/IInteractionItem.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/component/IInteractionItem.java @@ -23,7 +23,7 @@ default InteractionResult useOn(UseOnContext context) { default InteractionResultHolder use(Item item, Level level, Player player, InteractionHand usedHand) { if (item.isEdible()) { ItemStack itemStack = player.getItemInHand(usedHand); - if (player.canEat(item.getFoodProperties().canAlwaysEat())) { + if (player.canEat(itemStack.getFoodProperties(player).canAlwaysEat())) { player.startUsingItem(usedHand); return InteractionResultHolder.consume(itemStack); } else { diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/IItemComponent.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/IItemComponent.java index a5391e3e25..7cafcd4a17 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/component/IItemComponent.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/component/IItemComponent.java @@ -2,6 +2,7 @@ import com.gregtechceu.gtceu.api.item.ComponentItem; import net.minecraft.world.item.Item; +import com.gregtechceu.gtceu.api.item.IComponentItem; /** * @author KilaBash diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/IItemHUDProvider.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/IItemHUDProvider.java new file mode 100644 index 0000000000..db8b4b7463 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/api/item/component/IItemHUDProvider.java @@ -0,0 +1,43 @@ +package com.gregtechceu.gtceu.api.item.component; + +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +import javax.annotation.Nonnull; + +/** + * Provides a drawable HUD for the item + */ +public interface IItemHUDProvider extends IItemComponent { + + /** + * @return if the HUD needs to be drawn + */ + @OnlyIn(Dist.CLIENT) + default boolean shouldDrawHUD() { + return true; + } + + /** + * Draws the HUD + * + * @param stack the ItemStack to retrieve information from + */ + @OnlyIn(Dist.CLIENT) + default void drawHUD(ItemStack stack, PoseStack PoseStack) { + + } + + /** + * Checks and draws the hud for a provider + * + * @param provider the provider whose hud to draw + * @param stack the stack the provider should use + */ + @OnlyIn(Dist.CLIENT) + static void tryDrawHud(@Nonnull IItemHUDProvider provider, @Nonnull ItemStack stack, PoseStack PoseStack) { + if (provider.shouldDrawHUD()) provider.drawHUD(stack, PoseStack); + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/IMaterialPartItem.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/IMaterialPartItem.java index 3d4093688b..c166adf2ef 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/component/IMaterialPartItem.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/component/IMaterialPartItem.java @@ -2,7 +2,7 @@ import com.gregtechceu.gtceu.api.data.chemical.material.Material; import com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.common.data.GTMaterials; import com.lowdragmc.lowdraglib.utils.LocalizationUtils; import net.minecraft.client.color.item.ItemColor; @@ -89,7 +89,7 @@ default void appendHoverText(ItemStack stack, @org.jetbrains.annotations.Nullabl @OnlyIn(Dist.CLIENT) static ItemColor getItemStackColor() { return (itemStack, i) -> { - if (itemStack.getItem() instanceof ComponentItem componentItem) { + if (itemStack.getItem() instanceof IComponentItem componentItem) { for (IItemComponent component : componentItem.getComponents()) { if (component instanceof IMaterialPartItem materialPartItem) { return materialPartItem.getPartMaterial(itemStack).getMaterialARGB(); diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/ISubItemHandler.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/ISubItemHandler.java index dfb88a07fe..f120279119 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/component/ISubItemHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/component/ISubItemHandler.java @@ -1,8 +1,9 @@ package com.gregtechceu.gtceu.api.item.component; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.core.mixins.ItemAccessor; import net.minecraft.core.NonNullList; import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; /** @@ -11,8 +12,8 @@ * @implNote ISubItemHandler */ public interface ISubItemHandler extends IItemComponent { - default void fillItemCategory(ComponentItem item, CreativeModeTab category, NonNullList items) { - if (item.allowedIn(category)) { + default void fillItemCategory(Item item, CreativeModeTab category, NonNullList items) { + if (((ItemAccessor)item).invokeAllowedIn(category)) { items.add(new ItemStack(item)); } } diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/tool/ToolHelper.java b/src/main/java/com/gregtechceu/gtceu/api/item/tool/ToolHelper.java index 434d7b793b..4c904e411a 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/tool/ToolHelper.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/tool/ToolHelper.java @@ -26,9 +26,7 @@ import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.utils.DummyMachineBlockEntity; import com.gregtechceu.gtceu.utils.InfiniteEnergyContainer; -import com.lowdragmc.lowdraglib.Platform; import com.lowdragmc.lowdraglib.misc.ItemStackTransfer; -import com.simibubi.create.content.decoration.palettes.GlassPaneBlock; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.core.BlockPos; @@ -69,7 +67,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; import java.util.*; import java.util.function.Supplier; @@ -406,7 +403,7 @@ public static void applyHammerDropConversion(ServerLevel world, BlockPos pos, It caps.put(IO.OUT, ItemRecipeCapability.CAP, List.of(new NotifiableItemStackHandler(be.getMetaMachine(), 2, IO.OUT))); be.getMetaMachine().reinitializeCapabilities(caps); - Iterator hammerRecipes = GTRecipeTypes.FORGE_HAMMER_RECIPES.searchRecipe(Platform.getMinecraftServer().getRecipeManager(), be.metaMachine); + Iterator hammerRecipes = GTRecipeTypes.FORGE_HAMMER_RECIPES.searchRecipe(be.metaMachine); GTRecipe hammerRecipe = hammerRecipes == null || !hammerRecipes.hasNext() ? null : hammerRecipes.next(); if (hammerRecipe != null && hammerRecipe.handleRecipeIO(IO.IN, be.metaMachine)) { drops.clear(); @@ -435,7 +432,6 @@ public static void applyHammerDropConversion(ServerLevel world, BlockPos pos, It } } - @SuppressWarnings("BooleanMethodIsAlwaysInverted") public static boolean breakBlockRoutine(ServerPlayer player, ItemStack tool, BlockPos pos, boolean playSound) { // This is *not* a vanilla/forge convention, Forge never added "shears" to ItemShear's tool classes. if (isTool(tool, GTToolType.SHEARS) && shearBlockRoutine(player, tool, pos) == 0) { @@ -507,7 +503,7 @@ public static boolean removeBlockRoutine(@Nullable BlockState state, Level world boolean successful = world.removeBlock(pos, false); if (playSound) - world.levelEvent(2001, pos, Block.getId(state)); + world.levelEvent(LevelEvent.PARTICLES_DESTROY_BLOCK, pos, Block.getId(state)); if (successful) { state.getBlock().destroy(world, pos, state); diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/tool/TreeFellingHelper.java b/src/main/java/com/gregtechceu/gtceu/api/item/tool/TreeFellingHelper.java index de3a6da8c1..62fa7942b3 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/tool/TreeFellingHelper.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/tool/TreeFellingHelper.java @@ -4,7 +4,6 @@ import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -16,7 +15,7 @@ public class TreeFellingHelper { - public void fellTree(ItemStack stack, Level level, BlockState origin, BlockPos originPos, LivingEntity miner) { + public static void fellTree(ItemStack stack, Level level, BlockState origin, BlockPos originPos, LivingEntity miner) { BlockPos.MutableBlockPos mutablePos = new BlockPos.MutableBlockPos(); Queue checking = new ArrayDeque<>(); @@ -53,26 +52,17 @@ public void fellTree(ItemStack stack, Level level, BlockState origin, BlockPos o List orderedBlocks = visited.stream() .sorted(Comparator.comparingInt(pos -> pos.getY() - originPos.getY())) .collect(Collectors.toCollection(LinkedList::new)); - - int durabilityLeft = stack.getMaxDamage() - stack.getDamageValue(); - - if (durabilityLeft < orderedBlocks.size()) { - orderedBlocks.subList(durabilityLeft, orderedBlocks.size()).clear(); - } - - ToolHelper.damageItem(stack, serverPlayer); - - breakBlocksPerTick(serverPlayer, orderedBlocks, origin.getBlock()); + breakBlocksPerTick(serverPlayer, stack, orderedBlocks, origin.getBlock()); } } - public void breakBlocksPerTick(ServerPlayer player, List posList, Block originBlock) { + public static void breakBlocksPerTick(ServerPlayer player, ItemStack tool, List posList, Block originBlock) { for (int i = 0; i < posList.size(); i++) { int delayTick = i * 2; // 1 block per 2 tick BlockPos pos = posList.get(i); TaskHandler.enqueueServerTask(player.getLevel(), () -> { - if (player.getLevel().getBlockState(pos).is(originBlock)) { - player.getLevel().destroyBlock(pos, true); + if (player.level.getBlockState(pos).is(originBlock)) { + ToolHelper.breakBlockRoutine(player, tool, pos, true); } }, delayTick); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/machine/SimpleGeneratorMachine.java b/src/main/java/com/gregtechceu/gtceu/api/machine/SimpleGeneratorMachine.java index 667261227a..57d4af1fbb 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/machine/SimpleGeneratorMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/api/machine/SimpleGeneratorMachine.java @@ -80,7 +80,7 @@ public static GTRecipe recipeModifier(MetaMachine machine, @NotNull GTRecipe rec var EUt = RecipeHelper.getOutputEUt(recipe); if (EUt > 0) { var maxParallel = (int)(Math.min(generator.getOverclockVoltage(), GTValues.V[generator.getOverclockTier()]) / EUt); - return GTRecipeModifiers.fastParallel(generator, recipe, maxParallel, false).getA(); + return GTRecipeModifiers.fastParallel(generator, recipe, maxParallel, false).getFirst(); } } return null; diff --git a/src/main/java/com/gregtechceu/gtceu/api/machine/trait/NotifiableFluidTank.java b/src/main/java/com/gregtechceu/gtceu/api/machine/trait/NotifiableFluidTank.java index 317aea6394..79b7370382 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/machine/trait/NotifiableFluidTank.java +++ b/src/main/java/com/gregtechceu/gtceu/api/machine/trait/NotifiableFluidTank.java @@ -42,9 +42,6 @@ public class NotifiableFluidTank extends NotifiableRecipeHandlerTrait handleRecipeInner(IO io, GTRecipe recipe, List left, @Nullable String slotName, boolean simulate) { - return handleIngredient(io, left, simulate, this.handlerIO, storages); + return handleIngredient(io, recipe, left, simulate, this.handlerIO, storages); } @Nullable - public static List handleIngredient(IO io, List left, boolean simulate, IO handlerIO, FluidStorage[] storages) { + public static List handleIngredient(IO io, GTRecipe recipe, List left, boolean simulate, IO handlerIO, FluidStorage[] storages) { if (io != handlerIO) return left; var capabilities = simulate ? Arrays.stream(storages).map(FluidStorage::copy).toArray(FluidStorage[]::new) : storages; for (FluidStorage capability : capabilities) { @@ -156,28 +153,45 @@ public static List handleIngredient(IO io, List stack.isFluidEqual(this.lockedFluid.getFluid())); - return; + } else { + this.lockedFluid.setFluid(FluidStack.empty()); + setFilter(stack -> true); + onContentsChanged(); + } + } + + public void setLocked(boolean locked, FluidStack fluidStack) { + if (this.isLocked() == locked) return; + if (locked && !fluidStack.isEmpty()) { + this.lockedFluid.setFluid(fluidStack.copy()); + this.lockedFluid.getFluid().setAmount(1); + onContentsChanged(); + setFilter(stack -> stack.isFluidEqual(this.lockedFluid.getFluid())); + } else { + this.lockedFluid.setFluid(FluidStack.empty()); + setFilter(stack -> true); + onContentsChanged(); } - this.lockedFluid.setFluid(FluidStack.empty()); - setFilter(stack -> true); - onContentsChanged(); } public NotifiableFluidTank setFilter(Predicate filter) { diff --git a/src/main/java/com/gregtechceu/gtceu/api/machine/trait/RecipeLogic.java b/src/main/java/com/gregtechceu/gtceu/api/machine/trait/RecipeLogic.java index 58a61d37b8..56d3318a9d 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/machine/trait/RecipeLogic.java +++ b/src/main/java/com/gregtechceu/gtceu/api/machine/trait/RecipeLogic.java @@ -19,7 +19,6 @@ import com.lowdragmc.lowdraglib.syncdata.field.ManagedFieldHolder; import lombok.Getter; import lombok.Setter; -import net.minecraft.Util; import net.minecraft.network.chat.Component; import net.minecraft.world.item.crafting.RecipeManager; import net.minecraftforge.api.distmarker.Dist; @@ -31,7 +30,6 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -import java.util.concurrent.CompletableFuture; public class RecipeLogic extends MachineTrait implements IEnhancedManaged, IWorkable, IFancyTooltip { @@ -243,7 +241,7 @@ protected void doDamping() { } protected Iterator searchRecipe() { - return machine.getRecipeType().searchRecipe(getRecipeManager(), this.machine); + return machine.getRecipeType().searchRecipe(this.machine); } public void findAndHandleRecipe() { @@ -284,7 +282,7 @@ private void handleSearchingRecipes(Iterator matches) { public boolean handleFuelRecipe() { if (!needFuel() || fuelTime > 0) return true; - Iterator iterator = machine.getRecipeType().searchFuelRecipe(getRecipeManager(), machine); + Iterator iterator = machine.getRecipeType().searchFuelRecipe(machine); while (iterator != null && iterator.hasNext()) { GTRecipe recipe = iterator.next(); diff --git a/src/main/java/com/gregtechceu/gtceu/api/misc/FluidRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/api/misc/FluidRecipeHandler.java new file mode 100644 index 0000000000..ebeb994553 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/api/misc/FluidRecipeHandler.java @@ -0,0 +1,73 @@ +package com.gregtechceu.gtceu.api.misc; + +import com.gregtechceu.gtceu.api.capability.recipe.FluidRecipeCapability; +import com.gregtechceu.gtceu.api.capability.recipe.IO; +import com.gregtechceu.gtceu.api.capability.recipe.IRecipeHandler; +import com.gregtechceu.gtceu.api.capability.recipe.RecipeCapability; +import com.gregtechceu.gtceu.api.machine.trait.NotifiableFluidTank; +import com.gregtechceu.gtceu.api.recipe.GTRecipe; +import com.gregtechceu.gtceu.api.recipe.ingredient.FluidIngredient; +import com.lowdragmc.lowdraglib.misc.FluidStorage; +import com.lowdragmc.lowdraglib.side.fluid.FluidStack; +import com.lowdragmc.lowdraglib.syncdata.annotation.Persisted; +import lombok.Getter; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class FluidRecipeHandler implements IRecipeHandler { + @Getter + public final IO handlerIO; + @Persisted + @Getter + private final FluidStorage[] storages; + + public FluidRecipeHandler(IO handlerIO, int slots, long capacity) { + this.handlerIO = handlerIO; + this.storages = new FluidStorage[slots]; + for (int i = 0; i < this.storages.length; i++) { + this.storages[i] = new FluidStorage(capacity); + } + } + + @Override + public List handleRecipeInner(IO io, GTRecipe recipe, List left, @Nullable String slotName, boolean simulate) { + return NotifiableFluidTank.handleIngredient(io, recipe, left, simulate, this.handlerIO, getStorages()); + } + + @Override + public List getContents() { + List ingredients = new ArrayList<>(); + for (FluidStorage storage : getStorages()) { + FluidStack stack = storage.getFluid(); + if (!stack.isEmpty()) { + ingredients.add(stack); + } + } + return Arrays.asList(ingredients.toArray()); + } + + @Override + public double getTotalContentAmount() { + long amount = 0; + for (FluidStorage storage : getStorages()) { + FluidStack stack = storage.getFluid(); + if (!stack.isEmpty()) { + amount += stack.getAmount(); + } + } + return amount; + } + + @Override + public int getSize() { + return getStorages().length; + } + + @Override + public RecipeCapability getCapability() { + return FluidRecipeCapability.CAP; + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/api/pattern/BlockPattern.java b/src/main/java/com/gregtechceu/gtceu/api/pattern/BlockPattern.java index b53233757f..7bc31b630b 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/pattern/BlockPattern.java +++ b/src/main/java/com/gregtechceu/gtceu/api/pattern/BlockPattern.java @@ -18,6 +18,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; @@ -187,6 +188,7 @@ public void autoBuild(Player player, MultiblockState worldState) { Map cacheGlobal = worldState.getGlobalCount(); Map cacheLayer = worldState.getLayerCount(); Map blocks = new HashMap<>(); + Set placeBlockPos = new HashSet<>(); blocks.put(centerPos, controller); for (int c = 0, z = minZ++, r; c < this.fingerLength; c++) { for (r = 0; r < aisleRepetitions[c][0]; r++) { @@ -272,11 +274,12 @@ public void autoBuild(Player player, MultiblockState worldState) { // check inventory ItemStack found = null; + ItemStack originalItemStack = null; if (!player.isCreative()) { for (ItemStack itemStack : player.getInventory().items) { if (candidates.stream().anyMatch(candidate -> candidate.sameItem(itemStack)) && !itemStack.isEmpty() && itemStack.getItem() instanceof BlockItem) { found = itemStack.copy(); - itemStack.setCount(itemStack.getCount() - 1); + originalItemStack = itemStack; break; } } @@ -292,7 +295,13 @@ public void autoBuild(Player player, MultiblockState worldState) { if (found == null) continue; BlockItem itemBlock = (BlockItem) found.getItem(); BlockPlaceContext context = new BlockPlaceContext(world, player, InteractionHand.MAIN_HAND, found, BlockHitResult.miss(player.getEyePosition(0), Direction.UP, pos)); - itemBlock.place(context); + InteractionResult interactionResult = itemBlock.place(context); + if(interactionResult != InteractionResult.FAIL) { + placeBlockPos.add(pos); + if(originalItemStack != null) { + originalItemStack.setCount(originalItemStack.getCount() - 1); + } + } if (world.getBlockEntity(pos) instanceof IMachineBlockEntity machineBlockEntity) { blocks.put(pos, machineBlockEntity.getMetaMachine()); } else { @@ -307,7 +316,7 @@ public void autoBuild(Player player, MultiblockState worldState) { Direction frontFacing = controller.self().getFrontFacing(); blocks.forEach((pos, block) -> { // adjust facing if (!(block instanceof IMultiController)) { - if (block instanceof BlockState) { + if (block instanceof BlockState && placeBlockPos.contains(pos)) { resetFacing(pos, (BlockState) block, frontFacing, (p, f) -> { Object object = blocks.get(p.relative(f)); return object == null || (object instanceof BlockState && ((BlockState) object).getBlock() == Blocks.AIR); diff --git a/src/main/java/com/gregtechceu/gtceu/api/pattern/Predicates.java b/src/main/java/com/gregtechceu/gtceu/api/pattern/Predicates.java index c4a42d6109..5e350e424a 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/pattern/Predicates.java +++ b/src/main/java/com/gregtechceu/gtceu/api/pattern/Predicates.java @@ -1,5 +1,6 @@ package com.gregtechceu.gtceu.api.pattern; +import com.gregtechceu.gtceu.api.GTCEuAPI; import com.gregtechceu.gtceu.api.block.ActiveBlock; import com.gregtechceu.gtceu.api.block.ICoilType; import com.gregtechceu.gtceu.api.block.IMachineBlock; @@ -172,7 +173,7 @@ public static TraceabilityPredicate autoAbilities(boolean checkMaintenance, bool public static TraceabilityPredicate heatingCoils() { return new TraceabilityPredicate(blockWorldState -> { var blockState = blockWorldState.getBlockState(); - for (Map.Entry> entry : GTBlocks.ALL_COILS.entrySet()) { + for (Map.Entry> entry : GTCEuAPI.HEATING_COILS.entrySet()) { if (blockState.is(entry.getValue().get())) { var stats = entry.getKey(); Object currentCoil = blockWorldState.getMatchContext().getOrPut("CoilType", stats); @@ -184,7 +185,7 @@ public static TraceabilityPredicate heatingCoils() { } } return false; - }, () -> GTBlocks.ALL_COILS.entrySet().stream() + }, () -> GTCEuAPI.HEATING_COILS.entrySet().stream() // sort to make autogenerated jei previews not pick random coils each game load .sorted(Comparator.comparingInt(value -> value.getKey().getTier())) .map(coil -> BlockInfo.fromBlockState(coil.getValue().get().defaultBlockState())) @@ -195,7 +196,7 @@ public static TraceabilityPredicate heatingCoils() { public static TraceabilityPredicate cleanroomFilters() { return new TraceabilityPredicate(blockWorldState -> { var blockState = blockWorldState.getBlockState(); - for (var entry : GTBlocks.ALL_FILTERS.entrySet()) { + for (var entry : GTCEuAPI.CLEANROOM_FILTERS.entrySet()) { if (blockState.is(entry.getValue().get())) { var stats = entry.getKey(); Object currentCoil = blockWorldState.getMatchContext().getOrPut("FilterType", stats); @@ -207,7 +208,7 @@ public static TraceabilityPredicate cleanroomFilters() { } } return false; - }, () -> GTBlocks.ALL_FILTERS.values().stream() + }, () -> GTCEuAPI.CLEANROOM_FILTERS.values().stream() .map(blockSupplier -> BlockInfo.fromBlockState(blockSupplier.get().defaultBlockState())) .toArray(BlockInfo[]::new)) .addTooltips(Component.translatable("gtceu.multiblock.pattern.error.filters")); @@ -216,7 +217,7 @@ public static TraceabilityPredicate cleanroomFilters() { public static TraceabilityPredicate powerSubstationBatteries() { return new TraceabilityPredicate(blockWorldState -> { BlockState state = blockWorldState.getBlockState(); - for (Map.Entry> entry : GTBlocks.PSS_BATTERIES.entrySet()) { + for (Map.Entry> entry : GTCEuAPI.PSS_BATTERIES.entrySet()) { if (state.is(entry.getValue().get())) { IBatteryData battery = entry.getKey(); // Allow unfilled batteries in the structure, but do not add them to match context. @@ -231,7 +232,7 @@ public static TraceabilityPredicate powerSubstationBatteries() { } } return false; - }, () -> GTBlocks.PSS_BATTERIES.entrySet().stream() + }, () -> GTCEuAPI.PSS_BATTERIES.entrySet().stream() .sorted(Comparator.comparingInt(entry -> entry.getKey().getTier())) .map(entry -> new BlockInfo(entry.getValue().get().defaultBlockState(), null)) .toArray(BlockInfo[]::new)) diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeType.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeType.java index 74df64262c..d8dc5fba9e 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeType.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeType.java @@ -180,13 +180,12 @@ public GTRecipe getRecipe(RecipeManager recipeManager, ResourceLocation id) { } @Nullable - public Iterator searchFuelRecipe(RecipeManager recipeManager, IRecipeCapabilityHolder holder) { + public Iterator searchFuelRecipe(IRecipeCapabilityHolder holder) { if (!holder.hasProxies() || !isFuelRecipeType()) return null; return getLookup().getRecipeIterator(holder, recipe -> recipe.isFuel && recipe.matchRecipe(holder).isSuccess() && recipe.matchTickRecipe(holder).isSuccess()); } - @Nullable - public Iterator searchRecipe(RecipeManager recipeManager, IRecipeCapabilityHolder holder) { + public Iterator searchRecipe(IRecipeCapabilityHolder holder) { if (!holder.hasProxies()) return null; var iterator = getLookup().getRecipeIterator(holder, recipe -> !recipe.isFuel && recipe.matchRecipe(holder).isSuccess() && recipe.matchTickRecipe(holder).isSuccess()); boolean any = false; diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeHelper.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeHelper.java index d3d2348d47..1fc4dbfa35 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeHelper.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeHelper.java @@ -85,7 +85,7 @@ public static GTRecipe applyOverclock(OverclockingLogic logic, @NotNull GTRecipe * @param recipe the recipe to overclock * @return an int array of {OverclockedEUt, OverclockedDuration} */ - private static LongIntPair performOverclocking(OverclockingLogic logic, @NotNull GTRecipe recipe, long EUt, long maxOverclockVoltage) { + public static LongIntPair performOverclocking(OverclockingLogic logic, @NotNull GTRecipe recipe, long EUt, long maxOverclockVoltage) { int recipeTier = GTUtil.getTierByVoltage(EUt); int maximumTier = logic.getOverclockForTier(maxOverclockVoltage); // The maximum number of overclocks is determined by the difference between the tier the recipe is running at, diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/ResearchRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/ResearchRecipeBuilder.java index bcab66aeaa..9515d7fcea 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/ResearchRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/ResearchRecipeBuilder.java @@ -1,12 +1,13 @@ package com.gregtechceu.gtceu.api.recipe; import com.gregtechceu.gtceu.api.GTValues; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.component.IDataItem; import com.gregtechceu.gtceu.api.item.component.IItemComponent; import com.gregtechceu.gtceu.data.recipe.builder.GTRecipeBuilder; import com.gregtechceu.gtceu.utils.ResearchManager; import com.gregtechceu.gtceu.utils.GTStringUtils; +import dev.latvian.mods.kubejs.recipe.RecipeJS; import lombok.NoArgsConstructor; import net.minecraft.world.item.ItemStack; @@ -57,7 +58,7 @@ protected void validateResearchItem() { } boolean foundBehavior = false; - if (dataStack.getItem() instanceof ComponentItem metaItem) { + if (dataStack.getItem() instanceof IComponentItem metaItem) { for (IItemComponent behaviour : metaItem.getComponents()) { if (behaviour instanceof IDataItem) { foundBehavior = true; diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/ParallelLogic.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/ParallelLogic.java new file mode 100644 index 0000000000..fe752924e9 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/ParallelLogic.java @@ -0,0 +1,204 @@ +package com.gregtechceu.gtceu.api.recipe.modifier; + +import com.gregtechceu.gtceu.api.GTValues; +import com.gregtechceu.gtceu.api.capability.recipe.*; +import com.gregtechceu.gtceu.api.machine.MetaMachine; +import com.gregtechceu.gtceu.api.machine.feature.IOverclockMachine; +import com.gregtechceu.gtceu.api.machine.feature.IRecipeLogicMachine; +import com.gregtechceu.gtceu.api.machine.feature.ITieredMachine; +import com.gregtechceu.gtceu.api.recipe.GTRecipe; +import com.gregtechceu.gtceu.api.recipe.RecipeHelper; +import com.gregtechceu.gtceu.api.recipe.content.ContentModifier; +import com.mojang.datafixers.util.Pair; +import it.unimi.dsi.fastutil.ints.IntOpenHashSet; +import it.unimi.dsi.fastutil.ints.IntSet; +import it.unimi.dsi.fastutil.objects.*; +import lombok.AllArgsConstructor; +import net.minecraft.MethodsReturnNonnullByDefault; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.annotation.ParametersAreNonnullByDefault; +import java.util.function.Predicate; + +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +@AllArgsConstructor +public class ParallelLogic { + + @NotNull + public static Pair applyParallel(MetaMachine machine, @NotNull GTRecipe recipe, int parallelLimit, boolean modifyDuration) { + if (machine instanceof IRecipeLogicMachine rlm) { + return doParallelRecipes(recipe, rlm, parallelLimit, modifyDuration); + } + return Pair.of(recipe, 1); + } + + /** + * @param recipe The recipe + * @param holder The inventories + * @param parallelAmount hard cap on the amount returned + * @return returns the amount of possible time a recipe can be made from a given input inventory + */ + public static int getMaxRecipeMultiplier(@NotNull GTRecipe recipe, @NotNull IRecipeCapabilityHolder holder, int parallelAmount) { + IntSet multipliers = new IntOpenHashSet(); + + // non-tick inputs. + for (RecipeCapability cap : recipe.inputs.keySet()) { + if (cap.doMatchInRecipe()) { + // Find the maximum number of recipes that can be performed from the contents of the input inventories + multipliers.add(cap.getMaxParallelRatio(holder, recipe, parallelAmount)); + } + } + + + + // tick inputs. + for (RecipeCapability cap : recipe.tickInputs.keySet()) { + if (cap.doMatchInRecipe()) { + // Find the maximum number of recipes that can be performed from the contents of the input inventories + multipliers.add(cap.getMaxParallelRatio(holder, recipe, parallelAmount)); + } + } + if (multipliers.intStream().allMatch(value -> value == Integer.MAX_VALUE)) { + return 0; + } + // Find the maximum number of recipes that can be performed from all available inputs + return multipliers.intStream().min().orElse(0); + } + + /** + * @param recipe The recipe + * @param holder the inventories + * @param parallelAmount the maximum expected amount + * @param canVoid predicate for what parallel limits should be ignored + * @return returns the amount of recipes that can be merged successfully into a given output inventory + */ + public static int limitByOutputMerging(@NotNull GTRecipe recipe, @NotNull IRecipeCapabilityHolder holder, + int parallelAmount, Predicate> canVoid) { + Object2IntMap> modifiedParallelAmounts = new Object2IntOpenHashMap<>(); + boolean canVoidAll = true; + for (RecipeCapability cap : recipe.inputs.keySet()) { + modifiedParallelAmounts.put(cap, Integer.MAX_VALUE); + if (!canVoid.test(cap)) { + canVoidAll = false; + } + } + for (RecipeCapability cap : recipe.tickInputs.keySet()) { + modifiedParallelAmounts.put(cap, Integer.MAX_VALUE); + if (!canVoid.test(cap)) { + canVoidAll = false; + } + } + // If we are voiding everything, return the maximum number of parallels that can be performed from + // the inputs + if (canVoidAll) { + return parallelAmount; + } + + for (RecipeCapability cap : recipe.inputs.keySet()) { + if (!cap.doMatchInRecipe()) { + continue; + } + // Check both normal item outputs and chanced item outputs + if (!recipe.getOutputContents(cap).isEmpty()) { + boolean voiding = canVoid.test(cap); + // If we are voiding items, reset the item limit to the maximum number of parallels + if (voiding) { + modifiedParallelAmounts.put(cap, parallelAmount); + } else { + modifiedParallelAmounts.put(cap, cap.limitParallel(recipe, holder, parallelAmount)); + } + + // If we are not voiding, and cannot fit any items, return 0 + if (modifiedParallelAmounts.getInt(cap) == 0 && !voiding) { + return 0; + } + } + } + for (RecipeCapability cap : recipe.tickInputs.keySet()) { + if (!cap.doMatchInRecipe()) { + continue; + } + // Check both normal item outputs and chanced item outputs + if (!recipe.getTickOutputContents(cap).isEmpty()) { + boolean voiding = canVoid.test(cap); + // If we are voiding items, reset the item limit to the maximum number of parallels + if (voiding) { + if (modifiedParallelAmounts.containsKey(cap)) { + modifiedParallelAmounts.put(cap, modifiedParallelAmounts.getInt(cap) + parallelAmount); + } else { + modifiedParallelAmounts.put(cap, parallelAmount); + } + } else { + if (modifiedParallelAmounts.containsKey(cap)) { + modifiedParallelAmounts.put(cap, modifiedParallelAmounts.getInt(cap) + cap.limitParallel(recipe, holder, parallelAmount)); + } else { + modifiedParallelAmounts.put(cap, cap.limitParallel(recipe, holder, parallelAmount)); + } + } + + // If we are not voiding, and cannot fit any items, return 0 + if (modifiedParallelAmounts.getInt(cap) == 0 && !voiding) { + return 0; + } + } + } + + return modifiedParallelAmounts.values().intStream().min().orElse(0); + } + + /** + * Binary-search-like approach to find the maximum amount that can be inserted + * + * @param mergedAll if the merge was successful. + * If true sets {@code minMultiplier} to the as the current multiplier + * then sets {@code multiplier} to the sum of the mean difference between + * {@code multiplier} and {@code maxMultiplier} plus the remainder of the division, if any, + * and itself + * If false, sets {@code maxMultiplier} as the current multiplier, then sets {@code multiplier} + * to half of its value limited it to no less or than the value of {@code minMultiplier} + * @param minMultiplier the last known multiplier what was fully merged + * @param multiplier the current multiplier + * @param maxMultiplier the last know multiplier that resulted in simulation failure + * @return an array consisting of the last known multiplier, new multiplier to be attempted and + * the last know multiplier that resulted in failure + */ + public static int @NotNull [] adjustMultiplier(boolean mergedAll, int minMultiplier, int multiplier, + int maxMultiplier) { + if (mergedAll) { + minMultiplier = multiplier; + int remainder = (maxMultiplier - multiplier) % 2; + multiplier = multiplier + remainder + (maxMultiplier - multiplier) / 2; + } else { + maxMultiplier = multiplier; + multiplier = (multiplier + minMultiplier) / 2; + } + if (maxMultiplier - minMultiplier <= 1) { + multiplier = maxMultiplier = minMultiplier; + } + return new int[] { minMultiplier, multiplier, maxMultiplier }; + } + + // At this point, the recipe is already trimmed according to the item and fluid output limit, so we just need to + // take care of voiding + @NotNull + public static Pair doParallelRecipes(@NotNull GTRecipe currentRecipe, + @NotNull IRecipeLogicMachine machine, + int parallelAmount, boolean modifyDuration) { + // First check if we are limited by recipe inputs. This can short circuit a lot of consecutive checking + int multiplierByInputs = getMaxRecipeMultiplier(currentRecipe, machine, parallelAmount); + if (multiplierByInputs == 0) { + return Pair.of(currentRecipe, 1); + } + + // Simulate the merging of the maximum amount of recipes that can be run with these items + // and limit by the amount we can successfully merge + int limitByOutput = ParallelLogic.limitByOutputMerging(currentRecipe, machine, multiplierByInputs, machine::canVoidRecipeOutputs); + if (limitByOutput > 0) { + currentRecipe = currentRecipe.copy(ContentModifier.multiplier(limitByOutput), modifyDuration); + } + + return Pair.of(currentRecipe, limitByOutput); + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifier.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifier.java index ef27a120f0..a5b90e7ad2 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifier.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifier.java @@ -3,6 +3,8 @@ import com.gregtechceu.gtceu.api.machine.MetaMachine; import com.gregtechceu.gtceu.api.recipe.GTRecipe; import net.minecraft.MethodsReturnNonnullByDefault; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.annotation.ParametersAreNonnullByDefault; @@ -10,5 +12,6 @@ @ParametersAreNonnullByDefault @FunctionalInterface public interface RecipeModifier { - GTRecipe apply(MetaMachine machine, GTRecipe recipe); + @Nullable + GTRecipe apply(MetaMachine machine, @NotNull GTRecipe recipe); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifierList.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifierList.java index 3f1cb35d7f..8b40db1f57 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifierList.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/RecipeModifierList.java @@ -3,7 +3,9 @@ import com.gregtechceu.gtceu.api.machine.MetaMachine; import com.gregtechceu.gtceu.api.recipe.GTRecipe; import net.minecraft.MethodsReturnNonnullByDefault; +import org.jetbrains.annotations.NotNull; +import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; import java.util.List; @@ -16,12 +18,15 @@ public RecipeModifierList(RecipeModifier... modifiers) { this.modifiers = modifiers; } + @Nullable @Override - public GTRecipe apply(MetaMachine machine, GTRecipe recipe) { + public GTRecipe apply(MetaMachine machine, @NotNull GTRecipe recipe) { GTRecipe modifiedRecipe = recipe; for (RecipeModifier modifier : modifiers) { - modifiedRecipe = modifier.apply(machine, modifiedRecipe); + if (modifiedRecipe != null) { + modifiedRecipe = modifier.apply(machine, modifiedRecipe); + } } return modifiedRecipe; diff --git a/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/GTRegistrate.java b/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/GTRegistrate.java index c4253b262c..7a1a38de55 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/GTRegistrate.java +++ b/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/GTRegistrate.java @@ -118,6 +118,10 @@ public SoundEntryBuilder sound(String name) { return new SoundEntryBuilder(GTCEu.id(name)); } + public SoundEntryBuilder sound(ResourceLocation name) { + return new SoundEntryBuilder(name); + } + @Override public @NotNull ItemBuilder item(String name, NonNullFunction factory) { return super.item(name, factory).lang(FormattingUtil.toEnglishName(name.replaceAll("\\.", "_"))); diff --git a/src/main/java/com/gregtechceu/gtceu/client/ClientProxy.java b/src/main/java/com/gregtechceu/gtceu/client/ClientProxy.java index 191f43f1b4..3a29910fd2 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/ClientProxy.java +++ b/src/main/java/com/gregtechceu/gtceu/client/ClientProxy.java @@ -4,11 +4,21 @@ import com.gregtechceu.gtceu.api.gui.compass.GTCompassUIConfig; import com.gregtechceu.gtceu.api.gui.compass.GTRecipeViewCreator; import com.gregtechceu.gtceu.api.gui.compass.MultiblockAction; +import com.gregtechceu.gtceu.client.renderer.blockentity.GTSignRenderer; +import com.gregtechceu.gtceu.client.renderer.entity.GTExplosiveRenderer; import com.gregtechceu.gtceu.common.CommonProxy; +import com.gregtechceu.gtceu.common.data.GTBlockEntities; +import com.gregtechceu.gtceu.common.data.GTEntityTypes; +import com.gregtechceu.gtceu.utils.input.KeyBind; import com.lowdragmc.lowdraglib.gui.compass.CompassManager; import com.lowdragmc.lowdraglib.gui.compass.component.RecipeComponent; +import net.minecraft.client.renderer.entity.ThrownItemRenderer; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.client.event.EntityRenderersEvent; +import net.minecraftforge.client.event.RegisterGuiOverlaysEvent; +import net.minecraftforge.client.event.RegisterKeyMappingsEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; /** * @author KilaBash @@ -27,4 +37,23 @@ public static void init() { CompassManager.INSTANCE.registerUIConfig(GTCEu.MOD_ID, new GTCompassUIConfig()); CompassManager.INSTANCE.registerAction("multiblock", MultiblockAction::new); } + + @SubscribeEvent + public void onRegisterEntityRenderers(EntityRenderersEvent.RegisterRenderers event) { + event.registerEntityRenderer(GTEntityTypes.DYNAMITE.get(), ThrownItemRenderer::new); + event.registerEntityRenderer(GTEntityTypes.POWDERBARREL.get(), GTExplosiveRenderer::new); + event.registerEntityRenderer(GTEntityTypes.INDUSTRIAL_TNT.get(), GTExplosiveRenderer::new); + + event.registerBlockEntityRenderer(GTBlockEntities.GT_SIGN.get(), GTSignRenderer::new); + } + + @SubscribeEvent + public void registerKeyBindings(RegisterKeyMappingsEvent event) { + KeyBind.onRegisterKeyBinds(event); + } + + @SubscribeEvent + public void onRegisterGuiOverlays(RegisterGuiOverlaysEvent event) { + event.registerAboveAll("hud", new HudGuiOverlay()); + } } diff --git a/src/main/java/com/gregtechceu/gtceu/client/HudGuiOverlay.java b/src/main/java/com/gregtechceu/gtceu/client/HudGuiOverlay.java new file mode 100644 index 0000000000..5b489cef35 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/client/HudGuiOverlay.java @@ -0,0 +1,49 @@ +package com.gregtechceu.gtceu.client; + +import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorComponentItem; +import com.gregtechceu.gtceu.api.item.component.IItemComponent; +import com.gregtechceu.gtceu.api.item.component.IItemHUDProvider; +import com.mojang.blaze3d.vertex.PoseStack; +import lombok.NoArgsConstructor; +import net.minecraft.client.Minecraft; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.client.gui.overlay.ForgeGui; +import net.minecraftforge.client.gui.overlay.IGuiOverlay; +import org.jetbrains.annotations.NotNull; + +@NoArgsConstructor +public class HudGuiOverlay implements IGuiOverlay { + @Override + public void render(ForgeGui forgeGui, PoseStack PoseStack, float partialTick, int screenWidth, int screenHeight) { + Minecraft mc = Minecraft.getInstance(); + if (mc.isWindowActive() && mc.level != null && !mc.options.renderDebug && !mc.options.hideGui) { + renderHUDMetaArmor(mc.player.getItemBySlot(EquipmentSlot.HEAD), PoseStack); + renderHUDMetaArmor(mc.player.getItemBySlot(EquipmentSlot.CHEST), PoseStack); + renderHUDMetaArmor(mc.player.getItemBySlot(EquipmentSlot.LEGS), PoseStack); + renderHUDMetaArmor(mc.player.getItemBySlot(EquipmentSlot.FEET), PoseStack); + renderHUDMetaItem(mc.player.getItemInHand(InteractionHand.MAIN_HAND), PoseStack); + renderHUDMetaItem(mc.player.getItemInHand(InteractionHand.OFF_HAND), PoseStack); + } + } + + private static void renderHUDMetaArmor(@NotNull ItemStack stack, PoseStack PoseStack) { + if (stack.getItem() instanceof ArmorComponentItem valueItem) { + if (valueItem.getArmorLogic() instanceof IItemHUDProvider provider) { + IItemHUDProvider.tryDrawHud(provider, stack, PoseStack); + } + } + } + + private static void renderHUDMetaItem(@NotNull ItemStack stack, PoseStack PoseStack) { + if (stack.getItem() instanceof ComponentItem valueItem) { + for (IItemComponent behaviour : valueItem.getComponents()) { + if (behaviour instanceof IItemHUDProvider provider) { + IItemHUDProvider.tryDrawHud(provider, stack, PoseStack); + } + } + } + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/client/renderer/blockentity/GTSignRenderer.java b/src/main/java/com/gregtechceu/gtceu/client/renderer/blockentity/GTSignRenderer.java new file mode 100644 index 0000000000..399e3acb3d --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/client/renderer/blockentity/GTSignRenderer.java @@ -0,0 +1,189 @@ +package com.gregtechceu.gtceu.client.renderer.blockentity; + +import com.google.common.collect.ImmutableMap; +import com.gregtechceu.gtceu.common.blockentity.GTSignBlockEntity; +import com.mojang.blaze3d.platform.NativeImage; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import com.mojang.math.Vector3f; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; +import net.minecraft.client.model.Model; +import net.minecraft.client.model.geom.EntityModelSet; +import net.minecraft.client.model.geom.ModelLayers; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.CubeListBuilder; +import net.minecraft.client.model.geom.builders.LayerDefinition; +import net.minecraft.client.model.geom.builders.MeshDefinition; +import net.minecraft.client.model.geom.builders.PartDefinition; +import net.minecraft.client.player.LocalPlayer; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.Sheets; +import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; +import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; +import net.minecraft.client.renderer.blockentity.SignRenderer; +import net.minecraft.client.resources.model.Material; +import net.minecraft.core.Direction; +import net.minecraft.util.FormattedCharSequence; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SignBlock; +import net.minecraft.world.level.block.StandingSignBlock; +import net.minecraft.world.level.block.WallSignBlock; +import net.minecraft.world.level.block.entity.SignBlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.WoodType; +import net.minecraft.world.phys.Vec3; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +import java.util.List; +import java.util.Map; +import java.util.Objects; + +public class GTSignRenderer implements BlockEntityRenderer { + public static final int MAX_LINE_WIDTH = 90; + private static final int LINE_HEIGHT = 10; + private static final String STICK = "stick"; + private static final int BLACK_TEXT_OUTLINE_COLOR = -988212; + private static final int OUTLINE_RENDER_DISTANCE = Mth.square(16); + private final Map signModels; + private final Font font; + + public GTSignRenderer(BlockEntityRendererProvider.Context context) { + this.signModels = (Map)WoodType.values().collect(ImmutableMap.toImmutableMap((signType) -> { + return signType; + }, (signType) -> { + return new SignRenderer.SignModel(context.bakeLayer(ModelLayers.createSignModelName(signType))); + })); + this.font = context.getFont(); + } + + public void render(GTSignBlockEntity blockEntity, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) { + BlockState blockState = blockEntity.getBlockState(); + poseStack.pushPose(); + float f = 0.6666667F; + WoodType woodType = getWoodType(blockState.getBlock()); + SignRenderer.SignModel signModel = (SignRenderer.SignModel)this.signModels.get(woodType); + float g; + if (blockState.getBlock() instanceof StandingSignBlock) { + poseStack.translate(0.5, 0.5, 0.5); + g = -((float)(blockState.getValue(StandingSignBlock.ROTATION) * 360) / 16.0F); + poseStack.mulPose(Vector3f.YP.rotationDegrees(g)); + signModel.stick.visible = true; + } else { + poseStack.translate(0.5, 0.5, 0.5); + g = -blockState.getValue(WallSignBlock.FACING).toYRot(); + poseStack.mulPose(Vector3f.YP.rotationDegrees(g)); + poseStack.translate(0.0, -0.3125, -0.4375); + signModel.stick.visible = false; + } + + poseStack.pushPose(); + poseStack.scale(0.6666667F, -0.6666667F, -0.6666667F); + Material material = Sheets.getSignMaterial(woodType); + Objects.requireNonNull(signModel); + VertexConsumer vertexConsumer = material.buffer(bufferSource, signModel::renderType); + signModel.root.render(poseStack, vertexConsumer, packedLight, packedOverlay); + poseStack.popPose(); + float h = 0.010416667F; + poseStack.translate(0.0, 0.3333333432674408, 0.046666666865348816); + poseStack.scale(0.010416667F, -0.010416667F, 0.010416667F); + int i = getDarkColor(blockEntity); + FormattedCharSequence[] formattedCharSequences = blockEntity.getRenderMessages(Minecraft.getInstance().isTextFilteringEnabled(), (text) -> { + List list = this.font.split(text, 90); + return list.isEmpty() ? FormattedCharSequence.EMPTY : (FormattedCharSequence)list.get(0); + }); + int k; + boolean bl; + int l; + if (blockEntity.hasGlowingText()) { + k = blockEntity.getColor().getTextColor(); + bl = isOutlineVisible(blockEntity, k); + l = 15728880; + } else { + k = i; + bl = false; + l = packedLight; + } + + for(int m = 0; m < 4; ++m) { + FormattedCharSequence formattedCharSequence = formattedCharSequences[m]; + float n = (float)(-this.font.width(formattedCharSequence) / 2); + if (bl) { + this.font.drawInBatch8xOutline(formattedCharSequence, n, (float)(m * 10 - 20), k, i, poseStack.last().pose(), bufferSource, l); + } else { + this.font.drawInBatch(formattedCharSequence, n, (float)(m * 10 - 20), k, false, poseStack.last().pose(), bufferSource, false, 0, l); + } + } + + poseStack.popPose(); + } + + private static boolean isOutlineVisible(GTSignBlockEntity blockEntity, int textColor) { + if (textColor == DyeColor.BLACK.getTextColor()) { + return true; + } else { + Minecraft minecraft = Minecraft.getInstance(); + LocalPlayer localPlayer = minecraft.player; + if (localPlayer != null && minecraft.options.getCameraType().isFirstPerson() && localPlayer.isScoping()) { + return true; + } else { + Entity entity = minecraft.getCameraEntity(); + return entity != null && entity.distanceToSqr(Vec3.atCenterOf(blockEntity.getBlockPos())) < (double)OUTLINE_RENDER_DISTANCE; + } + } + } + + private static int getDarkColor(GTSignBlockEntity blockEntity) { + int i = blockEntity.getColor().getTextColor(); + double d = 0.4; + int j = (int)((double) NativeImage.getR(i) * 0.4); + int k = (int)((double)NativeImage.getG(i) * 0.4); + int l = (int)((double)NativeImage.getB(i) * 0.4); + return i == DyeColor.BLACK.getTextColor() && blockEntity.hasGlowingText() ? -988212 : NativeImage.combine(0, l, k, j); + } + + public static WoodType getWoodType(Block block) { + WoodType woodType; + if (block instanceof SignBlock) { + woodType = ((SignBlock)block).type(); + } else { + woodType = WoodType.OAK; + } + + return woodType; + } + + public static SignRenderer.SignModel createSignModel(EntityModelSet entityModelSet, WoodType woodType) { + return new SignRenderer.SignModel(entityModelSet.bakeLayer(ModelLayers.createSignModelName(woodType))); + } + + public static LayerDefinition createSignLayer() { + MeshDefinition meshDefinition = new MeshDefinition(); + PartDefinition partDefinition = meshDefinition.getRoot(); + partDefinition.addOrReplaceChild("sign", CubeListBuilder.create().texOffs(0, 0).addBox(-12.0F, -14.0F, -1.0F, 24.0F, 12.0F, 2.0F), PartPose.ZERO); + partDefinition.addOrReplaceChild("stick", CubeListBuilder.create().texOffs(0, 14).addBox(-1.0F, -2.0F, -1.0F, 2.0F, 14.0F, 2.0F), PartPose.ZERO); + return LayerDefinition.create(meshDefinition, 64, 32); + } + + @OnlyIn(Dist.CLIENT) + public static final class SignModel extends Model { + public final ModelPart root; + public final ModelPart stick; + + public SignModel(ModelPart root) { + super(RenderType::entityCutoutNoCull); + this.root = root; + this.stick = root.getChild("stick"); + } + + public void renderToBuffer(PoseStack poseStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + this.root.render(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/client/renderer/entity/GTExplosiveRenderer.java b/src/main/java/com/gregtechceu/gtceu/client/renderer/entity/GTExplosiveRenderer.java new file mode 100644 index 0000000000..bf3a28acf4 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/client/renderer/entity/GTExplosiveRenderer.java @@ -0,0 +1,55 @@ +package com.gregtechceu.gtceu.client.renderer.entity; + +import com.gregtechceu.gtceu.common.entity.GTExplosiveEntity; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.math.Vector3f; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.block.BlockRenderDispatcher; +import net.minecraft.client.renderer.entity.EntityRenderer; +import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.client.renderer.entity.TntMinecartRenderer; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.Mth; +import net.minecraft.world.inventory.InventoryMenu; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import org.jetbrains.annotations.NotNull; + +@OnlyIn(Dist.CLIENT) +public class GTExplosiveRenderer extends EntityRenderer { + private final BlockRenderDispatcher blockRenderer; + + public GTExplosiveRenderer(EntityRendererProvider.Context context) { + super(context); + this.shadowRadius = 0.5F; + this.blockRenderer = context.getBlockRenderDispatcher(); + } + + @Override + public void render(@NotNull T entity, float entityYaw, float partialTicks, PoseStack poseStack, @NotNull MultiBufferSource buffer, int packedLight) { + poseStack.pushPose(); + poseStack.translate(0.0F, 0.5F, 0.0F); + int fuseTime = entity.getFuse(); + if ((float)fuseTime - partialTicks + 1.0F < 10.0F) { + float size = 1.0F - ((float)fuseTime - partialTicks + 1.0F) / 10.0F; + size = Mth.clamp(size, 0.0F, 1.0F); + size *= size; + size *= size; + float scale = 1.0F + size * 0.3F; + poseStack.scale(scale, scale, scale); + } + + poseStack.mulPose(Vector3f.YP.rotationDegrees(-90.0F)); + poseStack.translate(-0.5F, -0.5F, 0.5F); + poseStack.mulPose(Vector3f.YP.rotationDegrees(90.0F)); + TntMinecartRenderer.renderWhiteSolidBlock(this.blockRenderer, entity.getExplosiveState(), poseStack, buffer, packedLight, fuseTime / 5 % 2 == 0); + poseStack.popPose(); + super.render(entity, entityYaw, partialTicks, poseStack, buffer, packedLight); + } + + @NotNull + @Override + public ResourceLocation getTextureLocation(@NotNull T entity) { + return InventoryMenu.BLOCK_ATLAS; + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/client/util/ToolChargeBarRenderer.java b/src/main/java/com/gregtechceu/gtceu/client/util/ToolChargeBarRenderer.java index 504763eeb5..520559afcb 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/util/ToolChargeBarRenderer.java +++ b/src/main/java/com/gregtechceu/gtceu/client/util/ToolChargeBarRenderer.java @@ -3,6 +3,7 @@ import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; import com.gregtechceu.gtceu.api.capability.IElectricItem; import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.IGTTool; import com.gregtechceu.gtceu.api.item.component.IDurabilityBar; import com.gregtechceu.gtceu.api.item.component.IItemComponent; @@ -67,7 +68,7 @@ public static void renderBarsTool(PoseStack poseStack, IGTTool tool, ItemStack s } } - public static void renderBarsItem(PoseStack poseStack, ComponentItem item, ItemStack stack, int xPosition, int yPosition) { + public static void renderBarsItem(PoseStack poseStack, IComponentItem item, ItemStack stack, int xPosition, int yPosition) { boolean renderedDurability = false; IDurabilityBar bar = null; for (IItemComponent component : item.getComponents()) { diff --git a/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java b/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java index 11b18fc998..71884c2cf2 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java +++ b/src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java @@ -25,6 +25,7 @@ import com.gregtechceu.gtceu.common.data.materials.GTFoods; import com.gregtechceu.gtceu.common.item.tool.forge.ToolLootModifier; import com.gregtechceu.gtceu.common.item.tool.rotation.CustomBlockRotations; +import com.gregtechceu.gtceu.common.network.GTNetwork; import com.gregtechceu.gtceu.common.registry.GTRegistration; import com.gregtechceu.gtceu.common.unification.material.MaterialRegistryManager; import com.gregtechceu.gtceu.config.ConfigHolder; @@ -42,6 +43,7 @@ import com.gregtechceu.gtceu.integration.kjs.GTRegistryInfo; import com.gregtechceu.gtceu.integration.kjs.events.MaterialModificationEventJS; import com.gregtechceu.gtceu.integration.top.forge.TheOneProbePluginImpl; +import com.gregtechceu.gtceu.utils.input.KeyBind; import com.lowdragmc.lowdraglib.LDLib; import com.lowdragmc.lowdraglib.gui.factory.UIFactory; import com.tterrag.registrate.providers.ProviderType; @@ -90,6 +92,7 @@ public static void init() { GTCEu.LOGGER.info("GTCEu common proxy init!"); GTRegistries.COMPASS_NODES.unfreeze(); + GTNetwork.init(); UIFactory.register(MachineUIFactory.INSTANCE); UIFactory.register(CoverUIFactory.INSTANCE); UIFactory.register(GTUIEditorFactory.INSTANCE); @@ -108,6 +111,7 @@ public static void init() { GTCovers.init(); GTFluids.init(); GTBlocks.init(); + GTEntityTypes.init(); GTBlockEntities.init(); GTRecipeTypes.init(); GTMachines.init(); @@ -145,6 +149,7 @@ public static void init() { WorldGenLayers.registerAll(); GTFeatures.init(); CustomBlockRotations.init(); + KeyBind.init(); } private static void initMaterials() { diff --git a/src/main/java/com/gregtechceu/gtceu/common/block/GTStandingSignBlock.java b/src/main/java/com/gregtechceu/gtceu/common/block/GTStandingSignBlock.java new file mode 100644 index 0000000000..1e299395bc --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/block/GTStandingSignBlock.java @@ -0,0 +1,27 @@ +package com.gregtechceu.gtceu.common.block; + +import com.gregtechceu.gtceu.common.blockentity.GTSignBlockEntity; +import com.gregtechceu.gtceu.common.data.GTBlockEntities; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.SignBlock; +import net.minecraft.world.level.block.StandingSignBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.entity.SignBlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.WoodType; + +import javax.annotation.Nullable; + +public class GTStandingSignBlock extends StandingSignBlock { + public GTStandingSignBlock(Properties properties, WoodType type) { + super(properties, type); + } + + @Override + public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { + return new GTSignBlockEntity(GTBlockEntities.GT_SIGN.get(), pos, state); + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/common/block/GTWallSignBlock.java b/src/main/java/com/gregtechceu/gtceu/common/block/GTWallSignBlock.java new file mode 100644 index 0000000000..0ff98f9b5b --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/block/GTWallSignBlock.java @@ -0,0 +1,26 @@ +package com.gregtechceu.gtceu.common.block; + +import com.gregtechceu.gtceu.common.blockentity.GTSignBlockEntity; +import com.gregtechceu.gtceu.common.data.GTBlockEntities; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.WallSignBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.entity.SignBlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.WoodType; + +import javax.annotation.Nullable; + +public class GTWallSignBlock extends WallSignBlock { + public GTWallSignBlock(Properties properties, WoodType type) { + super(properties, type); + } + + @Override + public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { + return new GTSignBlockEntity(GTBlockEntities.GT_SIGN.get(), pos, state); + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/common/block/StoneBlockType.java b/src/main/java/com/gregtechceu/gtceu/common/block/StoneBlockType.java index 1ddfd0202f..9c9e8206ab 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/block/StoneBlockType.java +++ b/src/main/java/com/gregtechceu/gtceu/common/block/StoneBlockType.java @@ -4,7 +4,6 @@ public enum StoneBlockType { STONE("stone", "%s"), - SMOOTH("smooth", "smooth_%s"), COBBLE("cobble", "%s_cobblestone", 2.0f, 6.0f), COBBLE_MOSSY("cobble_mossy", "mossy_%s_cobblestone", 2.0f, 6.0f), POLISHED("polished", "polished_%s"), @@ -14,6 +13,8 @@ public enum StoneBlockType { CHISELED("chiseled", "chiseled_%s"), TILED("tiled", "%s_tile"), TILED_SMALL("tiled_small", "%s_small_tile"), + WINDMILL_A("windmill_a", "%s_windmill_a"), + WINDMILL_B("windmill_b", "%s_windmill_b"), BRICKS_SMALL("bricks_small", "small_%s_bricks"), BRICKS_SQUARE("bricks_square", "square_%s_bricks"); diff --git a/src/main/java/com/gregtechceu/gtceu/common/block/explosive/GTExplosiveBlock.java b/src/main/java/com/gregtechceu/gtceu/common/block/explosive/GTExplosiveBlock.java new file mode 100644 index 0000000000..10434fba24 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/block/explosive/GTExplosiveBlock.java @@ -0,0 +1,157 @@ +package com.gregtechceu.gtceu.common.block.explosive; + +import com.gregtechceu.gtceu.common.entity.GTExplosiveEntity; +import net.minecraft.MethodsReturnNonnullByDefault; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.entity.projectile.Arrow; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Explosion; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.storage.loot.LootContext; +import net.minecraft.world.level.storage.loot.parameters.LootContextParams; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.annotation.ParametersAreNonnullByDefault; +import java.util.List; + +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +@SuppressWarnings("deprecation") +public abstract class GTExplosiveBlock extends Block { + + private final boolean canRedstoneActivate; + private final boolean explodeOnMine; + private final int fuseLength; + + /** + * @param canRedstoneActivate whether redstone signal can prime this explosive + * @param explodeOnMine whether mining this block should prime it (sneak mine to drop normally) + * @param fuseLength explosion countdown after priming. Vanilla TNT is 80. + */ + public GTExplosiveBlock(BlockBehaviour.Properties properties, boolean canRedstoneActivate, boolean explodeOnMine, int fuseLength) { + super(properties.isValidSpawn((state, level, pos, ent) -> false).explosionResistance(1.0f)); + this.canRedstoneActivate = canRedstoneActivate; + this.explodeOnMine = explodeOnMine; + this.fuseLength = fuseLength; + } + + protected abstract GTExplosiveEntity createEntity(@NotNull Level world, @NotNull BlockPos pos, @NotNull LivingEntity exploder); + + @Override + public boolean isCollisionShapeFullBlock(BlockState state, BlockGetter level, BlockPos pos) { + return true; + } + + @Override + public boolean dropFromExplosion(Explosion explosion) { + return false; + } + + public void explode(Level world, BlockPos pos, LivingEntity exploder) { + if (!world.isClientSide) { + GTExplosiveEntity entity = createEntity(world, pos, exploder); + entity.setFuse(fuseLength); + world.addFreshEntity(entity); + world.playSound(null, entity.getX(), entity.getY(), entity.getZ(), SoundEvents.TNT_PRIMED, + SoundSource.BLOCKS, 1.0f, 1.0f); + } + } + + @Override + public void wasExploded(Level level, BlockPos pos, Explosion explosion) { + if (!level.isClientSide) { + GTExplosiveEntity entity = createEntity(level, pos, explosion.getSourceMob()); + entity.setFuse(level.random.nextInt(fuseLength / 4) + fuseLength / 8); + level.addFreshEntity(entity); + } + } + + @Override + public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { + ItemStack stack = player.getItemInHand(hand); + if (!stack.isEmpty() && (stack.getItem() == Items.FLINT_AND_STEEL || stack.getItem() == Items.FIRE_CHARGE)) { + this.explode(level, pos, player); + level.removeBlock(pos, false); + if (stack.getItem() == Items.FLINT_AND_STEEL) { + stack.hurtAndBreak(1, player, playerx -> playerx.broadcastBreakEvent(hand)); + } else if (!player.isCreative()) { + stack.shrink(1); + } + return InteractionResult.SUCCESS; + } + return super.use(state, level, pos, player, hand, hit); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder params) { + if (explodeOnMine) { + Entity entity = params.getOptionalParameter(LootContextParams.THIS_ENTITY); + if (entity != null && !entity.isCrouching() && entity instanceof LivingEntity living) { + Vec3 center = params.getParameter(LootContextParams.ORIGIN); + this.explode(params.getLevel(), new BlockPos((int) center.x, (int) center.y, (int) center.z), living); + return List.of(); + } + } + return super.getDrops(state, params); + } + + @Override + public void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) { + super.entityInside(state, level, pos, entity); + if (!level.isClientSide && entity instanceof Arrow arrow) { + if (arrow.isOnFire()) { + this.explode(level, pos, arrow.getOwner() instanceof LivingEntity living ? living : null); + level.removeBlock(pos, false); + } + } + } + + @Override + public void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) { + super.onPlace(state, level, pos, oldState, movedByPiston); + if (canRedstoneActivate) { + if (level.hasNeighborSignal(pos)) { + explode(level, pos, null); + level.removeBlock(pos, false); + } + } + } + + @Override + public void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, BlockPos neighborPos, boolean movedByPiston) { + if (canRedstoneActivate) { + if (level.hasNeighborSignal(pos)) { + this.explode(level, pos, null); + level.removeBlock(pos, false); + } + } + } + + @Override + public void appendHoverText(ItemStack stack, @Nullable BlockGetter level, List tooltip, TooltipFlag flag) { + super.appendHoverText(stack, level, tooltip, flag); + if (explodeOnMine) { + tooltip.add(Component.translatable("block.gtceu.explosive.breaking_tooltip")); + } + if (!canRedstoneActivate) { + tooltip.add(Component.translatable("block.gtceu.explosive.lighting_tooltip")); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/block/explosive/IndustrialTNTBlock.java b/src/main/java/com/gregtechceu/gtceu/common/block/explosive/IndustrialTNTBlock.java new file mode 100644 index 0000000000..12f2bd750f --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/block/explosive/IndustrialTNTBlock.java @@ -0,0 +1,35 @@ +package com.gregtechceu.gtceu.common.block.explosive; + +import com.gregtechceu.gtceu.common.entity.GTExplosiveEntity; +import com.gregtechceu.gtceu.common.entity.IndustrialTNTEntity; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockBehaviour; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class IndustrialTNTBlock extends GTExplosiveBlock { + + public IndustrialTNTBlock(BlockBehaviour.Properties properties) { + super(properties, true, true, 40); + } + + @Override + public void appendHoverText(ItemStack stack, @Nullable BlockGetter level, List tooltip, TooltipFlag flag) { + tooltip.add(Component.translatable("block.gtceu.itnt.drops_tooltip")); + super.appendHoverText(stack, level, tooltip, flag); + } + + @Override + protected GTExplosiveEntity createEntity(@NotNull Level world, @NotNull BlockPos pos, @NotNull LivingEntity exploder) { + float x = pos.getX() + 0.5F, y = pos.getY(), z = pos.getZ() + 0.5F; + return new IndustrialTNTEntity(world, x, y, z, exploder); + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/block/explosive/PowderbarrelBlock.java b/src/main/java/com/gregtechceu/gtceu/common/block/explosive/PowderbarrelBlock.java new file mode 100644 index 0000000000..24fdc4a436 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/block/explosive/PowderbarrelBlock.java @@ -0,0 +1,33 @@ +package com.gregtechceu.gtceu.common.block.explosive; + +import com.gregtechceu.gtceu.common.entity.GTExplosiveEntity; +import com.gregtechceu.gtceu.common.entity.PowderbarrelEntity; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class PowderbarrelBlock extends GTExplosiveBlock { + public PowderbarrelBlock(Properties properties) { + super(properties, false, true, 100); + } + + @Override + protected GTExplosiveEntity createEntity(@NotNull Level world, @NotNull BlockPos pos, @NotNull LivingEntity exploder) { + float x = pos.getX() + 0.5F, y = pos.getY(), z = pos.getZ() + 0.5F; + return new PowderbarrelEntity(world, x, y, z, exploder); + } + + @Override + public void appendHoverText(ItemStack stack, @Nullable BlockGetter level, List tooltip, TooltipFlag flag) { + tooltip.add(Component.translatable("block.gtceu.powderbarrel.drops_tooltip")); + super.appendHoverText(stack, level, tooltip, flag); + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/common/blockentity/CableBlockEntity.java b/src/main/java/com/gregtechceu/gtceu/common/blockentity/CableBlockEntity.java index e1a3f9bff4..e1297fff32 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/blockentity/CableBlockEntity.java +++ b/src/main/java/com/gregtechceu/gtceu/common/blockentity/CableBlockEntity.java @@ -223,7 +223,7 @@ public boolean incrementAmperage(long amps, long voltage) { if (voltage > maxVoltageCounter.get(getLevel())) { maxVoltageCounter.set(getLevel(), voltage); } - averageVoltageCounter.increment(getLevel(), voltage); + averageVoltageCounter.increment(getLevel(), voltage * amps); averageAmperageCounter.increment(getLevel(), amps); int dif = (int) (averageAmperageCounter.getLast(getLevel()) - getMaxAmperage()); diff --git a/src/main/java/com/gregtechceu/gtceu/common/blockentity/GTSignBlockEntity.java b/src/main/java/com/gregtechceu/gtceu/common/blockentity/GTSignBlockEntity.java new file mode 100644 index 0000000000..df0ff7f4bd --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/blockentity/GTSignBlockEntity.java @@ -0,0 +1,229 @@ +package com.gregtechceu.gtceu.common.blockentity; + +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import net.minecraft.commands.CommandSource; +import net.minecraft.commands.CommandSourceStack; +import net.minecraft.core.BlockPos; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.*; +import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.util.FormattedCharSequence; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.entity.SignBlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.Vec2; +import net.minecraft.world.phys.Vec3; + +import javax.annotation.Nullable; +import java.util.UUID; +import java.util.function.Function; + +public class GTSignBlockEntity extends BlockEntity { + public static final int LINES = 4; + private static final String[] RAW_TEXT_FIELD_NAMES = new String[]{"Text1", "Text2", "Text3", "Text4"}; + private static final String[] FILTERED_TEXT_FIELD_NAMES = new String[]{"FilteredText1", "FilteredText2", "FilteredText3", "FilteredText4"}; + private final Component[] messages; + private final Component[] filteredMessages; + private boolean isEditable; + @Nullable + private UUID playerWhoMayEdit; + @Nullable + private FormattedCharSequence[] renderMessages; + private boolean renderMessagedFiltered; + private DyeColor color; + private boolean hasGlowingText; + + public GTSignBlockEntity(BlockEntityType blockEntityType, BlockPos pos, BlockState blockState) { + super(blockEntityType, pos, blockState); + this.messages = new Component[]{CommonComponents.EMPTY, CommonComponents.EMPTY, CommonComponents.EMPTY, CommonComponents.EMPTY}; + this.filteredMessages = new Component[]{CommonComponents.EMPTY, CommonComponents.EMPTY, CommonComponents.EMPTY, CommonComponents.EMPTY}; + this.isEditable = true; + this.color = DyeColor.BLACK; + } + + protected void saveAdditional(CompoundTag tag) { + super.saveAdditional(tag); + + for(int i = 0; i < 4; ++i) { + Component component = this.messages[i]; + String string = Component.Serializer.toJson(component); + tag.putString(RAW_TEXT_FIELD_NAMES[i], string); + Component component2 = this.filteredMessages[i]; + if (!component2.equals(component)) { + tag.putString(FILTERED_TEXT_FIELD_NAMES[i], Component.Serializer.toJson(component2)); + } + } + + tag.putString("Color", this.color.getName()); + tag.putBoolean("GlowingText", this.hasGlowingText); + } + + public void load(CompoundTag tag) { + this.isEditable = false; + super.load(tag); + this.color = DyeColor.byName(tag.getString("Color"), DyeColor.BLACK); + + for(int i = 0; i < 4; ++i) { + String string = tag.getString(RAW_TEXT_FIELD_NAMES[i]); + Component component = this.loadLine(string); + this.messages[i] = component; + String string2 = FILTERED_TEXT_FIELD_NAMES[i]; + if (tag.contains(string2, 8)) { + this.filteredMessages[i] = this.loadLine(tag.getString(string2)); + } else { + this.filteredMessages[i] = component; + } + } + + this.renderMessages = null; + this.hasGlowingText = tag.getBoolean("GlowingText"); + } + + private Component loadLine(String line) { + Component component = this.deserializeTextSafe(line); + if (this.level instanceof ServerLevel) { + try { + return ComponentUtils.updateForEntity(this.createCommandSourceStack((ServerPlayer)null), component, (Entity)null, 0); + } catch (CommandSyntaxException var4) { + } + } + + return component; + } + + private Component deserializeTextSafe(String text) { + try { + Component component = Component.Serializer.fromJson(text); + if (component != null) { + return component; + } + } catch (Exception var3) { + } + + return CommonComponents.EMPTY; + } + + public Component getMessage(int line, boolean filtered) { + return this.getMessages(filtered)[line]; + } + + public void setMessage(int line, Component message) { + this.setMessage(line, message, message); + } + + public void setMessage(int line, Component message, Component filteredMessage) { + this.messages[line] = message; + this.filteredMessages[line] = filteredMessage; + this.renderMessages = null; + } + + public FormattedCharSequence[] getRenderMessages(boolean filtered, Function messageTransformer) { + if (this.renderMessages == null || this.renderMessagedFiltered != filtered) { + this.renderMessagedFiltered = filtered; + this.renderMessages = new FormattedCharSequence[4]; + + for(int i = 0; i < 4; ++i) { + this.renderMessages[i] = (FormattedCharSequence)messageTransformer.apply(this.getMessage(i, filtered)); + } + } + + return this.renderMessages; + } + + private Component[] getMessages(boolean filtered) { + return filtered ? this.filteredMessages : this.messages; + } + + public ClientboundBlockEntityDataPacket getUpdatePacket() { + return ClientboundBlockEntityDataPacket.create(this); + } + + public CompoundTag getUpdateTag() { + return this.saveWithoutMetadata(); + } + + public boolean onlyOpCanSetNbt() { + return true; + } + + public boolean isEditable() { + return this.isEditable; + } + + public void setEditable(boolean isEditable) { + this.isEditable = isEditable; + if (!isEditable) { + this.playerWhoMayEdit = null; + } + + } + + public void setAllowedPlayerEditor(UUID playWhoMayEdit) { + this.playerWhoMayEdit = playWhoMayEdit; + } + + @Nullable + public UUID getPlayerWhoMayEdit() { + return this.playerWhoMayEdit; + } + + public boolean executeClickCommands(ServerPlayer level) { + Component[] var2 = this.getMessages(level.isTextFilteringEnabled()); + int var3 = var2.length; + + for(int var4 = 0; var4 < var3; ++var4) { + Component component = var2[var4]; + Style style = component.getStyle(); + ClickEvent clickEvent = style.getClickEvent(); + if (clickEvent != null && clickEvent.getAction() == ClickEvent.Action.RUN_COMMAND) { + level.getServer().getCommands().performPrefixedCommand(this.createCommandSourceStack(level), clickEvent.getValue()); + } + } + + return true; + } + + public CommandSourceStack createCommandSourceStack(@Nullable ServerPlayer player) { + String string = player == null ? "Sign" : player.getName().getString(); + Component component = player == null ? Component.literal("Sign") : player.getDisplayName(); + return new CommandSourceStack(CommandSource.NULL, Vec3.atCenterOf(this.worldPosition), Vec2.ZERO, (ServerLevel)this.level, 2, string, (Component)component, this.level.getServer(), player); + } + + public DyeColor getColor() { + return this.color; + } + + public boolean setColor(DyeColor color) { + if (color != this.getColor()) { + this.color = color; + this.markUpdated(); + return true; + } else { + return false; + } + } + + public boolean hasGlowingText() { + return this.hasGlowingText; + } + + public boolean setHasGlowingText(boolean hasGlowingText) { + if (this.hasGlowingText != hasGlowingText) { + this.hasGlowingText = hasGlowingText; + this.markUpdated(); + return true; + } else { + return false; + } + } + + private void markUpdated() { + this.setChanged(); + this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), 3); + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/common/cover/MachineControllerCover.java b/src/main/java/com/gregtechceu/gtceu/common/cover/MachineControllerCover.java index ebfa363770..a0e3ce164f 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/cover/MachineControllerCover.java +++ b/src/main/java/com/gregtechceu/gtceu/common/cover/MachineControllerCover.java @@ -28,6 +28,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; import org.jetbrains.annotations.Nullable; import javax.annotation.ParametersAreNonnullByDefault; @@ -177,7 +178,7 @@ private int getInputSignal() { Level level = coverHolder.getLevel(); BlockPos sourcePos = coverHolder.getPos().relative(attachedSide); - return level.getBlockState(sourcePos).getSignal(level, sourcePos, attachedSide); + return level.getSignal(sourcePos, attachedSide); } diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GCyMRecipeTypes.java b/src/main/java/com/gregtechceu/gtceu/common/data/GCyMRecipeTypes.java index 08f2f678f3..af0684068e 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GCyMRecipeTypes.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GCyMRecipeTypes.java @@ -1,5 +1,6 @@ package com.gregtechceu.gtceu.common.data; +import com.gregtechceu.gtceu.api.GTCEuAPI; import com.gregtechceu.gtceu.api.block.ICoilType; import com.gregtechceu.gtceu.api.capability.recipe.IO; import com.gregtechceu.gtceu.api.gui.GuiTextures; @@ -49,7 +50,7 @@ public class GCyMRecipeTypes { .setUiBuilder((recipe, widgetGroup) -> { int temp = recipe.data.getInt("ebf_temp"); List> items = new ArrayList<>(); - items.add(GTBlocks.ALL_COILS.entrySet().stream().filter(coil -> coil.getKey().getCoilTemperature() >= temp).map(coil -> new ItemStack(coil.getValue().get())).toList()); + items.add(GTCEuAPI.HEATING_COILS.entrySet().stream().filter(coil -> coil.getKey().getCoilTemperature() >= temp).map(coil -> new ItemStack(coil.getValue().get())).toList()); widgetGroup.addWidget(new SlotWidget(new CycleItemStackHandler(items), 0, widgetGroup.getSize().width - 25, widgetGroup.getSize().height - 40, false, false)); }) .setSound(GTSoundEntries.ARC); diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlockEntities.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlockEntities.java index d163096728..a22238d449 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlockEntities.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlockEntities.java @@ -44,6 +44,14 @@ public class GTBlockEntities { .validBlocks(GTBlocks.OPTICAL_PIPES) .register(); + public static final BlockEntityEntry GT_SIGN = REGISTRATE + .blockEntity("sign", GTSignBlockEntity::new) + .validBlocks(GTBlocks.RUBBER_SIGN, + GTBlocks.RUBBER_WALL_SIGN, + GTBlocks.TREATED_WOOD_SIGN, + GTBlocks.TREATED_WOOD_WALL_SIGN) + .register(); + public static void init() { } diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java index fc88e3fef9..9f45d78df7 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java @@ -11,6 +11,8 @@ import com.gregtechceu.gtceu.api.block.*; import com.gregtechceu.gtceu.api.data.chemical.ChemicalHelper; import com.gregtechceu.gtceu.api.data.chemical.material.Material; +import com.gregtechceu.gtceu.common.block.explosive.IndustrialTNTBlock; +import com.gregtechceu.gtceu.common.block.explosive.PowderbarrelBlock; import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.SignItem; import net.minecraft.world.level.block.state.properties.WoodType; @@ -81,6 +83,7 @@ import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.client.model.generators.ModelFile; import net.minecraftforge.client.model.generators.ModelProvider; import org.jetbrains.annotations.NotNull; @@ -383,7 +386,7 @@ private static void registerLaserPipeBlock(int index) { var type = LaserPipeType.values()[index]; var entry = REGISTRATE.block("%s_laser_pipe".formatted(type.getSerializedName()), (p) -> new LaserPipeBlock(p, type)) .initialProperties(() -> Blocks.IRON_BLOCK) - .properties(p -> p.dynamicShape().noOcclusion().noLootTable()) + .properties(p -> p.dynamicShape().noOcclusion()) .blockstate(NonNullBiConsumer.noop()) .defaultLoot() .tag(GTToolType.WIRE_CUTTER.harvestTags.get(0)) @@ -409,7 +412,7 @@ private static void registerOpticalPipeBlock(int index) { var type = OpticalPipeType.values()[index]; var entry = REGISTRATE.block("%s_optical_pipe".formatted(type.getSerializedName()), (p) -> new OpticalPipeBlock(p, type)) .initialProperties(() -> Blocks.IRON_BLOCK) - .properties(p -> p.dynamicShape().noOcclusion().noLootTable()) + .properties(p -> p.dynamicShape().noOcclusion()) .blockstate(NonNullBiConsumer.noop()) .defaultLoot() .tag(GTToolType.WIRE_CUTTER.harvestTags.get(0)) @@ -584,7 +587,6 @@ private static void registerOpticalPipeBlock(int index) { public static final BlockEntry STEEL_BRICKS_HULL = createSteamCasing("steel_brick_casing", "bricked_steel"); // Heating Coils - public static final Map> ALL_COILS = new HashMap<>(); public static final BlockEntry COIL_CUPRONICKEL = createCoilBlock(CoilBlock.CoilType.CUPRONICKEL); public static final BlockEntry COIL_KANTHAL = createCoilBlock(CoilBlock.CoilType.KANTHAL); public static final BlockEntry COIL_NICHROME = createCoilBlock(CoilBlock.CoilType.NICHROME); @@ -595,7 +597,6 @@ private static void registerOpticalPipeBlock(int index) { public static final BlockEntry COIL_TRITANIUM = createCoilBlock(CoilBlock.CoilType.TRITANIUM); // PSS batteries - public static final Map> PSS_BATTERIES = new HashMap<>(); public static final BlockEntry BATTERY_EMPTY_TIER_I = createBatteryBlock(BatteryBlock.BatteryPartType.EMPTY_TIER_I); public static final BlockEntry BATTERY_LAPOTRONIC_EV = createBatteryBlock(BatteryBlock.BatteryPartType.EV_LAPOTRONIC); public static final BlockEntry BATTERY_LAPOTRONIC_IV = createBatteryBlock(BatteryBlock.BatteryPartType.IV_LAPOTRONIC); @@ -620,7 +621,6 @@ private static void registerOpticalPipeBlock(int index) { public static final BlockEntry FUSION_GLASS = createGlassCasingBlock("fusion_glass", GTCEu.id("block/casings/transparent/fusion_glass"), () -> RenderType::cutoutMipped); // Cleanroom - public static final Map> ALL_FILTERS = new HashMap<>(); public static final BlockEntry PLASTCRETE = createCasingBlock("plascrete", GTCEu.id("block/casings/cleanroom/plascrete")); public static final BlockEntry FILTER_CASING = createCleanroomFilter(CleanroomFilterType.FILTER_CASING); public static final BlockEntry FILTER_CASING_STERILE = createCleanroomFilter(CleanroomFilterType.FILTER_CASING_STERILE); @@ -639,6 +639,7 @@ private static void registerOpticalPipeBlock(int index) { public static final BlockEntry COMPUTER_CASING = REGISTRATE.block("computer_casing", p -> (Block) new RendererBlock(p, Platform.isClient() ? new IModelRenderer(GTCEu.id("block/computer_casing")) : null)) .initialProperties(() -> Blocks.IRON_BLOCK) + .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .blockstate(NonNullBiConsumer.noop()) .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) .item(RendererBlockItem::new) @@ -648,6 +649,7 @@ private static void registerOpticalPipeBlock(int index) { public static final BlockEntry ADVANCED_COMPUTER_CASING = REGISTRATE.block("advanced_computer_casing", p -> (Block) new RendererBlock(p, Platform.isClient() ? new IModelRenderer(GTCEu.id("block/advanced_computer_casing")) : null)) .initialProperties(() -> Blocks.IRON_BLOCK) + .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .blockstate(NonNullBiConsumer.noop()) .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) .item(RendererBlockItem::new) @@ -659,6 +661,7 @@ private static void registerOpticalPipeBlock(int index) { Map.of("side", GTCEu.id("block/casings/hpca/computer_heat_vent_side"), "end", GTCEu.id("block/casings/hpca/computer_heat_vent_top_bot"))) : null)) .initialProperties(() -> Blocks.IRON_BLOCK) + .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(NonNullBiConsumer.noop()) .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) @@ -680,6 +683,7 @@ private static BlockEntry createPipeCasingBlock(String name, ResourceLoca Map.of("all", texture)) : null)) .lang("%s Pipe Casing".formatted(name)) .initialProperties(properties) + .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(NonNullBiConsumer.noop()) .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) @@ -715,6 +719,7 @@ public static BlockEntry createCasingBlock(String name, BiFunction p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(type) .blockstate(NonNullBiConsumer.noop()) .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) @@ -733,6 +738,7 @@ private static BlockEntry createMachineCasingBlock(int tier) { "side", GTCEu.id("block/casings/voltage/%s/side".formatted(tierName)))) : null)) .lang("%s Machine Casing".formatted(GTValues.VN[tier])) .initialProperties(() -> Blocks.IRON_BLOCK) + .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(NonNullBiConsumer.noop()) .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) @@ -754,6 +760,7 @@ private static BlockEntry createHermeticCasing(int tier) { "top_side", GTCEu.id("block/casings/hermetic_casing/hermetic_casing_overlay"))) : null)) .lang("Hermetic Casing %s".formatted(GTValues.LVT[tier])) .initialProperties(() -> Blocks.IRON_BLOCK) + .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(NonNullBiConsumer.noop()) .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) @@ -784,6 +791,7 @@ private static BlockEntry createSteamCasing(String name, String material) private static BlockEntry createCoilBlock(ICoilType coilType) { BlockEntry coilBlock = REGISTRATE.block("%s_coil_block".formatted(coilType.getName()), p -> new CoilBlock(p, coilType)) .initialProperties(() -> Blocks.IRON_BLOCK) + .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(NonNullBiConsumer.noop()) .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) @@ -792,7 +800,7 @@ private static BlockEntry createCoilBlock(ICoilType coilType) { .onRegister(compassNodeExist(GTCompassSections.BLOCKS, "coil_block")) .build() .register(); - ALL_COILS.put(coilType, coilBlock); + GTCEuAPI.HEATING_COILS.put(coilType, coilBlock); return coilBlock; } @@ -805,6 +813,7 @@ private static BlockEntry createBatteryBlock(IBatteryData batteryD "side", GTCEu.id("block/casings/battery/" + batteryData.getBatteryName() + "/side"))) : null)) .initialProperties(() -> Blocks.IRON_BLOCK) + .properties(p -> p.isValidSpawn((state, level, pos, entityType) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(NonNullBiConsumer.noop()) .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) @@ -813,7 +822,7 @@ private static BlockEntry createBatteryBlock(IBatteryData batteryD .onRegister(compassNodeExist(GTCompassSections.BLOCKS, "pss_battery")) .build() .register(); - PSS_BATTERIES.put(batteryData, batteryBlock); + GTCEuAPI.PSS_BATTERIES.put(batteryData, batteryBlock); return batteryBlock; } @@ -845,7 +854,7 @@ private static BlockEntry createCleanroomFilter(IFilterType filterType) { .model(NonNullBiConsumer.noop()) .build() .register(); - ALL_FILTERS.put(filterType, filterBlock); + GTCEuAPI.CLEANROOM_FILTERS.put(filterType, filterBlock); return filterBlock; } @@ -876,6 +885,7 @@ private static BlockEntry createFireboxCasing(BoilerFireboxType typ "top", type.top(), "side", type.side())) : null)) .initialProperties(() -> Blocks.IRON_BLOCK) + .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(NonNullBiConsumer.noop()) .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) @@ -891,6 +901,25 @@ private static BlockEntry createFireboxCasing(BoilerFireboxType typ //********** Misc **********// ////////////////////////////////////// + public static final BlockEntry POWDERBARREL = REGISTRATE.block("powderbarrel", PowderbarrelBlock::new) + .lang("Powderbarrel") + .properties(p -> p.destroyTime(0.5F).sound(SoundType.WOOD).color(MaterialColor.STONE)) + .tag(BlockTags.MINEABLE_WITH_AXE) + .simpleItem() + .register(); + + public static final BlockEntry INDUSTRIAL_TNT = REGISTRATE.block("industrial_tnt", IndustrialTNTBlock::new) + .lang("Industrial TNT") + .properties(p -> p.color(MaterialColor.FIRE).instabreak().sound(SoundType.GRASS)) + .tag(BlockTags.MINEABLE_WITH_AXE) + .blockstate((ctx, prov) -> + prov.simpleBlock(ctx.get(), prov.models().cubeBottomTop(ctx.getName(), + new ResourceLocation(prov.blockTexture(ctx.get()).getNamespace(), prov.blockTexture(ctx.get()).getPath() + "_side"), + new ResourceLocation("minecraft", "block/tnt_bottom"), + new ResourceLocation("minecraft", "block/tnt_top")))) + .simpleItem() + .register(); + public static final BlockEntry RUBBER_SAPLING = REGISTRATE.block("rubber_sapling", properties -> new SaplingBlock(new AbstractTreeGrower() { protected Holder> getConfiguredFeature(@NotNull RandomSource random, boolean largeHive) { return GTConfiguredFeatures.RUBBER; @@ -1014,26 +1043,29 @@ public static ItemColor leavesItemColor() { .blockstate((ctx, prov) -> prov.fenceBlock(ctx.getEntry(), prov.blockTexture(RUBBER_PLANK.get()))) .tag(BlockTags.WOODEN_FENCES) .item() + .model((ctx, prov) -> prov.fenceInventory(ctx.getName(), new ResourceLocation(GTBlocks.RUBBER_PLANK.getId().getNamespace(), "block/" + GTBlocks.RUBBER_PLANK.getId().getPath()))) .tag(ItemTags.WOODEN_FENCES) .build() .register(); - public static final BlockEntry RUBBER_SIGN = REGISTRATE - .block("rubber_sign", (p) -> new StandingSignBlock(p, RUBBER_TYPE)) + public static final BlockEntry RUBBER_SIGN = REGISTRATE + .block("rubber_sign", (p) -> new GTStandingSignBlock(p, RUBBER_TYPE)) .initialProperties(() -> Blocks.SPRUCE_SIGN) .lang("Rubber Sign") + .blockstate((ctx, prov) -> prov.signBlock(ctx.get(), GTBlocks.RUBBER_WALL_SIGN.get(), prov.blockTexture(GTBlocks.RUBBER_PLANK.get()))) .tag(BlockTags.STANDING_SIGNS) .setData(ProviderType.LANG, NonNullBiConsumer.noop()) .item((b, p) -> new SignItem(p, b, GTBlocks.RUBBER_WALL_SIGN.get())) + .defaultModel() .tag(ItemTags.SIGNS) .build() .register(); - public static final BlockEntry RUBBER_WALL_SIGN = REGISTRATE - .block("rubber_wall_sign", (p) -> new WallSignBlock(p, RUBBER_TYPE)) + public static final BlockEntry RUBBER_WALL_SIGN = REGISTRATE + .block("rubber_wall_sign", (p) -> new GTWallSignBlock(p, RUBBER_TYPE)) .initialProperties(() -> Blocks.SPRUCE_WALL_SIGN) .lang("Rubber Wall Sign") - .setData(ProviderType.LANG, NonNullBiConsumer.noop()) + .setData(ProviderType.BLOCKSTATE, NonNullBiConsumer.noop()) .tag(BlockTags.WALL_SIGNS) .loot((table, block) -> table.dropOther(block, RUBBER_SIGN.get().asItem())) .register(); @@ -1052,13 +1084,15 @@ public static ItemColor leavesItemColor() { .block("rubber_trapdoor", TrapDoorBlock::new) .initialProperties(() -> Blocks.SPRUCE_TRAPDOOR) .lang("Rubber Trapdoor") + .blockstate((ctx, prov) -> prov.trapdoorBlock(ctx.get(), prov.blockTexture(ctx.get()), true)) .tag(BlockTags.WOODEN_TRAPDOORS) .item() + .model((ctx, prov) -> prov.trapdoorOrientableBottom(ctx.getName(), new ResourceLocation(ctx.getId().getNamespace(), "block/" + ctx.getId().getPath()))) .tag(ItemTags.WOODEN_TRAPDOORS) .build() .register(); public static final BlockEntry RUBBER_STAIRS = REGISTRATE - .block("rubber_stairs", (p) -> new StairBlock(RUBBER_PLANK.getDefaultState(), p)) + .block("rubber_stairs", (p) -> new StairBlock(RUBBER_PLANK::getDefaultState, p)) .initialProperties(() -> Blocks.SPRUCE_STAIRS) .lang("Rubber Stairs") .tag(BlockTags.STAIRS) @@ -1074,6 +1108,7 @@ public static ItemColor leavesItemColor() { .tag(BlockTags.WOODEN_BUTTONS) .blockstate((ctx, prov) -> prov.buttonBlock(ctx.getEntry(), prov.blockTexture(RUBBER_PLANK.get()))) .item() + .model((ctx, prov) -> prov.buttonInventory(ctx.getName(), new ResourceLocation(GTBlocks.RUBBER_PLANK.getId().getNamespace(), "block/" + GTBlocks.RUBBER_PLANK.getId().getPath()))) .tag(ItemTags.WOODEN_BUTTONS) .build() .register(); @@ -1090,10 +1125,12 @@ public static ItemColor leavesItemColor() { .block("rubber_door", DoorBlock::new) .initialProperties(() -> Blocks.SPRUCE_DOOR) .lang("Rubber Door") - .loot((table, block) -> table.add(block, BlockLoot.createDoorTable(block))) - .blockstate(GTModels::rubberDoorModel) + .loot((table, block) -> table.add(block, table.createDoorTable(block))) + .addLayer(() -> RenderType::cutout) + .blockstate((ctx, prov) -> prov.doorBlock(ctx.getEntry(), GTCEu.id("block/rubber_door_bottom"), GTCEu.id("block/rubber_door_top"))) .tag(BlockTags.WOODEN_DOORS) .item() + .model((ctx, prov) -> prov.generated(ctx)) .tag(ItemTags.WOODEN_DOORS) .build() .register(); @@ -1131,24 +1168,27 @@ public static ItemColor leavesItemColor() { .blockstate((ctx, prov) -> prov.fenceBlock(ctx.getEntry(), prov.blockTexture(TREATED_WOOD_PLANK.get()))) .tag(BlockTags.WOODEN_FENCES) .item() + .model((ctx, prov) -> prov.fenceInventory(ctx.getName(), new ResourceLocation(GTBlocks.TREATED_WOOD_PLANK.getId().getNamespace(), "block/" + GTBlocks.TREATED_WOOD_PLANK.getId().getPath()))) .tag(ItemTags.WOODEN_FENCES) .build() .register(); - public static final BlockEntry TREATED_WOOD_SIGN = REGISTRATE - .block("treated_wood_sign", (p) -> new StandingSignBlock(p, TREATED_WOOD_TYPE)) + public static final BlockEntry TREATED_WOOD_SIGN = REGISTRATE + .block("treated_wood_sign", (p) -> new GTStandingSignBlock(p, TREATED_WOOD_TYPE)) .initialProperties(() -> Blocks.SPRUCE_SIGN) .lang("Treated Wood Sign") + .blockstate((ctx, prov) -> prov.signBlock(ctx.get(), GTBlocks.TREATED_WOOD_WALL_SIGN.get(), prov.blockTexture(GTBlocks.TREATED_WOOD_PLANK.get()))) .tag(BlockTags.STANDING_SIGNS) .setData(ProviderType.LANG, NonNullBiConsumer.noop()) .item((b, p) -> new SignItem(p, b, GTBlocks.TREATED_WOOD_WALL_SIGN.get())) + .defaultModel() .tag(ItemTags.SIGNS) .build() .register(); - public static final BlockEntry TREATED_WOOD_WALL_SIGN = REGISTRATE - .block("treated_wood_wall_sign", (p) -> new WallSignBlock(p, TREATED_WOOD_TYPE)) + public static final BlockEntry TREATED_WOOD_WALL_SIGN = REGISTRATE + .block("treated_wood_wall_sign", (p) -> new GTWallSignBlock(p, TREATED_WOOD_TYPE)) .initialProperties(() -> Blocks.SPRUCE_WALL_SIGN) .lang("Treated Wood Wall Sign") - .setData(ProviderType.LANG, NonNullBiConsumer.noop()) + .setData(ProviderType.BLOCKSTATE, NonNullBiConsumer.noop()) .tag(BlockTags.WALL_SIGNS) .loot((table, block) -> table.dropOther(block, TREATED_WOOD_SIGN.get().asItem())) .register(); @@ -1166,13 +1206,15 @@ public static ItemColor leavesItemColor() { .block("treated_wood_trapdoor", TrapDoorBlock::new) .initialProperties(() -> Blocks.SPRUCE_TRAPDOOR) .lang("Treated Wood Trapdoor") + .blockstate((ctx, prov) -> prov.trapdoorBlock(ctx.get(), prov.blockTexture(ctx.get()), true)) .tag(BlockTags.WOODEN_TRAPDOORS) .item() + .model((ctx, prov) -> prov.trapdoorOrientableBottom(ctx.getName(), new ResourceLocation(ctx.getId().getNamespace(), "block/" + ctx.getId().getPath()))) .tag(ItemTags.WOODEN_TRAPDOORS) .build() .register(); public static final BlockEntry TREATED_WOOD_STAIRS = REGISTRATE - .block("treated_wood_stairs", (p) -> new StairBlock(TREATED_WOOD_PLANK.getDefaultState(), p)) + .block("treated_wood_stairs", (p) -> new StairBlock(TREATED_WOOD_PLANK::getDefaultState, p)) .initialProperties(() -> Blocks.SPRUCE_STAIRS) .lang("Treated Wood Stairs") .tag(BlockTags.STAIRS) @@ -1188,10 +1230,11 @@ public static ItemColor leavesItemColor() { .tag(BlockTags.WOODEN_BUTTONS) .blockstate((ctx, prov) -> prov.buttonBlock(ctx.getEntry(), prov.blockTexture(TREATED_WOOD_PLANK.get()))) .item() + .model((ctx, prov) -> prov.buttonInventory(ctx.getName(), new ResourceLocation(GTBlocks.TREATED_WOOD_PLANK.getId().getNamespace(), "block/" + GTBlocks.TREATED_WOOD_PLANK.getId().getPath()))) .tag(ItemTags.WOODEN_BUTTONS) .build() .register(); - public static final BlockEntryTREATED_WOOD_FENCE_GATE = REGISTRATE + public static final BlockEntry TREATED_WOOD_FENCE_GATE = REGISTRATE .block("treated_wood_fence_gate", FenceGateBlock::new) .initialProperties(() -> Blocks.SPRUCE_FENCE_GATE) .lang("Treated Wood Fence Gate") @@ -1205,9 +1248,11 @@ public static ItemColor leavesItemColor() { .initialProperties(() -> Blocks.SPRUCE_DOOR) .lang("Treated Wood Door") .loot((table, block) -> table.add(block, table.createDoorTable(block))) - .blockstate(GTModels::rubberDoorModel) + .addLayer(() -> RenderType::cutout) + .blockstate((ctx, prov) -> prov.doorBlock(ctx.getEntry(), GTCEu.id("block/treated_wood_door_bottom"), GTCEu.id("block/treated_wood_door_top"))) .tag(BlockTags.WOODEN_DOORS) .item() + .model((ctx, prov) -> prov.generated(ctx)) .tag(ItemTags.WOODEN_DOORS) .build() .register(); @@ -1342,6 +1387,8 @@ public static NonNullConsumer compassNodeExist(CompassSe } public static void init() { + // Decor Blocks + generateStoneBlocks(); // Procedural Blocks REGISTRATE.creativeModeTab(() -> GTCreativeModeTabs.MATERIAL_BLOCK); @@ -1358,9 +1405,6 @@ public static void init() { generateLaserPipeBlocks(); // Laser Pipe Blocks generateOpticalPipeBlocks(); // Optical Pipe Blocks - // Decor Blocks - generateStoneBlocks(); - // Remove Builder Tables MATERIAL_BLOCKS_BUILDER = null; SURFACE_ROCK_BLOCKS_BUILDER = null; diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTConfiguredFeatures.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTConfiguredFeatures.java index 60a24c7054..10ca093582 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTConfiguredFeatures.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTConfiguredFeatures.java @@ -3,17 +3,21 @@ import com.gregtechceu.gtceu.GTCEu; import com.gregtechceu.gtceu.common.worldgen.RubberFoliagePlacer; import com.gregtechceu.gtceu.common.worldgen.RubberTrunkPlacer; +import com.gregtechceu.gtceu.common.worldgen.feature.configurations.StoneBlobConfiguration; import net.minecraft.core.Holder; import net.minecraft.data.worldgen.features.FeatureUtils; +import net.minecraft.tags.BlockTags; import net.minecraft.util.valueproviders.ConstantInt; import net.minecraft.util.valueproviders.UniformInt; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.Feature; +import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration; import net.minecraft.world.level.levelgen.feature.featuresize.TwoLayersFeatureSize; import net.minecraft.world.level.levelgen.feature.foliageplacers.MegaJungleFoliagePlacer; import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider; import net.minecraft.world.level.levelgen.feature.trunkplacers.ForkingTrunkPlacer; +import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest; import java.util.OptionalInt; @@ -24,13 +28,14 @@ */ public class GTConfiguredFeatures { public static final Holder> RUBBER = FeatureUtils.register(GTCEu.MOD_ID + ":rubber_tree", Feature.TREE, - new TreeConfiguration.TreeConfigurationBuilder( - BlockStateProvider.simple(GTBlocks.RUBBER_LOG.get().changeNatural(GTBlocks.RUBBER_LOG.getDefaultState(), true)), - new ForkingTrunkPlacer(5, 1, 3), - BlockStateProvider.simple(GTBlocks.RUBBER_LEAVES.get()), - new MegaJungleFoliagePlacer(ConstantInt.of(1), UniformInt.of(0, 1), 1), - new TwoLayersFeatureSize(1, 0, 2)).ignoreVines().build()); - -// public static final Holder> TREES_ADDITIONS = FeatureUtils.register(GTCEu.MOD_ID + ":trees_additions", Feature.RANDOM_SELECTOR, -// new RandomFeatureConfiguration(List.of(), GTPlacements.RUBBER_CHECKED)); + new TreeConfiguration.TreeConfigurationBuilder( + BlockStateProvider.simple(GTBlocks.RUBBER_LOG.get().changeNatural(GTBlocks.RUBBER_LOG.getDefaultState(), true)), + new ForkingTrunkPlacer(5, 1, 3), + BlockStateProvider.simple(GTBlocks.RUBBER_LEAVES.get()), + new MegaJungleFoliagePlacer(ConstantInt.of(1), UniformInt.of(0, 1), 1), + new TwoLayersFeatureSize(1, 0, 2)).ignoreVines().build()); + public static final Holder> RED_GRANITE_BLOB = FeatureUtils.register(GTCEu.MOD_ID + ":red_granite_blob", GTFeatures.STONE_BLOB.get(), + new StoneBlobConfiguration(OreConfiguration.target(new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES), GTBlocks.RED_GRANITE.getDefaultState()), UniformInt.of(20, 30))); + public static final Holder> MARBLE_BLOB = FeatureUtils.register(GTCEu.MOD_ID + ":marble_blob", GTFeatures.STONE_BLOB.get(), + new StoneBlobConfiguration(OreConfiguration.target(new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES), GTBlocks.MARBLE.getDefaultState()), UniformInt.of(20, 30))); } diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTCreativeModeTabs.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTCreativeModeTabs.java index 23761ec42b..4b1b430b7a 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTCreativeModeTabs.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTCreativeModeTabs.java @@ -3,8 +3,9 @@ import com.gregtechceu.gtceu.GTCEu; import com.gregtechceu.gtceu.api.GTValues; import com.gregtechceu.gtceu.api.data.chemical.ChemicalHelper; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.IGTTool; +import com.gregtechceu.gtceu.api.item.armor.ArmorComponentItem; import com.gregtechceu.gtceu.api.item.tool.GTToolType; import com.gregtechceu.gtceu.api.item.tool.ToolHelper; import com.gregtechceu.gtceu.api.data.tag.TagPrefix; diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTEntityTypes.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTEntityTypes.java new file mode 100644 index 0000000000..4f02f9bc7f --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTEntityTypes.java @@ -0,0 +1,33 @@ +package com.gregtechceu.gtceu.common.data; + +import com.gregtechceu.gtceu.common.entity.DynamiteEntity; +import com.gregtechceu.gtceu.common.entity.IndustrialTNTEntity; +import com.gregtechceu.gtceu.common.entity.PowderbarrelEntity; +import com.tterrag.registrate.util.entry.EntityEntry; +import net.minecraft.tags.EntityTypeTags; +import net.minecraft.world.entity.MobCategory; + +import static com.gregtechceu.gtceu.common.registry.GTRegistration.REGISTRATE; + +public class GTEntityTypes { + + public static final EntityEntry DYNAMITE = REGISTRATE.entity("dynamite", DynamiteEntity::new, MobCategory.MISC) + .lang("Dynamite") + .properties(builder -> builder.sized(0.25F, 0.25F).fireImmune().clientTrackingRange(4).updateInterval(10)) + .tag(EntityTypeTags.IMPACT_PROJECTILES) + .register(); + + public static final EntityEntry POWDERBARREL = REGISTRATE.entity("powderbarrel", PowderbarrelEntity::new, MobCategory.MISC) + .lang("Powderbarrel") + .properties(builder -> builder.sized(0.98F, 0.98F).fireImmune().clientTrackingRange(10).updateInterval(10)) + .register(); + + public static final EntityEntry INDUSTRIAL_TNT = REGISTRATE.entity("industrial_tnt", IndustrialTNTEntity::new, MobCategory.MISC) + .lang("Industrial TNT") + .properties(builder -> builder.sized(0.98F, 0.98F).fireImmune().clientTrackingRange(10).updateInterval(10)) + .register(); + + public static void init() { + + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTFeatures.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTFeatures.java index de3a4ea074..435ce4a5c7 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTFeatures.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTFeatures.java @@ -7,6 +7,7 @@ import com.gregtechceu.gtceu.api.data.worldgen.modifier.DimensionFilter; import com.gregtechceu.gtceu.api.data.worldgen.modifier.FrequencyModifier; import com.gregtechceu.gtceu.api.registry.GTRegistries; +import com.gregtechceu.gtceu.common.worldgen.feature.StoneBlobFeature; import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.data.recipe.CustomTags; import net.minecraft.core.Holder; @@ -17,22 +18,23 @@ import net.minecraft.data.worldgen.placement.VegetationPlacements; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.BiomeTags; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.levelgen.DensityFunctions; import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.Noises; +import net.minecraft.world.level.levelgen.VerticalAnchor; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.configurations.RandomFeatureConfiguration; -import net.minecraft.world.level.levelgen.placement.BiomeFilter; -import net.minecraft.world.level.levelgen.placement.InSquarePlacement; -import net.minecraft.world.level.levelgen.placement.PlacedFeature; +import net.minecraft.world.level.levelgen.placement.*; import net.minecraft.world.level.levelgen.synth.NormalNoise; import net.minecraftforge.common.world.BiomeModifier; import net.minecraftforge.common.world.ForgeBiomeModifiers; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.registries.RegistryObject; import java.util.List; @@ -48,6 +50,9 @@ public class GTFeatures { public static final DeferredRegister> CONFIGURED_FEATURE_REGISTER = DeferredRegister.create(Registry.CONFIGURED_FEATURE_REGISTRY, GTCEu.MOD_ID); public static final DeferredRegister PLACED_FEATURE_REGISTER = DeferredRegister.create(Registry.PLACED_FEATURE_REGISTRY, GTCEu.MOD_ID); public static final DeferredRegister BIOME_MODIFIER_REGISTER = DeferredRegister.create(ForgeRegistries.Keys.BIOME_MODIFIERS, GTCEu.MOD_ID); + public static final DeferredRegister> FEATURE_REGISTER = DeferredRegister.create(Registry.FEATURE_REGISTRY, GTCEu.MOD_ID); + + public static final RegistryObject STONE_BLOB = FEATURE_REGISTER.register("stone_blob", StoneBlobFeature::new); public static void init() { Object inst = FrequencyModifier.FREQUENCY_MODIFIER; // seemingly useless access to init the class in time @@ -80,6 +85,7 @@ public static void init() { } public static void init(IEventBus modEventBus) { + FEATURE_REGISTER.register(modEventBus); CONFIGURED_FEATURE_REGISTER.register(modEventBus); PLACED_FEATURE_REGISTER.register(modEventBus); BIOME_MODIFIER_REGISTER.register(modEventBus); @@ -107,6 +113,26 @@ public static void register() { PlacementUtils.filteredByBlockSurvival(GTBlocks.RUBBER_SAPLING.get()) )); }); + PLACED_FEATURE_REGISTER.register("red_granite_blob", () -> { + Registry> featureRegistry = BuiltinRegistries.ACCESS.registryOrThrow(Registry.CONFIGURED_FEATURE_REGISTRY); + var holder = featureRegistry.getOrCreateHolderOrThrow(ResourceKey.create(Registry.CONFIGURED_FEATURE_REGISTRY, GTCEu.id("red_granite_blob"))); + return new PlacedFeature(holder, List.of( + RarityFilter.onAverageOnceEvery(10), + InSquarePlacement.spread(), + BiomeFilter.biome(), + HeightRangePlacement.uniform(VerticalAnchor.absolute(-8), VerticalAnchor.top()) + )); + }); + PLACED_FEATURE_REGISTER.register("marble_blob", () -> { + Registry> featureRegistry = BuiltinRegistries.ACCESS.registryOrThrow(Registry.CONFIGURED_FEATURE_REGISTRY); + var holder = featureRegistry.getOrCreateHolderOrThrow(ResourceKey.create(Registry.CONFIGURED_FEATURE_REGISTRY, GTCEu.id("marble_blob"))); + return new PlacedFeature(holder, List.of( + RarityFilter.onAverageOnceEvery(10), + InSquarePlacement.spread(), + BiomeFilter.biome(), + HeightRangePlacement.uniform(VerticalAnchor.absolute(-8), VerticalAnchor.top()) + )); + }); BIOME_MODIFIER_REGISTER.register(id.getPath(), () -> { Registry biomeRegistry = BuiltinRegistries.ACCESS.registryOrThrow(Registry.BIOME_REGISTRY); @@ -119,5 +145,17 @@ public static void register() { GenerationStep.Decoration.VEGETAL_DECORATION ); }); + BIOME_MODIFIER_REGISTER.register("stone_blob", () -> { + Registry biomeRegistry = BuiltinRegistries.ACCESS.registryOrThrow(Registry.BIOME_REGISTRY); + Registry featureRegistry = BuiltinRegistries.ACCESS.registryOrThrow(Registry.PLACED_FEATURE_REGISTRY); + HolderSet biomes = new HolderSet.Named<>(biomeRegistry, BiomeTags.IS_OVERWORLD); + Holder redGraniteBlob = featureRegistry.getOrCreateHolderOrThrow(ResourceKey.create(Registry.PLACED_FEATURE_REGISTRY, GTCEu.id("red_granite_blob"))); + Holder marbleBlob = featureRegistry.getOrCreateHolderOrThrow(ResourceKey.create(Registry.PLACED_FEATURE_REGISTRY, GTCEu.id("marble_blob"))); + return new ForgeBiomeModifiers.AddFeaturesBiomeModifier( + biomes, + HolderSet.direct(redGraniteBlob, marbleBlob), + GenerationStep.Decoration.UNDERGROUND_ORES + ); + }); } } diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTItems.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTItems.java index c3b3719291..7007b4bbbd 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTItems.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTItems.java @@ -25,6 +25,7 @@ import com.gregtechceu.gtceu.api.item.ComponentItem; import com.gregtechceu.gtceu.api.item.IGTTool; import com.gregtechceu.gtceu.api.item.TagPrefixItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorComponentItem; import com.gregtechceu.gtceu.api.item.component.*; import com.gregtechceu.gtceu.api.item.tool.GTToolType; import com.gregtechceu.gtceu.api.item.tool.MaterialToolTier; @@ -33,6 +34,7 @@ import com.gregtechceu.gtceu.api.registry.registrate.GTRegistrate; import com.gregtechceu.gtceu.common.data.materials.GTFoods; import com.gregtechceu.gtceu.common.item.*; +import com.gregtechceu.gtceu.common.item.armor.*; import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.data.lang.LangHandler; import com.gregtechceu.gtceu.data.recipe.CustomTags; @@ -60,6 +62,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.stats.Stats; import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.*; import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.block.LayeredCauldronBlock; @@ -71,7 +74,6 @@ import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.NotNull; import java.util.*; import java.util.function.Function; import java.util.function.Supplier; @@ -404,69 +406,61 @@ public static ICustomDescriptionId cellName() { if (held != null && !held.isEmpty()) { prefix = FluidHelper.getDisplayName(held).getString(); } - return "%s %s".formatted(prefix, LocalizationUtils.format(itemStack.getItem().getDescriptionId())); + return "%s %s".formatted(prefix, itemStack.getItem().getDescription().getString()); }; } public static ItemEntry FLUID_CELL = REGISTRATE.item("fluid_cell", ComponentItem::create) - .model(cellModel()) .color(() -> GTItems::cellColor) + .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop()) .onRegister(compassNodeExist(GTCompassSections.ITEMS, "empty_cell")) - .onRegister(modelPredicate(GTCEu.id("fluid_cell"), (itemStack) -> FluidTransferHelper.getFluidContained(itemStack) == null ? 0f : 1f)) .onRegister(attach(ThermalFluidStats.create((int)FluidHelper.getBucket(), 1800, true, false, false, false, false), new ItemFluidContainer(), cellName())).register(); public static ItemEntry FLUID_CELL_UNIVERSAL = REGISTRATE.item("universal_fluid_cell", ComponentItem::create) .lang("Universal Cell") - .model(cellModel()) .color(() -> GTItems::cellColor) + .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop()) .onRegister(compassNodeExist(GTCompassSections.ITEMS, "empty_cell")) - .onRegister(modelPredicate(GTCEu.id("fluid_cell"), (itemStack) -> FluidTransferHelper.getFluidContained(itemStack) == null ? 0f : 1f)) .onRegister(attach(cellName(), ThermalFluidStats.create((int)FluidHelper.getBucket(), 1800, true, false, false, false, true), new ItemFluidContainer())).register(); public static ItemEntry FLUID_CELL_LARGE_STEEL = REGISTRATE.item("steel_fluid_cell", ComponentItem::create) .lang("Steel Cell") - .model(cellModel()) .color(() -> GTItems::cellColor) + .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop()) .onRegister(compassNodeExist(GTCompassSections.ITEMS, "empty_cell")) - .onRegister(modelPredicate(GTCEu.id("fluid_cell"), (itemStack) -> FluidTransferHelper.getFluidContained(itemStack) == null ? 0f : 1f)) .onRegister(attach(cellName(), ThermalFluidStats.create((int)FluidHelper.getBucket() * 8, GTMaterials.Steel.getProperty(PropertyKey.FLUID_PIPE).getMaxFluidTemperature(), true, false, false, false, true), new ItemFluidContainer())) .onRegister(materialInfo(new ItemMaterialInfo(new MaterialStack(GTMaterials.Steel, GTValues.M * 4)))).register(); public static ItemEntry FLUID_CELL_LARGE_ALUMINIUM = REGISTRATE.item("aluminium_fluid_cell", ComponentItem::create) .lang("Aluminium Cell") - .model(cellModel()) .color(() -> GTItems::cellColor) + .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop()) .onRegister(compassNodeExist(GTCompassSections.ITEMS, "empty_cell")) - .onRegister(modelPredicate(GTCEu.id("fluid_cell"), (itemStack) -> FluidTransferHelper.getFluidContained(itemStack) == null ? 0f : 1f)) .onRegister(attach(cellName(), ThermalFluidStats.create((int)FluidHelper.getBucket() * 32, GTMaterials.Aluminium.getProperty(PropertyKey.FLUID_PIPE).getMaxFluidTemperature(), true, false, false, false, true), new ItemFluidContainer())) .onRegister(materialInfo(new ItemMaterialInfo(new MaterialStack(GTMaterials.Aluminium, GTValues.M * 4)))).register(); public static ItemEntry FLUID_CELL_LARGE_STAINLESS_STEEL = REGISTRATE.item("stainless_steel_fluid_cell", ComponentItem::create) .lang("Stainless Steel Cell") - .model(cellModel()) .color(() -> GTItems::cellColor) + .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop()) .onRegister(compassNodeExist(GTCompassSections.ITEMS, "empty_cell")) - .onRegister(modelPredicate(GTCEu.id("fluid_cell"), (itemStack) -> FluidTransferHelper.getFluidContained(itemStack) == null ? 0f : 1f)) .onRegister(attach(cellName(), ThermalFluidStats.create((int)FluidHelper.getBucket() * 64, GTMaterials.StainlessSteel.getProperty(PropertyKey.FLUID_PIPE).getMaxFluidTemperature(), true, false, false, false, true), new ItemFluidContainer())) .onRegister(materialInfo(new ItemMaterialInfo(new MaterialStack(GTMaterials.StainlessSteel, GTValues.M * 6)))).register(); public static ItemEntry FLUID_CELL_LARGE_TITANIUM = REGISTRATE.item("titanium_fluid_cell", ComponentItem::create) .lang("Titanium Cell") - .model(cellModel()) .color(() -> GTItems::cellColor) + .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop()) .onRegister(compassNodeExist(GTCompassSections.ITEMS, "empty_cell")) - .onRegister(modelPredicate(GTCEu.id("fluid_cell"), (itemStack) -> FluidTransferHelper.getFluidContained(itemStack) == null ? 0f : 1f)) .onRegister(attach(cellName(), ThermalFluidStats.create((int)FluidHelper.getBucket() * 128, GTMaterials.Titanium.getProperty(PropertyKey.FLUID_PIPE).getMaxFluidTemperature(), true, false, false, false, true), new ItemFluidContainer())) .onRegister(materialInfo(new ItemMaterialInfo(new MaterialStack(GTMaterials.Titanium, GTValues.M * 6)))).register(); public static ItemEntry FLUID_CELL_LARGE_TUNGSTEN_STEEL = REGISTRATE.item("tungstensteel_fluid_cell", ComponentItem::create) .lang("Tungstensteel Cell") - .model(cellModel()) .color(() -> GTItems::cellColor) + .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop()) .properties(p -> p.stacksTo(32)) .onRegister(compassNodeExist(GTCompassSections.ITEMS, "empty_cell")) - .onRegister(modelPredicate(GTCEu.id("fluid_cell"), (itemStack) -> FluidTransferHelper.getFluidContained(itemStack) == null ? 0f : 1f)) .onRegister(attach(cellName(), ThermalFluidStats.create((int)FluidHelper.getBucket() * 512, GTMaterials.TungstenSteel.getProperty(PropertyKey.FLUID_PIPE).getMaxFluidTemperature(), true, false, false, false, true), new ItemFluidContainer())) .onRegister(materialInfo(new ItemMaterialInfo(new MaterialStack(GTMaterials.TungstenSteel, GTValues.M * 8)))).register(); public static ItemEntry FLUID_CELL_GLASS_VIAL = REGISTRATE.item("glass_vial", ComponentItem::create) - .model(cellModel()) .color(() -> GTItems::cellColor) + .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop()) .onRegister(compassNode(GTCompassSections.ITEMS)) - .onRegister(modelPredicate(GTCEu.id("fluid_cell"), (itemStack) -> FluidTransferHelper.getFluidContained(itemStack) == null ? 0f : 1f)) .onRegister(attach(cellName(), ThermalFluidStats.create((int)FluidHelper.getBucket(), 1200, false, true, false, false, true), new ItemFluidContainer())) .onRegister(materialInfo(new ItemMaterialInfo(new MaterialStack(GTMaterials.Glass, GTValues.M / 4)))).register(); @@ -910,7 +904,11 @@ public static ICustomDescriptionId cellName() { }))) .register() : null; - public static ItemEntry DYNAMITE; // TODO + public static ItemEntry DYNAMITE = REGISTRATE.item("dynamite", ComponentItem::create) + .lang("Dynamite") + .onRegister(attach(new DynamiteBehaviour())) + .tab(() -> TOOL) + .register(); public static ItemEntry CONVEYOR_MODULE_LV = REGISTRATE.item("lv_conveyor_module", ComponentItem::create) .lang("LV Conveyor Module") @@ -1679,31 +1677,124 @@ public static ICustomDescriptionId cellName() { public static ItemEntry CLIPBOARD; - // TODO ARMOR -// public static ArmorMetaItem.ArmorMetaValueItem NIGHTVISION_GOGGLES; -// -// public static ArmorMetaItem.ArmorMetaValueItem NANO_CHESTPLATE; -// public static ArmorMetaItem.ArmorMetaValueItem NANO_LEGGINGS; -// public static ArmorMetaItem.ArmorMetaValueItem NANO_BOOTS; -// public static ArmorMetaItem.ArmorMetaValueItem NANO_HELMET; -// -// public static ArmorMetaItem.ArmorMetaValueItem QUANTUM_CHESTPLATE; -// public static ArmorMetaItem.ArmorMetaValueItem QUANTUM_LEGGINGS; -// public static ArmorMetaItem.ArmorMetaValueItem QUANTUM_BOOTS; -// public static ArmorMetaItem.ArmorMetaValueItem QUANTUM_HELMET; -// -// public static ArmorMetaItem.ArmorMetaValueItem SEMIFLUID_JETPACK; -// public static ArmorMetaItem.ArmorMetaValueItem ELECTRIC_JETPACK; -// -// public static ArmorMetaItem.ArmorMetaValueItem ELECTRIC_JETPACK_ADVANCED; -// public static ArmorMetaItem.ArmorMetaValueItem NANO_CHESTPLATE_ADVANCED; -// public static ArmorMetaItem.ArmorMetaValueItem QUANTUM_CHESTPLATE_ADVANCED; + public static ItemEntry NIGHTVISION_GOGGLES = REGISTRATE.item("nightvision_goggles", (p) -> new ArmorComponentItem(GTArmorMaterials.GOGGLES, EquipmentSlot.HEAD, p) + .setArmorLogic(new NightvisionGoggles(2, + 80_000L * (long) Math.max(1, Math.pow(1, ConfigHolder.INSTANCE.tools.voltageTierNightVision - 1)), + ConfigHolder.INSTANCE.tools.voltageTierNightVision, EquipmentSlot.HEAD))) + .lang("Nightvision Goggles") + .register(); + + public static ItemEntry NANO_CHESTPLATE = REGISTRATE.item("nanomuscle_chestplate", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, EquipmentSlot.CHEST, p) + .setArmorLogic(new NanoMuscleSuite(EquipmentSlot.CHEST, + 512, + 6_400_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierNanoSuit - 3)), + ConfigHolder.INSTANCE.tools.voltageTierNanoSuit))) + .lang("NanoMuscle™ Suite Chestplate") + .properties(p -> p.rarity(Rarity.UNCOMMON)) + .register(); + public static ItemEntry NANO_LEGGINGS = REGISTRATE.item("nanomuscle_leggings", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, EquipmentSlot.LEGS, p) + .setArmorLogic(new NanoMuscleSuite(EquipmentSlot.LEGS, + 512, + 6_400_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierNanoSuit - 3)), + ConfigHolder.INSTANCE.tools.voltageTierNanoSuit))) + .lang("NanoMuscle™ Suite Leggings") + .properties(p -> p.rarity(Rarity.UNCOMMON)) + .register(); + public static ItemEntry NANO_BOOTS = REGISTRATE.item("nanomuscle_boots", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, EquipmentSlot.FEET, p) + .setArmorLogic(new NanoMuscleSuite(EquipmentSlot.FEET, + 512, + 6_400_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierNanoSuit - 3)), + ConfigHolder.INSTANCE.tools.voltageTierNanoSuit))) + .lang("NanoMuscle™ Suite Boots") + .properties(p -> p.rarity(Rarity.UNCOMMON)) + .register(); + public static ItemEntry NANO_HELMET = REGISTRATE.item("nanomuscle_helmet", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, EquipmentSlot.HEAD, p) + .setArmorLogic(new NanoMuscleSuite(EquipmentSlot.HEAD, + 512, + 6_400_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierNanoSuit - 3)), + ConfigHolder.INSTANCE.tools.voltageTierNanoSuit))) + .lang("NanoMuscle™ Suite Helmet") + .properties(p -> p.rarity(Rarity.UNCOMMON)) + .register(); + + public static ItemEntry QUANTUM_CHESTPLATE = REGISTRATE.item("quarktech_chestplate", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, EquipmentSlot.CHEST, p) + .setArmorLogic(new QuarkTechSuite(EquipmentSlot.CHEST, + 8192, + 100_000_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierQuarkTech - 5)), + ConfigHolder.INSTANCE.tools.voltageTierQuarkTech))) + .lang("QuarkTech™ Suite Chestplate") + .properties(p -> p.rarity(Rarity.RARE)) + .register(); + public static ItemEntry QUANTUM_LEGGINGS = REGISTRATE.item("quarktech_leggings", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, EquipmentSlot.LEGS, p) + .setArmorLogic(new QuarkTechSuite(EquipmentSlot.LEGS, + 8192, + 100_000_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierQuarkTech - 5)), + ConfigHolder.INSTANCE.tools.voltageTierQuarkTech))) + .lang("QuarkTech™ Suite Leggings") + .properties(p -> p.rarity(Rarity.RARE)) + .register(); + public static ItemEntry QUANTUM_BOOTS = REGISTRATE.item("quarktech_boots", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, EquipmentSlot.FEET, p) + .setArmorLogic(new QuarkTechSuite(EquipmentSlot.FEET, + 8192, + 100_000_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierQuarkTech - 5)), + ConfigHolder.INSTANCE.tools.voltageTierQuarkTech))) + .lang("QuarkTech™ Suite Leggings") + .properties(p -> p.rarity(Rarity.RARE)) + .register(); + public static ItemEntry QUANTUM_HELMET = REGISTRATE.item("quarktech_helmet", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, EquipmentSlot.HEAD, p) + .setArmorLogic(new QuarkTechSuite(EquipmentSlot.HEAD, + 8192, + 100_000_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierQuarkTech - 5)), + ConfigHolder.INSTANCE.tools.voltageTierQuarkTech))) + .lang("QuarkTech™ Suite Helmet") + .properties(p -> p.rarity(Rarity.RARE)) + .register(); + + public static ItemEntry LIQUID_FUEL_JETPACK = REGISTRATE.item("liquid_fuel_jetpack", (p) -> new ArmorComponentItem(GTArmorMaterials.JETPACK, EquipmentSlot.CHEST, p) + .setArmorLogic(new PowerlessJetpack())) + .lang("Liquid Fuel Jetpack") + .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop()) + .register(); + public static ItemEntry ELECTRIC_JETPACK = REGISTRATE.item("electric_jetpack", (p) -> new ArmorComponentItem(GTArmorMaterials.JETPACK, EquipmentSlot.CHEST, p) + .setArmorLogic(new Jetpack(30, + 1_000_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierImpeller - 2)), + ConfigHolder.INSTANCE.tools.voltageTierImpeller))) + .lang("Electric Jetpack") + .properties(p -> p.rarity(Rarity.UNCOMMON)) + .model(overrideModel(GTCEu.id("electric_jetpack"), 8)) + .onRegister(modelPredicate(GTCEu.id("electric_jetpack"), ElectricStats::getStoredPredicate)) + .register(); + + public static ItemEntry ELECTRIC_JETPACK_ADVANCED = REGISTRATE.item("advanced_electric_jetpack", (p) -> new ArmorComponentItem(GTArmorMaterials.JETPACK, EquipmentSlot.CHEST, p) + .setArmorLogic(new AdvancedJetpack(512, + 6_400_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierAdvImpeller - 4)), + ConfigHolder.INSTANCE.tools.voltageTierAdvImpeller))) + .lang("Advanced Electric Jetpack") + .properties(p -> p.rarity(Rarity.RARE)) + .register(); + public static ItemEntry NANO_CHESTPLATE_ADVANCED = REGISTRATE.item("avanced_nanomuscle_chestplate", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, EquipmentSlot.CHEST, p) + .setArmorLogic(new AdvancedNanoMuscleSuite(512, + 12_800_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierAdvNanoSuit - 3)), + ConfigHolder.INSTANCE.tools.voltageTierAdvNanoSuit))) + .lang("Advanced NanoMuscle™ Suite Chestplate") + .properties(p -> p.rarity(Rarity.RARE)) + .register(); + public static ItemEntry QUANTUM_CHESTPLATE_ADVANCED = REGISTRATE.item("advanced_quarktech_chestplate", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, EquipmentSlot.CHEST, p) + .setArmorLogic(new AdvancedQuarkTechSuite(8192, + 1_000_000_000L * + (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierAdvQuarkTech - 6)), + ConfigHolder.INSTANCE.tools.voltageTierAdvQuarkTech))) + .lang("Advanced QuarkTech™ Suite Chestplate") + .properties(p -> p.rarity(Rarity.EPIC)) + .register(); public static ItemEntry POWER_THRUSTER = REGISTRATE.item("power_thruster", Item::new).properties(p -> p.rarity(Rarity.UNCOMMON)).onRegister(compassNode(GTCompassSections.MISC)).register(); public static ItemEntry POWER_THRUSTER_ADVANCED = REGISTRATE.item("advanced_power_thruster", Item::new).lang("Advanced Power Thruster").properties(p -> p.rarity(Rarity.RARE)).onRegister(compassNode(GTCompassSections.MISC)).register(); public static ItemEntry GRAVITATION_ENGINE = REGISTRATE.item("gravitation_engine_unit", Item::new).lang("Gravitation Engine Unit").properties(p -> p.rarity(Rarity.EPIC)).onRegister(compassNode(GTCompassSections.MISC)).register(); - public static ItemEntry SUS_RECORD; + public static ItemEntry SUS_RECORD = REGISTRATE.item("sus_record", p -> new RecordItem(15, () -> GTSoundEntries.SUS_RECORD.getMainEvent(), p, 820)) + .lang("Music Disc") + .register(); public static ItemEntry NAN_CERTIFICATE = REGISTRATE.item("nan_certificate", Item::new).lang("Certificate of Not Being a Noob Anymore").properties(p -> p.rarity(Rarity.EPIC)).onRegister(compassNodeExist(GTCompassSections.MISC, "certificate_of_not_being_a_noob_anymore")).register(); public static ItemEntry FERTILIZER = REGISTRATE.item("fertilizer", ComponentItem::create).onRegister(attach(new FertilizerBehavior())).onRegister(compassNode(GTCompassSections.MISC)).register(); @@ -1773,6 +1864,10 @@ public static NonNullConsumer burnTime(int burnTime return item -> item.burnTime(burnTime); } + public static NonNullConsumer attach(IItemComponent components) { + return item -> item.attachComponents(components); + } + public static NonNullConsumer attach(IItemComponent... components) { return item -> item.attachComponents(components); } diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java index d68f257143..7948523a5f 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java @@ -93,7 +93,6 @@ import java.util.Locale; import java.util.function.BiConsumer; import java.util.function.BiFunction; -import java.util.function.Consumer; import java.util.function.Supplier; import java.util.stream.Stream; @@ -976,7 +975,7 @@ public static BiConsumer> createTankTooltips(String n .where('D', FLUID_EXPORT_HATCH[GTValues.LV], Direction.EAST) .where('H', MUFFLER_HATCH[GTValues.LV], Direction.UP) .where('M', MAINTENANCE_HATCH, Direction.NORTH); - ALL_COILS.entrySet().stream() + GTCEuAPI.HEATING_COILS.entrySet().stream() .sorted(Comparator.comparingInt(entry -> entry.getKey().getTier())) .forEach(coil -> shapeInfo.add(builder.shallowCopy().where('C', coil.getValue().get()).build())); return shapeInfo; @@ -1123,7 +1122,7 @@ public static BiConsumer> createTankTooltips(String n .where('H', MUFFLER_HATCH[GTValues.LV], Direction.SOUTH) .where('M', MAINTENANCE_HATCH, Direction.NORTH) .where('#', Blocks.AIR.defaultBlockState()); - ALL_COILS.entrySet().stream() + GTCEuAPI.HEATING_COILS.entrySet().stream() .sorted(Comparator.comparingInt(entry -> entry.getKey().getTier())) .forEach(coil -> shapeInfo.add(builder.shallowCopy().where('C', coil.getValue().get()).build())); return shapeInfo; @@ -1144,7 +1143,7 @@ public static BiConsumer> createTankTooltips(String n public static final MultiblockMachineDefinition MULTI_SMELTER = REGISTRATE.multiblock("multi_smelter", CoilWorkableElectricMultiblockMachine::new) .rotationState(RotationState.NON_Y_AXIS) .recipeTypes(GTRecipeTypes.FURNACE_RECIPES, GTRecipeTypes.ALLOY_SMELTER_RECIPES) - .recipeModifier(GTRecipeModifiers::multiSmelterOverclock) + .recipeModifiers(GTRecipeModifiers::multiSmelterParallel, GTRecipeModifiers.ELECTRIC_OVERCLOCK.apply(OverclockingLogic.NON_PERFECT_OVERCLOCK)) .appearanceBlock(CASING_INVAR_HEATPROOF) .pattern(definition -> FactoryBlockPattern.start() .aisle("XXX", "CCC", "XXX") @@ -1172,7 +1171,7 @@ public static BiConsumer> createTankTooltips(String n .where('H', MUFFLER_HATCH[GTValues.LV], Direction.SOUTH) .where('M', MAINTENANCE_HATCH, Direction.NORTH) .where('#', Blocks.AIR.defaultBlockState()); - ALL_COILS.entrySet().stream() + GTCEuAPI.HEATING_COILS.entrySet().stream() .sorted(Comparator.comparingInt(entry -> entry.getKey().getTier())) .forEach(coil -> shapeInfo.add(builder.shallowCopy().where('C', coil.getValue().get()).build())); return shapeInfo; @@ -1221,7 +1220,7 @@ public static BiConsumer> createTankTooltips(String n .where('M', MAINTENANCE_HATCH, Direction.NORTH) .where('X', MUFFLER_HATCH[GTValues.LV], Direction.SOUTH) .where('#', Blocks.AIR.defaultBlockState()); - ALL_COILS.entrySet().stream() + GTCEuAPI.HEATING_COILS.entrySet().stream() .sorted(Comparator.comparingInt(entry -> entry.getKey().getTier())) .forEach(coil -> shapeInfo.add(builder.shallowCopy().where('C', coil.getValue().get()).build())); return shapeInfo; @@ -1601,7 +1600,7 @@ public static BiConsumer> createTankTooltips(String n } else { builder.where('M',GTBlocks.PLASTCRETE.get()); } - ALL_FILTERS.values().forEach(block -> shapeInfo.add(builder.where('F', block.get()).build())); + GTCEuAPI.CLEANROOM_FILTERS.values().forEach(block -> shapeInfo.add(builder.where('F', block.get()).build())); return shapeInfo; }) .workableCasingRenderer(GTCEu.id("block/casings/cleanroom/plascrete"), @@ -1739,7 +1738,7 @@ public static BiConsumer> createTankTooltips(String n ? GTMachines.MAINTENANCE_HATCH.getBlock().defaultBlockState().setValue(GTMachines.MAINTENANCE_HATCH.get().getRotationState().property, Direction.SOUTH) : CASING_PALLADIUM_SUBSTATION.get().defaultBlockState()); - GTBlocks.PSS_BATTERIES.entrySet().stream() + GTCEuAPI.PSS_BATTERIES.entrySet().stream() // filter out empty batteries in example structures, though they are still // allowed in the predicate (so you can see them on right-click) .filter(entry -> entry.getKey().getCapacity() > 0) @@ -1991,7 +1990,7 @@ public static MultiblockMachineDefinition registerLargeBoiler(String name, Suppl .appearanceBlock(casing) .partAppearance((controller, part, side) -> controller.self().getPos().below().getY() == part.self().getPos().getY() ? fireBox.get().defaultBlockState() : casing.get().defaultBlockState()) .pattern((definition) -> { - TraceabilityPredicate fireboxPred = states(ALL_FIREBOXES.get(firebox).getDefaultState()).setMinGlobalLimited(3) + TraceabilityPredicate fireboxPred = blocks(ALL_FIREBOXES.get(firebox).get()).setMinGlobalLimited(3) .or(Predicates.abilities(PartAbility.IMPORT_FLUIDS).setMinGlobalLimited(1).setPreviewCount(1)) .or(Predicates.abilities(PartAbility.IMPORT_ITEMS).setMaxGlobalLimited(1).setPreviewCount(1)) .or(Predicates.abilities(PartAbility.MUFFLER).setExactLimit(1)); diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTMaterials.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTMaterials.java index 5b2f8f7d57..2e267a5201 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTMaterials.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTMaterials.java @@ -2,6 +2,7 @@ import com.gregtechceu.gtceu.GTCEu; import com.gregtechceu.gtceu.api.GTCEuAPI; +import com.gregtechceu.gtceu.api.data.chemical.ChemicalHelper; import com.gregtechceu.gtceu.api.data.chemical.material.MarkerMaterial; import com.gregtechceu.gtceu.api.data.chemical.material.MarkerMaterials; import com.gregtechceu.gtceu.api.data.chemical.material.Material; @@ -9,6 +10,7 @@ import com.gregtechceu.gtceu.api.data.chemical.material.stack.MaterialStack; import com.gregtechceu.gtceu.api.data.tag.TagPrefix; import com.gregtechceu.gtceu.common.data.materials.*; +import com.gregtechceu.gtceu.utils.SupplierMemoizer; import net.minecraft.world.item.Items; import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.block.Blocks; @@ -17,6 +19,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.function.Supplier; import static com.gregtechceu.gtceu.api.data.chemical.material.info.MaterialFlags.*; import static com.gregtechceu.gtceu.api.data.tag.TagPrefix.*; @@ -50,64 +53,21 @@ public static void init() { MarkerMaterials.register(); - /* - * Ranges 1-249 - */ ElementMaterials.register(); - - /* - * Ranges 250-999 - */ FirstDegreeMaterials.register(); - - /* - * Ranges 1000-1499 - */ OrganicChemistryMaterials.register(); - - /* - * Ranges 1500-1999 - */ UnknownCompositionMaterials.register(); - - /* - * Ranges 2000-2499 - */ SecondDegreeMaterials.register(); - - /* - * Ranges 2500-2999 - */ HigherDegreeMaterials.register(); + //Gregicality Multiblocks + GCyMMaterials.register(); + /* * Register info for cyclical references */ MaterialFlagAddition.register(); - /* - * FOR ADDON DEVELOPERS: - * - * GTCEu will not take more than 3000 IDs. Anything past ID 2999 - * is considered FAIR GAME, take whatever you like. - * - * If you would like to reserve IDs, feel free to reach out to the - * development team and claim a range of IDs! We will mark any - * claimed ranges below this comment. Max value is 32767. - * - * - Gregicality: 3000-19999 - * - Gregification: 20000-20999 - * - HtmlTech: 21000-21499 - * - GregTech Food Option: 21500-21999 - * - PCM's Ore Addon: 22000-23599 - * - MechTech: 23600-23999 - * - FREE RANGE 24000-31999 - * - Reserved for CraftTweaker: 32000-32767 - */ - - //Gregicality Multiblocks - GCyMMaterials.register(); - CHEMICAL_DYES = new Material[]{ DyeWhite, DyeOrange, DyeMagenta, DyeLightBlue, @@ -195,10 +155,10 @@ public static void init() { block.setIgnored(Blaze); block.setIgnored(Lapotron); - rock.setIgnored(Marble); + rock.setIgnored(Marble, SupplierMemoizer.memoizeBlockSupplier(() -> GTBlocks.MARBLE.get())); rock.setIgnored(Granite, Blocks.GRANITE); rock.setIgnored(Granite, Blocks.POLISHED_GRANITE); - rock.setIgnored(GraniteRed); + rock.setIgnored(GraniteRed, SupplierMemoizer.memoizeBlockSupplier(() -> GTBlocks.RED_GRANITE.get())); rock.setIgnored(Andesite, Blocks.ANDESITE); rock.setIgnored(Andesite, Blocks.POLISHED_ANDESITE); rock.setIgnored(Diorite, Blocks.DIORITE); @@ -207,6 +167,10 @@ public static void init() { rock.setIgnored(Netherrack, Blocks.NETHERRACK); rock.setIgnored(Obsidian, Blocks.OBSIDIAN); rock.setIgnored(Endstone, Blocks.END_STONE); + rock.setIgnored(Deepslate, Blocks.DEEPSLATE); + rock.setIgnored(Basalt, Blocks.BASALT); + block.setIgnored(Concrete, SupplierMemoizer.memoizeBlockSupplier(() -> GTBlocks.LIGHT_CONCRETE.get())); + block.setIgnored(Concrete, SupplierMemoizer.memoizeBlockSupplier(() -> GTBlocks.DARK_CONCRETE.get())); for (TagPrefix prefix : ORES.keySet()) { TagPrefix.OreType oreType = ORES.get(prefix); @@ -276,14 +240,6 @@ public static void init() { rawOreBlock.setIgnored(Iron, Blocks.RAW_IRON_BLOCK); rawOreBlock.setIgnored(Copper, Blocks.RAW_COPPER_BLOCK); - // TODO GT stone types, move out of this file - //ChemicalHelper.registerUnificationEntry(MetaBlocks.STONE_SMOOTH.getItemVariant(BlockStoneSmooth.BlockType.BLACK_GRANITE, 1), TagPrefix.stone, Deepslate); - //ChemicalHelper.registerUnificationEntry(MetaBlocks.STONE_SMOOTH.getItemVariant(BlockStoneSmooth.BlockType.RED_GRANITE, 1), TagPrefix.stone, GraniteRed); - //ChemicalHelper.registerUnificationEntry(MetaBlocks.STONE_SMOOTH.getItemVariant(BlockStoneSmooth.BlockType.MARBLE, 1), TagPrefix.stone, Marble); - //ChemicalHelper.registerUnificationEntry(MetaBlocks.STONE_SMOOTH.getItemVariant(BlockStoneSmooth.BlockType.BASALT, 1), TagPrefix.stone, Basalt); - //ChemicalHelper.registerUnificationEntry(MetaBlocks.STONE_SMOOTH.getItemVariant(BlockStoneSmooth.BlockType.CONCRETE_LIGHT, 1), TagPrefix.block, Concrete); - //ChemicalHelper.registerUnificationEntry(MetaBlocks.STONE_SMOOTH.getItemVariant(BlockStoneSmooth.BlockType.CONCRETE_DARK, 1), TagPrefix.block, Concrete); - block.modifyMaterialAmount(Amethyst, 4); block.modifyMaterialAmount(Glowstone, 4); block.modifyMaterialAmount(NetherQuartz, 4); diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTModels.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTModels.java index bf9ff27a6a..7f61f2217e 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTModels.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTModels.java @@ -86,9 +86,6 @@ public static void createTextureModel(DataGenContext ctx, public static void rubberTreeSaplingModel(DataGenContext context, RegistrateItemModelProvider provider) { provider.generated(context, provider.modLoc("block/" + provider.name(context))); } - public static void rubberDoorModel(DataGenContext ctx, RegistrateBlockstateProvider prov) { - prov.doorBlock(ctx.getEntry(), GTCEu.id("block/rubber_door_bottom"), GTCEu.id("block/rubber_door_top")); - } public static void longDistanceItemPipeModel(DataGenContext ctx, RegistrateBlockstateProvider prov) { prov.simpleBlock(ctx.getEntry(), prov.models().cubeAll("long_distance_item_pipeline", prov.modLoc("block/pipe/ld_item_pipe/block"))); diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTOres.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTOres.java index c37b38cbec..ed8eecff75 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTOres.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTOres.java @@ -14,6 +14,8 @@ import net.minecraft.data.worldgen.features.OreFeatures; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BiomeTags; +import net.minecraft.util.valueproviders.ConstantInt; +import net.minecraft.util.valueproviders.UniformInt; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.levelgen.VerticalAnchor; @@ -63,7 +65,7 @@ public class GTOres { public static RuleTest[] END_RULES = new RuleTest[]{WorldGeneratorUtils.END_ORE_REPLACEABLES}; public static final GTOreDefinition BAUXITE_VEIN_END = create("bauxite_vein_end", vein -> vein - .clusterSize(30).density(0.3f).weight(40) + .clusterSize(UniformInt.of(32, 40)).density(0.3f).weight(40) .layer(WorldGenLayers.ENDSTONE) .heightRangeUniform(10, 80) .biomes(BiomeTags.IS_END) @@ -82,7 +84,7 @@ public class GTOres { ); public static final GTOreDefinition MAGNETITE_VEIN_END = create("magnetite_vein_end", vein -> vein - .clusterSize(35).density(0.15f).weight(30) + .clusterSize(UniformInt.of(38, 44)).density(0.15f).weight(30) .layer(WorldGenLayers.ENDSTONE) .heightRangeUniform(20, 80) .biomes(BiomeTags.IS_END) @@ -101,7 +103,7 @@ public class GTOres { ); public static final GTOreDefinition NAQUADAH_VEIN = create("naquadah_vein", vein -> vein - .clusterSize(40).density(1.0f).weight(30) + .clusterSize(UniformInt.of(40, 52)).density(1.0f).weight(30) .layer(WorldGenLayers.ENDSTONE) .heightRangeUniform(10, 90) .biomes(BiomeTags.IS_END) @@ -123,7 +125,7 @@ public class GTOres { ); public static final GTOreDefinition PITCHBLENDE_VEIN = create("pitchblende_vein_end", vein -> vein - .clusterSize(30).density(1.0f).weight(30) + .clusterSize(UniformInt.of(32, 40)).density(1.0f).weight(30) .layer(WorldGenLayers.ENDSTONE) .heightRangeUniform(30, 60) .biomes(BiomeTags.IS_END) @@ -145,7 +147,7 @@ public class GTOres { ); public static final GTOreDefinition SCHEELITE_VEIN = create("scheelite_vein", vein -> vein - .clusterSize(30).density(0.2f).weight(20) + .clusterSize(UniformInt.of(32, 40)).density(0.2f).weight(20) .layer(WorldGenLayers.ENDSTONE) .heightRangeUniform(20, 60) .biomes(BiomeTags.IS_END) @@ -161,7 +163,7 @@ public class GTOres { ); public static final GTOreDefinition SHELDONITE_VEIN = create("sheldonite_vein", vein -> vein - .clusterSize(25).density(0.2f).weight(10) + .clusterSize(UniformInt.of(25, 29)).density(0.2f).weight(10) .layer(WorldGenLayers.ENDSTONE) .heightRangeUniform(5, 50) .biomes(BiomeTags.IS_END) @@ -185,7 +187,7 @@ public class GTOres { public static RuleTest[] NETHER_RULES = new RuleTest[]{OreFeatures.NETHER_ORE_REPLACEABLES}; public static final GTOreDefinition BANDED_IRON_VEIN = create("banded_iron_vein", vein -> vein - .clusterSize(40).density(1.0f).weight(30) + .clusterSize(UniformInt.of(40, 52)).density(1.0f).weight(30) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(20, 40) .biomes(BiomeTags.IS_NETHER) @@ -209,7 +211,7 @@ public class GTOres { ); public static final GTOreDefinition BERYLLIUM_VEIN = create("beryllium_vein", vein -> vein - .clusterSize(30).density(0.25f).weight(30) + .clusterSize(UniformInt.of(32, 40)).density(0.25f).weight(30) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(5, 30) .biomes(BiomeTags.IS_NETHER) @@ -225,7 +227,7 @@ public class GTOres { ); public static final GTOreDefinition CERTUS_QUARTZ_VEIN = create("certus_quartz", vein -> vein - .clusterSize(25).density(0.25f).weight(40) + .clusterSize(UniformInt.of(25, 29)).density(0.25f).weight(40) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(80, 120) .biomes(BiomeTags.IS_NETHER) @@ -243,7 +245,7 @@ public class GTOres { ); public static final GTOreDefinition MANGANESE_VEIN = create("manganese_vein", vein -> vein - .clusterSize(30).density(0.25f).weight(20) + .clusterSize(UniformInt.of(32, 40)).density(0.25f).weight(20) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(20, 30) .biomes(BiomeTags.IS_NETHER) @@ -259,7 +261,7 @@ public class GTOres { ); public static final GTOreDefinition MOLYBDENUM_VEIN = create("molybdenum_vein", vein -> vein - .clusterSize(25).density(0.25f).weight(5) + .clusterSize(UniformInt.of(25, 29)).density(0.25f).weight(5) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(20, 50) .biomes(BiomeTags.IS_NETHER) @@ -279,7 +281,7 @@ public class GTOres { ); public static final GTOreDefinition MONAZITE_VEIN = create("monazite_vein", vein -> vein - .clusterSize(25).density(0.25f).weight(30) + .clusterSize(UniformInt.of(25, 29)).density(0.25f).weight(30) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(20, 40) .biomes(BiomeTags.IS_NETHER) @@ -298,7 +300,7 @@ public class GTOres { ); public static final GTOreDefinition NETHER_QUARTZ_VEIN = create("nether_quartz_vein", vein -> vein - .clusterSize(30).density(0.2f).weight(80) + .clusterSize(UniformInt.of(32, 40)).density(0.2f).weight(80) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(40, 80) .biomes(BiomeTags.IS_NETHER) @@ -316,7 +318,7 @@ public class GTOres { ); public static final GTOreDefinition REDSTONE_VEIN = create("redstone_vein", vein -> vein - .clusterSize(30).density(0.2f).weight(60) + .clusterSize(UniformInt.of(32, 40)).density(0.2f).weight(60) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(5, 40) .biomes(BiomeTags.IS_NETHER) @@ -335,7 +337,7 @@ public class GTOres { ); public static final GTOreDefinition SALTPETER_VEIN = create("saltpeter_vein", vein -> vein - .clusterSize(30).density(0.25f).weight(40) + .clusterSize(UniformInt.of(32, 40)).density(0.25f).weight(40) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(5, 45) .biomes(BiomeTags.IS_NETHER) @@ -355,7 +357,7 @@ public class GTOres { ); public static final GTOreDefinition SULFUR_VEIN = create("sulfur_vein", vein -> vein - .clusterSize(30).density(0.2f).weight(100) + .clusterSize(UniformInt.of(32, 40)).density(0.2f).weight(100) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(10, 30) .biomes(BiomeTags.IS_NETHER) @@ -374,7 +376,7 @@ public class GTOres { ); public static final GTOreDefinition TETRAHEDRITE_VEIN = create("tetrahedrite_vein", vein -> vein - .clusterSize(40).density(1.0f).weight(70) + .clusterSize(UniformInt.of(40, 52)).density(1.0f).weight(70) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(80, 120) .biomes(BiomeTags.IS_NETHER) @@ -397,7 +399,7 @@ public class GTOres { ); public static final GTOreDefinition TOPAZ_VEIN = create("topaz_vein", vein -> vein - .clusterSize(25).density(0.25f).weight(70) + .clusterSize(UniformInt.of(25, 29)).density(0.25f).weight(70) .layer(WorldGenLayers.NETHERRACK) .heightRangeUniform(80, 120) .biomes(BiomeTags.IS_NETHER) @@ -426,7 +428,7 @@ public class GTOres { public static RuleTest[] OVERWORLD_RULES = new RuleTest[]{OreFeatures.STONE_ORE_REPLACEABLES }; public static final GTOreDefinition APATITE_VEIN = create("apatite_vein", vein -> vein - .clusterSize(30).density(0.25f).weight(40) + .clusterSize(UniformInt.of(32, 40)).density(0.25f).weight(40) .layer(WorldGenLayers.STONE) .heightRangeUniform(10, 80) .biomes(BiomeTags.IS_OVERWORLD) @@ -445,7 +447,7 @@ public class GTOres { ); public static final GTOreDefinition CASSITERITE_VEIN = create("cassiterite_vein", vein -> vein - .clusterSize(40).density(1.0f).weight(80) + .clusterSize(UniformInt.of(40, 52)).density(1.0f).weight(80) .layer(WorldGenLayers.STONE) .heightRangeUniform(10, 80) .biomes(BiomeTags.IS_OVERWORLD) @@ -466,7 +468,7 @@ public class GTOres { ); public static final GTOreDefinition COAL_VEIN = create("coal_vein", vein -> vein - .clusterSize(35).density(0.25f).weight(80) + .clusterSize(UniformInt.of(38, 44)).density(0.25f).weight(80) .layer(WorldGenLayers.STONE) .heightRangeUniform(10, 140) .biomes(BiomeTags.IS_OVERWORLD) @@ -482,7 +484,7 @@ public class GTOres { ); public static final GTOreDefinition COPPER_TIN_VEIN = create("copper_tin_vein", vein -> vein - .clusterSize(40).density(1.0f).weight(50) + .clusterSize(UniformInt.of(40, 52)).density(1.0f).weight(50) .layer(WorldGenLayers.STONE) .heightRangeUniform(-10, 160) .biomes(BiomeTags.IS_OVERWORLD) @@ -505,7 +507,7 @@ public class GTOres { ); public static final GTOreDefinition GALENA_VEIN = create("galena_vein", vein -> vein - .clusterSize(30).density(0.25f).weight(40) + .clusterSize(UniformInt.of(32, 40)).density(0.25f).weight(40) .layer(WorldGenLayers.STONE) .heightRangeUniform(-15, 45) .biomes(BiomeTags.IS_OVERWORLD) @@ -523,7 +525,7 @@ public class GTOres { ); public static final GTOreDefinition GARNET_TIN_VEIN = create("garnet_tin_vein", vein -> vein - .clusterSize(30).density(0.2f).weight(80) + .clusterSize(UniformInt.of(32, 40)).density(0.2f).weight(80) .layer(WorldGenLayers.STONE) .heightRangeUniform(30, 60) .biomes(BiomeTags.IS_OVERWORLD) @@ -542,7 +544,7 @@ public class GTOres { ); public static final GTOreDefinition GARNET_VEIN = create("garnet_vein", vein -> vein - .clusterSize(30).density(0.25f).weight(40) + .clusterSize(UniformInt.of(32, 40)).density(0.25f).weight(40) .layer(WorldGenLayers.STONE) .heightRangeUniform(-10, 50) .biomes(BiomeTags.IS_OVERWORLD) @@ -559,7 +561,7 @@ public class GTOres { ); public static final GTOreDefinition IRON_VEIN = create("iron_vein", vein -> vein - .clusterSize(40).density(1.0f).weight(120) + .clusterSize(UniformInt.of(40, 52)).density(1.0f).weight(120) .layer(WorldGenLayers.STONE) .heightRangeUniform(-10, 60) .biomes(BiomeTags.IS_OVERWORLD) @@ -581,7 +583,7 @@ public class GTOres { ); public static final GTOreDefinition LUBRICANT_VEIN = create("lubricant_vein", vein -> vein - .clusterSize(25).density(0.25f).weight(40) + .clusterSize(UniformInt.of(25, 29)).density(0.25f).weight(40) .layer(WorldGenLayers.STONE) .heightRangeUniform(0, 50) .biomes(BiomeTags.IS_OVERWORLD) @@ -599,7 +601,7 @@ public class GTOres { ); public static final GTOreDefinition MAGNETITE_VEIN_OW = create("magnetite_vein_ow", vein -> vein - .clusterSize(35).density(0.15f).weight(80) + .clusterSize(UniformInt.of(38, 44)).density(0.15f).weight(80) .layer(WorldGenLayers.STONE) .heightRangeUniform(10, 60) .biomes(BiomeTags.IS_OVERWORLD) @@ -616,7 +618,7 @@ public class GTOres { ); public static final GTOreDefinition MINERAL_SAND_VEIN = create("mineral_sand_vein", vein -> vein - .clusterSize(30).density(0.2f).weight(80) + .clusterSize(UniformInt.of(32, 40)).density(0.2f).weight(80) .layer(WorldGenLayers.STONE) .heightRangeUniform(15, 60) .biomes(BiomeTags.IS_OVERWORLD) @@ -635,7 +637,7 @@ public class GTOres { ); public static final GTOreDefinition NICKEL_VEIN = create("nickel_vein", vein -> vein - .clusterSize(30).density(0.25f).weight(40) + .clusterSize(UniformInt.of(32, 40)).density(0.25f).weight(40) .layer(WorldGenLayers.STONE) .heightRangeUniform(-10, 60) .biomes(BiomeTags.IS_OVERWORLD) @@ -654,7 +656,7 @@ public class GTOres { ); public static final GTOreDefinition SALTS_VEIN = create("salts_vein", vein -> vein - .clusterSize(30).density(0.2f).weight(50) + .clusterSize(UniformInt.of(32, 40)).density(0.2f).weight(50) .layer(WorldGenLayers.STONE) .heightRangeUniform(30, 70) .biomes(BiomeTags.IS_OVERWORLD) @@ -674,7 +676,7 @@ public class GTOres { public static final GTOreDefinition OILSANDS_VEIN = create("oilsands_vein", vein -> vein - .clusterSize(25).density(0.3f).weight(40) + .clusterSize(UniformInt.of(25, 29)).density(0.3f).weight(40) .layer(WorldGenLayers.STONE) .heightRangeUniform(30, 80) .biomes(BiomeTags.IS_OVERWORLD) @@ -697,7 +699,7 @@ public class GTOres { public static RuleTest[] DEEPSLATE_RULES = new RuleTest[]{OreFeatures.DEEPSLATE_ORE_REPLACEABLES }; public static final GTOreDefinition COPPER_VEIN = create("copper_vein", vein -> vein - .clusterSize(40).density(1.0f).weight(80) + .clusterSize(UniformInt.of(40, 52)).density(1.0f).weight(80) .layer(WorldGenLayers.DEEPSLATE) .heightRangeUniform(-40, 10) .biomes(BiomeTags.IS_OVERWORLD) @@ -719,7 +721,7 @@ public class GTOres { ); public static final GTOreDefinition DIAMOND_VEIN = create("diamond_vein", vein -> vein - .clusterSize(30).density(0.25f).weight(40) + .clusterSize(UniformInt.of(32, 40)).density(0.25f).weight(40) .layer(WorldGenLayers.DEEPSLATE) .heightRangeUniform(-65, -30) .biomes(BiomeTags.IS_OVERWORLD) @@ -739,7 +741,7 @@ public class GTOres { ); public static final GTOreDefinition LAPIS_VEIN = create("lapis_vein", vein -> vein - .clusterSize(40).density(0.25f).weight(40) + .clusterSize(UniformInt.of(40, 52)).density(0.25f).weight(40) .layer(WorldGenLayers.DEEPSLATE) .heightRangeUniform(-60, 10) .biomes(BiomeTags.IS_OVERWORLD) @@ -758,7 +760,7 @@ public class GTOres { ); public static final GTOreDefinition MANGANESE_VEIN_OW = create("manganese_vein_ow", vein -> vein - .clusterSize(50).density(0.25f).weight(20) + .clusterSize(UniformInt.of(50, 64)).density(0.25f).weight(20) .layer(WorldGenLayers.DEEPSLATE) .heightRangeUniform(-30, 0) .biomes(BiomeTags.IS_OVERWORLD) @@ -776,7 +778,7 @@ public class GTOres { ); public static final GTOreDefinition MICA_VEIN = create("mica_vein", vein -> vein - .clusterSize(30).density(0.25f).weight(20) + .clusterSize(UniformInt.of(32, 40)).density(0.25f).weight(20) .layer(WorldGenLayers.DEEPSLATE) .heightRangeUniform(-40, -10) .biomes(BiomeTags.IS_OVERWORLD) @@ -796,7 +798,7 @@ public class GTOres { ); public static final GTOreDefinition OLIVINE_VEIN = create("olivine_vein", vein -> vein - .clusterSize(30).density(0.25f).weight(20) + .clusterSize(UniformInt.of(32, 40)).density(0.25f).weight(20) .layer(WorldGenLayers.DEEPSLATE) .heightRangeUniform(-20, 10) .biomes(BiomeTags.IS_OVERWORLD) @@ -817,7 +819,7 @@ public class GTOres { ); public static final GTOreDefinition REDSTONE_VEIN_OW = create("redstone_vein_ow", vein -> vein - .clusterSize(30).density(0.2f).weight(60) + .clusterSize(UniformInt.of(32, 40)).density(0.2f).weight(60) .layer(WorldGenLayers.DEEPSLATE) .heightRangeUniform(-65, -10) .biomes(BiomeTags.IS_OVERWORLD) @@ -834,7 +836,7 @@ public class GTOres { ); public static final GTOreDefinition SAPPHIRE_VEIN = create("sapphire_vein", vein -> vein - .clusterSize(25).density(0.25f).weight(60) + .clusterSize(UniformInt.of(25, 29)).density(0.25f).weight(60) .layer(WorldGenLayers.DEEPSLATE) .heightRangeUniform(-40, 0) .biomes(BiomeTags.IS_OVERWORLD) @@ -892,13 +894,14 @@ public static void init() { public static void updateLargestVeinSize() { GTOres.largestVeinSize = GTRegistries.ORE_VEINS.values().stream() - .map(GTOreDefinition::clusterSize) - .max(Integer::compareTo) - .orElse(0); + .map(GTOreDefinition::clusterSize) + .map(intProvider -> (intProvider.getMinValue() + intProvider.getMaxValue()) / 2) // map to average of min & max values. + .max(Integer::compareTo) + .orElse(0); GTOres.largestIndicatorOffset = GTRegistries.ORE_VEINS.values().stream() .flatMap(definition -> definition.indicatorGenerators().stream().map(indicatorGenerator -> - indicatorGenerator.getSearchRadiusModifier((int) Math.ceil(definition.clusterSize() / 2.0)) + indicatorGenerator.getSearchRadiusModifier((int) Math.ceil(definition.clusterSize().getMinValue() / 2.0)) )) .max(Integer::compareTo) .orElse(0); @@ -906,9 +909,9 @@ public static void updateLargestVeinSize() { public static GTOreDefinition blankOreDefinition() { return new GTOreDefinition( - 0, 0, 0, IWorldGenLayer.NOWHERE, Set.of(), - HeightRangePlacement.uniform(VerticalAnchor.absolute(0), VerticalAnchor.absolute(0)), - 0, null, null, null, null + ConstantInt.of(0), 0, 0, IWorldGenLayer.NOWHERE, Set.of(), + HeightRangePlacement.uniform(VerticalAnchor.absolute(0), VerticalAnchor.absolute(0)), + 0, null, null, null, null ); } } diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeModifiers.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeModifiers.java index 6fea7fd65d..f4cd521edf 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeModifiers.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeModifiers.java @@ -14,18 +14,18 @@ import com.gregtechceu.gtceu.api.recipe.RecipeHelper; import com.gregtechceu.gtceu.api.recipe.content.Content; import com.gregtechceu.gtceu.api.recipe.content.ContentModifier; +import com.gregtechceu.gtceu.api.recipe.modifier.ParallelLogic; import com.gregtechceu.gtceu.api.recipe.modifier.RecipeModifier; -import lombok.val; +import com.mojang.datafixers.util.Pair; import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.Util; -import net.minecraft.util.Tuple; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.annotation.ParametersAreNonnullByDefault; import java.util.List; import java.util.Optional; -import java.util.function.BiFunction; import java.util.function.Function; /** @@ -39,19 +39,20 @@ public class GTRecipeModifiers { * Use it if machines are {@link IOverclockMachine}. */ public static final Function ELECTRIC_OVERCLOCK = Util.memoize(ElectricOverclockModifier::new); - public static final RecipeModifier PARALLEL_HATCH = (machine, recipe) -> GTRecipeModifiers.hatchParallel(machine, recipe, false).getA(); + public static final RecipeModifier PARALLEL_HATCH = (machine, recipe) -> GTRecipeModifiers.hatchParallel(machine, recipe, false).getFirst(); @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault public static class ElectricOverclockModifier implements RecipeModifier { private final OverclockingLogic overclockingLogic; - public ElectricOverclockModifier(OverclockingLogic overclockingLogic) { this.overclockingLogic = overclockingLogic; } + + @Nullable @Override - public GTRecipe apply(MetaMachine machine, GTRecipe recipe) { + public GTRecipe apply(MetaMachine machine, @NotNull GTRecipe recipe) { if (machine instanceof ITieredMachine tieredMachine && RecipeHelper.getRecipeEUtTier(recipe) > tieredMachine.getTier()) { return null; } @@ -70,18 +71,18 @@ public GTRecipe apply(MetaMachine machine, GTRecipe recipe) { * @param modifyDuration should multiply the duration * @return modified recipe and parallel amount */ - public static Tuple fastParallel(MetaMachine machine, @NotNull GTRecipe recipe, int maxParallel, boolean modifyDuration) { + public static Pair fastParallel(MetaMachine machine, @NotNull GTRecipe recipe, int maxParallel, boolean modifyDuration) { if (machine instanceof IRecipeCapabilityHolder holder) { while (maxParallel > 0) { var copied = recipe.copy(ContentModifier.multiplier(maxParallel), modifyDuration); if (copied.matchRecipe(holder).isSuccess() && copied.matchTickRecipe(holder).isSuccess()) { - return new Tuple<>(copied, maxParallel); + return Pair.of(copied, maxParallel); } maxParallel /= 2; } } - return new Tuple<>(recipe, 1); - }; + return Pair.of(recipe, 1); + } /** * Accurate parallel, always look for the maximum parallel value within maxParallel. @@ -91,47 +92,22 @@ public static Tuple fastParallel(MetaMachine machine, @NotNul * @param modifyDuration should multiply the duration * @return modified recipe and parallel amount */ - public static Tuple accurateParallel(MetaMachine machine, @NotNull GTRecipe recipe, int maxParallel, boolean modifyDuration) { + public static Pair accurateParallel(MetaMachine machine, @NotNull GTRecipe recipe, int maxParallel, boolean modifyDuration) { if (maxParallel == 1) { - return new Tuple<>(recipe, 1); + return Pair.of(recipe, 1); } -// if(!(machine instanceof ITieredMachine))return new Tuple<>(recipe, 1); - if (machine instanceof IRecipeCapabilityHolder holder) { - var parallel = tryParallel(holder, recipe, 1, maxParallel, modifyDuration); - return parallel == null ? new Tuple<>(recipe, 1) : parallel; - } - return null; + return ParallelLogic.applyParallel(machine, recipe, maxParallel, modifyDuration); } - private static Tuple tryParallel(IRecipeCapabilityHolder holder, GTRecipe original, int min, int max, boolean modifyDuration) { - if (min > max) return null; - - int mid = (min + max) / 2; - GTRecipe copied = original.copy(ContentModifier.multiplier(mid), modifyDuration); - if (!copied.matchRecipe(holder).isSuccess() || !copied.matchTickRecipe(holder).isSuccess() || - !(holder instanceof ITieredMachine && RecipeHelper.getRecipeEUtTier(copied) <= ((ITieredMachine)holder).getTier())) { - // tried too many - return tryParallel(holder, original, min, mid - 1, modifyDuration); - } else { - // at max parallels - if (mid == max) { - return new Tuple<>(copied, mid); - } - // matches, but try to do more - var tryMore = tryParallel(holder, original, mid + 1, max, modifyDuration); - return tryMore != null ? tryMore : new Tuple<>(copied, mid); - } - } - - public static Tuple hatchParallel(MetaMachine machine, @NotNull GTRecipe recipe, boolean modifyDuration) { + public static Pair hatchParallel(MetaMachine machine, @NotNull GTRecipe recipe, boolean modifyDuration) { if (machine instanceof IMultiController controller && controller.isFormed()) { Optional optional = controller.getParts().stream().filter(IParallelHatch.class::isInstance).map(IParallelHatch.class::cast).findAny(); if (optional.isPresent()) { IParallelHatch hatch = optional.get(); - return accurateParallel(machine, recipe, hatch.getCurrentParallel(), modifyDuration); + return ParallelLogic.applyParallel(machine, recipe, hatch.getCurrentParallel(), modifyDuration); } } - return new Tuple<>(recipe, 1); + return Pair.of(recipe, 1); } public static GTRecipe crackerOverclock(MetaMachine machine, @NotNull GTRecipe recipe) { @@ -153,7 +129,7 @@ public static GTRecipe crackerOverclock(MetaMachine machine, @NotNull GTRecipe r public static GTRecipe ebfOverclock(MetaMachine machine, @NotNull GTRecipe recipe) { if (machine instanceof CoilWorkableElectricMultiblockMachine coilMachine) { - val blastFurnaceTemperature = coilMachine.getCoilType().getCoilTemperature() + 100 * Math.max(0, coilMachine.getTier() - GTValues.MV); + final var blastFurnaceTemperature = coilMachine.getCoilType().getCoilTemperature() + 100 * Math.max(0, coilMachine.getTier() - GTValues.MV); if (!recipe.data.contains("ebf_temp") || recipe.data.getInt("ebf_temp") > blastFurnaceTemperature) { return null; } @@ -191,18 +167,17 @@ public static GTRecipe pyrolyseOvenOverclock(MetaMachine machine, @NotNull GTRec return null; } - public static GTRecipe multiSmelterOverclock(MetaMachine machine, @NotNull GTRecipe recipe) { + public static GTRecipe multiSmelterParallel(MetaMachine machine, @NotNull GTRecipe recipe) { if (machine instanceof CoilWorkableElectricMultiblockMachine coilMachine) { - var energyCost = Math.max(1L, 16 / coilMachine.getCoilType().getEnergyDiscount()); + var maxParallel = 32 * coilMachine.getCoilType().getLevel(); - var parallelLimit = Math.min(maxParallel, (int) (coilMachine.getOverclockVoltage() / energyCost)); - var result = GTRecipeModifiers.accurateParallel(machine, recipe, parallelLimit, false); - recipe = result.getA() == recipe ? result.getA().copy() : result.getA(); + var result = GTRecipeModifiers.accurateParallel(machine, recipe, maxParallel, false); + recipe = result.getFirst() == recipe ? result.getFirst().copy() : result.getFirst(); - int parallelValue = result.getB(); + int parallelValue = result.getSecond(); recipe.duration = Math.max(1, 256 * parallelValue / maxParallel); - long eut = parallelValue * energyCost; + long eut = 4 * (parallelValue / 8) / coilMachine.getCoilType().getEnergyDiscount(); recipe.tickInputs.put(EURecipeCapability.CAP, List.of(new Content(eut, 1.0f, 0.0f, null, null))); return recipe; } diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java index 1244e9d1f4..0726e59aea 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTRecipeTypes.java @@ -464,7 +464,7 @@ public class GTRecipeTypes { .setUiBuilder((recipe, widgetGroup) -> { int temp = recipe.data.getInt("ebf_temp"); List> items = new ArrayList<>(); - items.add(GTBlocks.ALL_COILS.entrySet().stream().filter(coil -> coil.getKey().getCoilTemperature() >= temp).map(coil -> new ItemStack(coil.getValue().get())).toList()); + items.add(GTCEuAPI.HEATING_COILS.entrySet().stream().filter(coil -> coil.getKey().getCoilTemperature() >= temp).map(coil -> new ItemStack(coil.getValue().get())).toList()); widgetGroup.addWidget(new SlotWidget(new CycleItemStackHandler(items), 0, widgetGroup.getSize().width - 25, widgetGroup.getSize().height - 32, false, false)); }) .setSound(GTSoundEntries.FURNACE); diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTSoundEntries.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTSoundEntries.java index 45f8ba1ba2..2f12b55d60 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTSoundEntries.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTSoundEntries.java @@ -44,6 +44,7 @@ public class GTSoundEntries { public static final SoundEntry COMPUTATION = REGISTRATE.sound("computation").build(); public static final SoundEntry MINER = REGISTRATE.sound("miner").build(); public static final SoundEntry SCIENCE = REGISTRATE.sound("science").build(); + public static final SoundEntry JET_ENGINE = REGISTRATE.sound("jet_engine").build(); public static final SoundEntry WRENCH_TOOL = REGISTRATE.sound("wrench").build(); public static final SoundEntry SOFT_MALLET_TOOL = REGISTRATE.sound("soft_hammer").build(); public static final SoundEntry DRILL_TOOL = REGISTRATE.sound("drill").build(); diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/machines/GCyMMachines.java b/src/main/java/com/gregtechceu/gtceu/common/data/machines/GCyMMachines.java index c8795d4fb9..e3a4edcd6c 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/machines/GCyMMachines.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/machines/GCyMMachines.java @@ -1,6 +1,7 @@ package com.gregtechceu.gtceu.common.data.machines; import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.api.GTCEuAPI; import com.gregtechceu.gtceu.api.GTValues; import com.gregtechceu.gtceu.api.data.RotationState; import com.gregtechceu.gtceu.api.data.chemical.ChemicalHelper; @@ -14,7 +15,6 @@ import com.gregtechceu.gtceu.api.pattern.MultiblockShapeInfo; import com.gregtechceu.gtceu.api.pattern.Predicates; import com.gregtechceu.gtceu.api.pattern.TraceabilityPredicate; -import com.gregtechceu.gtceu.api.pattern.MultiblockShapeInfo; import com.gregtechceu.gtceu.api.recipe.OverclockingLogic; import com.gregtechceu.gtceu.common.data.GTCompassSections; import com.gregtechceu.gtceu.common.data.GTMaterials; @@ -442,7 +442,7 @@ public static void init() {} .where('D', FLUID_EXPORT_HATCH[GTValues.LV], Direction.EAST) .where('H', MUFFLER_HATCH[GTValues.LV], Direction.UP) .where('M', MAINTENANCE_HATCH, Direction.NORTH); - ALL_COILS.entrySet().stream() + GTCEuAPI.HEATING_COILS.entrySet().stream() .sorted(Comparator.comparingInt(entry -> entry.getKey().getTier())) .forEach(coil -> shapeInfo.add(builder.shallowCopy().where('C', coil.getValue().get()).build())); return shapeInfo; @@ -781,7 +781,7 @@ public static void init() {} .where('D', FLUID_EXPORT_HATCH[GTValues.LV], Direction.NORTH) .where('H', MUFFLER_HATCH[GTValues.LV], Direction.UP) .where('M', MAINTENANCE_HATCH, Direction.SOUTH); - ALL_COILS.entrySet().stream() + GTCEuAPI.HEATING_COILS.entrySet().stream() .sorted(Comparator.comparingInt(entry -> entry.getKey().getTier())) .forEach(coil -> shapeInfo.add(builder.shallowCopy().where('C', coil.getValue().get()).build())); return shapeInfo; diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/materials/FirstDegreeMaterials.java b/src/main/java/com/gregtechceu/gtceu/common/data/materials/FirstDegreeMaterials.java index 27b3944677..0848479592 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/materials/FirstDegreeMaterials.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/materials/FirstDegreeMaterials.java @@ -9,7 +9,6 @@ import com.gregtechceu.gtceu.api.fluids.FluidBuilder; import com.gregtechceu.gtceu.api.fluids.FluidState; import com.gregtechceu.gtceu.api.fluids.attribute.FluidAttributes; -import com.gregtechceu.gtceu.api.fluids.store.FluidStorageKeys; import com.gregtechceu.gtceu.api.item.tool.GTToolType; import net.minecraft.world.item.enchantment.Enchantments; diff --git a/src/main/java/com/gregtechceu/gtceu/common/entity/DynamiteEntity.java b/src/main/java/com/gregtechceu/gtceu/common/entity/DynamiteEntity.java new file mode 100644 index 0000000000..ff5b61eda4 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/entity/DynamiteEntity.java @@ -0,0 +1,72 @@ +package com.gregtechceu.gtceu.common.entity; + +import com.gregtechceu.gtceu.common.data.GTEntityTypes; +import com.gregtechceu.gtceu.common.data.GTItems; +import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.projectile.ThrowableItemProjectile; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.Explosion; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.NotNull; + +public class DynamiteEntity extends ThrowableItemProjectile { + + private int ticksUntilExplosion; + + public DynamiteEntity(EntityType type, Level worldIn) { + super(type, worldIn); + } + + public DynamiteEntity(double x, double y, double z, Level worldIn) { + super(GTEntityTypes.DYNAMITE.get(), x, y, z, worldIn); + } + + public DynamiteEntity(LivingEntity throwerIn, Level worldIn) { + super(GTEntityTypes.DYNAMITE.get(), throwerIn, worldIn); + } + + @Override + public void onAddedToWorld() { + super.onAddedToWorld(); + ticksUntilExplosion = 80 + level.random.nextInt(60); + } + + @Override + @NotNull + protected Item getDefaultItem() { + return GTItems.DYNAMITE.get(); + } + + @Override + protected void onHitBlock(@NotNull BlockHitResult result) { + super.onHitBlock(result); + Vec3 vec3 = result.getLocation().subtract(this.getX(), this.getY(), this.getZ()); + this.setDeltaMovement(vec3); + Vec3 vec31 = vec3.normalize().scale(0.05F); + this.setPosRaw(this.getX() - vec31.x, this.getY() - vec31.y, this.getZ() - vec31.z); + } + + @Override + public void tick() { + ticksUntilExplosion--; + + if (level.random.nextInt(3) == 2) { + level.addParticle(ParticleTypes.SMOKE, this.getX(), this.getY(), this.getZ(), -this.getDeltaMovement().x * 0.05f, + this.isOnGround() ? 0.05f : -this.getDeltaMovement().y * 0.05f, -this.getDeltaMovement().z * 0.05f); + } + + if (ticksUntilExplosion < 0 && !level.isClientSide) { + Entity thrower = getOwner(); + level.explode(thrower == null ? this : thrower, this.getX(), this.getY(), this.getZ(), 1.5f, Explosion.BlockInteraction.BREAK); + this.discard(); + return; + } + + super.tick(); + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/entity/GTExplosiveEntity.java b/src/main/java/com/gregtechceu/gtceu/common/entity/GTExplosiveEntity.java new file mode 100644 index 0000000000..f50db40bc8 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/entity/GTExplosiveEntity.java @@ -0,0 +1,85 @@ +package com.gregtechceu.gtceu.common.entity; + +import com.gregtechceu.gtceu.core.mixins.PrimedTntAccessor; +import net.minecraft.network.protocol.game.ClientboundExplodePacket; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.item.PrimedTnt; +import net.minecraft.world.level.Explosion; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraftforge.event.ForgeEventFactory; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public abstract class GTExplosiveEntity extends PrimedTnt { + public GTExplosiveEntity(EntityType type, Level level, double x, double y, double z, @Nullable LivingEntity owner) { + this(type, level); + this.setPos(x, y, z); + double d = level.random.nextDouble() * (float) (Math.PI * 2); + this.setDeltaMovement(-Math.sin(d) * 0.02, 0.2F, -Math.cos(d) * 0.02); + this.setFuse(80); + this.xo = x; + this.yo = y; + this.zo = z; + ((PrimedTntAccessor)this).setOwner(owner); + } + + public GTExplosiveEntity(EntityType type, Level world) { + super(type, world); + } + + /** + * @return The strength of the explosive. + */ + protected abstract float getStrength(); + + /** + * @return Whether to drop all blocks, or use default logic + */ + public abstract boolean dropsAllBlocks(); + + /** + * @return The range of the explosive, if {@link #dropsAllBlocks} is true. + */ + protected int getRange() { + return 2; + } + + /** + * @return The block state of the block this explosion entity is created by. + */ + public abstract @NotNull BlockState getExplosiveState(); + + @Override + protected void explode() { + explode(level, this, this.getX(), this.getY(0.0625), this.getZ(), getStrength(), dropsAllBlocks()); + } + + protected void explode( + Level level, @Nullable Entity source, + double x, double y, double z, float radius, boolean dropBlocks) { + Explosion explosion = new Explosion( + level, source, + x, y, z, + radius, + false, + dropBlocks ? Explosion.BlockInteraction.BREAK : Explosion.BlockInteraction.DESTROY + ); + if (!ForgeEventFactory.onExplosionStart(level, explosion)) { + explosion.explode(); + explosion.finalizeExplosion(false); + } + + if (level instanceof ServerLevel serverLevel) { + for(ServerPlayer serverplayer : serverLevel.players()) { + if (serverplayer.distanceToSqr(x, y, z) < 4096.0) { + serverplayer.connection.send(new ClientboundExplodePacket(x, y, z, radius, explosion.getToBlow(), explosion.getHitPlayers().get(serverplayer))); + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/entity/IndustrialTNTEntity.java b/src/main/java/com/gregtechceu/gtceu/common/entity/IndustrialTNTEntity.java new file mode 100644 index 0000000000..300cafd237 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/entity/IndustrialTNTEntity.java @@ -0,0 +1,41 @@ +package com.gregtechceu.gtceu.common.entity; + +import com.gregtechceu.gtceu.common.data.GTBlocks; +import com.gregtechceu.gtceu.common.data.GTEntityTypes; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class IndustrialTNTEntity extends GTExplosiveEntity { + public IndustrialTNTEntity(Level world, double x, double y, double z, @Nullable LivingEntity owner) { + super(GTEntityTypes.INDUSTRIAL_TNT.get(), world, x, y, z, owner); + } + + @SuppressWarnings("unused") + public IndustrialTNTEntity(EntityType type, Level world) { + super(type, world); + } + + @Override + protected float getStrength() { + return 5.0F; + } + + @Override + public boolean dropsAllBlocks() { + return true; + } + + @Override + protected int getRange() { + return 3; + } + + @Override + public @NotNull BlockState getExplosiveState() { + return GTBlocks.INDUSTRIAL_TNT.getDefaultState(); + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/common/entity/PowderbarrelEntity.java b/src/main/java/com/gregtechceu/gtceu/common/entity/PowderbarrelEntity.java new file mode 100644 index 0000000000..ec0ceace4a --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/entity/PowderbarrelEntity.java @@ -0,0 +1,36 @@ +package com.gregtechceu.gtceu.common.entity; + +import com.gregtechceu.gtceu.common.data.GTBlocks; +import com.gregtechceu.gtceu.common.data.GTEntityTypes; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class PowderbarrelEntity extends GTExplosiveEntity { + public PowderbarrelEntity(Level world, double x, double y, double z, @Nullable LivingEntity owner) { + super(GTEntityTypes.POWDERBARREL.get(), world, x, y, z, owner); + } + + public PowderbarrelEntity(EntityType type, Level world) { + super(type, world); + } + + @Override + protected float getStrength() { + return 3.5F; + } + + @Override + public boolean dropsAllBlocks() { + return true; + } + + @Override + @NotNull + public BlockState getExplosiveState() { + return GTBlocks.POWDERBARREL.getDefaultState(); + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/CoverPlaceBehavior.java b/src/main/java/com/gregtechceu/gtceu/common/item/CoverPlaceBehavior.java index 9f7019c8bf..4f2badbd03 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/item/CoverPlaceBehavior.java +++ b/src/main/java/com/gregtechceu/gtceu/common/item/CoverPlaceBehavior.java @@ -3,7 +3,7 @@ import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; import com.gregtechceu.gtceu.api.capability.ICoverable; import com.gregtechceu.gtceu.api.cover.CoverDefinition; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.component.IInteractionItem; import com.gregtechceu.gtceu.api.item.component.IItemComponent; import com.gregtechceu.gtceu.api.item.tool.GTToolType; @@ -49,7 +49,7 @@ public InteractionResult onItemUseFirst(ItemStack itemStack, UseOnContext contex public static boolean isCoverBehaviorItem(ItemStack itemStack, @Nullable BooleanSupplier hasCoverSupplier, @Nullable Predicate canPlaceCover) { Item item = itemStack.getItem(); - if (item instanceof ComponentItem componentItem) { + if (item instanceof IComponentItem componentItem) { for (IItemComponent component : componentItem.getComponents()) { if (component instanceof CoverPlaceBehavior placeBehavior) { if (canPlaceCover == null || canPlaceCover.test(placeBehavior.coverDefinition)) { diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/DynamiteBehaviour.java b/src/main/java/com/gregtechceu/gtceu/common/item/DynamiteBehaviour.java new file mode 100644 index 0000000000..574fab0577 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/DynamiteBehaviour.java @@ -0,0 +1,48 @@ +package com.gregtechceu.gtceu.common.item; + +import com.gregtechceu.gtceu.api.item.component.IInteractionItem; +import com.gregtechceu.gtceu.common.entity.DynamiteEntity; +import net.minecraft.Util; +import net.minecraft.core.Position; +import net.minecraft.core.dispenser.AbstractProjectileDispenseBehavior; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.entity.projectile.Projectile; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.DispenserBlock; + +public class DynamiteBehaviour implements IInteractionItem { + + @Override + public void onAttached(Item item) { + DispenserBlock.registerBehavior(item, new AbstractProjectileDispenseBehavior() { + @Override + protected Projectile getProjectile(Level level, Position position, ItemStack stack) { + return Util.make(new DynamiteEntity(position.x(), position.y(), position.z(), level), entity -> entity.setItem(stack)); + } + }); + } + + @Override + public InteractionResultHolder use(Item item, Level level, Player player, InteractionHand usedHand) { + ItemStack itemstack = player.getItemInHand(usedHand); + + if (!player.isCreative()) { + itemstack.shrink(1); + } + + if (level.isClientSide) { + return InteractionResultHolder.success(itemstack); + } + + DynamiteEntity entity = new DynamiteEntity(player, level); + entity.shootFromRotation(player, player.getXRot(), player.getYRot(), 0.0F, 0.7F, 1.0F); + + level.addFreshEntity(entity); + + return InteractionResultHolder.success(itemstack); + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/FacadeItemBehaviour.java b/src/main/java/com/gregtechceu/gtceu/common/item/FacadeItemBehaviour.java index 0631de1e33..fda08ed3c4 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/item/FacadeItemBehaviour.java +++ b/src/main/java/com/gregtechceu/gtceu/common/item/FacadeItemBehaviour.java @@ -1,13 +1,12 @@ package com.gregtechceu.gtceu.common.item; import com.google.common.collect.ImmutableList; -import com.gregtechceu.gtceu.api.item.ComponentItem; import com.gregtechceu.gtceu.client.renderer.cover.FacadeCoverRenderer; import com.gregtechceu.gtceu.common.data.GTBlocks; -import com.gregtechceu.gtceu.common.data.GTCreativeModeTabs; import com.gregtechceu.gtceu.api.item.component.ICustomDescriptionId; import com.gregtechceu.gtceu.api.item.component.ICustomRenderer; import com.gregtechceu.gtceu.api.item.component.ISubItemHandler; +import com.gregtechceu.gtceu.common.data.GTCreativeModeTabs; import com.lowdragmc.lowdraglib.client.renderer.IRenderer; import com.lowdragmc.lowdraglib.utils.LocalizationUtils; import net.minecraft.core.NonNullList; @@ -15,6 +14,7 @@ import net.minecraft.nbt.Tag; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.RenderShape; @@ -45,7 +45,7 @@ public String getItemStackDisplayName(ItemStack itemStack) { } @Override - public void fillItemCategory(ComponentItem item, CreativeModeTab category, NonNullList items) { + public void fillItemCategory(Item item, CreativeModeTab category, NonNullList items) { if (category == GTCreativeModeTabs.ITEM) { List validFacades = ImmutableList.of(new ItemStack(Blocks.STONE), GTBlocks.COIL_CUPRONICKEL.asStack(), new ItemStack(Blocks.GLASS)); for (ItemStack facadeStack : validFacades) { diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/FluidFilterBehaviour.java b/src/main/java/com/gregtechceu/gtceu/common/item/FluidFilterBehaviour.java index fd6c3632f9..22705c642c 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/item/FluidFilterBehaviour.java +++ b/src/main/java/com/gregtechceu/gtceu/common/item/FluidFilterBehaviour.java @@ -3,7 +3,7 @@ import com.gregtechceu.gtceu.api.cover.filter.FluidFilter; import com.gregtechceu.gtceu.api.gui.GuiTextures; import com.gregtechceu.gtceu.api.gui.UITemplate; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.component.IItemUIFactory; import com.lowdragmc.lowdraglib.gui.factory.HeldItemUIFactory; import com.lowdragmc.lowdraglib.gui.modular.ModularUI; diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/ItemFilterBehaviour.java b/src/main/java/com/gregtechceu/gtceu/common/item/ItemFilterBehaviour.java index 7e9960fefc..54dfe3f6af 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/item/ItemFilterBehaviour.java +++ b/src/main/java/com/gregtechceu/gtceu/common/item/ItemFilterBehaviour.java @@ -1,6 +1,6 @@ package com.gregtechceu.gtceu.common.item; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.component.IItemUIFactory; import com.gregtechceu.gtceu.api.cover.filter.ItemFilter; import com.gregtechceu.gtceu.api.gui.GuiTextures; diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/ItemMagnetBehavior.java b/src/main/java/com/gregtechceu/gtceu/common/item/ItemMagnetBehavior.java index c6e4b36557..e31e1b2216 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/item/ItemMagnetBehavior.java +++ b/src/main/java/com/gregtechceu/gtceu/common/item/ItemMagnetBehavior.java @@ -3,7 +3,7 @@ import com.gregtechceu.gtceu.api.GTValues; import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; import com.gregtechceu.gtceu.api.capability.IElectricItem; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.component.IAddInformation; import com.gregtechceu.gtceu.api.item.component.IInteractionItem; import com.gregtechceu.gtceu.api.item.component.IItemLifeCycle; @@ -172,7 +172,7 @@ public void onItemToss(@NotNull ItemTossEvent event) { } private boolean isMagnet(@NotNull ItemStack stack) { - if (stack.getItem() instanceof ComponentItem metaItem) { + if (stack.getItem() instanceof IComponentItem metaItem) { for (var behavior : metaItem.getComponents()) { if (behavior instanceof ItemMagnetBehavior) { return true; diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/TurbineRotorBehaviour.java b/src/main/java/com/gregtechceu/gtceu/common/item/TurbineRotorBehaviour.java index 25784cc094..6cdcdad77e 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/item/TurbineRotorBehaviour.java +++ b/src/main/java/com/gregtechceu/gtceu/common/item/TurbineRotorBehaviour.java @@ -2,12 +2,14 @@ import com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.component.IMaterialPartItem; import com.gregtechceu.gtceu.api.item.component.ISubItemHandler; +import com.gregtechceu.gtceu.core.mixins.ItemAccessor; import net.minecraft.core.NonNullList; import net.minecraft.network.chat.Component; import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; @@ -26,9 +28,9 @@ public class TurbineRotorBehaviour implements IMaterialPartItem, ISubItemHandler { @Override - public void fillItemCategory(ComponentItem item, CreativeModeTab category, NonNullList items) { - if (item.allowedIn(category)) { - turbineBlade.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> { + public void fillItemCategory(Item item, CreativeModeTab category, NonNullList items) { + if (((ItemAccessor)item).invokeAllowedIn(category)) { + turbineBlade.executeHandler(null, PropertyKey.INGOT, (tagPrefix, material, property, provider) -> { var rotorStack = new ItemStack(item); var behavior = TurbineRotorBehaviour.getBehaviour(rotorStack); if (behavior != null) { @@ -78,7 +80,7 @@ public void appendHoverText(ItemStack stack, @org.jetbrains.annotations.Nullable @Nullable public static TurbineRotorBehaviour getBehaviour(@NotNull ItemStack itemStack) { - if (itemStack.getItem() instanceof ComponentItem componentItem) { + if (itemStack.getItem() instanceof IComponentItem componentItem) { for (var component : componentItem.getComponents()) { if (component instanceof TurbineRotorBehaviour behaviour) { return behaviour; diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/armor/AdvancedJetpack.java b/src/main/java/com/gregtechceu/gtceu/common/item/armor/AdvancedJetpack.java new file mode 100644 index 0000000000..69362d276e --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/armor/AdvancedJetpack.java @@ -0,0 +1,104 @@ +package com.gregtechceu.gtceu.common.item.armor; + +import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; +import com.gregtechceu.gtceu.api.capability.IElectricItem; +import com.gregtechceu.gtceu.utils.input.KeyBind; +import net.minecraft.core.particles.ParticleOptions; +import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.NotNull; + +public class AdvancedJetpack extends Jetpack { + + public AdvancedJetpack(int energyPerUse, long capacity, int tier) { + super(energyPerUse, capacity, tier); + } + + @Override + public void onArmorTick(Level world, Player player, @NotNull ItemStack stack) { + IElectricItem cont = GTCapabilityHelper.getElectricItem(stack); + if (cont == null) { + return; + } + CompoundTag data = stack.getOrCreateTag(); + boolean hoverMode = data.contains("hover") && data.getBoolean("hover"); + byte toggleTimer = data.contains("toggleTimer") ? data.getByte("toggleTimer") : 0; + + if (toggleTimer == 0 && KeyBind.ARMOR_HOVER.isKeyDown(player)) { + hoverMode = !hoverMode; + toggleTimer = 5; + data.putBoolean("hover", hoverMode); + if (!world.isClientSide) { + if (hoverMode) + player.displayClientMessage(Component.translatable("metaarmor.jetpack.hover.enable"), true); + else + player.displayClientMessage(Component.translatable("metaarmor.jetpack.hover.disable"), true); + } + } + + performFlying(player, hoverMode, stack); + + if (toggleTimer > 0) toggleTimer--; + + data.putBoolean("hover", hoverMode); + data.putByte("toggleTimer", toggleTimer); + } + + @Override + public double getSprintEnergyModifier() { + return 2.5D; + } + + @Override + public double getSprintSpeedModifier() { + return 1.3D; + } + + @Override + public double getVerticalHoverSpeed() { + return 0.34D; + } + + @Override + public double getVerticalHoverSlowSpeed() { + return 0.03D; + } + + @Override + public double getVerticalAcceleration() { + return 0.13D; + } + + @Override + public double getVerticalSpeed() { + return 0.48D; + } + + @Override + public double getSidewaysSpeed() { + return 0.14D; + } + + @Override + public ParticleOptions getParticle() { + return ParticleTypes.CLOUD; + } + + @Override + public float getFallDamageReduction() { + return 2.0f; + } + + @Override + public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { + return GTCEu.id("textures/armor/advanced_jetpack.png"); + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/armor/AdvancedNanoMuscleSuite.java b/src/main/java/com/gregtechceu/gtceu/common/item/armor/AdvancedNanoMuscleSuite.java new file mode 100644 index 0000000000..fd424c1975 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/armor/AdvancedNanoMuscleSuite.java @@ -0,0 +1,294 @@ +package com.gregtechceu.gtceu.common.item.armor; + +import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; +import com.gregtechceu.gtceu.api.capability.IElectricItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorComponentItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorUtils; +import com.gregtechceu.gtceu.utils.input.KeyBind; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.datafixers.util.Pair; +import net.minecraft.core.NonNullList; +import net.minecraft.core.particles.ParticleOptions; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Iterator; +import java.util.List; + +public class AdvancedNanoMuscleSuite extends NanoMuscleSuite implements IJetpack { + + // A replacement for checking the current world time, to get around the gamerule that stops it + private long timer = 0L; + private List, List>> inventoryIndexMap; + + public AdvancedNanoMuscleSuite(int energyPerUse, long capacity, int tier) { + super(EquipmentSlot.CHEST, energyPerUse, capacity, tier); + } + + @Override + public void onArmorTick(Level world, Player player, @NotNull ItemStack item) { + IElectricItem cont = GTCapabilityHelper.getElectricItem(item); + if (cont == null) { + return; + } + + CompoundTag data = item.getOrCreateTag(); + boolean hoverMode = data.contains("hover") && data.getBoolean("hover"); + byte toggleTimer = data.contains("toggleTimer") ? data.getByte("toggleTimer") : 0; + boolean canShare = data.contains("canShare") && data.getBoolean("canShare"); + + if (toggleTimer == 0 && KeyBind.ARMOR_HOVER.isKeyDown(player)) { + hoverMode = !hoverMode; + toggleTimer = 5; + data.putBoolean("hover", hoverMode); + if (!world.isClientSide) { + if (hoverMode) + player.displayClientMessage(Component.translatable("metaarmor.jetpack.hover.enable"), true); + else + player.displayClientMessage(Component.translatable("metaarmor.jetpack.hover.disable"), true); + } + } + + if (toggleTimer == 0 && KeyBind.ARMOR_CHARGING.isKeyDown(player)) { + canShare = !canShare; + toggleTimer = 5; + if (!world.isClientSide) { + if (canShare && cont.getCharge() == 0) + player.displayClientMessage(Component.translatable("metaarmor.nms.share.error"), true); + else if (canShare) + player.displayClientMessage(Component.translatable("metaarmor.nms.share.enable"), true); + else + player.displayClientMessage(Component.translatable("metaarmor.nms.share.disable"), true); + } + + // Only allow for charging to be enabled if charge is nonzero + canShare = canShare && (cont.getCharge() != 0); + data.putBoolean("canShare", canShare); + } + + performFlying(player, hoverMode, item); + + // Charging mechanics + if (canShare && !world.isClientSide) { + // Check for new things to charge every 5 seconds + if (timer % 100 == 0) + inventoryIndexMap = ArmorUtils.getChargeableItem(player, cont.getTier()); + + if (inventoryIndexMap != null && !inventoryIndexMap.isEmpty()) { + // Charge all inventory slots + for (int i = 0; i < inventoryIndexMap.size(); i++) { + Pair, List> inventoryMap = inventoryIndexMap.get(i); + Iterator inventoryIterator = inventoryMap.getSecond().iterator(); + while (inventoryIterator.hasNext()) { + int slot = inventoryIterator.next(); + IElectricItem chargable = GTCapabilityHelper.getElectricItem(inventoryMap.getFirst().get(slot)); + + // Safety check the null, it should not actually happen. Also don't try and charge itself + if (chargable == null || chargable == cont) { + inventoryIterator.remove(); + continue; + } + + long attemptedChargeAmount = chargable.getTransferLimit() * 10; + + // Accounts for tick differences when charging items + if (chargable.getCharge() < chargable.getMaxCharge() && cont.canUse(attemptedChargeAmount) && + timer % 10 == 0) { + long delta = chargable.charge(attemptedChargeAmount, cont.getTier(), true, false); + if (delta > 0) { + cont.discharge(delta, cont.getTier(), true, false, false); + } + if (chargable.getCharge() == chargable.getMaxCharge()) { + inventoryIterator.remove(); + } + player.inventoryMenu.sendAllDataToRemote(); + } + } + + if (inventoryMap.getSecond().isEmpty()) inventoryIndexMap.remove(inventoryMap); + } + } + } + + if (toggleTimer > 0) toggleTimer--; + + data.putBoolean("canShare", canShare); + data.putBoolean("hover", hoverMode); + data.putByte("toggleTimer", toggleTimer); + + timer++; + if (timer == Long.MAX_VALUE) + timer = 0; + } + + @Override + public void addInfo(ItemStack itemStack, List lines) { + CompoundTag data = itemStack.getOrCreateTag(); + Component state; + if (data.contains("canShare")) { + state = data.getBoolean("canShare") ? Component.translatable("metaarmor.hud.status.enabled") : + Component.translatable("metaarmor.hud.status.disabled"); + } else { + state = Component.translatable("metaarmor.hud.status.disabled"); + } + lines.add(Component.translatable("metaarmor.energy_share.tooltip", state)); + lines.add(Component.translatable("metaarmor.energy_share.tooltip.guide")); + + Component status = Component.translatable("metaarmor.hud.status.disabled"); + if (data.contains("hover")) { + if (data.getBoolean("hover")) + status = Component.translatable("metaarmor.hud.status.enabled"); + } + lines.add(Component.translatable("metaarmor.hud.hover_mode", status)); + super.addInfo(itemStack, lines); + } + + @Override + public InteractionResultHolder onRightClick(Level world, @NotNull Player player, InteractionHand hand) { + ItemStack armor = player.getItemInHand(hand); + + if (armor.getItem() instanceof ArmorComponentItem && player.isShiftKeyDown()) { + CompoundTag data = armor.getOrCreateTag(); + boolean canShare = data.contains("canShare") && data.getBoolean("canShare"); + IElectricItem cont = GTCapabilityHelper.getElectricItem(armor); + if (cont == null) { + return InteractionResultHolder.fail(armor); + } + + canShare = !canShare; + if (!world.isClientSide) { + if (canShare && cont.getCharge() == 0) { + player.sendSystemMessage(Component.translatable("metaarmor.energy_share.error")); + } else if (canShare) { + player.sendSystemMessage(Component.translatable("metaarmor.energy_share.enable")); + } else { + player.sendSystemMessage(Component.translatable("metaarmor.energy_share.disable")); + } + } + + canShare = canShare && (cont.getCharge() != 0); + data.putBoolean("canShare", canShare); + return InteractionResultHolder.success(armor); + } + + return super.onRightClick(world, player, hand); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void drawHUD(ItemStack item, PoseStack PoseStack) { + addCapacityHUD(item, this.HUD); + IElectricItem cont = GTCapabilityHelper.getElectricItem(item); + if (cont == null) return; + if (!cont.canUse(energyPerUse)) return; + CompoundTag data = item.getTag(); + if (data != null) { + if (data.contains("canShare")) { + String status = data.getBoolean("canShare") ? "metaarmor.hud.status.enabled" : + "metaarmor.hud.status.disabled"; + this.HUD.newString(Component.translatable("mataarmor.hud.supply_mode", Component.translatable(status))); + } + + if (data.contains("hover")) { + String status = data.getBoolean("hover") ? "metaarmor.hud.status.enabled" : + "metaarmor.hud.status.disabled"; + this.HUD.newString(Component.translatable("metaarmor.hud.hover_mode", Component.translatable(status))); + } + } + this.HUD.draw(PoseStack); + this.HUD.reset(); + } + + @Override + public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { + return GTCEu.id("textures/armor/advanced_nano_muscle_suite_1.png"); + } + + @Override + public boolean canUseEnergy(@NotNull ItemStack stack, int amount) { + IElectricItem container = getIElectricItem(stack); + if (container == null) + return false; + return container.canUse(amount); + } + + @Override + public void drainEnergy(@NotNull ItemStack stack, int amount) { + IElectricItem container = getIElectricItem(stack); + if (container == null) + return; + container.discharge(amount, tier, true, false, false); + } + + @Override + public boolean hasEnergy(@NotNull ItemStack stack) { + IElectricItem container = getIElectricItem(stack); + if (container == null) + return false; + return container.getCharge() > 0; + } + + @Nullable + private static IElectricItem getIElectricItem(@NotNull ItemStack stack) { + return GTCapabilityHelper.getElectricItem(stack); + } + + @Override + public double getSprintEnergyModifier() { + return 4.0D; + } + + @Override + public double getSprintSpeedModifier() { + return 1.8D; + } + + @Override + public double getVerticalHoverSpeed() { + return 0.4D; + } + + @Override + public double getVerticalHoverSlowSpeed() { + return 0.005D; + } + + @Override + public double getVerticalAcceleration() { + return 0.14D; + } + + @Override + public double getVerticalSpeed() { + return 0.8D; + } + + @Override + public double getSidewaysSpeed() { + return 0.19D; + } + + @Nullable + @Override + public ParticleOptions getParticle() { + return null; + } + + @Override + public float getFallDamageReduction() { + return 3.5f; + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/armor/AdvancedQuarkTechSuite.java b/src/main/java/com/gregtechceu/gtceu/common/item/armor/AdvancedQuarkTechSuite.java new file mode 100644 index 0000000000..8361161263 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/armor/AdvancedQuarkTechSuite.java @@ -0,0 +1,320 @@ +package com.gregtechceu.gtceu.common.item.armor; + +import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; +import com.gregtechceu.gtceu.api.capability.IElectricItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorComponentItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorUtils; +import com.gregtechceu.gtceu.utils.input.KeyBind; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.datafixers.util.Pair; +import net.minecraft.core.NonNullList; +import net.minecraft.core.particles.ParticleOptions; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import org.jetbrains.annotations.NotNull; + +import java.util.Iterator; +import java.util.List; + +public class AdvancedQuarkTechSuite extends QuarkTechSuite implements IJetpack { + + // A replacement for checking the current world time, to get around the gamerule that stops it + private long timer = 0L; + private List, List>> inventoryIndexMap; + + public AdvancedQuarkTechSuite(int energyPerUse, long capacity, int tier) { + super(EquipmentSlot.CHEST, energyPerUse, capacity, tier); + } + + @Override + public void onArmorTick(Level world, Player player, ItemStack item) { + IElectricItem cont = GTCapabilityHelper.getElectricItem(item); + if (cont == null) { + return; + } + + CompoundTag data = item.getOrCreateTag(); + boolean hoverMode = data.contains("hover") && data.getBoolean("hover"); + byte toggleTimer = data.contains("toggleTimer") ? data.getByte("toggleTimer") : 0; + boolean canShare = data.contains("canShare") && data.getBoolean("canShare"); + + if (toggleTimer == 0 && KeyBind.ARMOR_HOVER.isKeyDown(player)) { + hoverMode = !hoverMode; + toggleTimer = 5; + data.putBoolean("hover", hoverMode); + if (!world.isClientSide) { + if (hoverMode) + player.displayClientMessage(Component.translatable("metaarmor.jetpack.hover.enable"), true); + else + player.displayClientMessage(Component.translatable("metaarmor.jetpack.hover.disable"), true); + } + } + + if (toggleTimer == 0 && KeyBind.ARMOR_CHARGING.isKeyDown(player)) { + canShare = !canShare; + toggleTimer = 5; + if (!world.isClientSide) { + if (canShare && cont.getCharge() == 0) + player.displayClientMessage(Component.translatable("metaarmor.qts.share.error"), true); + else if (canShare) + player.displayClientMessage(Component.translatable("metaarmor.qts.share.enable"), true); + else + player.displayClientMessage(Component.translatable("metaarmor.qts.share.disable"), true); + } + + // Only allow for charging to be enabled if charge is nonzero + canShare = canShare && (cont.getCharge() != 0); + data.putBoolean("canShare", canShare); + } + + performFlying(player, hoverMode, item); + + if (player.isOnFire()) + player.clearFire(); + + // Charging mechanics + if (canShare && !world.isClientSide) { + // Check for new things to charge every 5 seconds + if (timer % 100 == 0) + inventoryIndexMap = ArmorUtils.getChargeableItem(player, cont.getTier()); + + if (inventoryIndexMap != null && !inventoryIndexMap.isEmpty()) { + // Charge all inventory slots + for (int i = 0; i < inventoryIndexMap.size(); i++) { + Pair, List> inventoryMap = inventoryIndexMap.get(i); + Iterator inventoryIterator = inventoryMap.getSecond().iterator(); + while (inventoryIterator.hasNext()) { + int slot = inventoryIterator.next(); + IElectricItem chargable = GTCapabilityHelper.getElectricItem(inventoryMap.getFirst().get(slot)); + + // Safety check the null, it should not actually happen. Also don't try and charge itself + if (chargable == null || chargable == cont) { + inventoryIterator.remove(); + continue; + } + + long attemptedChargeAmount = chargable.getTransferLimit() * 10; + + // Accounts for tick differences when charging items + if (chargable.getCharge() < chargable.getMaxCharge() && cont.canUse(attemptedChargeAmount) && + timer % 10 == 0) { + long delta = chargable.charge(attemptedChargeAmount, cont.getTier(), true, false); + if (delta > 0) { + cont.discharge(delta, cont.getTier(), true, false, false); + } + if (chargable.getCharge() == chargable.getMaxCharge()) { + inventoryIterator.remove(); + } + player.inventoryMenu.sendAllDataToRemote(); + } + } + + if (inventoryMap.getSecond().isEmpty()) + inventoryIndexMap.remove(inventoryMap); + } + } + } + + if (toggleTimer > 0) toggleTimer--; + + data.putBoolean("canShare", canShare); + data.putBoolean("hover", hoverMode); + data.putByte("toggleTimer", toggleTimer); + + timer++; + if (timer == Long.MAX_VALUE) + timer = 0; + } + + @Override + public void addInfo(ItemStack itemStack, List lines) { + CompoundTag data = itemStack.getOrCreateTag(); + Component state; + if (data.contains("canShare")) { + state = data.getBoolean("canShare") ? Component.translatable("metaarmor.hud.status.enabled") : + Component.translatable("metaarmor.hud.status.disabled"); + } else { + state = Component.translatable("metaarmor.hud.status.disabled"); + } + lines.add(Component.translatable("metaarmor.energy_share.tooltip", state)); + lines.add(Component.translatable("metaarmor.energy_share.tooltip.guide")); + Component status = Component.translatable("metaarmor.hud.status.disabled"); + if (data.contains("hover")) { + if (data.getBoolean("hover")) + status = Component.translatable("metaarmor.hud.status.enabled"); + } + lines.add(Component.translatable("metaarmor.hud.hover_mode", status)); + super.addInfo(itemStack, lines); + } + + @Override + public InteractionResultHolder onRightClick(Level world, Player player, InteractionHand hand) { + ItemStack armor = player.getItemInHand(hand); + if (armor.getItem() instanceof ArmorComponentItem && player.isShiftKeyDown()) { + CompoundTag data = armor.getOrCreateTag(); + boolean canShare = data.contains("canShare") && data.getBoolean("canShare"); + IElectricItem cont = GTCapabilityHelper.getElectricItem(armor); + if (cont == null) { + return InteractionResultHolder.fail(armor); + } + + canShare = !canShare; + if (!world.isClientSide) { + if (canShare && cont.getCharge() == 0) { + player.sendSystemMessage(Component.translatable("metaarmor.energy_share.error")); + } else if (canShare) { + player.sendSystemMessage(Component.translatable("metaarmor.energy_share.enable")); + } else { + player.sendSystemMessage(Component.translatable("metaarmor.energy_share.disable")); + } + } + + canShare = canShare && (cont.getCharge() != 0); + data.putBoolean("canShare", canShare); + return InteractionResultHolder.success(armor); + } else { + return super.onRightClick(world, player, hand); + } + } + + @OnlyIn(Dist.CLIENT) + @Override + public void drawHUD(ItemStack item, PoseStack PoseStack) { + addCapacityHUD(item, this.HUD); + IElectricItem cont = GTCapabilityHelper.getElectricItem(item); + if (cont == null) return; + if (!cont.canUse(energyPerUse)) return; + CompoundTag data = item.getTag(); + if (data != null) { + if (data.contains("canShare")) { + String status = data.getBoolean("canShare") ? "metaarmor.hud.status.enabled" : + "metaarmor.hud.status.disabled"; + this.HUD.newString(Component.translatable("mataarmor.hud.supply_mode", Component.translatable(status))); + } + + if (data.contains("hover")) { + String status = data.getBoolean("hover") ? "metaarmor.hud.status.enabled" : + "metaarmor.hud.status.disabled"; + this.HUD.newString(Component.translatable("metaarmor.hud.hover_mode", Component.translatable(status))); + } + } + this.HUD.draw(PoseStack); + this.HUD.reset(); + } + + /* + @Override + public ArmorProperties getProperties(EntityLivingBase player, @NotNull ItemStack armor, DamageSource source, + double damage, EntityEquipmentSlot equipmentSlot) { + int damageLimit = Integer.MAX_VALUE; + IElectricItem item = armor.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null); + if (item == null) { + return new ArmorProperties(0, 0, damageLimit); + } + if (energyPerUse > 0) { + damageLimit = (int) Math.min(damageLimit, 25.0D * item.getCharge() / (energyPerUse * 250.0D)); + } + return new ArmorProperties(8, getDamageAbsorption() * getAbsorption(armor), damageLimit); + } + + @Override + public boolean handleUnblockableDamage(EntityLivingBase entity, @NotNull ItemStack armor, DamageSource source, + double damage, EntityEquipmentSlot equipmentSlot) { + return source != DamageSource.FALL && source != DamageSource.DROWN && source != DamageSource.STARVE; + } + */ + + @Override + public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { + return GTCEu.id("textures/armor/advanced_quark_tech_suite_1.png"); + } + + @Override + public double getDamageAbsorption() { + return 1.5D; + } + + @Override + public boolean canUseEnergy(@NotNull ItemStack stack, int amount) { + IElectricItem container = getIElectricItem(stack); + if (container == null) + return false; + return container.canUse(amount); + } + + @Override + public void drainEnergy(@NotNull ItemStack stack, int amount) { + IElectricItem container = getIElectricItem(stack); + if (container == null) + return; + container.discharge(amount, tier, true, false, false); + } + + @Override + public boolean hasEnergy(@NotNull ItemStack stack) { + IElectricItem container = getIElectricItem(stack); + if (container == null) + return false; + return container.getCharge() > 0; + } + + private static IElectricItem getIElectricItem(@NotNull ItemStack stack) { + return GTCapabilityHelper.getElectricItem(stack); + } + + @Override + public double getSprintEnergyModifier() { + return 6.0D; + } + + @Override + public double getSprintSpeedModifier() { + return 2.4D; + } + + @Override + public double getVerticalHoverSpeed() { + return 0.45D; + } + + @Override + public double getVerticalHoverSlowSpeed() { + return 0.0D; + } + + @Override + public double getVerticalAcceleration() { + return 0.15D; + } + + @Override + public double getVerticalSpeed() { + return 0.9D; + } + + @Override + public double getSidewaysSpeed() { + return 0.21D; + } + + @Override + public ParticleOptions getParticle() { + return null; + } + + @Override + public float getFallDamageReduction() { + return 8f; + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/armor/GTArmorMaterials.java b/src/main/java/com/gregtechceu/gtceu/common/item/armor/GTArmorMaterials.java new file mode 100644 index 0000000000..64c761751b --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/armor/GTArmorMaterials.java @@ -0,0 +1,84 @@ +package com.gregtechceu.gtceu.common.item.armor; + +import com.mojang.serialization.Codec; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.Util; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.item.ArmorMaterial; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraftforge.common.util.Lazy; + +import java.util.EnumMap; + +@AllArgsConstructor +public enum GTArmorMaterials implements ArmorMaterial, StringRepresentable { + GOGGLES("goggles", 7, Util.make(new EnumMap<>(EquipmentSlot.class), map -> { + map.put(EquipmentSlot.FEET, 0); + map.put(EquipmentSlot.LEGS, 0); + map.put(EquipmentSlot.CHEST, 0); + map.put(EquipmentSlot.HEAD, 0); + }), 50, SoundEvents.ARMOR_EQUIP_GENERIC, 0.0F, 0.0F, () -> Ingredient.EMPTY), + JETPACK("jetpack", 15, Util.make(new EnumMap<>(EquipmentSlot.class), map -> { + map.put(EquipmentSlot.FEET, 0); + map.put(EquipmentSlot.LEGS, 0); + map.put(EquipmentSlot.CHEST, 0); + map.put(EquipmentSlot.HEAD, 0); + }), 50, SoundEvents.ARMOR_EQUIP_GENERIC, 0.0F, 0.0F, () -> Ingredient.EMPTY), + ARMOR("armor", 40, Util.make(new EnumMap<>(EquipmentSlot.class), map -> { + map.put(EquipmentSlot.FEET, 0); + map.put(EquipmentSlot.LEGS, 0); + map.put(EquipmentSlot.CHEST, 0); + map.put(EquipmentSlot.HEAD, 0); + }), 50, SoundEvents.ARMOR_EQUIP_GENERIC, 5.0F, 0.0F, () -> Ingredient.EMPTY), + ; + + public static final Codec CODEC = StringRepresentable.fromEnum(GTArmorMaterials::values); + private static final EnumMap HEALTH_FUNCTION_FOR_TYPE = Util.make(new EnumMap<>(EquipmentSlot.class), map -> { + map.put(EquipmentSlot.FEET, 13); + map.put(EquipmentSlot.LEGS, 15); + map.put(EquipmentSlot.CHEST, 16); + map.put(EquipmentSlot.HEAD, 11); + }); + + private final String name; + private final int durabilityMultiplier; + private final EnumMap protectionFunctionForType; + @Getter + private final int enchantmentValue; + @Getter + private final SoundEvent equipSound; + @Getter + private final float toughness; + @Getter + private final float knockbackResistance; + private final Lazy repairIngredient; + + @Override + public int getDurabilityForSlot(EquipmentSlot slot) { + return HEALTH_FUNCTION_FOR_TYPE.get(slot) * this.durabilityMultiplier; + } + + @Override + public int getDefenseForSlot(EquipmentSlot slot) { + return this.protectionFunctionForType.get(slot); + } + + @Override + public Ingredient getRepairIngredient() { + return this.repairIngredient.get(); + } + + @Override + public String getName() { + return name; + } + + @Override + public String getSerializedName() { + return name; + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/armor/IJetpack.java b/src/main/java/com/gregtechceu/gtceu/common/item/armor/IJetpack.java new file mode 100644 index 0000000000..005937ed66 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/armor/IJetpack.java @@ -0,0 +1,115 @@ +package com.gregtechceu.gtceu.common.item.armor; + +import com.gregtechceu.gtceu.api.item.armor.ArmorUtils; +import com.gregtechceu.gtceu.utils.input.KeyBind; +import net.minecraft.core.particles.ParticleOptions; +import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Logic from + * SimplyJetpacks2 + */ +public interface IJetpack { + + default double getSprintEnergyModifier() { + return 1.0D; + } + + default double getSprintSpeedModifier() { + return 1.0D; + } + + default double getVerticalHoverSpeed() { + return 0.18D; + } + + default double getVerticalHoverSlowSpeed() { + return 0.14D; + } + + default double getVerticalAcceleration() { + return 0.1D; + } + + default double getVerticalSpeed() { + return 0.22D; + } + + default double getSidewaysSpeed() { + return 0.0D; + } + + @Nullable + default ParticleOptions getParticle() { + return ParticleTypes.LARGE_SMOKE; + } + + default float getFallDamageReduction() { + return 0.0f; + } + + int getEnergyPerUse(); + + boolean canUseEnergy(ItemStack stack, int amount); + + void drainEnergy(ItemStack stack, int amount); + + boolean hasEnergy(ItemStack stack); + + default void performFlying(@NotNull Player player, boolean hover, ItemStack stack) { + double currentAccel = getVerticalAcceleration() * (player.getDeltaMovement().y < 0.3D ? 2.5D : 1.0D); + double currentSpeedVertical = getVerticalSpeed() * (player.isInWater() ? 0.4D : 1.0D); + boolean flyKeyDown = KeyBind.VANILLA_JUMP.isKeyDown(player); + boolean descendKeyDown = KeyBind.VANILLA_SNEAK.isKeyDown(player); + + if (!player.isInWater() && !player.isInLava() && canUseEnergy(stack, getEnergyPerUse())) { + if (flyKeyDown || hover && !player.isOnGround()) { + drainEnergy(stack, (int) (player.isSprinting() ? + Math.round(getEnergyPerUse() * getSprintEnergyModifier()) : getEnergyPerUse())); + + if (hasEnergy(stack)) { + Vec3 delta = player.getDeltaMovement(); + if (flyKeyDown) { + if (!hover) { + player.setDeltaMovement(delta.x, Math.min(delta.y + currentAccel, currentSpeedVertical), delta.z); + } else { + if (descendKeyDown) { + player.setDeltaMovement(delta.x, Math.min(delta.y + currentAccel, getVerticalHoverSlowSpeed()), delta.z); + } else { + player.setDeltaMovement(delta.x, Math.min(delta.y + currentAccel, getVerticalHoverSpeed()), delta.z); + } + } + } else if (descendKeyDown) { + player.setDeltaMovement(delta.x, Math.min(delta.y + currentAccel, -getVerticalHoverSpeed()), delta.z); + } else { + player.setDeltaMovement(delta.x, Math.min(delta.y + currentAccel, -getVerticalHoverSlowSpeed()), delta.z); + } + float speedSideways = (float) (player.isShiftKeyDown() ? getSidewaysSpeed() * 0.5f : + getSidewaysSpeed()); + float speedForward = (float) (player.isSprinting() ? speedSideways * getSprintSpeedModifier() : + speedSideways); + + player.hurtMarked = true; + if (KeyBind.VANILLA_FORWARD.isKeyDown(player)) + player.moveRelative(speedForward, new Vec3(0, 0, speedForward)); + if (KeyBind.VANILLA_BACKWARD.isKeyDown(player)) + player.moveRelative(speedSideways * 0.8f, new Vec3(0, 0, -speedForward)); + if (KeyBind.VANILLA_LEFT.isKeyDown(player)) + player.moveRelative(speedSideways, new Vec3(speedSideways, 0, 0)); + if (KeyBind.VANILLA_RIGHT.isKeyDown(player)) + player.moveRelative(-speedSideways, new Vec3(speedSideways, 0, 0)); + if (!player.level.isClientSide) { + player.fallDistance = 0; + } + + } + ArmorUtils.spawnParticle(player.level, player, getParticle(), -0.6D); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/armor/IStepAssist.java b/src/main/java/com/gregtechceu/gtceu/common/item/armor/IStepAssist.java new file mode 100644 index 0000000000..d8f8566dc6 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/armor/IStepAssist.java @@ -0,0 +1,24 @@ + +package com.gregtechceu.gtceu.common.item.armor; + +import net.minecraft.world.entity.player.Player; +import org.jetbrains.annotations.NotNull; + +/** + * Logic from + * EnderIO + */ +public interface IStepAssist { + + float MAGIC_STEP_HEIGHT = 1.0023f; + + default void updateStepHeight(@NotNull Player player) { + if (!player.isShiftKeyDown()) { + if (player.maxUpStep < MAGIC_STEP_HEIGHT) { + player.maxUpStep = MAGIC_STEP_HEIGHT; + } + } else if (player.getStepHeight() == MAGIC_STEP_HEIGHT) { + player.maxUpStep = 0.6F; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/armor/Jetpack.java b/src/main/java/com/gregtechceu/gtceu/common/item/armor/Jetpack.java new file mode 100644 index 0000000000..91fc8bf7b9 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/armor/Jetpack.java @@ -0,0 +1,164 @@ +package com.gregtechceu.gtceu.common.item.armor; + +import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; +import com.gregtechceu.gtceu.api.capability.IElectricItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorLogicSuite; +import com.gregtechceu.gtceu.api.item.armor.ArmorUtils; +import com.gregtechceu.gtceu.utils.input.KeyBind; +import com.lowdragmc.lowdraglib.Platform; +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.core.particles.ParticleOptions; +import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class Jetpack extends ArmorLogicSuite implements IJetpack { + + @OnlyIn(Dist.CLIENT) + protected ArmorUtils.ModularHUD HUD; + + public Jetpack(int energyPerUse, long capacity, int tier) { + super(energyPerUse, capacity, tier, EquipmentSlot.CHEST); + if (Platform.isClient() && this.shouldDrawHUD()) { + // noinspection NewExpressionSideOnly + HUD = new ArmorUtils.ModularHUD(); + } + } + + @Override + public void onArmorTick(Level world, Player player, @NotNull ItemStack stack) { + CompoundTag data = stack.getOrCreateTag(); + byte toggleTimer = 0; + boolean hover = false; + if (data.contains("toggleTimer")) toggleTimer = data.getByte("toggleTimer"); + if (data.contains("hover")) hover = data.getBoolean("hover"); + + if (toggleTimer == 0 && KeyBind.ARMOR_HOVER.isKeyDown(player)) { + hover = !hover; + toggleTimer = 5; + data.putBoolean("hover", hover); + if (!world.isClientSide) { + if (hover) player.displayClientMessage(Component.translatable("metaarmor.jetpack.hover.enable"), true); + else player.displayClientMessage(Component.translatable("metaarmor.jetpack.hover.disable"), true); + } + } + + performFlying(player, hover, stack); + + if (toggleTimer > 0) toggleTimer--; + + data.putBoolean("hover", hover); + data.putByte("toggleTimer", toggleTimer); + } + + @Override + public boolean canUseEnergy(@NotNull ItemStack stack, int amount) { + IElectricItem container = getIElectricItem(stack); + if (container == null) + return false; + return container.canUse(amount); + } + + @Override + public void drainEnergy(@NotNull ItemStack stack, int amount) { + IElectricItem container = getIElectricItem(stack); + if (container == null) + return; + container.discharge(amount, tier, true, false, false); + } + + @Override + public boolean hasEnergy(@NotNull ItemStack stack) { + IElectricItem container = getIElectricItem(stack); + if (container == null) + return false; + return container.getCharge() > 0; + } + + @Nullable + private static IElectricItem getIElectricItem(@NotNull ItemStack stack) { + return GTCapabilityHelper.getElectricItem(stack); + } + + @Override + public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { + return GTCEu.id("textures/armor/jetpack.png"); + } + + /* + @Override + public ArmorProperties getProperties(EntityLivingBase player, @NotNull ItemStack armor, DamageSource source, + double damage, EquipmentSlot equipmentSlot) { + return new ArmorProperties(0, 0, 0); + } + */ + + @OnlyIn(Dist.CLIENT) + @Override + public void drawHUD(ItemStack item, PoseStack PoseStack) { + addCapacityHUD(item, this.HUD); + CompoundTag data = item.getTag(); + if (data != null) { + if (data.contains("hover")) { + Component status = (data.getBoolean("hover") ? Component.translatable("metaarmor.hud.status.enabled") : + Component.translatable("metaarmor.hud.status.disabled")); + Component result = Component.translatable("metaarmor.hud.hover_mode", status); + this.HUD.newString(result); + } + } + this.HUD.draw(PoseStack); + this.HUD.reset(); + } + + @Override + public void addInfo(ItemStack itemStack, List lines) { + super.addInfo(itemStack, lines); + CompoundTag data = itemStack.getTag(); + if (data != null) { + Component status = Component.translatable("metaarmor.hud.status.disabled"); + if (data.contains("hover")) { + if (data.getBoolean("hover")) + status = Component.translatable("metaarmor.hud.status.enabled"); + } + lines.add(Component.translatable("metaarmor.hud.hover_mode", status)); + } + } + + @Override + public double getVerticalHoverSlowSpeed() { + return 0.1D; + } + + @Override + public double getVerticalAcceleration() { + return 0.12D; + } + + @Override + public double getVerticalSpeed() { + return 0.3D; + } + + @Override + public double getSidewaysSpeed() { + return 0.08D; + } + + @Override + public ParticleOptions getParticle() { + return ParticleTypes.SMOKE; + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/armor/NanoMuscleSuite.java b/src/main/java/com/gregtechceu/gtceu/common/item/armor/NanoMuscleSuite.java new file mode 100644 index 0000000000..61b0f3202a --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/armor/NanoMuscleSuite.java @@ -0,0 +1,171 @@ +package com.gregtechceu.gtceu.common.item.armor; + +import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; +import com.gregtechceu.gtceu.api.capability.IElectricItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorLogicSuite; +import com.gregtechceu.gtceu.api.item.armor.ArmorUtils; +import com.gregtechceu.gtceu.common.data.GTItems; +import com.gregtechceu.gtceu.utils.input.KeyBind; +import com.lowdragmc.lowdraglib.Platform; +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.Minecraft; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class NanoMuscleSuite extends ArmorLogicSuite implements IStepAssist { + + @OnlyIn(Dist.CLIENT) + protected ArmorUtils.ModularHUD HUD; + + public NanoMuscleSuite(EquipmentSlot slot, int energyPerUse, long maxCapacity, int tier) { + super(energyPerUse, maxCapacity, tier, slot); + if (Platform.isClient() && this.shouldDrawHUD()) { + // noinspection NewExpressionSideOnly + HUD = new ArmorUtils.ModularHUD(); + } + } + + @Override + public void onArmorTick(Level world, Player player, ItemStack itemStack) { + IElectricItem item = GTCapabilityHelper.getElectricItem(itemStack); + if (item == null) { + return; + } + CompoundTag nbtData = itemStack.getOrCreateTag(); + byte toggleTimer = nbtData.getByte("toggleTimer"); + if (type == EquipmentSlot.HEAD) { + boolean nightvision = nbtData.getBoolean("Nightvision"); + if (toggleTimer == 0 && KeyBind.ARMOR_MODE_SWITCH.isKeyDown(player)) { + toggleTimer = 5; + if (!nightvision && item.getCharge() >= 4) { + nightvision = true; + if (!world.isClientSide) + player.displayClientMessage(Component.translatable("metaarmor.nms.nightvision.enabled"), true); + } else if (nightvision) { + nightvision = false; + disableNightVision(world, player, true); + } else { + if (!world.isClientSide) { + player.displayClientMessage(Component.translatable("metaarmor.nms.nightvision.error"), true); + } + } + + if (!world.isClientSide) { + nbtData.putBoolean("Nightvision", nightvision); + } + } + + if (nightvision && !world.isClientSide && item.getCharge() >= 4) { + player.removeEffect(MobEffects.BLINDNESS); + player.addEffect(new MobEffectInstance(MobEffects.NIGHT_VISION, 999999, 0, true, false)); + item.discharge((4), this.tier, true, false, false); + } + + if (!world.isClientSide && toggleTimer > 0) { + --toggleTimer; + nbtData.putByte("toggleTimer", toggleTimer); + } + } else if (type == EquipmentSlot.FEET) { + updateStepHeight(player); + } + } + + public static void disableNightVision(@NotNull Level world, Player player, boolean sendMsg) { + if (!world.isClientSide) { + player.removeEffect(MobEffects.NIGHT_VISION); + if (sendMsg) player.displayClientMessage(Component.translatable("metaarmor.nms.nightvision.disabled"), true); + } + } + + public boolean handleUnblockableDamage(LivingEntity entity, @NotNull ItemStack armor, DamageSource source, + double damage, EquipmentSlot equipmentSlot) { + return source == DamageSource.FALL; + } + + /* + @Override + public ArmorProperties getProperties(EntityLivingBase player, @NotNull ItemStack armor, DamageSource source, + double damage, EquipmentSlot equipmentSlot) { + IElectricItem container = armor.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null); + int damageLimit = Integer.MAX_VALUE; + if (source == DamageSource.FALL && this.getEquipmentSlot(armor) == EquipmentSlot.FEET) { + if (energyPerUse > 0 && container != null) { + damageLimit = (int) Math.min(damageLimit, 25.0 * container.getCharge() / (energyPerUse * 10.0D)); + } + return new ArmorProperties(10, (damage < 8.0) ? 1.0 : 0.875, damageLimit); + } + return super.getProperties(player, armor, source, damage, equipmentSlot); + } + */ + + @Override + public void damageArmor(LivingEntity entity, ItemStack itemStack, DamageSource source, int damage, EquipmentSlot equipmentSlot) { + IElectricItem item = GTCapabilityHelper.getElectricItem(itemStack); + if (item != null) { + item.discharge((long) energyPerUse / 10 * damage, item.getTier(), true, false, false); + } + } + + @Override + public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { + ItemStack currentChest = Minecraft.getInstance().player.getInventory() + .getArmor(EquipmentSlot.CHEST.getIndex()); + ItemStack advancedChest = GTItems.NANO_CHESTPLATE_ADVANCED.asStack(); + String armorTexture = "nano_muscule_suite"; + if (advancedChest.is(currentChest.getItem())) armorTexture = "advanced_nano_muscle_suite"; + return slot != EquipmentSlot.LEGS ? + GTCEu.id(String.format("textures/armor/%s_1.png", armorTexture)) : + GTCEu.id(String.format("textures/armor/%s_2.png", armorTexture)); + } + + @Override + public double getDamageAbsorption() { + return 1.0D; + } + + @Override + public float getHeatResistance() { + return 0.75f; + } + + @OnlyIn(Dist.CLIENT) + @Override + public void drawHUD(ItemStack item, PoseStack PoseStack) { + addCapacityHUD(item, this.HUD); + this.HUD.draw(PoseStack); + this.HUD.reset(); + } + + @Override + public void addInfo(ItemStack itemStack, List lines) { + super.addInfo(itemStack, lines); + if (type == EquipmentSlot.HEAD) { + CompoundTag nbtData = itemStack.getOrCreateTag(); + boolean nv = nbtData.getBoolean("Nightvision"); + if (nv) { + lines.add(Component.translatable("metaarmor.message.nightvision.enabled")); + } else { + lines.add(Component.translatable("metaarmor.message.nightvision.disabled")); + } + } else if (type == EquipmentSlot.FEET) { + lines.add(Component.translatable("metaarmor.tooltip.stepassist")); + lines.add(Component.translatable("metaarmor.tooltip.falldamage")); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/armor/NightvisionGoggles.java b/src/main/java/com/gregtechceu/gtceu/common/item/armor/NightvisionGoggles.java new file mode 100644 index 0000000000..4a1eb4052f --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/armor/NightvisionGoggles.java @@ -0,0 +1,100 @@ +package com.gregtechceu.gtceu.common.item.armor; + +import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; +import com.gregtechceu.gtceu.api.capability.IElectricItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorLogicSuite; +import com.gregtechceu.gtceu.utils.input.KeyBind; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ArmorItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class NightvisionGoggles extends ArmorLogicSuite { + + public NightvisionGoggles(int energyPerUse, long capacity, int voltageTier, EquipmentSlot slot) { + super(energyPerUse, capacity, voltageTier, slot); + } + + @Override + public void onArmorTick(Level world, @NotNull Player player, @NotNull ItemStack itemStack) { + IElectricItem item = GTCapabilityHelper.getElectricItem(itemStack); + if (item == null) { + return; + } + CompoundTag nbtData = itemStack.getOrCreateTag(); + byte toggleTimer = nbtData.getByte("toggleTimer"); + if (!player.getItemBySlot(EquipmentSlot.HEAD).is(itemStack.getItem())) { + disableNightVision(world, player, false); + } + if (type == EquipmentSlot.HEAD) { + boolean nightvision = nbtData.getBoolean("Nightvision"); + if (toggleTimer == 0 && KeyBind.ARMOR_MODE_SWITCH.isKeyDown(player)) { + toggleTimer = 5; + if (!nightvision && item.getCharge() >= energyPerUse) { + nightvision = true; + if (!world.isClientSide) + player.displayClientMessage(Component.translatable("metaarmor.message.nightvision.enabled"), true); + } else if (nightvision) { + nightvision = false; + disableNightVision(world, player, true); + } else { + if (!world.isClientSide) { + player.displayClientMessage(Component.translatable("metaarmor.message.nightvision.error"), true); + } + } + + if (!world.isClientSide) { + nbtData.putBoolean("Nightvision", nightvision); + } + } + + if (nightvision && !world.isClientSide && item.getCharge() >= energyPerUse) { + player.removeEffect(MobEffects.BLINDNESS); + player.addEffect(new MobEffectInstance(MobEffects.NIGHT_VISION, 999999, 0, true, false)); + item.discharge((energyPerUse), this.tier, true, false, false); + } + + if (toggleTimer > 0) --toggleTimer; + + nbtData.putByte("toggleTimer", toggleTimer); + } + } + + public static void disableNightVision(@NotNull Level world, Player player, boolean sendMsg) { + if (!world.isClientSide) { + player.removeEffect(MobEffects.NIGHT_VISION); + if (sendMsg) + player.displayClientMessage(Component.translatable("metaarmor.message.nightvision.disabled"), true); + } + } + + @Override + public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { + return GTCEu.id("textures/armor/nightvision_goggles.png"); + } + + @Override + public void addInfo(ItemStack itemStack, List lines) { + super.addInfo(itemStack, lines); + if (type == EquipmentSlot.HEAD) { + CompoundTag nbtData = itemStack.getOrCreateTag(); + boolean nv = nbtData.getBoolean("Nightvision"); + if (nv) { + lines.add(Component.translatable("metaarmor.message.nightvision.enabled")); + } else { + lines.add(Component.translatable("metaarmor.message.nightvision.disabled")); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/armor/PowerlessJetpack.java b/src/main/java/com/gregtechceu/gtceu/common/item/armor/PowerlessJetpack.java new file mode 100644 index 0000000000..14ecca14a4 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/armor/PowerlessJetpack.java @@ -0,0 +1,326 @@ +package com.gregtechceu.gtceu.common.item.armor; + +import com.google.common.collect.Table; +import com.google.common.collect.Tables; +import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.api.capability.recipe.*; +import com.gregtechceu.gtceu.api.item.armor.ArmorComponentItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorUtils; +import com.gregtechceu.gtceu.api.item.armor.IArmorLogic; +import com.gregtechceu.gtceu.api.item.component.*; +import com.gregtechceu.gtceu.api.item.component.forge.IComponentCapability; +import com.gregtechceu.gtceu.api.misc.FluidRecipeHandler; +import com.gregtechceu.gtceu.api.misc.IgnoreEnergyRecipeHandler; +import com.gregtechceu.gtceu.api.recipe.GTRecipe; +import com.gregtechceu.gtceu.common.data.GTMaterials; +import com.gregtechceu.gtceu.common.data.GTRecipeTypes; +import com.gregtechceu.gtceu.core.mixins.ItemAccessor; +import com.gregtechceu.gtceu.utils.GradientUtil; +import com.gregtechceu.gtceu.utils.input.KeyBind; +import com.lowdragmc.lowdraglib.Platform; +import com.lowdragmc.lowdraglib.misc.ItemStackTransfer; +import com.lowdragmc.lowdraglib.side.fluid.FluidTransferHelper; +import com.lowdragmc.lowdraglib.side.fluid.IFluidTransfer; +import com.lowdragmc.lowdraglib.side.fluid.forge.FluidHelperImpl; +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.core.NonNullList; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.*; +import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ForgeCapabilities; +import com.lowdragmc.lowdraglib.side.fluid.FluidStack; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack; +import org.apache.commons.lang3.tuple.Pair; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.*; +import java.util.function.Predicate; + +public class PowerlessJetpack implements IArmorLogic, IJetpack, IItemHUDProvider { + + public static final int tankCapacity = 16000; + + private GTRecipe previousRecipe = null; + private GTRecipe currentRecipe = null; + private int burnTimer = 0; + + @OnlyIn(Dist.CLIENT) + private ArmorUtils.ModularHUD HUD; + + public PowerlessJetpack() { + if (Platform.isClient()) + HUD = new ArmorUtils.ModularHUD(); + } + + @Override + public void onArmorTick(Level world, Player player, @NotNull ItemStack stack) { + IFluidTransfer internalTank = FluidTransferHelper.getFluidTransfer(new ItemStackTransfer(stack), 0); + if (internalTank == null) + return; + + CompoundTag data = stack.getOrCreateTag(); + byte toggleTimer = 0; + boolean hover = false; + + if (data.contains("burnTimer")) burnTimer = data.getShort("burnTimer"); + if (data.contains("toggleTimer")) toggleTimer = data.getByte("toggleTimer"); + if (data.contains("hover")) hover = data.getBoolean("hover"); + + if (toggleTimer == 0 && KeyBind.ARMOR_HOVER.isKeyDown(player)) { + hover = !hover; + toggleTimer = 5; + data.putBoolean("hover", hover); + if (!world.isClientSide) { + if (hover) + player.displayClientMessage(Component.translatable("metaarmor.jetpack.hover.enable"), true); + else + player.displayClientMessage(Component.translatable("metaarmor.jetpack.hover.disable"), true); + } + } + + // This causes a caching issue. currentRecipe is only set to null in findNewRecipe, so the fuel is never updated + // Rewrite in Armor Rework + if (currentRecipe == null) + findNewRecipe(stack); + + performFlying(player, hover, stack); + + if (toggleTimer > 0) + toggleTimer--; + + data.putBoolean("hover", hover); + data.putShort("burnTimer", (short) burnTimer); + data.putByte("toggleTimer", toggleTimer); + } + + @Override + public EquipmentSlot getArmorType() { + return EquipmentSlot.CHEST; + } + + @Override + public int getArmorDisplay(Player player, @NotNull ItemStack armor, EquipmentSlot slot) { + return 0; + } + + @Override + public void addToolComponents(@NotNull ArmorComponentItem item) { + item.attachComponents(new Behaviour(tankCapacity)); + } + + @Override + public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { + return GTCEu.id("textures/armor/liquid_fuel_jetpack.png"); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void drawHUD(@NotNull ItemStack item, PoseStack PoseStack) { + IFluidTransfer tank = FluidTransferHelper.getFluidTransfer(new ItemStackTransfer(item), 0); + if (tank != null) { + if (tank.getFluidInTank(0).getAmount() == 0) return; + String formated = String.format("%.1f", + (tank.getFluidInTank(0).getAmount() * 100.0F / tank.getTankCapacity(0))); + this.HUD.newString(Component.translatable("metaarmor.hud.fuel_lvl", formated + "%")); + CompoundTag data = item.getTag(); + + if (data != null) { + if (data.contains("hover")) { + Component status = (data.getBoolean("hover") ? Component.translatable("metaarmor.hud.status.enabled") : + Component.translatable("metaarmor.hud.status.disabled")); + Component result = Component.translatable("metaarmor.hud.hover_mode", status); + this.HUD.newString(result); + } + } + } + this.HUD.draw(PoseStack); + this.HUD.reset(); + } + + @Override + public int getEnergyPerUse() { + return 1; + } + + @Override + public boolean canUseEnergy(ItemStack stack, int amount) { + FluidStack fuel = getFuel(); + if (fuel == null) { + return false; + } + + IFluidTransfer fluidHandlerItem = getIFluidHandlerItem(stack); + if (fluidHandlerItem == null) + return false; + + com.lowdragmc.lowdraglib.side.fluid.FluidStack fluidStack = fluidHandlerItem.drain(fuel, false); + if (fluidStack.isEmpty()) + return false; + + return fluidStack.getAmount() >= fuel.getAmount(); + } + + @Override + public void drainEnergy(ItemStack stack, int amount) { + if (this.burnTimer == 0) { + FluidStack fuel = getFuel(); + if (fuel == null) return; + getIFluidHandlerItem(stack).drain(fuel, true); + burnTimer = currentRecipe.duration; + } + this.burnTimer--; + } + + @Override + public boolean hasEnergy(ItemStack stack) { + return burnTimer > 0 || currentRecipe != null; + } + + private static IFluidTransfer getIFluidHandlerItem(@NotNull ItemStack stack) { + return FluidTransferHelper.getFluidTransfer(new ItemStackTransfer(stack), 0); + } + + public void findNewRecipe(@NotNull ItemStack stack) { + IFluidTransfer internalTank = getIFluidHandlerItem(stack); + if (internalTank != null) { + com.lowdragmc.lowdraglib.side.fluid.FluidStack fluidStack = internalTank.drain(1, false); + if (previousRecipe != null && fluidStack != null && + FluidRecipeCapability.CAP.of(previousRecipe.getInputContents(FluidRecipeCapability.CAP).get(0)).test(fluidStack) && + fluidStack.getAmount() > 0) { + currentRecipe = previousRecipe; + return; + } else if (fluidStack != null) { + Table, List>> table = Tables.newCustomTable(new EnumMap<>(IO.class), IdentityHashMap::new); + FluidRecipeHandler handler = new FluidRecipeHandler(IO.IN, 1, Long.MAX_VALUE); + table.put(IO.IN, FluidRecipeCapability.CAP, Collections.singletonList(handler)); + IRecipeCapabilityHolder holder = new IRecipeCapabilityHolder() { + @Override + public @NotNull Table, List>> getCapabilitiesProxy() { + return table; + } + }; + Iterator iterator = GTRecipeTypes.COMBUSTION_GENERATOR_FUELS.searchRecipe(holder); + if (iterator.hasNext()) { + GTRecipe nextRecipe = iterator.next(); + if (nextRecipe == null) { + return; + } + previousRecipe = nextRecipe; + currentRecipe = previousRecipe; + return; + } + } + } + currentRecipe = null; + } + + public void resetRecipe() { + currentRecipe = null; + previousRecipe = null; + } + + public FluidStack getFuel() { + if (currentRecipe != null) { + return FluidRecipeCapability.CAP.of(currentRecipe.getInputContents(FluidRecipeCapability.CAP).get(0)).getStacks()[0]; + } + + return FluidStack.empty(); + } + + /* + @Override + public ISpecialArmor.ArmorProperties getProperties(EntityLivingBase player, @NotNull ItemStack armor, + @NotNull DamageSource source, double damage, + EntityEquipmentSlot equipmentSlot) { + int damageLimit = (int) Math.min(Integer.MAX_VALUE, burnTimer * 1.0 / 32 * 25.0); + if (source.isUnblockable()) return new ISpecialArmor.ArmorProperties(0, 0.0, 0); + return new ISpecialArmor.ArmorProperties(0, 0, damageLimit); + } + */ + + public static class Behaviour implements IDurabilityBar, IItemComponent, ISubItemHandler, IAddInformation, IInteractionItem, IComponentCapability { + + private static final Predicate JETPACK_FUEL_FILTER = fluidStack -> { + Table, List>> table = Tables.newCustomTable(new EnumMap<>(IO.class), IdentityHashMap::new); + FluidRecipeHandler handler = new FluidRecipeHandler(IO.IN, 1, Long.MAX_VALUE); + handler.getStorages()[0].setFluid(fluidStack); + table.put(IO.IN, FluidRecipeCapability.CAP, Collections.singletonList(handler)); + table.put(IO.OUT, EURecipeCapability.CAP, Collections.singletonList(new IgnoreEnergyRecipeHandler())); + IRecipeCapabilityHolder holder = new IRecipeCapabilityHolder() { + @Override + public @NotNull Table, List>> getCapabilitiesProxy() { + return table; + } + }; + Iterator iterator = GTRecipeTypes.COMBUSTION_GENERATOR_FUELS.searchRecipe(holder); + return iterator.hasNext() && iterator.next() != null; + }; + + public final int maxCapacity; + private final Pair durabilityBarColors; + + public Behaviour(int internalCapacity) { + this.maxCapacity = internalCapacity; + this.durabilityBarColors = GradientUtil.getGradient(0xB7AF08, 10); + } + + @Override + public float getDurabilityForDisplay(@NotNull ItemStack itemStack) { + IFluidTransfer fluidHandlerItem = FluidTransferHelper.getFluidTransfer(new ItemStackTransfer(itemStack), 0); + if (fluidHandlerItem == null) return 0; + FluidStack fluidStack = fluidHandlerItem.getFluidInTank(0); + return fluidStack.isEmpty() ? 0 : (float) fluidStack.getAmount() / (float) fluidHandlerItem.getTankCapacity(0); + } + + @Nullable + @Override + public Pair getDurabilityColorsForDisplay(ItemStack itemStack) { + return durabilityBarColors; + } + + @Override + public @NotNull LazyOptional getCapability(ItemStack itemStack, @NotNull Capability cap) { + return ForgeCapabilities.FLUID_HANDLER_ITEM.orEmpty(cap, LazyOptional.of(() -> new FluidHandlerItemStack(itemStack, maxCapacity) { + @Override + public boolean canFillFluidType(net.minecraftforge.fluids.FluidStack fluid) { + return JETPACK_FUEL_FILTER.test(FluidHelperImpl.toFluidStack(fluid)); + } + })); + } + + @Override + public void appendHoverText(ItemStack stack, @Nullable Level level, List tooltipComponents, TooltipFlag isAdvanced) { + CompoundTag data = stack.getOrCreateTag(); + Component status = Component.translatable("metaarmor.hud.status.disabled"); + if (data.contains("hover")) { + if (data.getBoolean("hover")) + status = Component.translatable("metaarmor.hud.status.enabled"); + } + tooltipComponents.add(Component.translatable("metaarmor.hud.hover_mode", status)); + } + + @Override + public void fillItemCategory(Item item, CreativeModeTab category, NonNullList items) { + if (((ItemAccessor)item).invokeAllowedIn(category)) { + ItemStack copy = item.getDefaultInstance(); + IFluidTransfer fluidHandlerItem = FluidTransferHelper.getFluidTransfer(new ItemStackTransfer(copy), 0); + if (fluidHandlerItem != null) { + fluidHandlerItem.fill(GTMaterials.Diesel.getFluid(tankCapacity), true); + items.add(copy); + } else { + items.add(copy); + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/armor/QuarkTechSuite.java b/src/main/java/com/gregtechceu/gtceu/common/item/armor/QuarkTechSuite.java new file mode 100644 index 0000000000..6d0b8bc7f9 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/item/armor/QuarkTechSuite.java @@ -0,0 +1,331 @@ +package com.gregtechceu.gtceu.common.item.armor; + +import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.api.capability.GTCapabilityHelper; +import com.gregtechceu.gtceu.api.capability.IElectricItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorLogicSuite; +import com.gregtechceu.gtceu.api.item.armor.ArmorUtils; +import com.gregtechceu.gtceu.common.data.GTItems; +import com.gregtechceu.gtceu.core.IFireImmuneEntity; +import com.gregtechceu.gtceu.utils.input.KeyBind; +import com.lowdragmc.lowdraglib.Platform; +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.Minecraft; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.effect.MobEffect; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import org.jetbrains.annotations.NotNull; + +import java.util.IdentityHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +public class QuarkTechSuite extends ArmorLogicSuite implements IStepAssist { + + protected static final Map potionRemovalCost = new IdentityHashMap<>(); + private float charge = 0.0F; + + @OnlyIn(Dist.CLIENT) + protected ArmorUtils.ModularHUD HUD; + + public QuarkTechSuite(EquipmentSlot slot, int energyPerUse, long capacity, int tier) { + super(energyPerUse, capacity, tier, slot); + potionRemovalCost.put(MobEffects.POISON, 10000); + potionRemovalCost.put(MobEffects.WITHER, 25000); + if (Platform.isClient() && this.shouldDrawHUD()) { + HUD = new ArmorUtils.ModularHUD(); + } + } + + @Override + public void onArmorTick(Level world, Player player, ItemStack itemStack) { + IElectricItem item = GTCapabilityHelper.getElectricItem(itemStack); + if (item == null) + return; + + CompoundTag data = itemStack.getOrCreateTag(); + byte toggleTimer = data.contains("toggleTimer") ? data.getByte("toggleTimer") : 0; + + if (!player.getItemBySlot(EquipmentSlot.HEAD).is(GTItems.QUANTUM_HELMET.get())) { + disableNightVision(world, player, false); + } else if (!player.getItemBySlot(EquipmentSlot.CHEST).is(GTItems.QUANTUM_CHESTPLATE.get()) && + !player.getItemBySlot(EquipmentSlot.CHEST).is(GTItems.QUANTUM_CHESTPLATE_ADVANCED.get())) { + if (!world.isClientSide) ((IFireImmuneEntity)player).gtceu$setFireImmune(false); + } + + boolean ret = false; + if (type == EquipmentSlot.HEAD) { + int air = player.getAirSupply(); + if (item.canUse(energyPerUse / 100) && air < 100) { + player.setAirSupply(air + 200); + item.discharge(energyPerUse / 100, item.getTier(), true, false, false); + ret = true; + } + + if (item.canUse(energyPerUse / 10) && player.getFoodData().needsFood()) { + int slotId = -1; + for (int i = 0; i < player.getInventory().items.size(); i++) { + ItemStack current = player.getInventory().items.get(i); + if (current.getFoodProperties(player) != null) { + slotId = i; + break; + } + } + + if (slotId > -1) { + ItemStack stack = player.getInventory().items.get(slotId); + InteractionResultHolder result = ArmorUtils.canEat(player, stack); + stack = result.getObject(); + if (stack.isEmpty()) + player.getInventory().items.set(slotId, ItemStack.EMPTY); + + if (result.getResult() == InteractionResult.SUCCESS) + item.discharge(energyPerUse / 10, item.getTier(), true, false, false); + + ret = true; + } + } + + for (MobEffectInstance effect : new LinkedList<>(player.getActiveEffects())) { + MobEffect potion = effect.getEffect(); + Integer cost = potionRemovalCost.get(potion); + if (cost != null) { + cost = cost * (effect.getAmplifier() + 1); + if (item.canUse(cost)) { + item.discharge(cost, item.getTier(), true, false, false); + player.removeEffect(potion); + } + } + } + + boolean nightvision = data.getBoolean("Nightvision"); + if (toggleTimer == 0 && KeyBind.ARMOR_MODE_SWITCH.isKeyDown(player)) { + toggleTimer = 5; + if (!nightvision && item.getCharge() >= 4) { + nightvision = true; + if (!world.isClientSide) + player.displayClientMessage(Component.translatable("metaarmor.qts.nightvision.enabled"), + true); + } else if (nightvision) { + nightvision = false; + disableNightVision(world, player, true); + } else { + if (!world.isClientSide) { + player.displayClientMessage(Component.translatable("metaarmor.qts.nightvision.error"), true); + } + } + + if (!world.isClientSide) { + data.putBoolean("Nightvision", nightvision); + } + } + + if (nightvision && !world.isClientSide && item.getCharge() >= energyPerUse) { + player.removeEffect(MobEffects.BLINDNESS); + player.addEffect(new MobEffectInstance(MobEffects.NIGHT_VISION, 999999, 0, true, false)); + item.discharge(4, this.tier, true, false, false); + } + + if (!world.isClientSide && toggleTimer > 0) { + --toggleTimer; + data.putByte("toggleTimer", toggleTimer); + } + } else if (type == EquipmentSlot.CHEST && !player.fireImmune()) { + ((IFireImmuneEntity)player).gtceu$setFireImmune(true); + if (player.isOnFire()) + player.clearFire(); + } else if (type == EquipmentSlot.LEGS) { + if (item.canUse(energyPerUse / 100) && (player.isOnGround() || player.isInWater()) && + KeyBind.VANILLA_FORWARD.isKeyDown(player) && player.isSprinting()) { + byte consumerTicks = data.getByte("consumerTicks"); + ++consumerTicks; + if (consumerTicks >= 10) { + consumerTicks = 0; + item.discharge(energyPerUse / 100, item.getTier(), true, false, false); + ret = true; + } + data.putByte("consumerTicks", consumerTicks); + float speed = 0.25F; + if (player.isInWater()) { + speed = 0.1F; + if (KeyBind.VANILLA_JUMP.isKeyDown(player)) { + player.push(0.0, 0.1, 0.0); + player.hurtMarked = true; + } + } + player.moveRelative(speed, new Vec3(0, 0, 1)); + } else if (item.canUse(energyPerUse / 100) && player.isInWater() && + (KeyBind.VANILLA_SNEAK.isKeyDown(player) || KeyBind.VANILLA_JUMP.isKeyDown(player))) { + byte consumerTicks = data.getByte("consumerTicks"); + ++consumerTicks; + if (consumerTicks >= 10) { + consumerTicks = 0; + item.discharge(energyPerUse / 100, item.getTier(), true, false, false); + ret = true; + } + data.putByte("consumerTicks", consumerTicks); + double acceleration = 0.085D; + if (KeyBind.VANILLA_SNEAK.isKeyDown(player)) + player.push(0.0, -acceleration, 0.0); + if (KeyBind.VANILLA_JUMP.isKeyDown(player)) + player.push(0.0, acceleration, 0.0); + } + } else if (type == EquipmentSlot.FEET) { + if (!world.isClientSide) { + boolean onGround = !data.contains("onGround") || data.getBoolean("onGround"); + if (onGround && !player.isOnGround() && KeyBind.VANILLA_JUMP.isKeyDown(player)) { + item.discharge(energyPerUse / 100, item.getTier(), true, false, false); + ret = true; + } + + if (player.isOnGround() != onGround) { + data.putBoolean("onGround", player.isOnGround()); + } + } else { + if (item.canUse(energyPerUse / 100) && player.isOnGround()) { + this.charge = 1.0F; + } + + Vec3 delta = player.getDeltaMovement(); + if (delta.y >= 0.0D && this.charge > 0.0F && !player.isInWater()) { + if (KeyBind.VANILLA_JUMP.isKeyDown(player)) { + if (this.charge == 1.0F) { + player.setDeltaMovement(delta.x * 3.6D, delta.y, delta.z * 3.6D); + } + + delta = player.getDeltaMovement(); + player.setDeltaMovement(delta.x, delta.y + this.charge * 0.32, delta.z); + this.charge = (float) (this.charge * 0.7D); + } else if (this.charge < 1.0F) { + this.charge = 0.0F; + } + } + } + updateStepHeight(player); + } + + if (ret) { + player.inventoryMenu.sendAllDataToRemote(); + } + } + + public static void disableNightVision(@NotNull Level world, Player player, boolean sendMsg) { + if (!world.isClientSide) { + player.removeEffect(MobEffects.NIGHT_VISION); + if (sendMsg) + player.displayClientMessage(Component.translatable("metaarmor.qts.nightvision.disabled"), true); + } + } + + /* + @Override + public ArmorProperties getProperties(EntityLivingBase player, @NotNull ItemStack armor, DamageSource source, + double damage, EntityEquipmentSlot equipmentSlot) { + int damageLimit = Integer.MAX_VALUE; + IElectricItem item = armor.getCapability(GregtechCapabilities.CAPABILITY_ELECTRIC_ITEM, null); + if (item == null) { + return new ArmorProperties(0, 0, damageLimit); + } + if (energyPerUse > 0) { + damageLimit = (int) Math.min(damageLimit, 25.0D * item.getCharge() / (energyPerUse * 100.0D)); + } + + if (source == DamageSource.FALL) { + if (SLOT == EntityEquipmentSlot.FEET) { + return new ArmorProperties(10, 1.0D, damageLimit); + } + + if (SLOT == EntityEquipmentSlot.LEGS) { + return new ArmorProperties(9, 0.8D, damageLimit); + } + } + return new ArmorProperties(8, getDamageAbsorption() * getAbsorption(armor), damageLimit); + } + + @Override + public boolean handleUnblockableDamage(EntityLivingBase entity, @NotNull ItemStack armor, DamageSource source, + double damage, EntityEquipmentSlot equipmentSlot) { + return source != DamageSource.FALL && source != DamageSource.DROWN && source != DamageSource.STARVE && + source != DamageSource.OUT_OF_WORLD; + } + */ + + @Override + public void damageArmor(LivingEntity entity, ItemStack itemStack, DamageSource source, int damage, EquipmentSlot equipmentSlot) { + IElectricItem item = GTCapabilityHelper.getElectricItem(itemStack); + if (item == null) { + return; + } + item.discharge(energyPerUse / 100L * damage, item.getTier(), true, false, false); + } + + @Override + public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { + ItemStack currentChest = Minecraft.getInstance().player.getInventory() + .armor.get(EquipmentSlot.CHEST.getIndex()); + String armorTexture = "quark_tech_suite"; + if (currentChest.is(GTItems.QUANTUM_CHESTPLATE_ADVANCED.get())) armorTexture = "advanced_quark_tech_suite"; + return slot != EquipmentSlot.LEGS ? + GTCEu.id(String.format("textures/armor/%s_1.png", armorTexture)) : + GTCEu.id(String.format("textures/armor/%s_2.png", armorTexture)); + } + + @Override + public double getDamageAbsorption() { + return type == EquipmentSlot.CHEST ? 1.2D : 1.0D; + } + + @Override + public float getHeatResistance() { + return 0.5f; + } + + @OnlyIn(Dist.CLIENT) + @Override + public void drawHUD(ItemStack item, PoseStack PoseStack) { + addCapacityHUD(item, this.HUD); + this.HUD.draw(PoseStack); + this.HUD.reset(); + } + + @Override + public void addInfo(ItemStack itemStack, List lines) { + super.addInfo(itemStack, lines); + if (type == EquipmentSlot.HEAD) { + CompoundTag nbtData = itemStack.getOrCreateTag(); + boolean nv = nbtData.getBoolean("Nightvision"); + if (nv) { + lines.add(Component.translatable("metaarmor.message.nightvision.enabled")); + } else { + lines.add(Component.translatable("metaarmor.message.nightvision.disabled")); + } + lines.add(Component.translatable("metaarmor.tooltip.potions")); + lines.add(Component.translatable("metaarmor.tooltip.breath")); + lines.add(Component.translatable("metaarmor.tooltip.autoeat")); + } else if (type == EquipmentSlot.CHEST) { + lines.add(Component.translatable("metaarmor.tooltip.burning")); + } else if (type == EquipmentSlot.LEGS) { + lines.add(Component.translatable("metaarmor.tooltip.speed")); + } else if (type == EquipmentSlot.FEET) { + lines.add(Component.translatable("metaarmor.tooltip.stepassist")); + lines.add(Component.translatable("metaarmor.tooltip.falldamage")); + lines.add(Component.translatable("metaarmor.tooltip.jump")); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/tool/behavior/HarvestCropsBehavior.java b/src/main/java/com/gregtechceu/gtceu/common/item/tool/behavior/HarvestCropsBehavior.java index 92f502e9d4..909b8096d1 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/item/tool/behavior/HarvestCropsBehavior.java +++ b/src/main/java/com/gregtechceu/gtceu/common/item/tool/behavior/HarvestCropsBehavior.java @@ -19,6 +19,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.CropBlock; +import net.minecraft.world.level.block.LevelEvent; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; @@ -95,7 +96,7 @@ private static boolean harvestBlockRoutine(ItemStack stack, BlockPos pos, Player NonNullList drops = NonNullList.create(); drops.addAll(Block.getDrops(blockState, (ServerLevel) player.level, pos, null)); dropListOfItems(player.level, pos, drops); - player.level.levelEvent(2001, pos, Block.getId(blockState)); + player.level.levelEvent(LevelEvent.PARTICLES_DESTROY_BLOCK, pos, Block.getId(blockState)); player.level.setBlock(pos, blockCrops.getStateForAge(0), Block.UPDATE_ALL); if (!player.isCreative()) { ToolHelper.damageItem(stack, player); diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/ProcessingArrayMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/ProcessingArrayMachine.java index d9330d3bb1..4a0a9c5c14 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/ProcessingArrayMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/ProcessingArrayMachine.java @@ -209,8 +209,8 @@ public static GTRecipe recipeModifier(MetaMachine machine, @NotNull GTRecipe rec var parallel = Objects.requireNonNull(GTRecipeModifiers.accurateParallel( machine, recipe, Math.min(parallelLimit, getMachineLimit(machine.getDefinition().getTier())), false )); - int parallelCount = parallel.getB(); - recipe = parallel.getA(); + int parallelCount = parallel.getSecond(); + recipe = parallel.getFirst(); // apply overclock afterward long maxVoltage = Math.min(processingArray.getOverclockVoltage() * parallelCount, processingArray.getMaxVoltage()); diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/LargeCombustionEngineMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/LargeCombustionEngineMachine.java index 16108261d0..aaec491731 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/LargeCombustionEngineMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/LargeCombustionEngineMachine.java @@ -109,11 +109,11 @@ public static GTRecipe recipeModifier(MetaMachine machine, @NotNull GTRecipe rec var maxParallel = (int) (engineMachine.getOverclockVoltage() / EUt); // get maximum parallel var parallelResult = GTRecipeModifiers.fastParallel(engineMachine, recipe, maxParallel, false); if (engineMachine.isOxygenBoosted) { // boost production - recipe = parallelResult.getA() == recipe ? recipe.copy() : parallelResult.getA(); - long eut = (long) (EUt * parallelResult.getB() * (engineMachine.isExtreme() ? 2 : 1.5)); + recipe = parallelResult.getFirst() == recipe ? recipe.copy() : parallelResult.getFirst(); + long eut = (long) (EUt * parallelResult.getSecond() * (engineMachine.isExtreme() ? 2 : 1.5)); recipe.tickOutputs.put(EURecipeCapability.CAP, List.of(new Content(eut, 1.0f, 0.0f, null, null))); } else { - recipe = parallelResult.getA(); + recipe = parallelResult.getFirst(); } return recipe; } diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/LargeTurbineMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/LargeTurbineMachine.java index 4df133d450..855211fc0a 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/LargeTurbineMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/LargeTurbineMachine.java @@ -2,6 +2,7 @@ import com.gregtechceu.gtceu.api.GTValues; import com.gregtechceu.gtceu.api.capability.recipe.EURecipeCapability; +import com.gregtechceu.gtceu.api.capability.recipe.IO; import com.gregtechceu.gtceu.api.capability.recipe.RecipeCapability; import com.gregtechceu.gtceu.api.machine.IMachineBlockEntity; import com.gregtechceu.gtceu.api.machine.MetaMachine; @@ -13,6 +14,7 @@ import com.gregtechceu.gtceu.api.recipe.RecipeHelper; import com.gregtechceu.gtceu.api.recipe.content.Content; import com.gregtechceu.gtceu.common.data.GTRecipeModifiers; +import com.gregtechceu.gtceu.common.machine.multiblock.part.EnergyHatchPartMachine; import com.gregtechceu.gtceu.utils.FormattingUtil; import com.gregtechceu.gtceu.utils.GTUtil; import lombok.Getter; @@ -82,28 +84,35 @@ protected long boostProduction(long production) { ////////////////////////////////////// @Nullable public static GTRecipe recipeModifier(MetaMachine machine, @NotNull GTRecipe recipe) { - if (machine instanceof LargeTurbineMachine turbineMachine) { - var rotorHolder = turbineMachine.getRotorHolder(); - var EUt = RecipeHelper.getOutputEUt(recipe); - if (rotorHolder != null && EUt > 0) { - var turbineMaxVoltage = (int)turbineMachine.getOverclockVoltage(); - if (turbineMachine.excessVoltage >= turbineMaxVoltage) { - turbineMachine.excessVoltage -= turbineMaxVoltage; - } else { - double holderEfficiency = rotorHolder.getTotalEfficiency() / 100.0; - //get the amount of parallel required to match the desired output voltage - var maxParallel = (int) ((turbineMaxVoltage - turbineMachine.excessVoltage) / (EUt * holderEfficiency)); - //this is necessary to prevent over-consumption of fuel - turbineMachine.excessVoltage += (int) (maxParallel * EUt * holderEfficiency - turbineMaxVoltage); - var parallelResult = GTRecipeModifiers.fastParallel(turbineMachine, recipe, Math.max(1, maxParallel), false); - recipe = parallelResult.getA() == recipe ? recipe.copy() : parallelResult.getA(); - long eut = turbineMachine.boostProduction((long) (EUt * holderEfficiency * parallelResult.getB())); - recipe.tickOutputs.put(EURecipeCapability.CAP, List.of(new Content(eut, 1.0f, 0.0f, null, null))); - return recipe; - } - } + if (!(machine instanceof LargeTurbineMachine turbineMachine)) + return null; + + var rotorHolder = turbineMachine.getRotorHolder(); + var EUt = RecipeHelper.getOutputEUt(recipe); + + if (rotorHolder == null || EUt <= 0) + return null; + + var turbineMaxVoltage = (int)turbineMachine.getOverclockVoltage(); + if (turbineMachine.excessVoltage >= turbineMaxVoltage) { + turbineMachine.excessVoltage -= turbineMaxVoltage; + return null; } - return null; + + double holderEfficiency = rotorHolder.getTotalEfficiency() / 100.0; + + //get the amount of parallel required to match the desired output voltage + var maxParallel = (int) ((turbineMaxVoltage - turbineMachine.excessVoltage) / (EUt * holderEfficiency)); + + //this is necessary to prevent over-consumption of fuel + turbineMachine.excessVoltage += (int) (maxParallel * EUt * holderEfficiency - turbineMaxVoltage); + var parallelResult = GTRecipeModifiers.fastParallel(turbineMachine, recipe, Math.max(1, maxParallel), false); + recipe = parallelResult.getFirst() == recipe ? recipe.copy() : parallelResult.getFirst(); + + long eut = turbineMachine.boostProduction((long) (EUt * holderEfficiency * parallelResult.getSecond())); + recipe.tickOutputs.put(EURecipeCapability.CAP, List.of(new Content(eut, 1.0f, 0.0f, null, null))); + + return recipe; } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/FluidHatchPartMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/FluidHatchPartMachine.java index aa1151cf4d..fdb72e5417 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/FluidHatchPartMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/FluidHatchPartMachine.java @@ -155,20 +155,19 @@ protected Widget createSingleSlotGUI() { // Add input/output-specific widgets if (this.io == IO.OUT) { // if this is an output hatch, assign tankWidget to the phantom widget displaying the locked fluid... - group.addWidget(tankWidget = new PhantomFluidWidget(this.tank.getLockedFluid(), 67, 40, 18, 18) - .setIFluidStackUpdater(f -> { - if (this.tank.getFluidInTank(0).getAmount() != 0) { - return; - } - if (f.isEmpty()) { - this.tank.setLocked(false); - } else { - this.tank.setLocked(true); - FluidStack newFluid = f.copy(); - newFluid.setAmount(1); - this.tank.getLockedFluid().setFluid(newFluid); - } - }).setShowAmount(true).setDrawHoverTips(false).setBackground(GuiTextures.FLUID_SLOT)); + group.addWidget(tankWidget = new PhantomFluidWidget(this.tank.getLockedFluid(), 0, 67, 40, 18, 18, + () -> this.tank.getLockedFluid().getFluid(), f -> { + if (!this.tank.getFluidInTank(0).isEmpty()) { + return; + } + if (f == null || f.isEmpty()) { + this.tank.setLocked(false); + } else { + FluidStack newFluid = f.copy(); + newFluid.setAmount(1); + this.tank.setLocked(true, newFluid); + } + }).setShowAmount(true).setDrawHoverTips(true).setBackground(GuiTextures.FLUID_SLOT)); group.addWidget(new ToggleButtonWidget(7, 40, 18, 18, GuiTextures.BUTTON_LOCK, this.tank::isLocked, this.tank::setLocked) @@ -176,10 +175,10 @@ protected Widget createSingleSlotGUI() { .setShouldUseBaseBackground()) // ...and add the actual tank widget separately. .addWidget(new TankWidget(tank.getStorages()[0], 67, 22, 18, 18, true, io.support(IO.IN)) - .setShowAmount(true).setDrawHoverTips(false).setBackground(GuiTextures.FLUID_SLOT)); + .setShowAmount(true).setDrawHoverTips(true).setBackground(GuiTextures.FLUID_SLOT)); } else { group.addWidget(tankWidget = new TankWidget(tank.getStorages()[0], 67, 22, 18, 18, true, io.support(IO.IN)) - .setShowAmount(true).setDrawHoverTips(false).setBackground(GuiTextures.FLUID_SLOT)); + .setShowAmount(true).setDrawHoverTips(true).setBackground(GuiTextures.FLUID_SLOT)); } group.addWidget(new LabelWidget(8, 8, "gtceu.gui.fluid_amount")) diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/ObjectHolderMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/ObjectHolderMachine.java index 4c7bc571c9..88a32b9f05 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/ObjectHolderMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/ObjectHolderMachine.java @@ -4,7 +4,7 @@ import com.gregtechceu.gtceu.api.capability.recipe.IO; import com.gregtechceu.gtceu.api.gui.GuiTextures; import com.gregtechceu.gtceu.api.gui.widget.BlockableSlotWidget; -import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.component.IDataItem; import com.gregtechceu.gtceu.api.item.component.IItemComponent; import com.gregtechceu.gtceu.api.machine.IMachineBlockEntity; @@ -151,7 +151,7 @@ public boolean isItemValid(int slot, @NotNull ItemStack stack) { } boolean isDataItem = false; - if (stack.getItem() instanceof ComponentItem metaItem) { + if (stack.getItem() instanceof IComponentItem metaItem) { for (IItemComponent behaviour : metaItem.getComponents()) { if (behaviour instanceof IDataItem) { isDataItem = true; diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/steam/SteamParallelMultiblockMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/steam/SteamParallelMultiblockMachine.java index 763276e09b..5a7549e43e 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/steam/SteamParallelMultiblockMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/steam/SteamParallelMultiblockMachine.java @@ -71,7 +71,7 @@ public void onStructureFormed() { public static GTRecipe recipeModifier(MetaMachine machine, @NotNull GTRecipe recipe) { int duration = recipe.duration; var eut = RecipeHelper.getInputEUt(recipe); - var result = GTRecipeModifiers.accurateParallel(machine, recipe, MAX_PARALLELS, false).getA(); + var result = GTRecipeModifiers.accurateParallel(machine, recipe, MAX_PARALLELS, false).getFirst(); recipe = result == recipe ? result.copy() : result; // we remove tick inputs, as our "cost" is just steam now, just stored as EU/t diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/storage/CreativeTankMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/storage/CreativeTankMachine.java index 82d58398af..caf7b6648f 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/storage/CreativeTankMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/storage/CreativeTankMachine.java @@ -77,7 +77,8 @@ protected void checkAutoOutput() { @Override public WidgetGroup createUIWidget() { var group = new WidgetGroup(0, 0, 176, 131); - group.addWidget(new PhantomFluidWidget(this.cache.getStorages()[0], 36, 6, 18, 18).setShowAmount(false).setBackground(GuiTextures.FLUID_SLOT)); + group.addWidget(new PhantomFluidWidget(this.cache.getStorages()[0], 0, 36, 6, 18, 18, () -> this.cache.getStorages()[0].getFluid(), (fluid) -> this.cache.getStorages()[0].setFluid(fluid)) + .setShowAmount(false).setBackground(GuiTextures.FLUID_SLOT)); group.addWidget(new LabelWidget(7, 9, "gtceu.creative.tank.fluid")); group.addWidget(new ImageWidget(7, 45, 154, 14, GuiTextures.DISPLAY)); group.addWidget(new TextFieldWidget(9, 47, 152, 10, () -> String.valueOf(mBPerCycle), value -> { diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/storage/QuantumTankMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/storage/QuantumTankMachine.java index 349ae415bc..a3d5589865 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/storage/QuantumTankMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/storage/QuantumTankMachine.java @@ -294,10 +294,8 @@ protected void setLocked(boolean locked) { if (!stored.isEmpty() && locked) { var copied = stored.copy(); copied.setAmount(cache.getLockedFluid().getCapacity()); - cache.getLockedFluid().setFluid(copied); - cache.setLocked(true); + cache.setLocked(true, copied); } else if (!locked) { - cache.getLockedFluid().setFluid(FluidStack.empty()); cache.setLocked(false); } } @@ -314,7 +312,7 @@ public Widget createUIWidget() { ).setTextColor(-1).setDropShadow(true)) .addWidget(new TankWidget(cache.getStorages()[0], 68, 23, true, true) .setBackground(GuiTextures.FLUID_SLOT)) - .addWidget(new PhantomFluidWidget(cache.getLockedFluid(), 68, 41, 18, 18) + .addWidget(new PhantomFluidWidget(cache.getLockedFluid(), 0, 68, 41, 18, 18, () -> cache.getLockedFluid().getFluid(), (fluid) -> cache.getLockedFluid().setFluid(fluid)) .setShowAmount(false) .setBackground(ColorPattern.T_GRAY.rectTexture())) .addWidget(new ToggleButtonWidget(4, 41, 18, 18, diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/trait/miner/MinerLogic.java b/src/main/java/com/gregtechceu/gtceu/common/machine/trait/miner/MinerLogic.java index 9751437118..b710981709 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/trait/miner/MinerLogic.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/trait/miner/MinerLogic.java @@ -337,7 +337,7 @@ protected boolean doPostProcessing(NonNullList blockDrops, BlockState } outputItemHandler.storage.onContentsChanged(0); - var matches = machine.getRecipeType().searchRecipe(getRecipeManager(), this); + var matches = machine.getRecipeType().searchRecipe(this); while (matches != null && matches.hasNext()) { GTRecipe match = matches.next(); diff --git a/src/main/java/com/gregtechceu/gtceu/common/network/GTNetwork.java b/src/main/java/com/gregtechceu/gtceu/common/network/GTNetwork.java new file mode 100644 index 0000000000..10017400cd --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/network/GTNetwork.java @@ -0,0 +1,16 @@ +package com.gregtechceu.gtceu.common.network; + +import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.common.network.packets.CPacketKeysPressed; +import com.lowdragmc.lowdraglib.networking.INetworking; +import com.lowdragmc.lowdraglib.networking.forge.LDLNetworkingImpl; + +public class GTNetwork { + + public static final INetworking NETWORK = LDLNetworkingImpl.createNetworking(GTCEu.id("network"), "0.0.1"); + + public static void init() { + NETWORK.registerC2S(CPacketKeysPressed.class); + } + +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/network/packets/CPacketKeysPressed.java b/src/main/java/com/gregtechceu/gtceu/common/network/packets/CPacketKeysPressed.java new file mode 100644 index 0000000000..946e60e127 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/network/packets/CPacketKeysPressed.java @@ -0,0 +1,54 @@ +package com.gregtechceu.gtceu.common.network.packets; + +import com.gregtechceu.gtceu.utils.input.KeyBind; +import com.lowdragmc.lowdraglib.networking.IHandlerContext; +import com.lowdragmc.lowdraglib.networking.IPacket; +import com.mojang.datafixers.util.Pair; +import lombok.NoArgsConstructor; +import net.minecraft.network.FriendlyByteBuf; + +import java.util.List; + +@NoArgsConstructor +public class CPacketKeysPressed implements IPacket { + private Object updateKeys; + + public CPacketKeysPressed(List updateKeys) { + this.updateKeys = updateKeys; + } + + @Override + public void encode(FriendlyByteBuf buf) { + List updateKeys = (List) this.updateKeys; + buf.writeVarInt(updateKeys.size()); + for (KeyBind keyBind : updateKeys) { + buf.writeVarInt(keyBind.ordinal()); + buf.writeBoolean(keyBind.isPressed()); + buf.writeBoolean(keyBind.isKeyDown()); + } + } + + @Override + public void decode(FriendlyByteBuf buf) { + this.updateKeys = new Pair[KeyBind.VALUES.length]; + Pair[] updateKeys = (Pair[]) this.updateKeys; + int size = buf.readVarInt(); + for (int i = 0; i < size; i++) { + updateKeys[buf.readVarInt()] = Pair.of(buf.readBoolean(), buf.readBoolean()); + } + } + + @Override + public void execute(IHandlerContext handler) { + if (handler.getPlayer() != null) { + KeyBind[] keybinds = KeyBind.VALUES; + Pair[] updateKeys = (Pair[]) this.updateKeys; + for (int i = 0; i < updateKeys.length; i++) { + Pair pair = updateKeys[i]; + if (pair != null) { + keybinds[i].update(pair.getFirst(), pair.getSecond(), handler.getPlayer()); + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/pipelike/cable/AveragingPerTickCounter.java b/src/main/java/com/gregtechceu/gtceu/common/pipelike/cable/AveragingPerTickCounter.java index b8ceb3a454..a3fdbc1a07 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/pipelike/cable/AveragingPerTickCounter.java +++ b/src/main/java/com/gregtechceu/gtceu/common/pipelike/cable/AveragingPerTickCounter.java @@ -38,16 +38,12 @@ private void checkValueState(Level world) { Arrays.fill(values, defaultValue); currentIndex = 0; } else { - currentIndex += dif; - if (currentIndex > values.length - 1) - currentIndex -= values.length; - int index; - for (int i = 0, n = values.length; i < dif; i++) { - index = i + currentIndex; - if (index >= n) - index -= n; - values[index] = defaultValue; + for (int i = currentIndex + 1; i <= currentIndex + dif; i++) { + values[i % values.length] = defaultValue; } + currentIndex += dif; + if (currentIndex >= values.length) + currentIndex = currentIndex % values.length; } this.lastUpdatedWorldTime = currentWorldTime; dirty = true; diff --git a/src/main/java/com/gregtechceu/gtceu/common/worldgen/feature/StoneBlobFeature.java b/src/main/java/com/gregtechceu/gtceu/common/worldgen/feature/StoneBlobFeature.java new file mode 100644 index 0000000000..34c14c6a19 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/worldgen/feature/StoneBlobFeature.java @@ -0,0 +1,103 @@ +package com.gregtechceu.gtceu.common.worldgen.feature; + +import com.gregtechceu.gtceu.common.worldgen.feature.configurations.StoneBlobConfiguration; +import net.minecraft.core.BlockPos; +import net.minecraft.core.SectionPos; +import net.minecraft.util.Mth; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.WorldGenLevel; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.chunk.BulkSectionAccess; +import net.minecraft.world.level.chunk.LevelChunkSection; +import net.minecraft.world.level.levelgen.Heightmap; +import net.minecraft.world.level.levelgen.feature.Feature; +import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; +import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration; + +import java.util.function.Function; + +public class StoneBlobFeature extends Feature { + public StoneBlobFeature() { + super(StoneBlobConfiguration.CODEC); + } + + @Override + public boolean place(FeaturePlaceContext context) { + RandomSource random = context.random(); + BlockPos blockpos = context.origin(); + WorldGenLevel level = context.level(); + StoneBlobConfiguration config = context.config(); + + int placedAmount = 0; + int size = config.size().sample(random); + int radius = Mth.ceil(size / 2f); + int x0 = blockpos.getX() - radius; + int y0 = blockpos.getY() - radius; + int z0 = blockpos.getZ() - radius; + int width = size + 1; + int length = size + 1; + int height = size + 1; + + if (blockpos.getY() >= level.getHeight(Heightmap.Types.OCEAN_FLOOR_WG, blockpos.getX(), blockpos.getZ())) { + return false; + } + + BlockPos.MutableBlockPos mutablePos = new BlockPos.MutableBlockPos(); + try (BulkSectionAccess bulkSectionAccess = new BulkSectionAccess(level)) { + + for (int x = 0; x < width; x++) { + float dx = x * 2f / width - 1; + if (dx * dx > 1) + continue; + + for (int y = 0; y < height; y++) { + float dy = y * 2f / height - 1; + if (dx * dx + dy * dy > 1) + continue; + if (level.isOutsideBuildHeight(y0 + y)) + continue; + + for (int z = 0; z < length; z++) { + float dz = z * 2f / length - 1; + if (dx * dx + dy * dy + dz * dz > 1) + continue; + + final int currentX = x0 + x; + final int currentY = y0 + y; + final int currentZ = z0 + z; + + mutablePos.set(currentX, currentY, currentZ); + if (!level.ensureCanWrite(mutablePos)) + continue; + LevelChunkSection levelchunksection = bulkSectionAccess.getSection(mutablePos); + if (levelchunksection == null) + continue; + + int sectionX = SectionPos.sectionRelative(currentX); + int sectionY = SectionPos.sectionRelative(currentY); + int sectionZ = SectionPos.sectionRelative(currentZ); + BlockState blockstate = levelchunksection.getBlockState(sectionX, sectionY, sectionZ); + + if (!canPlaceOre(blockstate, bulkSectionAccess::getBlockState, random, config.state(), mutablePos)) + continue; + if (config.state().state.isAir()) + continue; + levelchunksection.setBlockState(sectionX, sectionY, sectionZ, config.state().state, false); + ++placedAmount; + } + } + } + } + + return placedAmount > 0; + } + + public boolean canPlaceOre(BlockState state, Function adjacentStateAccessor, + RandomSource random, OreConfiguration.TargetBlockState targetState, + BlockPos.MutableBlockPos mutablePos) { + if (!targetState.target.test(state, random)) + return false; + + return !isAdjacentToAir(adjacentStateAccessor, mutablePos); + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/common/worldgen/feature/configurations/StoneBlobConfiguration.java b/src/main/java/com/gregtechceu/gtceu/common/worldgen/feature/configurations/StoneBlobConfiguration.java new file mode 100644 index 0000000000..20337c452d --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/worldgen/feature/configurations/StoneBlobConfiguration.java @@ -0,0 +1,15 @@ +package com.gregtechceu.gtceu.common.worldgen.feature.configurations; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.util.valueproviders.IntProvider; +import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration; +import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration; + +public record StoneBlobConfiguration(OreConfiguration.TargetBlockState state, IntProvider size) implements FeatureConfiguration { + public static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + OreConfiguration.TargetBlockState.CODEC.fieldOf("state").forGetter(StoneBlobConfiguration::state), + IntProvider.codec(1, 64).fieldOf("size").forGetter(StoneBlobConfiguration::size) + ).apply(instance, StoneBlobConfiguration::new)); +} diff --git a/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java b/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java index dfb721c6a8..e608a91cd7 100644 --- a/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java +++ b/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java @@ -337,6 +337,55 @@ public static class ToolConfigs { @Configurable.Comment({ "Amount of blocks that can be spray painted at once", "Default: 16" }) @Configurable.Range(min = 1, max = 512) public int sprayCanChainLength = 16; + @Configurable.Comment("NanoSaber Options") + public NanoSaber nanoSaber = new NanoSaber(); + @Configurable.Comment("NightVision Goggles Voltage Tier. Default: 1 (LV)") + @Configurable.Range(min = 0, max = 14) + public int voltageTierNightVision = 1; + @Configurable.Comment("NanoSuit Voltage Tier. Default: 3 (HV)") + @Configurable.Range(min = 0, max = 14) + public int voltageTierNanoSuit = 3; + @Configurable.Comment({ "Advanced NanoSuit Chestplate Voltage Tier.", "Default: 3 (HV)" }) + @Configurable.Range(min = 0, max = 14) + public int voltageTierAdvNanoSuit = 3; + @Configurable.Comment({ "QuarkTech Suit Voltage Tier.", "Default: 5 (IV)" }) + @Configurable.Range(min = 0, max = 14) + public int voltageTierQuarkTech = 5; + @Configurable.Comment({ "Advanced QuarkTech Suit Chestplate Voltage Tier.", "Default: 5 (LuV)" }) + @Configurable.Range(min = 0, max = 14) + public int voltageTierAdvQuarkTech = 6; + @Configurable.Comment({ "Electric Impeller Jetpack Voltage Tier.", "Default: 2 (MV)" }) + @Configurable.Range(min = 0, max = 14) + public int voltageTierImpeller = 2; + @Configurable.Comment({ "Advanced Electric Jetpack Voltage Tier.", "Default: 3 (HV)" }) + @Configurable.Range(min = 0, max = 14) + public int voltageTierAdvImpeller = 3; + @Configurable.Comment("Armor HUD Location") + public ArmorHud armorHud = new ArmorHud(); + + public static class ArmorHud { + @Configurable.Comment({ "Sets HUD location", "1 - left-upper corner", "2 - right-upper corner", + "3 - left-bottom corner", "4 - right-bottom corner" }) + public byte hudLocation = 1; + @Configurable.Comment("Horizontal offset of HUD [0 ~ 100)") + public byte hudOffsetX = 0; + @Configurable.Comment("Vertical offset of HUD [0 ~ 100)") + public byte hudOffsetY = 0; + } + + public static class NanoSaber { + @Configurable.DecimalRange(min = 0, max = 100) + @Configurable.Comment({ "The additional damage added when the NanoSaber is powered.", "Default: 20.0" }) + public double nanoSaberDamageBoost = 20; + @Configurable.DecimalRange(min = 0, max = 100) + @Configurable.Comment({ "The base damage of the NanoSaber.", "Default: 5.0" }) + public double nanoSaberBaseDamage = 5; + @Configurable.Comment({ "Should Zombies spawn with charged, active NanoSabers on hard difficulty?", "Default: true" }) + public boolean zombieSpawnWithSabers = true; + @Configurable.Range(min = 1, max = 512) + @Configurable.Comment({ "The EU/t consumption of the NanoSaber.", "Default: 64" }) + public int energyConsumption = 64; + } } public static class ClientConfigs { @@ -375,6 +424,23 @@ public static class ClientConfigs { @Configurable.Comment({"Duration of UI animations in ms", "Default: 300"}) @Configurable.Range(min = 1) public int animationTime = 300; + @Configurable + public ArmorHud armorHud = new ArmorHud(); + + public static class ArmorHud { + @Configurable + @Configurable.Comment({"Sets HUD location", "1 - left-upper corner", "2 - right-upper corner", "3 - left-bottom corner", "4 - right-bottom corner", "Default: 1"}) + @Configurable.Range(min = 1, max = 4) + public int hudLocation = 1; + @Configurable + @Configurable.Comment({"Horizontal offset of HUD.", "Default: 0"}) + @Configurable.Range(min = 0, max = 100) + public int hudOffsetX = 0; + @Configurable + @Configurable.Comment({"Vertical offset of HUD.", "Default: 0"}) + @Configurable.Range(min = 0, max = 100) + public int hudOffsetY = 0; + } } public static class DeveloperConfigs { diff --git a/src/main/java/com/gregtechceu/gtceu/core/IFireImmuneEntity.java b/src/main/java/com/gregtechceu/gtceu/core/IFireImmuneEntity.java new file mode 100644 index 0000000000..ebbdfff3cd --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/core/IFireImmuneEntity.java @@ -0,0 +1,6 @@ +package com.gregtechceu.gtceu.core; + +public interface IFireImmuneEntity { + + void gtceu$setFireImmune(boolean isImmune); +} diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/EntityMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/EntityMixin.java new file mode 100644 index 0000000000..98aac5709c --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/EntityMixin.java @@ -0,0 +1,30 @@ +package com.gregtechceu.gtceu.core.mixins; + +import com.gregtechceu.gtceu.core.IFireImmuneEntity; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(Entity.class) +public abstract class EntityMixin implements IFireImmuneEntity { + + @Shadow + public abstract EntityType getType(); + + @Unique + private boolean gtceu$fireImmune = false; + + @Inject(method = "fireImmune", at = @At("RETURN"), cancellable = true) + private void gtceu$changeFireImmune(CallbackInfoReturnable cir) { + cir.setReturnValue(gtceu$fireImmune || cir.getReturnValueZ()); + } + + public void gtceu$setFireImmune(boolean isImmune) { + this.gtceu$fireImmune = isImmune; + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/ForgeGuiMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/ForgeGuiMixin.java new file mode 100644 index 0000000000..41dc2551a2 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/ForgeGuiMixin.java @@ -0,0 +1,31 @@ +package com.gregtechceu.gtceu.core.mixins; + +import com.gregtechceu.gtceu.api.item.armor.ArmorComponentItem; +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import net.minecraft.client.Minecraft; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.client.gui.overlay.ForgeGui; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; + +@Mixin(value = ForgeGui.class, remap = false) +public abstract class ForgeGuiMixin { + + @Shadow + public abstract Minecraft getMinecraft(); + + @ModifyExpressionValue(method = "renderArmor", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;getArmorValue()I", remap = true)) + private int gtceu$modifyArmorAmount(int level) { + var armorInv = getMinecraft().player.getInventory().armor; + for (int i = 0; i < armorInv.size(); ++i) { + ItemStack armor = armorInv.get(i); + if (armor.getItem() instanceof ArmorComponentItem armorItem) { + EquipmentSlot slot = EquipmentSlot.byTypeAndIndex(EquipmentSlot.Type.ARMOR, i); + level += armorItem.getArmorDisplay(getMinecraft().player, armor, slot); + } + } + return level; + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/ItemAccessor.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/ItemAccessor.java new file mode 100644 index 0000000000..20e578f9b3 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/ItemAccessor.java @@ -0,0 +1,12 @@ +package com.gregtechceu.gtceu.core.mixins; + +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.Item; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; + +@Mixin(Item.class) +public interface ItemAccessor { + @Invoker + boolean invokeAllowedIn(CreativeModeTab category); +} diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/ItemRendererMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/ItemRendererMixin.java index efad195e5d..91b23f73fc 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/mixins/ItemRendererMixin.java +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/ItemRendererMixin.java @@ -1,6 +1,7 @@ package com.gregtechceu.gtceu.core.mixins; import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.IGTTool; import com.gregtechceu.gtceu.client.util.ToolChargeBarRenderer; import com.llamalad7.mixinextras.sugar.Local; @@ -26,7 +27,7 @@ public class ItemRendererMixin { private void gtceu$renderCustomDurabilityBars(Font font, ItemStack stack, int x, int y, String text, CallbackInfo ci, @Local PoseStack poseStack) { if (stack.getItem() instanceof IGTTool toolItem) { ToolChargeBarRenderer.renderBarsTool(poseStack, toolItem, stack, x, y); - } else if (stack.getItem() instanceof ComponentItem componentItem) { + } else if (stack.getItem() instanceof IComponentItem componentItem) { ToolChargeBarRenderer.renderBarsItem(poseStack, componentItem, stack, x, y); } } diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/LivingEntityMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/LivingEntityMixin.java new file mode 100644 index 0000000000..4047b408a4 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/LivingEntityMixin.java @@ -0,0 +1,36 @@ +package com.gregtechceu.gtceu.core.mixins; + +import com.gregtechceu.gtceu.api.item.armor.ArmorComponentItem; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(LivingEntity.class) +public abstract class LivingEntityMixin { + @Shadow + public abstract Iterable getArmorSlots(); + @Shadow + public abstract void setItemSlot(EquipmentSlot slot, ItemStack stack); + + @Inject(method = "getDamageAfterArmorAbsorb", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/damagesource/CombatRules;getDamageAfterAbsorb(FFF)F")) + private void gtceu$adjustArmorAbsorption(DamageSource damageSource, float damageAmount, CallbackInfoReturnable cir) { + float armorDamage = Math.max(1.0F, damageAmount / 4.0F); + int i = 0; + for (ItemStack itemStack : this.getArmorSlots()) { + if (itemStack.getItem() instanceof ArmorComponentItem armorItem) { + EquipmentSlot slot = EquipmentSlot.byTypeAndIndex(EquipmentSlot.Type.ARMOR, i); + armorItem.damageArmor((LivingEntity)(Object)this, itemStack, damageSource, (int) armorDamage, slot); + if (itemStack.getCount() == 0) { + this.setItemSlot(slot, ItemStack.EMPTY); + } + } + ++i; + } + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/PrimedTntAccessor.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/PrimedTntAccessor.java new file mode 100644 index 0000000000..b97082aba5 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/PrimedTntAccessor.java @@ -0,0 +1,12 @@ +package com.gregtechceu.gtceu.core.mixins; + +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.item.PrimedTnt; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(PrimedTnt.class) +public interface PrimedTntAccessor { + @Accessor + void setOwner(LivingEntity owner); +} diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/ServerGamePacketListenerImplAccessor.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/ServerGamePacketListenerImplAccessor.java new file mode 100644 index 0000000000..3ee25d8221 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/ServerGamePacketListenerImplAccessor.java @@ -0,0 +1,12 @@ +package com.gregtechceu.gtceu.core.mixins; + +import net.minecraft.server.network.ServerGamePacketListenerImpl; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(ServerGamePacketListenerImpl.class) +public interface ServerGamePacketListenerImplAccessor { + + @Accessor + void setAboveGroundTickCount(int aboveGroundTickCount); +} diff --git a/src/main/java/com/gregtechceu/gtceu/data/lang/BlockLang.java b/src/main/java/com/gregtechceu/gtceu/data/lang/BlockLang.java index be169c2ee0..cca5d3ca78 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/lang/BlockLang.java +++ b/src/main/java/com/gregtechceu/gtceu/data/lang/BlockLang.java @@ -84,123 +84,9 @@ private static void initCasingLang(RegistrateLangProvider provider) { provider.add("block.filter_casing.tooltip", "Creates a §aParticle-Free§7 environment"); provider.add("block.sterilizing_filter_casing.tooltip", "Creates a §aSterilized§7 environment"); - - // TODO warning sign blocks - /* - replace(provider, "tile.warning_sign.yellow_stripes.name", "Yellow Stripes Block"); - replace(provider, "tile.warning_sign.small_yellow_stripes.name", "Yellow Stripes Block"); - replace(provider, "tile.warning_sign.radioactive_hazard.name", "Radioactive Hazard Sign Block"); - replace(provider, "tile.warning_sign.bio_hazard.name", "Bio Hazard Sign Block"); - replace(provider, "tile.warning_sign.explosion_hazard.name", "Explosion Hazard Sign Block"); - replace(provider, "tile.warning_sign.fire_hazard.name", "Fire Hazard Sign Block"); - replace(provider, "tile.warning_sign.acid_hazard.name", "Acid Hazard Sign Block"); - replace(provider, "tile.warning_sign.magic_hazard.name", "Magic Hazard Sign Block"); - replace(provider, "tile.warning_sign.frost_hazard.name", "Frost Hazard Sign Block"); - replace(provider, "tile.warning_sign.noise_hazard.name", "Noise Hazard Sign Block"); - replace(provider, "tile.warning_sign.generic_hazard.name", "Generic Hazard Sign Block"); - replace(provider, "tile.warning_sign.high_voltage_hazard.name", "High Voltage Hazard Sign Block"); - replace(provider, "tile.warning_sign.magnetic_hazard.name", "Magnetic Hazard Sign Block"); - replace(provider, "tile.warning_sign.antimatter_hazard.name", "Antimatter Hazard Sign Block"); - replace(provider, "tile.warning_sign.high_temperature_hazard.name", "High Temperature Hazard Sign Block"); - replace(provider, "tile.warning_sign.void_hazard.name", "Void Hazard Sign Block"); - replace(provider, "tile.warning_sign_1.mob_spawner_hazard.name", "Mob Spawner Hazard Sign Block"); - replace(provider, "tile.warning_sign_1.spatial_storage_hazard.name", "Spatial Storage Hazard Sign Block"); - replace(provider, "tile.warning_sign_1.laser_hazard.name", "Laser Hazard Sign Block"); - replace(provider, "tile.warning_sign_1.mob_hazard.name", "Mob Infestation Hazard Sign Block"); - replace(provider, "tile.warning_sign_1.boss_hazard.name", "Boss Hazard Sign Block"); - replace(provider, "tile.warning_sign_1.gregification_hazard.name", "Gregification Hazard Sign Block"); - replace(provider, "tile.warning_sign_1.causality_hazard.name", "Non-Standard Causality Hazard Sign Block"); - replace(provider, "tile.warning_sign_1.automated_defenses_hazard.name", "Automated Defenses Hazard Sign Block"); - replace(provider, "tile.warning_sign_1.high_pressure_hazard.name", "High Pressure Hazard Sign Block"); - */ - - // todo stone type decorative blocks - /* - provider.add("tile.asphalt.asphalt.name", "Asphalt"); - provider.add("tile.stone_smooth.black_granite.name", "Black Granite"); - provider.add("tile.stone_smooth.red_granite.name", "Red Granite"); - provider.add("tile.stone_smooth.marble.name", "Marble"); - provider.add("tile.stone_smooth.basalt.name", "Basalt"); - provider.add("tile.stone_smooth.concrete_light.name", "Light Concrete"); - provider.add("tile.stone_smooth.concrete_dark.name", "Dark Concrete"); - provider.add("tile.stone_cobble.black_granite.name", "Black Granite Cobblestone"); - provider.add("tile.stone_cobble.red_granite.name", "Red Granite Cobblestone"); - provider.add("tile.stone_cobble.marble.name", "Marble Cobblestone"); - provider.add("tile.stone_cobble.basalt.name", "Basalt Cobblestone"); - provider.add("tile.stone_cobble.concrete_light.name", "Light Concrete Cobblestone"); - provider.add("tile.stone_cobble.concrete_dark.name", "Dark Concrete Cobblestone"); - provider.add("tile.stone_cobble_mossy.black_granite.name", "Mossy Black Granite Cobblestone"); - provider.add("tile.stone_cobble_mossy.red_granite.name", "Mossy Red Granite Cobblestone"); - provider.add("tile.stone_cobble_mossy.marble.name", "Mossy Marble Cobblestone"); - provider.add("tile.stone_cobble_mossy.basalt.name", "Mossy Basalt Cobblestone"); - provider.add("tile.stone_cobble_mossy.concrete_light.name", "Mossy Light Concrete Cobblestone"); - provider.add("tile.stone_cobble_mossy.concrete_dark.name", "Mossy Dark Concrete Cobblestone"); - provider.add("tile.stone_polished.black_granite.name", "Polished Black Granite"); - provider.add("tile.stone_polished.red_granite.name", "Polished Red Granite"); - provider.add("tile.stone_polished.marble.name", "Polished Marble"); - provider.add("tile.stone_polished.basalt.name", "Polished Basalt"); - provider.add("tile.stone_polished.concrete_light.name", "Polished Light Concrete"); - provider.add("tile.stone_polished.concrete_dark.name", "Polished Dark Concrete"); - provider.add("tile.stone_bricks.black_granite.name", "Black Granite Bricks"); - provider.add("tile.stone_bricks.red_granite.name", "Red Granite Bricks"); - provider.add("tile.stone_bricks.marble.name", "Marble Bricks"); - provider.add("tile.stone_bricks.basalt.name", "Basalt Bricks"); - provider.add("tile.stone_bricks.concrete_light.name", "Light Concrete Bricks"); - provider.add("tile.stone_bricks.concrete_dark.name", "Dark Concrete Bricks"); - provider.add("tile.stone_bricks_cracked.black_granite.name", "Cracked Black Granite Bricks"); - provider.add("tile.stone_bricks_cracked.red_granite.name", "Cracked Red Granite Bricks"); - provider.add("tile.stone_bricks_cracked.marble.name", "Cracked Marble Bricks"); - provider.add("tile.stone_bricks_cracked.basalt.name", "Cracked Basalt Bricks"); - provider.add("tile.stone_bricks_cracked.concrete_light.name", "Cracked Light Concrete Bricks"); - provider.add("tile.stone_bricks_cracked.concrete_dark.name", "Cracked Dark Concrete Bricks"); - provider.add("tile.stone_bricks_mossy.black_granite.name", "Mossy Black Granite Bricks"); - provider.add("tile.stone_bricks_mossy.red_granite.name", "Mossy Red Granite Bricks"); - provider.add("tile.stone_bricks_mossy.marble.name", "Mossy Marble Bricks"); - provider.add("tile.stone_bricks_mossy.basalt.name", "Mossy Basalt Bricks"); - provider.add("tile.stone_bricks_mossy.concrete_light.name", "Mossy Light Concrete Bricks"); - provider.add("tile.stone_bricks_mossy.concrete_dark.name", "Mossy Dark Concrete Bricks"); - provider.add("tile.stone_chiseled.black_granite.name", "Chiseled Black Granite"); - provider.add("tile.stone_chiseled.red_granite.name", "Chiseled Red Granite"); - provider.add("tile.stone_chiseled.marble.name", "Chiseled Marble"); - provider.add("tile.stone_chiseled.basalt.name", "Chiseled Basalt"); - provider.add("tile.stone_chiseled.concrete_light.name", "Chiseled Light Concrete"); - provider.add("tile.stone_chiseled.concrete_dark.name", "Chiseled Dark Concrete"); - provider.add("tile.stone_tiled.black_granite.name", "Black Granite Tiles"); - provider.add("tile.stone_tiled.red_granite.name", "Red Granite Tiles"); - provider.add("tile.stone_tiled.marble.name", "Marble Tiles"); - provider.add("tile.stone_tiled.basalt.name", "Basalt Tiles"); - provider.add("tile.stone_tiled.concrete_light.name", "Light Concrete Tiles"); - provider.add("tile.stone_tiled.concrete_dark.name", "Dark Concrete Tiles"); - provider.add("tile.stone_tiled_small.black_granite.name", "Small Black Granite Tiles"); - provider.add("tile.stone_tiled_small.red_granite.name", "Small Red Granite Tiles"); - provider.add("tile.stone_tiled_small.marble.name", "Small Marble Tiles"); - provider.add("tile.stone_tiled_small.basalt.name", "Small Basalt Tiles"); - provider.add("tile.stone_tiled_small.concrete_light.name", "Small Light Concrete Tiles"); - provider.add("tile.stone_tiled_small.concrete_dark.name", "Small Dark Concrete Tiles"); - provider.add("tile.stone_bricks_small.black_granite.name", "Small Black Granite Bricks"); - provider.add("tile.stone_bricks_small.red_granite.name", "Small Red Granite Bricks"); - provider.add("tile.stone_bricks_small.marble.name", "Small Marble Bricks"); - provider.add("tile.stone_bricks_small.basalt.name", "Small Basalt Bricks"); - provider.add("tile.stone_bricks_small.concrete_light.name", "Small Light Concrete Bricks"); - provider.add("tile.stone_bricks_small.concrete_dark.name", "Small Dark Concrete Bricks"); - provider.add("tile.stone_bricks_windmill_a.black_granite.name", "Black Granite Windmill Tiles A"); - provider.add("tile.stone_bricks_windmill_a.red_granite.name", "Red Granite Windmill Tiles A"); - provider.add("tile.stone_bricks_windmill_a.marble.name", "Marble Windmill Tiles A"); - provider.add("tile.stone_bricks_windmill_a.basalt.name", "Basalt Windmill Tiles A"); - provider.add("tile.stone_bricks_windmill_a.concrete_light.name", "Light Concrete Windmill Tiles A"); - provider.add("tile.stone_bricks_windmill_a.concrete_dark.name", "Dark Concrete Windmill Tiles A"); - provider.add("tile.stone_bricks_windmill_b.black_granite.name", "Black Granite Windmill Tiles B"); - provider.add("tile.stone_bricks_windmill_b.red_granite.name", "Red Granite Windmill Tiles B"); - provider.add("tile.stone_bricks_windmill_b.marble.name", "Marble Windmill Tiles B"); - provider.add("tile.stone_bricks_windmill_b.basalt.name", "Basalt Windmill Tiles B"); - provider.add("tile.stone_bricks_windmill_b.concrete_light.name", "Light Concrete Windmill Tiles B"); - provider.add("tile.stone_bricks_windmill_b.concrete_dark.name", "Dark Concrete Windmill Tiles B"); - provider.add("tile.stone_bricks_square.black_granite.name", "Square Black Granite Bricks"); - provider.add("tile.stone_bricks_square.red_granite.name", "Square Red Granite Bricks"); - provider.add("tile.stone_bricks_square.marble.name", "Square Marble Bricks"); - provider.add("tile.stone_bricks_square.basalt.name", "Square Basalt Bricks"); - provider.add("tile.stone_bricks_square.concrete_light.name", "Square Light Concrete Bricks"); - provider.add("tile.stone_bricks_square.concrete_dark.name", "Square Dark Concrete Bricks"); - */ + provider.add("block.gtceu.explosive.breaking_tooltip", "Primes explosion when mined, sneak mine to pick back up"); + provider.add("block.gtceu.explosive.lighting_tooltip", "Cannot be lit with Redstone"); + provider.add("block.gtceu.powderbarrel.drops_tooltip", "Slightly larger than TNT, drops all destroyed Blocks as Items"); + provider.add("block.gtceu.itnt.drops_tooltip", "Much larger than TNT, drops all destroyed Blocks as Items"); } } diff --git a/src/main/java/com/gregtechceu/gtceu/data/lang/ItemLang.java b/src/main/java/com/gregtechceu/gtceu/data/lang/ItemLang.java index 23216b6436..a85dda5acb 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/lang/ItemLang.java +++ b/src/main/java/com/gregtechceu/gtceu/data/lang/ItemLang.java @@ -290,5 +290,7 @@ private static void initItemTooltips(RegistrateLangProvider provider) { provider.add("item.gtceu.bottle.purple.drink.tooltip", "§7How about Lemonade. Or some Ice Tea? I got Purple Drink!"); multilineLang(provider, "item.gtceu.foam_sprayer.tooltip", "§7Sprays Construction Foam\nUse on a frame to foam connected frames\nFoam can be colored"); provider.add("item.gtceu.firebrick.tooltip", "§7Heat resistant"); + + provider.add("item.gtceu.sus_record.desc", "sussy!"); } } diff --git a/src/main/java/com/gregtechceu/gtceu/data/lang/LangHandler.java b/src/main/java/com/gregtechceu/gtceu/data/lang/LangHandler.java index 70b41ba165..8fef931a2f 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/lang/LangHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/lang/LangHandler.java @@ -646,7 +646,6 @@ public static void init(RegistrateLangProvider provider) { provider.add("behavior.prospector.not_enough_energy", "Not Enough Energy!"); provider.add("metaitem.tricorder_scanner.tooltip", "Tricorder"); provider.add("metaitem.debug_scanner.tooltip", "Tricorder"); - provider.add("behavior.portable_scanner.amp_per_sec", "Last Second %s A"); provider.add("behavior.portable_scanner.bedrock_fluid.amount", "Fluid In Deposit: %s %s - %s%%"); provider.add("behavior.portable_scanner.bedrock_fluid.amount_unknown", "Fluid In Deposit: %s%%"); provider.add("behavior.portable_scanner.bedrock_fluid.nothing", "Fluid In Deposit: §6Nothing§r"); @@ -663,7 +662,8 @@ public static void init(RegistrateLangProvider provider) { provider.add("behavior.portable_scanner.energy_container_in", "Max IN: %s (%s) EU at %s A"); provider.add("behavior.portable_scanner.energy_container_out", "Max OUT: %s (%s) EU at %s A"); provider.add("behavior.portable_scanner.energy_container_storage", "Energy: %s EU / %s EU"); - provider.add("behavior.portable_scanner.eu_per_sec", "Last Second %s EU"); + provider.add("behavior.portable_scanner.eu_per_sec", "Average (last second): %s EU/t"); + provider.add("behavior.portable_scanner.amp_per_sec", "Average (last second): %s A"); provider.add("behavior.portable_scanner.machine_disabled", "Disabled."); provider.add("behavior.portable_scanner.machine_power_loss", "Shut down due to power loss."); provider.add("behavior.portable_scanner.machine_progress", "Progress/Load: %s / %s"); diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/WoodTypeEntry.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/WoodTypeEntry.java index 855a79c671..2797c4190b 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/WoodTypeEntry.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/WoodTypeEntry.java @@ -3,7 +3,6 @@ import com.google.common.base.Preconditions; import com.gregtechceu.gtceu.api.data.chemical.ChemicalHelper; import com.gregtechceu.gtceu.api.data.chemical.material.Material; -import com.gregtechceu.gtceu.api.data.chemical.material.stack.UnificationEntry; import com.gregtechceu.gtceu.api.data.tag.TagPrefix; import com.gregtechceu.gtceu.common.data.GTMaterials; import net.minecraft.tags.TagKey; @@ -101,7 +100,7 @@ private WoodTypeEntry(@NotNull String modid, @NotNull String woodName, @Nullable Item fence, @Nullable String fenceRecipeName, @Nullable Item fenceGate, @Nullable String fenceGateRecipeName, @Nullable Item stairs, @Nullable String stairsRecipeName, boolean addStairsCraftingRecipe, - @NotNull Item boat, @Nullable String boatRecipeName, + @Nullable Item boat, @Nullable String boatRecipeName, @Nullable Material material, boolean addLogOreDict, boolean addPlanksOreDict, boolean addDoorsOreDict, boolean addSlabsOreDict, boolean addFencesOreDict, boolean addFenceGatesOreDict, boolean addStairsOreDict, diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java index 9fea3f8b33..3a18ebb40e 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java @@ -40,6 +40,7 @@ import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.level.ItemLike; +import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.material.Fluids; import org.jetbrains.annotations.Nullable; @@ -546,11 +547,11 @@ public GTRecipeBuilder blastFurnaceTemp(int blastTemp) { } public GTRecipeBuilder explosivesAmount(int explosivesAmount) { - return addData("explosives_amount", explosivesAmount); + return inputItems(new ItemStack(Blocks.TNT, explosivesAmount)); } public GTRecipeBuilder explosivesType(ItemStack explosivesType) { - return addData("explosives_type", explosivesType.save(new CompoundTag())); + return inputItems(explosivesType); } public GTRecipeBuilder solderMultiplier(int multiplier) { diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java index 1179852e64..4942fbbba4 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java @@ -101,6 +101,13 @@ private static void harderBrickRecipes(Consumer provider) { private static void hardWoodRecipes(Consumer provider) { VanillaRecipeHelper.addShapedRecipe(provider, "ladder", new ItemStack(Blocks.LADDER, 2), "SrS", "SRS", "ShS", 'S', new UnificationEntry(TagPrefix.rod, GTMaterials.Wood), 'R', new UnificationEntry(TagPrefix.bolt, GTMaterials.Wood)); + + VanillaRecipeHelper.addShapedRecipe(provider, "bowl", new ItemStack(Items.BOWL), "k", "X", 'X', ItemTags.PLANKS); + + VanillaRecipeHelper.addShapedRecipe(provider, "chest", new ItemStack(Blocks.CHEST), "LPL", "PFP", "LPL", + 'L', ItemTags.LOGS, + 'P', ItemTags.PLANKS, + 'F', new ItemStack(Items.FLINT)); } private static void hardIronRecipes(Consumer provider) { diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java index b1d2085b3d..5eef64a688 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java @@ -102,6 +102,8 @@ private static void harderBrickRecipes(Consumer registry) { private static void hardWoodRecipes(Consumer registry) { registry.accept(new ResourceLocation("minecraft:ladder")); + registry.accept(new ResourceLocation("minecraft:bowl")); + registry.accept(new ResourceLocation("minecraft:chest")); } private static void hardIronRecipes(Consumer registry) { diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/MaterialRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/MaterialRecipeHandler.java index 8c5fe26903..5ec75ed454 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/MaterialRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/MaterialRecipeHandler.java @@ -9,6 +9,7 @@ import com.gregtechceu.gtceu.api.data.tag.TagPrefix; import com.gregtechceu.gtceu.api.fluids.store.FluidStorageKeys; import com.gregtechceu.gtceu.api.recipe.ingredient.FluidIngredient; +import com.gregtechceu.gtceu.common.data.GTBlocks; import com.gregtechceu.gtceu.common.data.GTItems; import com.gregtechceu.gtceu.common.data.GTMaterials; import com.gregtechceu.gtceu.config.ConfigHolder; @@ -17,13 +18,10 @@ import com.gregtechceu.gtceu.data.recipe.builder.GTRecipeBuilder; import com.gregtechceu.gtceu.utils.FormattingUtil; import com.gregtechceu.gtceu.utils.GTUtil; -import com.lowdragmc.lowdraglib.side.fluid.FluidStack; import net.minecraft.data.recipes.FinishedRecipe; -import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.item.ItemStack; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Locale; @@ -42,18 +40,18 @@ public class MaterialRecipeHandler { Arrays.asList(gem, gemFlawless, gemExquisite); public static void init(Consumer provider) { - ingot.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processIngot(tagPrefix, material, property, provider)); - nugget.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processNugget(tagPrefix, material, property, provider)); + ingot.executeHandler(provider, PropertyKey.INGOT, MaterialRecipeHandler::processIngot); + nugget.executeHandler(provider, PropertyKey.DUST, MaterialRecipeHandler::processNugget); - block.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processBlock(tagPrefix, material, property, provider)); - frameGt.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processFrame(tagPrefix, material, property, provider)); + block.executeHandler(provider, PropertyKey.DUST, MaterialRecipeHandler::processBlock); + frameGt.executeHandler(provider, PropertyKey.DUST, MaterialRecipeHandler::processFrame); - dust.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processDust(tagPrefix, material, property, provider)); - dustSmall.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processSmallDust(tagPrefix, material, property, provider)); - dustTiny.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processTinyDust(tagPrefix, material, property, provider)); + dust.executeHandler(provider, PropertyKey.DUST, MaterialRecipeHandler::processDust); + dustSmall.executeHandler(provider, PropertyKey.DUST, MaterialRecipeHandler::processSmallDust); + dustTiny.executeHandler(provider, PropertyKey.DUST, MaterialRecipeHandler::processTinyDust); for (TagPrefix orePrefix : GEM_ORDER) { - orePrefix.executeHandler(PropertyKey.GEM, (tagPrefix, material, property) -> processGemConversion(tagPrefix, material, property, provider)); + orePrefix.executeHandler(provider, PropertyKey.GEM, MaterialRecipeHandler::processGemConversion); } } @@ -81,20 +79,33 @@ public static void processDust(TagPrefix dustPrefix, Material mat, DustProperty } if (!mat.hasFlag(EXPLOSIVE) && !mat.hasFlag(FLAMMABLE)) { + IMPLOSION_RECIPES.recipeBuilder("implode_" + id + "_powderbarrel") + .inputItems(GTUtil.copyAmount(4, dustStack)) + .outputItems(GTUtil.copyAmount(3, gemStack)) + .chancedOutput(dust, GTMaterials.DarkAsh, 2500, 0) + .explosivesType(new ItemStack(GTBlocks.POWDERBARREL.get(), 8)) + .save(provider); + IMPLOSION_RECIPES.recipeBuilder("implode_" + id + "_tnt") - .inputItems(GTUtil.copyAmount(4, dustStack)) - .outputItems(GTUtil.copyAmount(3, gemStack)) - .chancedOutput(dust, GTMaterials.DarkAsh, 2500, 0) - .explosivesAmount(2) - .save(provider); + .inputItems(GTUtil.copyAmount(4, dustStack)) + .outputItems(GTUtil.copyAmount(3, gemStack)) + .chancedOutput(dust, GTMaterials.DarkAsh, 2500, 0) + .explosivesAmount(4) + .save(provider); + + IMPLOSION_RECIPES.recipeBuilder("implode_" + id + "_dynamite") + .inputItems(GTUtil.copyAmount(4, dustStack)) + .outputItems(GTUtil.copyAmount(3, gemStack)) + .chancedOutput(dust, GTMaterials.DarkAsh, 2500, 0) + .explosivesType(GTItems.DYNAMITE.asStack(2)) + .save(provider); - // TODO Dynamite - //IMPLOSION_RECIPES.recipeBuilder("implode_" + id + "_dynamite") - // .inputItems(GTUtil.copyAmount(4, dustStack)) - // .outputs(GTUtil.copyAmount(3, gemStack)) - // .chancedOutput(dust, GTMaterials.DarkAsh, 2500, 0) - // .explosivesType(GTItems.DYNAMITE.asStack()) - // .save(provider); + IMPLOSION_RECIPES.recipeBuilder("implode_" + id + "_itnt") + .inputItems(GTUtil.copyAmount(4, dustStack)) + .outputItems(GTUtil.copyAmount(3, gemStack)) + .chancedOutput(dust, GTMaterials.DarkAsh, 2500, 0) + .explosivesType(new ItemStack(GTBlocks.INDUSTRIAL_TNT.get())) + .save(provider); } if (oreProperty != null) { @@ -407,10 +418,14 @@ public static void processNugget(TagPrefix orePrefix, Material material, DustPro ItemStack ingotStack = ChemicalHelper.get(ingot, material); if (!ConfigHolder.INSTANCE.recipes.disableManualCompression) { - VanillaRecipeHelper.addShapelessRecipe(provider, String.format("nugget_disassembling_%s", material.getName()), + if (!ingot.isIgnored(material)) { + VanillaRecipeHelper.addShapelessRecipe(provider, String.format("nugget_disassembling_%s", material.getName()), GTUtil.copyAmount(9, nuggetStack), new UnificationEntry(ingot, material)); - VanillaRecipeHelper.addShapedRecipe(provider, String.format("nugget_assembling_%s", material.getName()), + } + if (!orePrefix.isIgnored(material)) { + VanillaRecipeHelper.addShapedRecipe(provider, String.format("nugget_assembling_%s", material.getName()), ingotStack, "XXX", "XXX", "XXX", 'X', new UnificationEntry(orePrefix, material)); + } } COMPRESSOR_RECIPES.recipeBuilder("compress_" + material.getName() + "_nugget_to_ingot") @@ -438,10 +453,14 @@ public static void processNugget(TagPrefix orePrefix, Material material, DustPro ItemStack gemStack = ChemicalHelper.get(gem, material); if (!ConfigHolder.INSTANCE.recipes.disableManualCompression) { - VanillaRecipeHelper.addShapelessRecipe(provider, String.format("nugget_disassembling_%s", material.getName()), + if (!gem.isIgnored(material)) { + VanillaRecipeHelper.addShapelessRecipe(provider, String.format("nugget_disassembling_%s", material.getName()), GTUtil.copyAmount(9, nuggetStack), new UnificationEntry(gem, material)); - VanillaRecipeHelper.addShapedRecipe(provider, String.format("nugget_assembling_%s", material.getName()), + } + if (!orePrefix.isIgnored(material)) { + VanillaRecipeHelper.addShapedRecipe(provider, String.format("nugget_assembling_%s", material.getName()), gemStack, "XXX", "XXX", "XXX", 'X', new UnificationEntry(orePrefix, material)); + } } } } @@ -502,7 +521,7 @@ public static void processBlock(TagPrefix blockPrefix, Material material, DustPr int size = (int) (materialAmount / M); int sizeSqrt = Math.round(Mth.sqrt(size)); //do not allow handcrafting or uncrafting of blacklisted blocks - if (!material.hasFlag(EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES) && !ConfigHolder.INSTANCE.recipes.disableManualCompression && sizeSqrt*sizeSqrt == size) { + if (!material.hasFlag(EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES) && !ConfigHolder.INSTANCE.recipes.disableManualCompression && sizeSqrt*sizeSqrt == size && !block.isIgnored(material)) { String patternString = "B".repeat(Math.max(0, sizeSqrt)); String[] pattern = new String[sizeSqrt]; Arrays.fill(pattern, patternString); diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java index 5b8d99c034..c9ede1a77d 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java @@ -2,6 +2,8 @@ import com.gregtechceu.gtceu.api.data.chemical.ChemicalHelper; import com.gregtechceu.gtceu.api.data.chemical.material.Material; +import com.gregtechceu.gtceu.api.data.chemical.material.info.MaterialFlag; +import com.gregtechceu.gtceu.api.data.chemical.material.info.MaterialFlags; import com.gregtechceu.gtceu.api.data.chemical.material.properties.OreProperty; import com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey; import com.gregtechceu.gtceu.api.data.chemical.material.stack.MaterialStack; @@ -33,18 +35,18 @@ public class OreRecipeHandler { public static void init(Consumer provider) { for (TagPrefix ore : ORES.keySet()) { if (ConfigHolder.INSTANCE.worldgen.allUniqueStoneTypes || ORES.get(ore).shouldDropAsItem()) { - ore.executeHandler(PropertyKey.ORE, (tagPrefix, material, property) -> processOre(tagPrefix, material, property, provider)); + ore.executeHandler(provider, PropertyKey.ORE, OreRecipeHandler::processOre); } } - ore.executeHandler(PropertyKey.ORE, (tagPrefix, material, property) -> processOreForgeHammer(tagPrefix, material, property, provider)); + ore.executeHandler(provider, PropertyKey.ORE, OreRecipeHandler::processOreForgeHammer); - rawOre.executeHandler(PropertyKey.ORE, (tagPrefix, material, property) -> processRawOre(tagPrefix, material, property, provider)); + rawOre.executeHandler(provider, PropertyKey.ORE, OreRecipeHandler::processRawOre); - crushed.executeHandler(PropertyKey.ORE, (tagPrefix, material, property) -> processCrushedOre(tagPrefix, material, property, provider)); - crushedPurified.executeHandler(PropertyKey.ORE, (tagPrefix, material, property) -> processCrushedPurified(tagPrefix, material, property, provider)); - crushedRefined.executeHandler(PropertyKey.ORE, (tagPrefix, material, property) -> processCrushedCentrifuged(tagPrefix, material, property, provider)); - dustImpure.executeHandler(PropertyKey.ORE, (tagPrefix, material, property) -> processDirtyDust(tagPrefix, material, property, provider)); - dustPure.executeHandler(PropertyKey.ORE, (tagPrefix, material, property) -> processPureDust(tagPrefix, material, property, provider)); + crushed.executeHandler(provider, PropertyKey.ORE, OreRecipeHandler::processCrushedOre); + crushedPurified.executeHandler(provider, PropertyKey.ORE, OreRecipeHandler::processCrushedPurified); + crushedRefined.executeHandler(provider, PropertyKey.ORE, OreRecipeHandler::processCrushedCentrifuged); + dustImpure.executeHandler(provider, PropertyKey.ORE, OreRecipeHandler::processDirtyDust); + dustPure.executeHandler(provider, PropertyKey.ORE, OreRecipeHandler::processPureDust); } @@ -54,7 +56,7 @@ private static void processMetalSmelting(TagPrefix crushedPrefix, Material mater if (smeltingResult.hasProperty(PropertyKey.INGOT)) { ItemStack ingotStack = ChemicalHelper.get(ingot, smeltingResult); - if (!ingotStack.isEmpty() && doesMaterialUseNormalFurnace(smeltingResult)) { + if (!ingotStack.isEmpty() && doesMaterialUseNormalFurnace(smeltingResult) && !crushedPrefix.isIgnored(material)) { VanillaRecipeHelper.addSmeltingRecipe(provider, "smelt_" + crushedPrefix.name + "_" + material.getName() + "_to_ingot", ChemicalHelper.getTag(crushedPrefix, material), ingotStack, 0.5f); } @@ -161,7 +163,7 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp .save(provider); } - //do not try to add smelting recipes for materials which require blast furnace + //do not try to add smelting recipes for materials which require blast furnace, or don't have smelting recipes at all. if (!ingotStack.isEmpty() && doesMaterialUseNormalFurnace(smeltingMaterial) && !orePrefix.isIgnored(material)) { float xp = Math.round(((1 + property.getOreMultiplier() * 0.33f) / 3) * 10f) / 10f; VanillaRecipeHelper.addSmeltingRecipe(provider, "smelt_" + orePrefix.name + "_" + material.getName() + "_ore_to_ingot", @@ -429,7 +431,7 @@ public static void processPureDust(TagPrefix purePrefix, Material material, OreP } private static boolean doesMaterialUseNormalFurnace(Material material) { - return !material.hasProperty(PropertyKey.BLAST); + return !material.hasProperty(PropertyKey.BLAST) && !material.hasFlag(MaterialFlags.NO_SMELTING); } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PartsRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PartsRecipeHandler.java index 3f30c81c0d..57932b18a6 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PartsRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PartsRecipeHandler.java @@ -13,7 +13,6 @@ import com.gregtechceu.gtceu.data.recipe.builder.GTRecipeBuilder; import com.gregtechceu.gtceu.utils.GTUtil; import net.minecraft.data.recipes.FinishedRecipe; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import java.util.function.Consumer; @@ -29,26 +28,26 @@ private PartsRecipeHandler() { } public static void init(Consumer provider) { - rod.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processStick(tagPrefix, material, property, provider)); - rodLong.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processLongStick(tagPrefix, material, property, provider)); - plate.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processPlate(tagPrefix, material, property, provider)); - plateDouble.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processPlateDouble(tagPrefix, material, property, provider)); - plateDense.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processPlateDense(tagPrefix, material, property, provider)); - - turbineBlade.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processTurbine(tagPrefix, material, property, provider)); - rotor.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processRotor(tagPrefix, material, property, provider)); - bolt.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processBolt(tagPrefix, material, property, provider)); - screw.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processScrew(tagPrefix, material, property, provider)); - wireFine.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processFineWire(tagPrefix, material, property, provider)); - foil.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processFoil(tagPrefix, material, property, provider)); - lens.executeHandler(PropertyKey.GEM, (tagPrefix, material, property) -> processLens(tagPrefix, material, property, provider)); - - gear.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processGear(tagPrefix, material, property, provider)); - gearSmall.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processGear(tagPrefix, material, property, provider)); - ring.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processRing(tagPrefix, material, property, provider)); - springSmall.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processSpringSmall(tagPrefix, material, property, provider)); - spring.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processSpring(tagPrefix, material, property, provider)); - round.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processRound(tagPrefix, material, property, provider)); + rod.executeHandler(provider, PropertyKey.DUST, PartsRecipeHandler::processStick); + rodLong.executeHandler(provider, PropertyKey.DUST, PartsRecipeHandler::processLongStick); + plate.executeHandler(provider, PropertyKey.DUST, PartsRecipeHandler::processPlate); + plateDouble.executeHandler(provider, PropertyKey.INGOT, PartsRecipeHandler::processPlateDouble); + plateDense.executeHandler(provider, PropertyKey.INGOT, PartsRecipeHandler::processPlateDense); + + turbineBlade.executeHandler(provider, PropertyKey.INGOT, PartsRecipeHandler::processTurbine); + rotor.executeHandler(provider, PropertyKey.INGOT, PartsRecipeHandler::processRotor); + bolt.executeHandler(provider, PropertyKey.DUST, PartsRecipeHandler::processBolt); + screw.executeHandler(provider, PropertyKey.DUST, PartsRecipeHandler::processScrew); + wireFine.executeHandler(provider, PropertyKey.INGOT, PartsRecipeHandler::processFineWire); + foil.executeHandler(provider, PropertyKey.INGOT, PartsRecipeHandler::processFoil); + lens.executeHandler(provider, PropertyKey.GEM, PartsRecipeHandler::processLens); + + gear.executeHandler(provider, PropertyKey.DUST, PartsRecipeHandler::processGear); + gearSmall.executeHandler(provider, PropertyKey.DUST, PartsRecipeHandler::processGear); + ring.executeHandler(provider, PropertyKey.INGOT, PartsRecipeHandler::processRing); + springSmall.executeHandler(provider, PropertyKey.INGOT, PartsRecipeHandler::processSpringSmall); + spring.executeHandler(provider, PropertyKey.INGOT, PartsRecipeHandler::processSpring); + round.executeHandler(provider, PropertyKey.INGOT, PartsRecipeHandler::processRound); } public static void processBolt(TagPrefix boltPrefix, Material material, DustProperty property, Consumer provider) { diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PipeRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PipeRecipeHandler.java index b296158a42..881a8fd4af 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PipeRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PipeRecipeHandler.java @@ -1,6 +1,5 @@ package com.gregtechceu.gtceu.data.recipe.generated; -import com.google.common.base.CaseFormat; import com.gregtechceu.gtceu.api.data.chemical.ChemicalHelper; import com.gregtechceu.gtceu.api.data.chemical.material.Material; import com.gregtechceu.gtceu.api.data.chemical.material.properties.FluidPipeProperties; @@ -14,7 +13,6 @@ import com.gregtechceu.gtceu.utils.FormattingUtil; import com.gregtechceu.gtceu.utils.GTUtil; import net.minecraft.data.recipes.FinishedRecipe; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import java.util.function.Consumer; @@ -28,24 +26,24 @@ public class PipeRecipeHandler { public static void init(Consumer provider) { - pipeTinyFluid.executeHandler(PropertyKey.FLUID_PIPE, (tagPrefix, material, property) -> processPipeTiny(tagPrefix, material, property, provider)); - pipeSmallFluid.executeHandler(PropertyKey.FLUID_PIPE, (tagPrefix, material, property) -> processPipeSmall(tagPrefix, material, property, provider)); - pipeNormalFluid.executeHandler(PropertyKey.FLUID_PIPE, (tagPrefix, material, property) -> processPipeNormal(tagPrefix, material, property, provider)); - pipeLargeFluid.executeHandler(PropertyKey.FLUID_PIPE, (tagPrefix, material, property) -> processPipeLarge(tagPrefix, material, property, provider)); - pipeHugeFluid.executeHandler(PropertyKey.FLUID_PIPE, (tagPrefix, material, property) -> processPipeHuge(tagPrefix, material, property, provider)); - - pipeQuadrupleFluid.executeHandler(PropertyKey.FLUID_PIPE, (tagPrefix, material, property) -> processPipeQuadruple(tagPrefix, material, property, provider)); - pipeNonupleFluid.executeHandler(PropertyKey.FLUID_PIPE, (tagPrefix, material, property) -> processPipeNonuple(tagPrefix, material, property, provider)); - - pipeSmallItem.executeHandler(PropertyKey.ITEM_PIPE, (tagPrefix, material, property) -> processPipeSmall(tagPrefix, material, property, provider)); - pipeNormalItem.executeHandler(PropertyKey.ITEM_PIPE, (tagPrefix, material, property) -> processPipeNormal(tagPrefix, material, property, provider)); - pipeLargeItem.executeHandler(PropertyKey.ITEM_PIPE, (tagPrefix, material, property) -> processPipeLarge(tagPrefix, material, property, provider)); - pipeHugeItem.executeHandler(PropertyKey.ITEM_PIPE, (tagPrefix, material, property) -> processPipeHuge(tagPrefix, material, property, provider)); - - pipeSmallRestrictive.executeHandler(PropertyKey.ITEM_PIPE, (tagPrefix, material, property) -> processRestrictivePipe(tagPrefix, material, property, provider)); - pipeNormalRestrictive.executeHandler(PropertyKey.ITEM_PIPE, (tagPrefix, material, property) -> processRestrictivePipe(tagPrefix, material, property, provider)); - pipeLargeRestrictive.executeHandler(PropertyKey.ITEM_PIPE, (tagPrefix, material, property) -> processRestrictivePipe(tagPrefix, material, property, provider)); - pipeHugeRestrictive.executeHandler(PropertyKey.ITEM_PIPE, (tagPrefix, material, property) -> processRestrictivePipe(tagPrefix, material, property, provider)); + pipeTinyFluid.executeHandler(provider, PropertyKey.FLUID_PIPE, PipeRecipeHandler::processPipeTiny); + pipeSmallFluid.executeHandler(provider, PropertyKey.FLUID_PIPE, PipeRecipeHandler::processPipeSmall); + pipeNormalFluid.executeHandler(provider, PropertyKey.FLUID_PIPE, PipeRecipeHandler::processPipeNormal); + pipeLargeFluid.executeHandler(provider, PropertyKey.FLUID_PIPE, PipeRecipeHandler::processPipeLarge); + pipeHugeFluid.executeHandler(provider, PropertyKey.FLUID_PIPE, PipeRecipeHandler::processPipeHuge); + + pipeQuadrupleFluid.executeHandler(provider, PropertyKey.FLUID_PIPE, PipeRecipeHandler::processPipeQuadruple); + pipeNonupleFluid.executeHandler(provider, PropertyKey.FLUID_PIPE, PipeRecipeHandler::processPipeNonuple); + + pipeSmallItem.executeHandler(provider, PropertyKey.ITEM_PIPE, PipeRecipeHandler::processPipeSmall); + pipeNormalItem.executeHandler(provider, PropertyKey.ITEM_PIPE, PipeRecipeHandler::processPipeNormal); + pipeLargeItem.executeHandler(provider, PropertyKey.ITEM_PIPE, PipeRecipeHandler::processPipeLarge); + pipeHugeItem.executeHandler(provider, PropertyKey.ITEM_PIPE, PipeRecipeHandler::processPipeHuge); + + pipeSmallRestrictive.executeHandler(provider, PropertyKey.ITEM_PIPE, PipeRecipeHandler::processRestrictivePipe); + pipeNormalRestrictive.executeHandler(provider, PropertyKey.ITEM_PIPE, PipeRecipeHandler::processRestrictivePipe); + pipeLargeRestrictive.executeHandler(provider, PropertyKey.ITEM_PIPE, PipeRecipeHandler::processRestrictivePipe); + pipeHugeRestrictive.executeHandler(provider, PropertyKey.ITEM_PIPE, PipeRecipeHandler::processRestrictivePipe); } private static void processRestrictivePipe(TagPrefix pipePrefix, Material material, ItemPipeProperties property, Consumer provider) { diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PolarizingRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PolarizingRecipeHandler.java index 64e3da0780..a12c96f2b3 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PolarizingRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/PolarizingRecipeHandler.java @@ -23,7 +23,7 @@ public class PolarizingRecipeHandler { public static void init(Consumer provider) { for (TagPrefix orePrefix : POLARIZING_PREFIXES) { - orePrefix.executeHandler(PropertyKey.INGOT, (tagPrefix, material, property) -> processPolarizing(tagPrefix, material, property, provider)); + orePrefix.executeHandler(provider, PropertyKey.INGOT, PolarizingRecipeHandler::processPolarizing); } } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/RecyclingRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/RecyclingRecipeHandler.java index a8e1e84f59..cd4605f631 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/RecyclingRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/RecyclingRecipeHandler.java @@ -41,7 +41,7 @@ public static void init(Consumer provider) { else if (object instanceof Predicate) return ((Predicate) object).test(orePrefix); else return false; - })) orePrefix.executeHandler(PropertyKey.DUST, (tagPrefix, material, property) -> processCrushing(tagPrefix, material, property, provider)); + })) orePrefix.executeHandler(provider, PropertyKey.DUST, RecyclingRecipeHandler::processCrushing); } } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/ToolRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/ToolRecipeHandler.java index 2cd69d0e00..25468bfd85 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/ToolRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/ToolRecipeHandler.java @@ -52,8 +52,8 @@ public class ToolRecipeHandler { public static void init(Consumer provider) { initializeGTItems(); - TagPrefix.plate.executeHandler(PropertyKey.TOOL, (tagPrefix, material, property) -> processTool(tagPrefix, material, property, provider)); - TagPrefix.plate.executeHandler(PropertyKey.TOOL, (tagPrefix, material, property) -> processElectricTool(tagPrefix, material, property, provider)); + TagPrefix.plate.executeHandler(provider, PropertyKey.TOOL, ToolRecipeHandler::processTool); + TagPrefix.plate.executeHandler(provider, PropertyKey.TOOL, ToolRecipeHandler::processElectricTool); registerPowerUnitRecipes(provider); registerCustomToolRecipes(provider); } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/WireCombiningHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/WireCombiningHandler.java index 0ed35fd453..9b228d934c 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/WireCombiningHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/WireCombiningHandler.java @@ -11,7 +11,6 @@ import com.gregtechceu.gtceu.common.data.GTMaterials; import com.gregtechceu.gtceu.data.recipe.VanillaRecipeHelper; import net.minecraft.data.recipes.FinishedRecipe; -import net.minecraft.resources.ResourceLocation; import org.apache.commons.lang3.ArrayUtils; import java.util.Map; @@ -37,16 +36,16 @@ public class WireCombiningHandler { public static void init(Consumer provider) { // Generate Wire Packer/Unpacker recipes - wireGtSingle.executeHandler(PropertyKey.WIRE, (tagPrefix, material, property) -> processWireCompression(tagPrefix, material, property, provider)); + wireGtSingle.executeHandler(provider, PropertyKey.WIRE, WireCombiningHandler::processWireCompression); // Generate manual recipes for combining Wires/Cables for (TagPrefix wirePrefix : WIRE_DOUBLING_ORDER) { - wirePrefix.executeHandler(PropertyKey.WIRE, (tagPrefix, material, property) -> generateWireCombiningRecipe(tagPrefix, material, property, provider)); + wirePrefix.executeHandler(provider, PropertyKey.WIRE, WireCombiningHandler::generateWireCombiningRecipe); } // Generate Cable -> Wire recipes in the unpacker for (TagPrefix cablePrefix : cableToWireMap.keySet()) { - cablePrefix.executeHandler(PropertyKey.WIRE, (tagPrefix, material, property) -> processCableStripping(tagPrefix, material, property, provider)); + cablePrefix.executeHandler(provider, PropertyKey.WIRE, WireCombiningHandler::processCableStripping); } } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/WireRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/WireRecipeHandler.java index 4c6fb80fe1..b8a148daf1 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/WireRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/WireRecipeHandler.java @@ -63,14 +63,14 @@ public static void init(Consumer provider) { // Wiremill: 1x Wire -> Fine // Extruder: Ingot -> 1x Wire // Wire Cutter: Plate -> 1x Wire - wireGtSingle.executeHandler(PropertyKey.WIRE, (tagPrefix, material, property) -> processWires(tagPrefix, material, property, provider)); + wireGtSingle.executeHandler(provider, PropertyKey.WIRE, WireRecipeHandler::processWires); // Generate Cable Covering Recipes - wireGtSingle.executeHandler(PropertyKey.WIRE, (tagPrefix, material, property) -> generateCableCovering(tagPrefix, material, property, provider)); - wireGtDouble.executeHandler(PropertyKey.WIRE, (tagPrefix, material, property) -> generateCableCovering(tagPrefix, material, property, provider)); - wireGtQuadruple.executeHandler(PropertyKey.WIRE, (tagPrefix, material, property) -> generateCableCovering(tagPrefix, material, property, provider)); - wireGtOctal.executeHandler(PropertyKey.WIRE, (tagPrefix, material, property) -> generateCableCovering(tagPrefix, material, property, provider)); - wireGtHex.executeHandler(PropertyKey.WIRE, (tagPrefix, material, property) -> generateCableCovering(tagPrefix, material, property, provider)); + wireGtSingle.executeHandler(provider, PropertyKey.WIRE, WireRecipeHandler::generateCableCovering); + wireGtDouble.executeHandler(provider, PropertyKey.WIRE, WireRecipeHandler::generateCableCovering); + wireGtQuadruple.executeHandler(provider, PropertyKey.WIRE, WireRecipeHandler::generateCableCovering); + wireGtOctal.executeHandler(provider, PropertyKey.WIRE, WireRecipeHandler::generateCableCovering); + wireGtHex.executeHandler(provider, PropertyKey.WIRE, WireRecipeHandler::generateCableCovering); } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/CraftingRecipeLoader.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/CraftingRecipeLoader.java index 8c20d8ac20..37a1cd8070 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/CraftingRecipeLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/CraftingRecipeLoader.java @@ -5,6 +5,7 @@ import com.gregtechceu.gtceu.api.data.chemical.material.stack.UnificationEntry; import com.gregtechceu.gtceu.api.recipe.FacadeCoverRecipe; import com.gregtechceu.gtceu.common.data.GTBlocks; +import com.gregtechceu.gtceu.common.data.GTItems; import com.gregtechceu.gtceu.data.recipe.CustomTags; import com.gregtechceu.gtceu.data.recipe.VanillaRecipeHelper; import net.minecraft.data.recipes.FinishedRecipe; @@ -89,8 +90,8 @@ public static void init(Consumer provider) { VanillaRecipeHelper.addShapedRecipe(provider, "blacklight", BLACKLIGHT.asStack(), "SPS", "GRG", "CPK", 'S', new UnificationEntry(screw, TungstenCarbide), 'P', new UnificationEntry(plate, TungstenCarbide), 'G', GTBlocks.CASING_LAMINATED_GLASS.asStack(), 'R', new UnificationEntry(spring, Europium), 'C', CustomTags.IV_CIRCUITS, 'K', new UnificationEntry(cableGtSingle, Platinum)); - VanillaRecipeHelper.addShapedRecipe(provider, true, GTCEu.id("filter_casing"), GTBlocks.FILTER_CASING.asStack(), "BBB", "III", "MFR", 'B', new ItemStack(Blocks.IRON_BARS), 'I', ITEM_FILTER.asStack(), 'M', ELECTRIC_MOTOR_MV.asStack(), 'F', new UnificationEntry(frameGt, Steel), 'R', new UnificationEntry(rotor, Steel)); - VanillaRecipeHelper.addShapedRecipe(provider, true, GTCEu.id("filter_casing_sterile"), GTBlocks.FILTER_CASING_STERILE.asStack(), "BEB", "ISI", "MFR", 'B', new UnificationEntry(pipeLargeFluid, Polybenzimidazole), 'E', EMITTER_ZPM.asStack(), 'I', ITEM_FILTER.asStack(), 'S', BLACKLIGHT.asStack(), 'M', ELECTRIC_MOTOR_ZPM.asStack(), 'F', new UnificationEntry(frameGt, Tritanium), 'R', new UnificationEntry(rotor, NaquadahAlloy)); + VanillaRecipeHelper.addShapedRecipe(provider, true, "filter_casing", GTBlocks.FILTER_CASING.asStack(), "BBB", "III", "MFR", 'B', new ItemStack(Blocks.IRON_BARS), 'I', ITEM_FILTER.asStack(), 'M', ELECTRIC_MOTOR_MV.asStack(), 'F', new UnificationEntry(frameGt, Steel), 'R', new UnificationEntry(rotor, Steel)); + VanillaRecipeHelper.addShapedRecipe(provider, true, "filter_casing_sterile", GTBlocks.FILTER_CASING_STERILE.asStack(), "BEB", "ISI", "MFR", 'B', new UnificationEntry(pipeLargeFluid, Polybenzimidazole), 'E', EMITTER_ZPM.asStack(), 'I', ITEM_FILTER.asStack(), 'S', BLACKLIGHT.asStack(), 'M', ELECTRIC_MOTOR_ZPM.asStack(), 'F', new UnificationEntry(frameGt, Tritanium), 'R', new UnificationEntry(rotor, NaquadahAlloy)); /////////////////////////////////////////////////// // Shapes and Molds // @@ -153,17 +154,22 @@ public static void init(Consumer provider) { /////////////////////////////////////////////////// // Armors // /////////////////////////////////////////////////// - // TODO armor - //VanillaRecipeHelper.addShapedRecipe(provider, "nightvision_goggles", MetaItems.NIGHTVISION_GOGGLES.asStack(), "CSC", "RBR", "LdL", 'C', new UnificationEntry(circuit, Tier.ULV), 'S', new UnificationEntry(screw, Steel), 'R', new UnificationEntry(ring, Rubber), 'B', MetaItems.BATTERY_LV_SODIUM, 'L', new UnificationEntry(lens, Glass)); - //VanillaRecipeHelper.addShapedRecipe(provider, "fluid_jetpack", MetaItems.SEMIFLUID_JETPACK.asStack(), "xCw", "SUS", "RIR", 'C', new UnificationEntry(circuit, Tier.LV), 'S', MetaItems.FLUID_CELL_LARGE_STEEL.asStack(), 'U', MetaItems.ELECTRIC_PUMP_LV.asStack(), 'R', new UnificationEntry(rotor, Lead), 'I', new UnificationEntry(pipeSmallFluid, Potin)); - //VanillaRecipeHelper.addShapedRecipe(provider, "electric_jetpack", MetaItems.ELECTRIC_JETPACK.asStack(), "xCd", "TBT", "I I", 'C', new UnificationEntry(circuit, Tier.MV), 'T', MetaItems.POWER_THRUSTER.asStack(), 'B', MetaItems.BATTERY_MV_LITHIUM.asStack(), 'I', new UnificationEntry(wireGtDouble, AnnealedCopper)); - //VanillaRecipeHelper.addShapedRecipe(provider, "electric_jetpack_advanced", MetaItems.ELECTRIC_JETPACK_ADVANCED.asStack(), "xJd", "TBT", "WCW", 'J', MetaItems.ELECTRIC_JETPACK.asStack(), 'T', MetaItems.POWER_THRUSTER_ADVANCED.asStack(), 'B', ENERGIUM_CRYSTAL.asStack(), 'W', new UnificationEntry(wireGtQuadruple, Gold), 'C', new UnificationEntry(circuit, Tier.HV)); - //VanillaRecipeHelper.addShapedRecipe(provider, "nano_helmet", MetaItems.NANO_HELMET.asStack(), "PPP", "PNP", "xEd", 'P', MetaItems.CARBON_FIBER_PLATE.asStack(), 'N', MetaItems.NIGHTVISION_GOGGLES.asStack(), 'E', MetaItems.ENERGIUM_CRYSTAL.asStack()); - //VanillaRecipeHelper.addShapedRecipe(provider, "nano_chestplate", MetaItems.NANO_CHESTPLATE.asStack(), "PEP", "PPP", "PPP", 'P', MetaItems.CARBON_FIBER_PLATE.asStack(), 'E', MetaItems.ENERGIUM_CRYSTAL.asStack()); - //VanillaRecipeHelper.addShapedRecipe(provider, "nano_leggings", MetaItems.NANO_LEGGINGS.asStack(), "PPP", "PEP", "PxP", 'P', MetaItems.CARBON_FIBER_PLATE.asStack(), 'E', MetaItems.ENERGIUM_CRYSTAL.asStack()); - //VanillaRecipeHelper.addShapedRecipe(provider, "nano_boots", MetaItems.NANO_BOOTS.asStack(), "PxP", "PEP", 'P', MetaItems.CARBON_FIBER_PLATE.asStack(), 'E', MetaItems.ENERGIUM_CRYSTAL.asStack()); - //VanillaRecipeHelper.addShapedRecipe(provider, "nano_chestplate_advanced", MetaItems.NANO_CHESTPLATE_ADVANCED.asStack(), "xJd", "PNP", "WCW", 'J', MetaItems.ELECTRIC_JETPACK_ADVANCED.asStack(), 'P', MetaItems.LOW_POWER_INTEGRATED_CIRCUIT.asStack(), 'N', MetaItems.NANO_CHESTPLATE.asStack(), 'W', new UnificationEntry(wireGtQuadruple, Platinum), 'C', new UnificationEntry(circuit, Tier.IV)); - //VanillaRecipeHelper.addShapedRecipe(provider, "gravitation_engine", MetaItems.GRAVITATION_ENGINE.asStack(), "ESE", "POP", "ESE", 'E', MetaItems.EMITTER_LuV.asStack(), 'S', new UnificationEntry(wireGtQuadruple, Osmium), 'P', new UnificationEntry(plateDouble, Iridium), 'O', MetaItems.ENERGY_LAPOTRONIC_ORB.asStack()); + VanillaRecipeHelper.addShapedRecipe(provider, "nightvision_goggles", GTItems.NIGHTVISION_GOGGLES.asStack(), "CSC", "RBR", "LdL", 'C', CustomTags.ULV_CIRCUITS, 'S', new UnificationEntry(screw, Steel), 'R', new UnificationEntry(ring, Rubber), 'B', GTItems.BATTERY_LV_SODIUM, 'L', new UnificationEntry(lens, Glass)); + VanillaRecipeHelper.addShapedRecipe(provider, "fluid_jetpack", GTItems.LIQUID_FUEL_JETPACK.asStack(), "xCw", "SUS", "RIR", 'C', CustomTags.LV_CIRCUITS, 'S', GTItems.FLUID_CELL_LARGE_STEEL.asStack(), 'U', GTItems.ELECTRIC_PUMP_LV.asStack(), 'R', new UnificationEntry(rotor, Lead), 'I', new UnificationEntry(pipeSmallFluid, Potin)); + VanillaRecipeHelper.addShapedRecipe(provider, "electric_jetpack", GTItems.ELECTRIC_JETPACK.asStack(), "xCd", "TBT", "I I", 'C', CustomTags.MV_CIRCUITS, 'T', GTItems.POWER_THRUSTER.asStack(), 'B', GTItems.BATTERY_MV_LITHIUM.asStack(), 'I', new UnificationEntry(wireGtDouble, AnnealedCopper)); + VanillaRecipeHelper.addShapedRecipe(provider, "electric_jetpack_advanced", GTItems.ELECTRIC_JETPACK_ADVANCED.asStack(), "xJd", "TBT", "WCW", 'J', GTItems.ELECTRIC_JETPACK.asStack(), 'T', GTItems.POWER_THRUSTER_ADVANCED.asStack(), 'B', ENERGIUM_CRYSTAL.asStack(), 'W', new UnificationEntry(wireGtQuadruple, Gold), 'C', CustomTags.HV_CIRCUITS); + VanillaRecipeHelper.addShapedRecipe(provider, "nano_helmet", GTItems.NANO_HELMET.asStack(), "PPP", "PNP", "xEd", 'P', GTItems.CARBON_FIBER_PLATE.asStack(), 'N', GTItems.NIGHTVISION_GOGGLES.asStack(), 'E', GTItems.ENERGIUM_CRYSTAL.asStack()); + VanillaRecipeHelper.addShapedRecipe(provider, "nano_chestplate", GTItems.NANO_CHESTPLATE.asStack(), "PEP", "PPP", "PPP", 'P', GTItems.CARBON_FIBER_PLATE.asStack(), 'E', GTItems.ENERGIUM_CRYSTAL.asStack()); + VanillaRecipeHelper.addShapedRecipe(provider, "nano_leggings", GTItems.NANO_LEGGINGS.asStack(), "PPP", "PEP", "PxP", 'P', GTItems.CARBON_FIBER_PLATE.asStack(), 'E', GTItems.ENERGIUM_CRYSTAL.asStack()); + VanillaRecipeHelper.addShapedRecipe(provider, "nano_boots", GTItems.NANO_BOOTS.asStack(), "PxP", "PEP", 'P', GTItems.CARBON_FIBER_PLATE.asStack(), 'E', GTItems.ENERGIUM_CRYSTAL.asStack()); + VanillaRecipeHelper.addShapedRecipe(provider, "nano_chestplate_advanced", GTItems.NANO_CHESTPLATE_ADVANCED.asStack(), "xJd", "PNP", "WCW", 'J', GTItems.ELECTRIC_JETPACK_ADVANCED.asStack(), 'P', GTItems.LOW_POWER_INTEGRATED_CIRCUIT.asStack(), 'N', GTItems.NANO_CHESTPLATE.asStack(), 'W', new UnificationEntry(wireGtQuadruple, Platinum), 'C', CustomTags.IV_CIRCUITS); + VanillaRecipeHelper.addShapedRecipe(provider, "gravitation_engine", GTItems.GRAVITATION_ENGINE.asStack(), "ESE", "POP", "ESE", 'E', GTItems.EMITTER_LuV.asStack(), 'S', new UnificationEntry(wireGtQuadruple, Osmium), 'P', new UnificationEntry(plateDouble, Iridium), 'O', GTItems.ENERGY_LAPOTRONIC_ORB.asStack()); + + + VanillaRecipeHelper.addShapedRecipe(provider, "powderbarrel", new ItemStack(GTBlocks.POWDERBARREL.get()), "PSP", "GGG", "PGP", + 'P', new UnificationEntry(plate, Wood), + 'S', new ItemStack(Items.STRING), + 'G', new UnificationEntry(dust, Gunpowder)); /////////////////////////////////////////////////// // Special // diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/GCyMRecipes.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/GCyMRecipes.java index fcd2898e54..ad5fb582f9 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/GCyMRecipes.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/GCyMRecipes.java @@ -15,7 +15,6 @@ import net.minecraft.data.recipes.FinishedRecipe; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.function.Consumer; @@ -299,7 +298,7 @@ private static void registerBinaryAlloy(@NotNull Material input1, int input1Amou .inputItems(TagPrefix.dust, input1, input1Amount) .inputItems(TagPrefix.dust, input2, input2Amount) .circuitMeta(input1Amount + input2Amount) - .outputFluids(output.getFluid(GTValues.L * outputAmount)) + .outputFluids(output.getFluid((long) GTValues.L * outputAmount)) .duration(duration * 3 / 4) .EUt(16) .blastFurnaceTemp(FluidHelper.getTemperature(output.getFluid(1))) @@ -318,7 +317,7 @@ private static void registerTrinaryAlloy(@NotNull Material input1, int input1Amo .inputItems(TagPrefix.dust, input2, input2Amount) .inputItems(TagPrefix.dust, input3, input3Amount) .circuitMeta(input1Amount + input2Amount + input3Amount) - .outputFluids(output.getFluid(GTValues.L * outputAmount)) + .outputFluids(output.getFluid((long) GTValues.L * outputAmount)) .duration(duration * 3 / 4) .EUt(16) .blastFurnaceTemp(FluidHelper.getTemperature(output.getFluid(1))) @@ -328,7 +327,7 @@ private static void registerTrinaryAlloy(@NotNull Material input1, int input1Amo private static void registerBlastAlloyRecipes(Consumer provider) { registerFormulaic(provider); registerManual(provider); - ingot.executeHandler(PropertyKey.ALLOY_BLAST, (tagPrefix, material, property) -> generateAlloyBlastRecipes(tagPrefix, material, property, provider)); + ingot.executeHandler(provider, PropertyKey.ALLOY_BLAST, GCyMRecipes::generateAlloyBlastRecipes); } /** diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MachineRecipeLoader.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MachineRecipeLoader.java index d46f221245..71cf6e8a07 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MachineRecipeLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MachineRecipeLoader.java @@ -1,13 +1,15 @@ package com.gregtechceu.gtceu.data.recipe.misc; -import com.gregtechceu.gtceu.GTCEu; import com.gregtechceu.gtceu.api.GTValues; import com.gregtechceu.gtceu.api.data.chemical.ChemicalHelper; +import com.gregtechceu.gtceu.api.data.chemical.material.MarkerMaterial; +import com.gregtechceu.gtceu.api.data.chemical.material.MarkerMaterials; import com.gregtechceu.gtceu.api.data.chemical.material.Material; import com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey; import com.gregtechceu.gtceu.api.data.chemical.material.stack.MaterialStack; import com.gregtechceu.gtceu.api.machine.MachineDefinition; import com.gregtechceu.gtceu.api.machine.multiblock.CleanroomType; +import com.gregtechceu.gtceu.common.block.StoneBlockType; import com.gregtechceu.gtceu.common.data.GTBlocks; import com.gregtechceu.gtceu.common.data.GTMachines; import com.gregtechceu.gtceu.config.ConfigHolder; @@ -15,13 +17,17 @@ import com.gregtechceu.gtceu.data.recipe.VanillaRecipeHelper; import com.lowdragmc.lowdraglib.side.fluid.FluidStack; import com.tterrag.registrate.util.entry.ItemEntry; +import com.tterrag.registrate.util.entry.ItemProviderEntry; +import net.minecraft.core.Registry; import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; +import java.util.List; import java.util.function.Consumer; import static com.gregtechceu.gtceu.api.GTValues.*; @@ -217,48 +223,45 @@ private static void registerCokeOvenRecipes(Consumer provider) { } private static void registerStoneBricksRecipes(Consumer provider) { - // TODO Stone type decorative blocks - /* // normal variant -> cobble variant - List cobbles = Arrays.stream(BlockStoneCobble.BlockType.values()).map(MetaBlocks.STONE_COBBLE::getItemVariant).collect(Collectors.toList()); - List mossCobbles = Arrays.stream(BlockStoneCobbleMossy.BlockType.values()).map(MetaBlocks.STONE_COBBLE_MOSSY::getItemVariant).collect(Collectors.toList()); - List smooths = Arrays.stream(BlockStoneSmooth.BlockType.values()).map(MetaBlocks.STONE_SMOOTH::getItemVariant).collect(Collectors.toList()); - List polisheds = Arrays.stream(BlockStonePolished.BlockType.values()).map(MetaBlocks.STONE_POLISHED::getItemVariant).collect(Collectors.toList()); - List bricks = Arrays.stream(BlockStoneBricks.BlockType.values()).map(MetaBlocks.STONE_BRICKS::getItemVariant).collect(Collectors.toList()); - List crackedBricks = Arrays.stream(BlockStoneBricksCracked.BlockType.values()).map(MetaBlocks.STONE_BRICKS_CRACKED::getItemVariant).collect(Collectors.toList()); - List mossBricks = Arrays.stream(BlockStoneBricksMossy.BlockType.values()).map(MetaBlocks.STONE_BRICKS_MOSSY::getItemVariant).collect(Collectors.toList()); - List chiseledBricks = Arrays.stream(BlockStoneChiseled.BlockType.values()).map(MetaBlocks.STONE_CHISELED::getItemVariant).collect(Collectors.toList()); - List tiledBricks = Arrays.stream(BlockStoneTiled.BlockType.values()).map(MetaBlocks.STONE_TILED::getItemVariant).collect(Collectors.toList()); - List smallTiledBricks = Arrays.stream(BlockStoneTiledSmall.BlockType.values()).map(MetaBlocks.STONE_TILED_SMALL::getItemVariant).collect(Collectors.toList()); - List windmillA = Arrays.stream(BlockStoneWindmillA.BlockType.values()).map(MetaBlocks.STONE_WINDMILL_A::getItemVariant).collect(Collectors.toList()); - List windmillB = Arrays.stream(BlockStoneWindmillB.BlockType.values()).map(MetaBlocks.STONE_WINDMILL_B::getItemVariant).collect(Collectors.toList()); - List squareBricks = Arrays.stream(BlockStoneBricksSquare.BlockType.values()).map(MetaBlocks.STONE_BRICKS_SQUARE::getItemVariant).collect(Collectors.toList()); - List smallBricks = Arrays.stream(BlockStoneBricksSmall.BlockType.values()).map(MetaBlocks.STONE_BRICKS_SMALL::getItemVariant).collect(Collectors.toList()); - - - registerSmoothRecipe(cobbles, smooths); - registerCobbleRecipe(smooths, cobbles); - registerMossRecipe(cobbles, mossCobbles); - registerSmoothRecipe(smooths, polisheds); - registerBricksRecipe(polisheds, bricks, MarkerColor.LightBlue); - registerCobbleRecipe(bricks, crackedBricks); - registerMossRecipe(bricks, mossBricks); - registerBricksRecipe(polisheds, chiseledBricks, MarkerColor.White); - registerBricksRecipe(polisheds, tiledBricks, MarkerColor.Red); - registerBricksRecipe(tiledBricks, smallTiledBricks, MarkerColor.Red); - registerBricksRecipe(polisheds, windmillA, MarkerColor.Blue); - registerBricksRecipe(polisheds, windmillB, MarkerColor.Yellow); - registerBricksRecipe(polisheds, squareBricks, MarkerColor.Green); - registerBricksRecipe(polisheds, smallBricks, MarkerColor.Pink); - - for (int i = 0; i < smooths.size(); i++) { - EXTRUDER_RECIPES.recipeBuilder() - .inputItems(smooths.get(i)) + List cobbles = GTBlocks.STONE_BLOCKS.row(StoneBlockType.COBBLE).values().stream().map(ItemProviderEntry::asStack).toList(); + List mossCobbles = GTBlocks.STONE_BLOCKS.row(StoneBlockType.COBBLE_MOSSY).values().stream().map(ItemProviderEntry::asStack).toList(); + List stones = GTBlocks.STONE_BLOCKS.row(StoneBlockType.STONE).values().stream().map(ItemProviderEntry::asStack).toList(); + List polisheds = GTBlocks.STONE_BLOCKS.row(StoneBlockType.POLISHED).values().stream().map(ItemProviderEntry::asStack).toList(); + List bricks = GTBlocks.STONE_BLOCKS.row(StoneBlockType.BRICKS).values().stream().map(ItemProviderEntry::asStack).toList(); + List crackedBricks = GTBlocks.STONE_BLOCKS.row(StoneBlockType.BRICKS_CRACKED).values().stream().map(ItemProviderEntry::asStack).toList(); + List mossBricks = GTBlocks.STONE_BLOCKS.row(StoneBlockType.BRICKS_MOSSY).values().stream().map(ItemProviderEntry::asStack).toList(); + List chiseledBricks = GTBlocks.STONE_BLOCKS.row(StoneBlockType.CHISELED).values().stream().map(ItemProviderEntry::asStack).toList(); + List tiledBricks = GTBlocks.STONE_BLOCKS.row(StoneBlockType.TILED).values().stream().map(ItemProviderEntry::asStack).toList(); + List smallTiledBricks = GTBlocks.STONE_BLOCKS.row(StoneBlockType.TILED_SMALL).values().stream().map(ItemProviderEntry::asStack).toList(); + List windmillA = GTBlocks.STONE_BLOCKS.row(StoneBlockType.WINDMILL_A).values().stream().map(ItemProviderEntry::asStack).toList(); + List windmillB = GTBlocks.STONE_BLOCKS.row(StoneBlockType.WINDMILL_B).values().stream().map(ItemProviderEntry::asStack).toList(); + List squareBricks = GTBlocks.STONE_BLOCKS.row(StoneBlockType.BRICKS_SQUARE).values().stream().map(ItemProviderEntry::asStack).toList(); + List smallBricks = GTBlocks.STONE_BLOCKS.row(StoneBlockType.BRICKS_SMALL).values().stream().map(ItemProviderEntry::asStack).toList(); + + registerSmoothRecipe(provider, cobbles, stones); + registerCobbleRecipe(provider, stones, cobbles); + registerMossRecipe(provider, cobbles, mossCobbles); + registerSmoothRecipe(provider, stones, polisheds); + registerBricksRecipe(provider, polisheds, bricks, MarkerMaterials.Color.LightBlue); + registerCobbleRecipe(provider, bricks, crackedBricks); + registerMossRecipe(provider, bricks, mossBricks); + registerBricksRecipe(provider, polisheds, chiseledBricks, MarkerMaterials.Color.White); + registerBricksRecipe(provider, polisheds, tiledBricks, MarkerMaterials.Color.Red); + registerBricksRecipe(provider, tiledBricks, smallTiledBricks, MarkerMaterials.Color.Red); + registerBricksRecipe(provider, polisheds, windmillA, MarkerMaterials.Color.Blue); + registerBricksRecipe(provider, polisheds, windmillB, MarkerMaterials.Color.Yellow); + registerBricksRecipe(provider, polisheds, squareBricks, MarkerMaterials.Color.Green); + registerBricksRecipe(provider, polisheds, smallBricks, MarkerMaterials.Color.Pink); + + for (int i = 0; i < stones.size(); i++) { + ResourceLocation bricksId = Registry.ITEM.getKey(bricks.get(i).getItem()); + EXTRUDER_RECIPES.recipeBuilder("extrude_" + bricksId.getPath()) + .inputItems(stones.get(i)) .notConsumable(SHAPE_EXTRUDER_INGOT) .outputItems(bricks.get(i)) .duration(24).EUt(8).save(provider); } - */ } private static void registerMixingCrystallizationRecipes(Consumer provider) { @@ -665,7 +668,6 @@ private static void registerBlastFurnaceRecipes(Consumer provide .blastFurnaceTemp(1700) .duration(1600).EUt(VA[HV]).save(provider); - //TODO Tempered Glass BLAST_RECIPES.recipeBuilder("tempered_glass_blasting") .inputItems(block, Glass) .inputFluids(Oxygen.getFluid(100)) @@ -931,52 +933,52 @@ private static void registerFluidRecipes(Consumer provider) { FLUID_HEATER_RECIPES.recipeBuilder("heat_distilled_to_steam").duration(30).EUt(VA[LV]).inputFluids(DistilledWater.getFluid(6)).circuitMeta(1).outputFluids(Steam.getFluid(960)).save(provider); } - // TODO stone types - /* - private static void registerSmoothRecipe(Consumer provider, List roughStack, List smoothStack) { + private static void registerSmoothRecipe(Consumer provider, List roughStack, List stoneStack) { for (int i = 0; i < roughStack.size(); i++) { - ModHandler.addSmeltingRecipe(roughStack.get(i), smoothStack.get(i), 0.1f); - - EXTRUDER_RECIPES.recipeBuilder() - .inputItems(roughStack.get(i)) - .notConsumable(SHAPE_EXTRUDER_BLOCK) - .outputItems(smoothStack.get(i)) - .duration(24).EUt(8).save(provider); + ResourceLocation stoneId = Registry.ITEM.getKey(stoneStack.get(i).getItem()); + VanillaRecipeHelper.addSmeltingRecipe(provider, "smelt_" + stoneId.getPath(), roughStack.get(i), stoneStack.get(i), 0.1f); + + EXTRUDER_RECIPES.recipeBuilder("extrude_" + stoneId.getPath()) + .inputItems(roughStack.get(i)) + .notConsumable(SHAPE_EXTRUDER_BLOCK.asStack()) + .outputItems(stoneStack.get(i)) + .duration(24).EUt(8).save(provider); } } - private static void registerCobbleRecipe(Consumer provider, List smoothStack, List cobbleStack) { - for (int i = 0; i < smoothStack.size(); i++) { - FORGE_HAMMER_RECIPES.recipeBuilder() - .inputItems(smoothStack.get(i)) - .outputItems(cobbleStack.get(i)) - .duration(12).EUt(4).save(provider); + private static void registerCobbleRecipe(Consumer provider, List stoneStack, List cobbleStack) { + for (int i = 0; i < stoneStack.size(); i++) { + ResourceLocation cobbleId = Registry.ITEM.getKey(cobbleStack.get(i).getItem()); + FORGE_HAMMER_RECIPES.recipeBuilder("hammer_" + cobbleId.getPath()) + .inputItems(stoneStack.get(i)) + .outputItems(cobbleStack.get(i)) + .duration(12).EUt(4).save(provider); } } private static void registerBricksRecipe(Consumer provider, List polishedStack, List brickStack, MarkerMaterial color) { for (int i = 0; i < polishedStack.size(); i++) { - LASER_ENGRAVER_RECIPES.recipeBuilder() - .inputItems(polishedStack.get(i)) - .notConsumable(craftingLens, color) - .outputItems(brickStack.get(i)) - .duration(50).EUt(16).save(provider); + ResourceLocation brickId = Registry.ITEM.getKey(brickStack.get(i).getItem()); + LASER_ENGRAVER_RECIPES.recipeBuilder("engrave_" + brickId.getPath()) + .inputItems(polishedStack.get(i)) + .notConsumable(lens, color) + .outputItems(brickStack.get(i)) + .duration(50).EUt(16).save(provider); } } private static void registerMossRecipe(Consumer provider, List regularStack, List mossStack) { for (int i = 0; i < regularStack.size(); i++) { - CHEMICAL_BATH_RECIPES.recipeBuilder() - .inputItems(regularStack.get(i)) - .inputFluids(Water.getFluid(100)) - .outputItems(mossStack.get(i)) - .duration(50).EUt(16).save(provider); + ResourceLocation mossId = Registry.ITEM.getKey(mossStack.get(i).getItem()); + CHEMICAL_BATH_RECIPES.recipeBuilder("bath_" + mossId.getPath()) + .inputItems(regularStack.get(i)) + .inputFluids(Water.getFluid(100)) + .outputItems(mossStack.get(i)) + .duration(50).EUt(16).save(provider); } } - */ private static void registerNBTRemoval(Consumer provider) { - for (MachineDefinition chest : GTMachines.QUANTUM_CHEST) { if (chest != null) { VanillaRecipeHelper.addShapelessNBTClearingRecipe(provider, "quantum_chest_nbt_" + chest.getTier(), chest.asStack(), chest.asStack()); @@ -1010,16 +1012,12 @@ private static void registerNBTRemoval(Consumer provider) { VanillaRecipeHelper.addShapelessNBTClearingRecipe(provider, "cell_vial_nbt", FLUID_CELL_GLASS_VIAL.asStack(), FLUID_CELL_GLASS_VIAL.asStack()); // Data Items - VanillaRecipeHelper.addShapelessNBTClearingRecipe(provider, "data_stick_nbt", TOOL_DATA_STICK.asStack(), - TOOL_DATA_STICK.asStack()); - VanillaRecipeHelper.addShapelessNBTClearingRecipe(provider, "data_orb_nbt", TOOL_DATA_ORB.asStack(), - TOOL_DATA_ORB.asStack()); - VanillaRecipeHelper.addShapelessNBTClearingRecipe(provider, "data_module_nbt", TOOL_DATA_MODULE.asStack(), - TOOL_DATA_MODULE.asStack()); + VanillaRecipeHelper.addShapelessNBTClearingRecipe(provider, "data_stick_nbt", TOOL_DATA_STICK.asStack(), TOOL_DATA_STICK.asStack()); + VanillaRecipeHelper.addShapelessNBTClearingRecipe(provider, "data_orb_nbt", TOOL_DATA_ORB.asStack(), TOOL_DATA_ORB.asStack()); + VanillaRecipeHelper.addShapelessNBTClearingRecipe(provider, "data_module_nbt", TOOL_DATA_MODULE.asStack(), TOOL_DATA_MODULE.asStack()); //Jetpacks - // TODO armor - //ModHandler.addShapelessRecipe("fluid_jetpack_clear", SEMIFLUID_JETPACK, SEMIFLUID_JETPACK); + VanillaRecipeHelper.addShapelessRecipe(provider, "fluid_jetpack_clear", LIQUID_FUEL_JETPACK.asStack(), LIQUID_FUEL_JETPACK.asStack()); } private static void registerHatchConversion(Consumer provider) { diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MiscRecipeLoader.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MiscRecipeLoader.java index 866ed9d8c8..ca37c234bb 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MiscRecipeLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MiscRecipeLoader.java @@ -4,18 +4,15 @@ import com.gregtechceu.gtceu.api.data.chemical.material.MarkerMaterials.Color; import com.gregtechceu.gtceu.api.data.chemical.material.stack.UnificationEntry; import com.gregtechceu.gtceu.common.data.GTBlocks; -import com.gregtechceu.gtceu.common.recipe.RockBreakerCondition; import com.gregtechceu.gtceu.data.recipe.CustomTags; import com.gregtechceu.gtceu.data.recipe.VanillaRecipeHelper; import com.gregtechceu.gtceu.data.recipe.builder.GTRecipeBuilder; import com.tterrag.registrate.util.entry.ItemEntry; import net.minecraft.data.recipes.FinishedRecipe; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.material.Fluids; import java.util.function.Consumer; @@ -101,7 +98,7 @@ public static void init(Consumer provider) { .notConsumable(Blocks.ANDESITE.asItem()) .outputItems(Blocks.ANDESITE.asItem()) .duration(16) - .EUt(60) + .EUt(VHA[MV]) .addData("fluidA", "minecraft:lava") .addData("fluidB", "minecraft:water") .save(provider); @@ -110,7 +107,7 @@ public static void init(Consumer provider) { .notConsumable(Blocks.GRANITE.asItem()) .outputItems(Blocks.GRANITE.asItem()) .duration(16) - .EUt(60) + .EUt(VHA[MV]) .addData("fluidA", "minecraft:lava") .addData("fluidB", "minecraft:water") .save(provider); @@ -119,7 +116,7 @@ public static void init(Consumer provider) { .notConsumable(Blocks.DIORITE.asItem()) .outputItems(Blocks.DIORITE.asItem()) .duration(16) - .EUt(60) + .EUt(VHA[MV]) .addData("fluidA", "minecraft:lava") .addData("fluidB", "minecraft:water") .save(provider); @@ -128,7 +125,7 @@ public static void init(Consumer provider) { .notConsumable(dust, Redstone) .outputItems(Blocks.OBSIDIAN.asItem()) .duration(16) - .EUt(240) + .EUt(VHA[HV]) .addData("fluidA", "minecraft:lava") .addData("fluidB", "minecraft:water") .save(provider); @@ -137,7 +134,7 @@ public static void init(Consumer provider) { .notConsumable(Blocks.BASALT.asItem()) .outputItems(Blocks.BASALT.asItem()) .duration(16) - .EUt(VA[HV]) + .EUt(VHA[HV]) .addData("fluidA", "minecraft:lava") .addData("fluidB", "minecraft:water") .save(provider); @@ -146,7 +143,7 @@ public static void init(Consumer provider) { .notConsumable(Blocks.BLACKSTONE.asItem()) .outputItems(Blocks.BLACKSTONE.asItem()) .duration(16) - .EUt(VA[HV]) + .EUt(VHA[HV]) .addData("fluidA", "minecraft:lava") .addData("fluidB", "minecraft:water") .save(provider); @@ -156,40 +153,38 @@ public static void init(Consumer provider) { .notConsumable(Blocks.DEEPSLATE.asItem()) .outputItems(Blocks.DEEPSLATE.asItem()) .duration(16) - .EUt(VA[EV]) + .EUt(VHA[EV]) .addData("fluidA", "minecraft:lava") .addData("fluidB", "minecraft:water") .save(provider); - // TODO stone types -/* + ROCK_BREAKER_RECIPES.recipeBuilder("marble") - .notConsumable(stone, Marble) - .outputItems(stone, Marble) + .notConsumable(rock, Marble) + .outputItems(rock, Marble) .duration(16) - .EUt(240) + .EUt(VHA[HV]) + .addData("fluidA", "minecraft:lava") + .addData("fluidB", "minecraft:water") .save(provider); ROCK_BREAKER_RECIPES.recipeBuilder("basalt") - .notConsumable(stone, Basalt) - .outputItems(stone, Basalt) + .notConsumable(rock, Basalt) + .outputItems(rock, Basalt) .duration(16) - .EUt(240) + .EUt(VHA[HV]) + .addData("fluidA", "minecraft:lava") + .addData("fluidB", "minecraft:water") .save(provider); ROCK_BREAKER_RECIPES.recipeBuilder("red_granite") - .notConsumable(stone, GraniteRed) - .outputItems(stone, GraniteRed) + .notConsumable(rock, GraniteRed) + .outputItems(rock, GraniteRed) .duration(16) - .EUt(960) + .EUt(VHA[EV]) + .addData("fluidA", "minecraft:lava") + .addData("fluidB", "minecraft:water") .save(provider); - ROCK_BREAKER_RECIPES.recipeBuilder("black_granite") - .notConsumable(stone, GraniteBlack) - .outputItems(stone, GraniteBlack) - .duration(16) - .EUt(960) - .save(provider); -*/ // Jetpacks ASSEMBLER_RECIPES.recipeBuilder("power_thruster").duration(200).EUt(30) .inputItems(ELECTRIC_MOTOR_MV) @@ -210,10 +205,8 @@ public static void init(Consumer provider) { .save(provider); // QuarkTech Suite - // TODO armor - /* ASSEMBLER_RECIPES.recipeBuilder("quantum_helmet").duration(1500).EUt(VA[IV]) - .inputItems(circuit, Tier.LuV, 2) + .inputItems(CustomTags.LuV_CIRCUITS, 2) .inputItems(wireGtQuadruple, Tungsten, 5) .inputItems(ENERGY_LAPOTRONIC_ORB) .inputItems(SENSOR_IV) @@ -227,10 +220,10 @@ public static void init(Consumer provider) { .save(provider); ASSEMBLER_RECIPES.recipeBuilder("quantum_chestplate").duration(1500).EUt(VA[IV]) - .inputItems(circuit, Tier.LuV, 2) + .inputItems(CustomTags.LuV_CIRCUITS, 2) .inputItems(wireGtQuadruple, Tungsten, 8) .inputItems(ENERGY_LAPOTRONIC_ORB) - .inputItems(EMITTER_IV.getStackForm(2)) + .inputItems(EMITTER_IV.asStack(2)) .inputItems(FIELD_GENERATOR_IV) .inputItems(screw, TungstenSteel, 4) .inputItems(plate, Iridium, 8) @@ -241,7 +234,7 @@ public static void init(Consumer provider) { .save(provider); ASSEMBLER_RECIPES.recipeBuilder("quantum_leggings").duration(1500).EUt(VA[IV]) - .inputItems(circuit, Tier.LuV, 2) + .inputItems(CustomTags.LuV_CIRCUITS, 2) .inputItems(wireGtQuadruple, Tungsten, 7) .inputItems(ENERGY_LAPOTRONIC_ORB) .inputItems(ELECTRIC_MOTOR_IV, 4) @@ -255,7 +248,7 @@ public static void init(Consumer provider) { .save(provider); ASSEMBLER_RECIPES.recipeBuilder("quantum_boots").duration(1500).EUt(VA[IV]) - .inputItems(circuit, Tier.LuV, 2) + .inputItems(CustomTags.LuV_CIRCUITS, 2) .inputItems(wireGtQuadruple, Tungsten, 4) .inputItems(ENERGY_LAPOTRONIC_ORB) .inputItems(ELECTRIC_PISTON_IV, 2) @@ -269,13 +262,13 @@ public static void init(Consumer provider) { .save(provider); ASSEMBLY_LINE_RECIPES.recipeBuilder("quantum_chestplate_advanced").duration(1000).EUt(VA[LuV]) - .inputNBT(((ArmorMetaItem) QUANTUM_CHESTPLATE.getItem()).getItem(QUANTUM_CHESTPLATE), NBTMatcher.ANY, NBTCondition.ANY) + .inputItems(QUANTUM_CHESTPLATE.get().asItem()) .inputItems(HIGH_POWER_INTEGRATED_CIRCUIT, 2) .inputItems(wireFine, NiobiumTitanium, 64) .inputItems(wireGtQuadruple, Osmium, 6) .inputItems(plateDouble, Iridium, 4) .inputItems(GRAVITATION_ENGINE, 2) - .inputItems(circuit, Tier.ZPM) + .inputItems(CustomTags.ZPM_CIRCUITS) .inputItems(plateDense, RhodiumPlatedPalladium, 2) .inputItems(ENERGY_LAPOTRONIC_ORB_CLUSTER) .inputItems(FIELD_GENERATOR_LuV, 2) @@ -283,7 +276,6 @@ public static void init(Consumer provider) { .inputItems(screw, HSSS, 8) .outputItems(QUANTUM_CHESTPLATE_ADVANCED) .save(provider); - */ // TODO Central monitor /* diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java index af818d101c..6787b6c839 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java @@ -1042,8 +1042,9 @@ private static void mixingRecipes(Consumer provider) { MIXER_RECIPES.recipeBuilder("mud") .inputItems(new ItemStack(Blocks.DIRT)) + .circuitMeta(1) .inputFluids(Water.getFluid(L)) - .outputItems(new ItemStack(Blocks.COARSE_DIRT, 2)) + .outputItems(new ItemStack(Blocks.MUD, 1)) .duration(100).EUt(4).save(provider); } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java index 96115f313a..5cb058ef5b 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java @@ -543,6 +543,11 @@ private static void registerGTWoodRecipes(Consumer provider) { "s", "L", "L", 'L', GTBlocks.TREATED_WOOD_PLANK.get().asItem()); } + + VanillaRecipeHelper.addShapelessRecipe(provider, "rubber_button", GTBlocks.RUBBER_BUTTON.asStack(), GTBlocks.RUBBER_PLANK.asStack()); + VanillaRecipeHelper.addShapelessRecipe(provider, "treated_wood_button", GTBlocks.TREATED_WOOD_BUTTON.asStack(), GTBlocks.TREATED_WOOD_PLANK.asStack()); + VanillaRecipeHelper.addShapedRecipe(provider, "rubber_pressure_plate", GTBlocks.RUBBER_PRESSURE_PLATE.asStack(), "aa", 'a', GTBlocks.RUBBER_PLANK.asStack()); + VanillaRecipeHelper.addShapedRecipe(provider, "treated_wood_plate", GTBlocks.TREATED_WOOD_PRESSURE_PLATE.asStack(), "aa", 'a', GTBlocks.TREATED_WOOD_PLANK.asStack()); } public static void hardWoodRecipes(Consumer registry) { diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ReactorRecipes.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ReactorRecipes.java index 1beece6c48..4597ddac37 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ReactorRecipes.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ReactorRecipes.java @@ -1,8 +1,11 @@ package com.gregtechceu.gtceu.data.recipe.serialized.chemistry; import com.gregtechceu.gtceu.api.data.chemical.material.MarkerMaterials; +import com.gregtechceu.gtceu.common.data.GTBlocks; +import com.gregtechceu.gtceu.common.data.GTItems; import com.gregtechceu.gtceu.common.data.GTMaterials; import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; @@ -599,6 +602,13 @@ public static void init(Consumer provider) { .outputItems(Blocks.TNT.asItem()) .duration(200).EUt(24).save(provider); + CHEMICAL_RECIPES.recipeBuilder("itnt_from_toluene") + .inputItems(GELLED_TOLUENE, 4) + .inputFluids(NitrationMixture.getFluid(200)) + .outputItems(new ItemStack(GTBlocks.INDUSTRIAL_TNT.get())) + .outputFluids(DilutedSulfuricAcid.getFluid(150)) + .duration(80).EUt(VA[HV]).save(provider); + CHEMICAL_RECIPES.recipeBuilder("phenol_from_dichlorobenzene") .inputItems(dust, SodiumHydroxide, 6) .inputFluids(Dichlorobenzene.getFluid(1000)) @@ -623,13 +633,12 @@ public static void init(Consumer provider) { .outputFluids(Radon.getFluid(1000)) .duration(4000).EUt(VA[HV]).save(provider); - // TODO Dynamite - //CHEMICAL_RECIPES.recipeBuilder("dynamite") - // .inputItems(Items.PAPER) - // .inputItems(Items.STRING) - // .inputFluids(GlycerylTrinitrate.getFluid(500)) - // .outputItems(DYNAMITE) - // .duration(160).EUt(4).save(provider); + CHEMICAL_RECIPES.recipeBuilder("dynamite") + .inputItems(Items.PAPER) + .inputItems(Items.STRING) + .inputFluids(GlycerylTrinitrate.getFluid(500)) + .outputItems(GTItems.DYNAMITE.get()) + .duration(160).EUt(4).save(provider); CHEMICAL_RECIPES.recipeBuilder("niobium_nitride") .inputItems(dust, Niobium) diff --git a/src/main/java/com/gregtechceu/gtceu/data/tags/TagsHandler.java b/src/main/java/com/gregtechceu/gtceu/data/tags/TagsHandler.java index de890e471b..47fd001bd0 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/tags/TagsHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/tags/TagsHandler.java @@ -5,6 +5,7 @@ import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; +import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.block.Block; import com.gregtechceu.gtceu.api.data.chemical.material.MarkerMaterials.Color; @@ -43,10 +44,10 @@ public static void initExtraUnificationEntries() { registerUnificationItems(ingot, Clay, Items.CLAY_BALL); registerUnificationItems(lens, Color.White, new Supplier[]{GTItems.MATERIAL_ITEMS.get(lens, Glass), GTItems.MATERIAL_ITEMS.get(lens, NetherStar)}); - registerUnificationItems(lens, Color.LightBlue, GTItems.MATERIAL_ITEMS.get(lens, Diamond).get()); - registerUnificationItems(lens, Color.Red, GTItems.MATERIAL_ITEMS.get(lens, Ruby).get()); - registerUnificationItems(lens, Color.Green, GTItems.MATERIAL_ITEMS.get(lens, Emerald).get()); - registerUnificationItems(lens, Color.Blue, GTItems.MATERIAL_ITEMS.get(lens, Sapphire).get()); + registerUnificationItems(lens, Color.LightBlue, (Supplier) GTItems.MATERIAL_ITEMS.get(lens, Diamond)); + registerUnificationItems(lens, Color.Red, (Supplier) GTItems.MATERIAL_ITEMS.get(lens, Ruby)); + registerUnificationItems(lens, Color.Green, (Supplier) GTItems.MATERIAL_ITEMS.get(lens, Emerald)); + registerUnificationItems(lens, Color.Blue, (Supplier) GTItems.MATERIAL_ITEMS.get(lens, Sapphire)); registerUnificationItems(dye, Color.Black, Items.BLACK_DYE); registerUnificationItems(dye, Color.Red, Items.RED_DYE); diff --git a/src/main/java/com/gregtechceu/gtceu/forge/ForgeCommonEventListener.java b/src/main/java/com/gregtechceu/gtceu/forge/ForgeCommonEventListener.java index e542afafce..70062e3c1f 100644 --- a/src/main/java/com/gregtechceu/gtceu/forge/ForgeCommonEventListener.java +++ b/src/main/java/com/gregtechceu/gtceu/forge/ForgeCommonEventListener.java @@ -6,9 +6,10 @@ import com.gregtechceu.gtceu.api.block.MetaMachineBlock; import com.gregtechceu.gtceu.api.capability.forge.compat.EUToFEProvider; import com.gregtechceu.gtceu.api.data.tag.TagPrefix; -import com.gregtechceu.gtceu.api.item.ComponentItem; import com.gregtechceu.gtceu.api.item.DrumMachineItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.TagPrefixItem; +import com.gregtechceu.gtceu.api.item.armor.ArmorComponentItem; import com.gregtechceu.gtceu.api.machine.feature.IInteractedMachine; import com.gregtechceu.gtceu.common.ServerCommands; import com.gregtechceu.gtceu.common.data.GTBlocks; @@ -22,6 +23,9 @@ import net.minecraft.core.Direction; import net.minecraft.core.Registry; import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.common.capabilities.Capability; @@ -31,8 +35,10 @@ import net.minecraftforge.event.AttachCapabilitiesEvent; import net.minecraftforge.event.RegisterCommandsEvent; import net.minecraftforge.event.TickEvent; +import net.minecraftforge.event.entity.living.LivingFallEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.level.LevelEvent; +import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.MissingMappingsEvent; @@ -54,7 +60,7 @@ public class ForgeCommonEventListener { @SubscribeEvent public static void registerItemStackCapabilities(AttachCapabilitiesEvent event) { - if (event.getObject().getItem() instanceof ComponentItem componentItem) { + if (event.getObject().getItem() instanceof IComponentItem componentItem) { final ItemStack itemStack = event.getObject(); event.addCapability(GTCEu.id("capability"), new ICapabilityProvider() { @@ -118,6 +124,29 @@ public static void worldUnload(LevelEvent.Unload event) { } } + @SubscribeEvent(priority = EventPriority.LOW) + public static void onEntityLivingFallEvent(LivingFallEvent event) { + if (event.getEntity() instanceof ServerPlayer player) { + ItemStack armor = player.getItemBySlot(EquipmentSlot.FEET); + ItemStack jet = player.getItemBySlot(EquipmentSlot.CHEST); + + if (player.fallDistance < 3.2f) + return; + + if (!armor.isEmpty() && armor.getItem() instanceof ArmorComponentItem valueItem) { + valueItem.getArmorLogic().damageArmor(player, armor, DamageSource.FALL, + (int) (player.fallDistance - 1.2f), EquipmentSlot.FEET); + player.fallDistance = 0; + event.setCanceled(true); + } else if (!jet.isEmpty() && jet.getItem() instanceof ArmorComponentItem valueItem && jet.getOrCreateTag().contains("flyMode")) { + valueItem.getArmorLogic().damageArmor(player, jet, DamageSource.FALL, + (int) (player.fallDistance - 1.2f), EquipmentSlot.FEET); + player.fallDistance = 0; + event.setCanceled(true); + } + } + } + @SubscribeEvent public static void remapIds(MissingMappingsEvent event) { event.getMappings(Registry.BLOCK.key(), GTCEu.MOD_ID).forEach(mapping -> { diff --git a/src/main/java/com/gregtechceu/gtceu/integration/GTRecipeWidget.java b/src/main/java/com/gregtechceu/gtceu/integration/GTRecipeWidget.java index 04e529dce1..906d9088a4 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/GTRecipeWidget.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/GTRecipeWidget.java @@ -230,8 +230,7 @@ private void setRecipeTextWidget(OverclockingLogic logic) { int duration = recipe.duration; String tierText = GTValues.VNF[tier]; if (tier > getMinTier() && inputEUt != 0) { - LongIntPair pair = logic.getLogic().runOverclockingLogic( - recipe, inputEUt, GTValues.V[tier], duration, GTValues.MAX); + LongIntPair pair = RecipeHelper.performOverclocking(logic, recipe, inputEUt, GTValues.V[tier]); duration = pair.rightInt(); inputEUt = pair.firstLong(); tierText = tierText.formatted(ChatFormatting.ITALIC); diff --git a/src/main/java/com/gregtechceu/gtceu/integration/ae2/machine/MEInputHatchPartMachine.java b/src/main/java/com/gregtechceu/gtceu/integration/ae2/machine/MEInputHatchPartMachine.java index 15aa277bcf..10525fb42a 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/ae2/machine/MEInputHatchPartMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/ae2/machine/MEInputHatchPartMachine.java @@ -30,7 +30,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; import java.util.function.Predicate; @@ -158,7 +157,7 @@ public long fill(int tank, FluidStack resource, boolean simulate, boolean notify @Override public List handleRecipeInner(IO io, GTRecipe recipe, List left, @Nullable String slotName, boolean simulate) { - return handleIngredient(io, left, simulate, this.handlerIO, getStorages()); + return handleIngredient(io, recipe, left, simulate, this.handlerIO, getStorages()); } public FluidStack drainInternal(long maxDrain, boolean simulate) { diff --git a/src/main/java/com/gregtechceu/gtceu/integration/ae2/machine/MEOutputHatchPartMachine.java b/src/main/java/com/gregtechceu/gtceu/integration/ae2/machine/MEOutputHatchPartMachine.java index eb4e86d5e1..2fbbdeb747 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/ae2/machine/MEOutputHatchPartMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/ae2/machine/MEOutputHatchPartMachine.java @@ -33,7 +33,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.stream.Stream; @@ -138,7 +137,7 @@ public void setStackInSlot(int slot, @NotNull ItemStack stack) { @Override public List handleRecipeInner(IO io, GTRecipe recipe, List left, @Nullable String slotName, boolean simulate) { - return handleIngredient(io, left, simulate, this.handlerIO, Stream.generate(() -> new FluidStorage(0) { + return handleIngredient(io, recipe, left, simulate, this.handlerIO, Stream.generate(() -> new FluidStorage(0) { @Override public long fill(FluidStack resource, boolean simulate, boolean notifyChanges) { return InaccessibleInfiniteSlot.this.fill(resource, simulate, notifyChanges); diff --git a/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/block/CoilBlockBuilder.java b/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/block/CoilBlockBuilder.java index 59f75430b2..168ffe3e99 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/block/CoilBlockBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/block/CoilBlockBuilder.java @@ -1,5 +1,6 @@ package com.gregtechceu.gtceu.integration.kjs.builders.block; +import com.gregtechceu.gtceu.api.GTCEuAPI; import com.gregtechceu.gtceu.api.block.SimpleCoilType; import com.gregtechceu.gtceu.api.data.chemical.material.Material; import com.gregtechceu.gtceu.common.block.CoilBlock; @@ -50,7 +51,7 @@ protected BlockItemBuilder getOrCreateItemBuilder() { public Block createObject() { SimpleCoilType coilType = new SimpleCoilType(this.id.getPath(), temperature, level, energyDiscount, tier, material, texture); CoilBlock result = new CoilBlock(this.createProperties(), coilType); - GTBlocks.ALL_COILS.put(coilType, () -> result); + GTCEuAPI.HEATING_COILS.put(coilType, () -> result); return result; } } diff --git a/src/main/java/com/gregtechceu/gtceu/test/api/machine/trait/ParallelLogicTest.java b/src/main/java/com/gregtechceu/gtceu/test/api/machine/trait/ParallelLogicTest.java index b5baf1c6e7..e686e87d03 100644 --- a/src/main/java/com/gregtechceu/gtceu/test/api/machine/trait/ParallelLogicTest.java +++ b/src/main/java/com/gregtechceu/gtceu/test/api/machine/trait/ParallelLogicTest.java @@ -50,8 +50,8 @@ public void getMaxRecipeMultiplier_FluidLimitTest(GameTestHelper helper) { var paralleled = GTRecipeModifiers.accurateParallel(machine, recipe, parallelLimit, false); - if (paralleled != null && paralleled.getB() != 2) { - helper.fail("Expected Parallel amount to be 2, is %s.".formatted(paralleled.getB())); + if (paralleled != null && paralleled.getSecond() != 2) { + helper.fail("Expected Parallel amount to be 2, is %s.".formatted(paralleled.getSecond())); } helper.succeed(); @@ -86,8 +86,8 @@ public void getMaxRecipeMultiplier_LimitFailureTest(GameTestHelper helper) { var paralleled = GTRecipeModifiers.accurateParallel(machine, recipe, parallelLimit, false); - if (paralleled == null || paralleled.getB() == 0) { - helper.fail("Parallel is too high, should be 0, is %s.".formatted(paralleled.getB())); + if (paralleled == null || paralleled.getSecond() == 0) { + helper.fail("Parallel is too high, should be 0, is %s.".formatted(paralleled.getSecond())); } helper.succeed(); @@ -122,8 +122,8 @@ public void getMaxRecipeMultiplier_ItemFailureTest(GameTestHelper helper) { var paralleled = GTRecipeModifiers.accurateParallel(machine, recipe, parallelLimit, false); - if (paralleled == null || paralleled.getB() == 0) { - helper.fail("Parallel is too high, should be 0, is %s.".formatted(paralleled.getB())); + if (paralleled == null || paralleled.getSecond() == 0) { + helper.fail("Parallel is too high, should be 0, is %s.".formatted(paralleled.getSecond())); } helper.succeed(); diff --git a/src/main/java/com/gregtechceu/gtceu/utils/RegistryUtil.java b/src/main/java/com/gregtechceu/gtceu/utils/RegistryUtil.java new file mode 100644 index 0000000000..07ae29f92d --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/utils/RegistryUtil.java @@ -0,0 +1,23 @@ +package com.gregtechceu.gtceu.utils; + +import net.minecraft.MethodsReturnNonnullByDefault; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; + +import javax.annotation.ParametersAreNonnullByDefault; +import java.util.Arrays; +import java.util.List; + +@MethodsReturnNonnullByDefault +@ParametersAreNonnullByDefault +public class RegistryUtil { + private RegistryUtil() { + } + + public static List> resolveResourceKeys(ResourceKey> registryKey, String... locations) { + return Arrays.stream(locations) + .map(location -> ResourceKey.create(registryKey, new ResourceLocation(location))) + .toList(); + } +} diff --git a/src/main/java/com/gregtechceu/gtceu/utils/ResearchManager.java b/src/main/java/com/gregtechceu/gtceu/utils/ResearchManager.java index ee9c3d2299..0e6cec23f9 100644 --- a/src/main/java/com/gregtechceu/gtceu/utils/ResearchManager.java +++ b/src/main/java/com/gregtechceu/gtceu/utils/ResearchManager.java @@ -4,6 +4,7 @@ import com.gregtechceu.gtceu.api.capability.recipe.IRecipeCapabilityHolder; import com.gregtechceu.gtceu.api.capability.recipe.ItemRecipeCapability; import com.gregtechceu.gtceu.api.item.ComponentItem; +import com.gregtechceu.gtceu.api.item.IComponentItem; import com.gregtechceu.gtceu.api.item.component.IDataItem; import com.gregtechceu.gtceu.api.item.component.IItemComponent; import com.gregtechceu.gtceu.api.recipe.GTRecipe; @@ -88,7 +89,7 @@ public static Pair readResearchId(@NotNull ItemStack stack * @return if the stack is a data item */ public static boolean isStackDataItem(@NotNull ItemStack stack, boolean isDataBank) { - if (stack.getItem() instanceof ComponentItem metaItem) { + if (stack.getItem() instanceof IComponentItem metaItem) { for (IItemComponent behaviour : metaItem.getComponents()) { if (behaviour instanceof IDataItem dataItem) { return !dataItem.requireDataBank() || isDataBank; diff --git a/src/main/java/com/gregtechceu/gtceu/utils/input/KeyBind.java b/src/main/java/com/gregtechceu/gtceu/utils/input/KeyBind.java new file mode 100644 index 0000000000..446ce05450 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/utils/input/KeyBind.java @@ -0,0 +1,169 @@ +package com.gregtechceu.gtceu.utils.input; + +import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.common.network.GTNetwork; +import com.gregtechceu.gtceu.common.network.packets.CPacketKeysPressed; +import com.lowdragmc.lowdraglib.Platform; +import com.mojang.blaze3d.platform.InputConstants; +import net.minecraft.client.KeyMapping; +import net.minecraft.client.Minecraft; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Player; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.client.event.RegisterKeyMappingsEvent; +import net.minecraftforge.client.settings.IKeyConflictContext; +import net.minecraftforge.client.settings.KeyConflictContext; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; +import org.apache.commons.lang3.tuple.MutablePair; + +import java.util.*; +import java.util.function.Supplier; + +@Mod.EventBusSubscriber(modid = GTCEu.MOD_ID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.FORGE) +public enum KeyBind { + VANILLA_JUMP(() -> () -> Minecraft.getInstance().options.keyJump), + VANILLA_SNEAK(() -> () -> Minecraft.getInstance().options.keyShift), + VANILLA_FORWARD(() -> () -> Minecraft.getInstance().options.keyUp), + VANILLA_BACKWARD(() -> () -> Minecraft.getInstance().options.keyDown), + VANILLA_LEFT(() -> () -> Minecraft.getInstance().options.keyLeft), + VANILLA_RIGHT(() -> () -> Minecraft.getInstance().options.keyRight), + ARMOR_MODE_SWITCH("gtceu.key.armor_mode_switch", KeyConflictContext.IN_GAME, InputConstants.KEY_M), + ARMOR_HOVER("gtceu.key.armor_hover", KeyConflictContext.IN_GAME, InputConstants.KEY_H), + ARMOR_CHARGING("gtceu.key.armor_charging", KeyConflictContext.IN_GAME, InputConstants.KEY_N), + TOOL_AOE_CHANGE("gtceu.key.tool_aoe_change", KeyConflictContext.IN_GAME, InputConstants.KEY_V); + + public static final KeyBind[] VALUES = values(); + + private static double mouseDelta = 0.0; + + public static void init() { + GTCEu.LOGGER.info("Registering KeyBinds"); + if (Platform.isClient()) { + MinecraftForge.EVENT_BUS.register(KeyBind.class); + } + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public static void onInputEvent(InputEvent.Key event) { + List updating = new ArrayList<>(); + for (KeyBind keybind : VALUES) { + boolean previousPressed = keybind.isPressed; + boolean previousKeyDown = keybind.isKeyDown; + keybind.isPressed = keybind.isPressed(); + keybind.isKeyDown = keybind.isKeyDown(); + if (previousPressed != keybind.isPressed || previousKeyDown != keybind.isKeyDown) { + updating.add(keybind); + } + } + if (!updating.isEmpty()) { + GTNetwork.NETWORK.sendToServer(new CPacketKeysPressed(updating)); + } + } + + public static void onRegisterKeyBinds(RegisterKeyMappingsEvent event) { + Arrays.stream(VALUES).forEach(value -> { + if (value.keybindingGetter == null) { + event.register(value.keybinding); + } else { + value.keybinding = value.keybindingGetter.get().get(); + } + }); + } + + @SubscribeEvent + public static void onMouseScroll(InputEvent.MouseScrollingEvent event) { + mouseDelta = event.getScrollDelta(); + } + + @OnlyIn(Dist.CLIENT) + public static boolean scrollingUp() { + return mouseDelta > 0; + } + + @OnlyIn(Dist.CLIENT) + public static boolean notScrolling() { + return mouseDelta == 0; + } + + @OnlyIn(Dist.CLIENT) + public static boolean scrollingDown() { + return mouseDelta < 0; + } + + @OnlyIn(Dist.CLIENT) + private Supplier> keybindingGetter; + @OnlyIn(Dist.CLIENT) + private KeyMapping keybinding; + @OnlyIn(Dist.CLIENT) + private boolean isPressed, isKeyDown; + + private final WeakHashMap> mapping = new WeakHashMap<>(); + + // For Vanilla/Other Mod keybinds + // Double Supplier to keep client classes from loading + KeyBind(Supplier> keybindingGetter) { + if (Platform.isClient()) { + this.keybindingGetter = keybindingGetter; + } + } + + KeyBind(String langKey, int button) { + if (Platform.isClient()) { + this.keybinding = new KeyMapping(langKey, button, GTCEu.NAME); + } + } + + KeyBind(String langKey, IKeyConflictContext ctx, int button) { + if (Platform.isClient()) { + this.keybinding = new KeyMapping(langKey, ctx, InputConstants.Type.KEYSYM, button, GTCEu.NAME); + } + } + + @OnlyIn(Dist.CLIENT) + public KeyMapping toMinecraft() { + return this.keybinding; + } + + @OnlyIn(Dist.CLIENT) + public boolean isPressed() { + return this.keybinding.isDown(); + } + + @OnlyIn(Dist.CLIENT) + public boolean isKeyDown() { + return this.keybinding.isDown(); + } + + public void update(boolean pressed, boolean keyDown, ServerPlayer player) { + MutablePair pair = this.mapping.get(player); + if (pair == null) { + this.mapping.put(player, MutablePair.of(pressed, keyDown)); + } else { + pair.left = pressed; + pair.right = keyDown; + } + } + + public boolean isPressed(Player player) { + if (player.level.isClientSide) { + return isPressed(); + } else { + MutablePair pair = this.mapping.get((ServerPlayer) player); + return pair != null && pair.left; + } + } + + public boolean isKeyDown(Player player) { + if (player.level.isClientSide) { + return isKeyDown(); + } else { + MutablePair pair = this.mapping.get((ServerPlayer) player); + return pair != null && pair.right; + } + } +} diff --git a/src/main/resources/assets/gtceu/lang/ru_ru.json b/src/main/resources/assets/gtceu/lang/ru_ru.json index b514ca2f71..057218c5ce 100644 --- a/src/main/resources/assets/gtceu/lang/ru_ru.json +++ b/src/main/resources/assets/gtceu/lang/ru_ru.json @@ -6797,5 +6797,153 @@ "tagprefix.fence_gate": "Калитка (%s)", "tagprefix.log": "Дерево (%s)", "tagprefix.slab": "Плита (%s)", - "tagprefix.stairs": "Ступеньки (%s)" + "tagprefix.stairs": "Ступеньки (%s)", + "block.gtceu.antimatter_hazard_sign_block": "Блок со знаком антиматериальной опасности", + "block.gtceu.blue_lamp": "Синяя лампа", + "block.gtceu.boss_hazard_sign_block": "Блок со знаком опасности Босса", + "block.gtceu.brown_lamp": "Коричневая лампа", + "block.gtceu.chiseled_light_concrete": "Точеный светлый бетон", + "block.gtceu.chiseled_marble": "Точеный мрамор", + "block.gtceu.chiseled_red_granite": "Точеный красный гранит", + "block.gtceu.cracked_dark_concrete_bricks": "Потрескавшийся темный бетонный кирпич", + "block.gtceu.cracked_marble_bricks": "Потрескавшийся мраморный кирпич", + "block.gtceu.cracked_red_granite_bricks": "Потрескавшийся красно-гранитный кирпич", + "block.gtceu.cyan_lamp": "Бирюзовая лампа", + "block.gtceu.dark_concrete": "Темный бетон", + "block.gtceu.dark_concrete_cobblestone": "Темно-бетонный булыжник", + "block.gtceu.causality_hazard_sign_block": "Блок со знаком опасности нестандартной причинности", + "block.gtceu.dark_concrete_tile": "Темная бетонная плитка", + "block.gtceu.fire_hazard_sign_block": "Блок со знаком пожароопасности", + "block.gtceu.foam": "Пена", + "block.gtceu.generic_hazard_sign_block": "Блок со знаком общей опасности", + "block.gtceu.gray_lamp": "Серая лампа", + "block.gtceu.green_lamp": "Зеленая лампа", + "block.gtceu.gregification_hazard_sign_block": "Блок со знаком опасности Грегификации", + "block.gtceu.high_temperature_hazard_sign_block": "Блок со знаком высокотемпературной опасности", + "block.gtceu.high_voltage_hazard_sign_block": "Блок со знаком высоковольтной опасности", + "block.gtceu.light_blue_lamp": "Голубая лампа", + "block.gtceu.light_concrete": "Светлый бетон", + "block.gtceu.light_concrete_bricks": "Светлый бетонный кирпич", + "block.gtceu.light_gray_lamp": "Светло-серая лампа", + "block.gtceu.lime_lamp": "Лаймовая лампа", + "block.gtceu.light_concrete_small_tile": "Маленькая светлая бетонная плитка", + "block.gtceu.light_concrete_tile": "Светлая бетонная плитка", + "block.gtceu.magenta_lamp": "Пурпурная лампа", + "block.gtceu.magnetic_hazard_sign_block": "Блок со знаком магнитной опасности", + "block.gtceu.marble": "Мрамор", + "block.gtceu.marble_bricks": "Мраморный кирпич", + "block.gtceu.marble_cobblestone": "Мраморный булыжник", + "block.gtceu.mob_spawner_hazard_sign_block": "Блок со знаком опасности спавнера мобов", + "block.gtceu.mossy_dark_concrete_bricks": "Замшелый темный бетонный кирпич", + "block.gtceu.mossy_dark_concrete_cobblestone": "Замшелый темно-бетонный булыжник", + "block.gtceu.mossy_light_concrete_cobblestone": "Замшелый светло-бетонный булыжник", + "block.gtceu.mossy_marble_bricks": "Замшелый мраморный кирпич", + "block.gtceu.mossy_marble_cobblestone": "Замшелый мраморный булыжник", + "block.gtceu.mossy_red_granite_cobblestone": "Замшелый красно-гранитный булыжник", + "block.gtceu.marble_small_tile": "Маленькая мраморная плитка", + "block.gtceu.marble_tile": "Мраморная плитка", + "block.gtceu.petrified_foam": "Затвердевшая пена", + "block.gtceu.polished_dark_concrete": "Полированный темный бетон", + "block.gtceu.polished_light_concrete": "Полированный светлый бетон", + "block.gtceu.polished_marble": "Полированный мрамор", + "block.gtceu.polished_red_granite": "Полированный красный гранит", + "block.gtceu.radioactive_hazard_sign_block": "Блок со знаком радиоактивной опасности", + "block.gtceu.red_granite": "Красный гранит", + "block.gtceu.red_granite_bricks": "Красно-гранитный кирпич", + "block.gtceu.red_lamp": "Красная лампа", + "block.gtceu.reinforced_stone": "Армированный камень", + "block.gtceu.red_granite_small_tile": "Маленькая красная гранитная плитка", + "block.gtceu.red_granite_tile": "Красная гранитная плитка", + "block.gtceu.rubber_door": "Каучуковая дверь", + "block.gtceu.rubber_fence": "Каучуковый забор", + "block.gtceu.rubber_fence_gate": "Каучуковая калитка", + "block.gtceu.rubber_wood": "Каучуковое дерево", + "block.gtceu.small_light_concrete_bricks": "Маленький светлый бетонный кирпич", + "block.gtceu.small_marble_bricks": "Маленький мраморный кирпич", + "block.gtceu.spatial_storage_hazard_sign_block": "Блок со знаком опасности пространственного хранения", + "block.gtceu.square_dark_concrete_bricks": "Квадратный темный бетонный кирпич", + "block.gtceu.square_marble_bricks": "Квадратный мраморный кирпич", + "block.gtceu.square_red_granite_bricks": "Квадратный красный гранитный кирпич", + "block.gtceu.rubber_hanging_sign": "Каучуковая подвесная табличка", + "block.gtceu.rubber_pressure_plate": "Каучуковая нажимная плита", + "block.gtceu.rubber_stairs": "Каучуковая лестница", + "block.gtceu.rubber_trapdoor": "Каучуковый люк", + "block.gtceu.treated_wood_button": "Кнопка из обработанного дерева", + "block.gtceu.treated_wood_door": "Обработанная деревянная дверь", + "block.gtceu.treated_wood_fence": "Обработанный деревянный забор", + "block.gtceu.treated_wood_hanging_sign": "Подвесная табличка из обработанного дерева", + "block.gtceu.treated_wood_pressure_plate": "Нажимная плита из обработанного дерева", + "block.gtceu.treated_wood_stairs": "Обработанные деревянные ступеньки", + "block.gtceu.treated_wood_trapdoor": "Люк из обработанного дерева", + "block.gtceu.white_lamp": "Белая лампа", + "block.gtceu.yellow_lamp": "Желтая лампа", + "block.gtceu.yellow_stripes_block.a": "Желтый полосатый блок", + "block.gtceu.yellow_stripes_block.b": "Желтый полосатый блок", + "block.gtceu.yellow_stripes_block.d": "Желтый полосатый блок", + "compass.node.gtceu.generation/treated_wood_slab": "Обработанная деревянная плита", + "block.gtceu.yellow_stripes_block_a": "Желтый полосатый блок А", + "compass.node.gtceu.generation/rubber_slab": "Каучуковая плита", + "block.gtceu.bio_hazard_sign_block": "Блок со знаком биологической опасности", + "block.gtceu.acid_hazard_sign_block": "Блок со знаком кислотной опасности", + "block.gtceu.black_lamp": "Черная лампа", + "block.gtceu.chiseled_dark_concrete": "Точеный темный бетон", + "block.gtceu.cracked_light_concrete_bricks": "Потрескавшийся светлый бетонный кирпич", + "block.gtceu.frost_hazard_sign_block": "Блок со знаком опасности низких температур", + "block.gtceu.high_pressure_hazard_sign_block": "Блок со знаком опасности высокого давления", + "block.gtceu.laser_hazard_sign_block": "Блок со знаком лазерной опасности", + "block.gtceu.mob_infestation_hazard_sign_block": "Блок со знаком опасности появления мобов", + "block.gtceu.mossy_red_granite_bricks": "Замшелый красно-гранитный кирпич", + "block.gtceu.orange_lamp": "Оранжевая лампа", + "block.gtceu.pink_lamp": "Розовая лампа", + "block.gtceu.purple_lamp": "Фиолетовая лампа", + "block.gtceu.red_granite_cobblestone": "Красно-гранитный булыжник", + "block.gtceu.rubber_button": "Каучуковая кнопка", + "block.gtceu.small_dark_concrete_bricks": "Маленький темный бетонный кирпич", + "block.gtceu.small_red_granite_bricks": "Маленький красный гранитный кирпич", + "block.gtceu.square_light_concrete_bricks": "Квадратный светлый бетонный кирпич", + "block.gtceu.void_hazard_sign_block": "Блок со знаком пустотной опасности", + "block.gtceu.yellow_stripes_block.c": "Желтый полосатый блок", + "block.gtceu.dark_concrete_small_tile": "Маленькая темная бетонная плитка", + "block.gtceu.stripped_rubber_wood": "Обтёсанная каучуковая древесина", + "block.gtceu.yellow_stripes_block_b": "Желтый полосатый блок Б", + "block.gtceu.dark_concrete_bricks": "Темный бетонный кирпич", + "block.gtceu.explosion_hazard_sign_block": "Блок со знаком взрывоопасности", + "block.gtceu.light_concrete_cobblestone": "Светло-бетонный булыжник", + "block.gtceu.magic_hazard_sign_block": "Блок со знаком магической опасности", + "block.gtceu.mossy_light_concrete_bricks": "Замшелый светлый бетонный кирпич", + "block.gtceu.noise_hazard_sign_block": "Блок со знаком шумовой опасности", + "block.gtceu.rubber_slab": "Каучуковая плита", + "block.gtceu.stripped_rubber_log": "Обтёсанное каучуковое бревно", + "block.gtceu.treated_wood_fence_gate": "Обработанная деревянная калитка", + "block.gtceu.treated_wood_slab": "Обработанная деревянная плита", + "block.gtceu.turret_hazard_sign_block": "Блок со знаком опасности автоматизированной защиты", + "block.gtceu.smooth_dark_concrete": "Гладкий темный бетон", + "block.gtceu.smooth_light_concrete": "Гладкий светлый бетон", + "block.gtceu.smooth_marble": "Гладкий мрамор", + "block.gtceu.smooth_red_granite": "Гладкий красный гранит", + "block.gtceu.dark_concrete_windmill_b": "Тёмная бетонная плитка \"Ветряная мельница\" Б", + "block.gtceu.itnt.drops_tooltip": "Намного мощнее, чем TNT. Все взорванные блоки выпадают как предметы", + "block.gtceu.marble_windmill_b": "Мраморная плитка \"Ветряная мельница\" Б", + "block.gtceu.powderbarrel": "Пороховая бочка", + "block.gtceu.red_granite_windmill_a": "Красная гранитная плитка \"Ветряная мельница\" A", + "block.gtceu.red_granite_windmill_b": "Красная гранитная плитка \"Ветряная мельница\" Б", + "block.gtceu.dark_concrete_windmill_a": "Тёмная бетонная плитка \"Ветряная мельница\" A", + "block.gtceu.explosive.breaking_tooltip": "При обычной добыче взрывается, добудьте в присяде, чтобы забрать обратно", + "block.gtceu.explosive.lighting_tooltip": "Нельзя зажечь с помощью Редстоуна", + "block.gtceu.industrial_tnt": "Промышленный динамит", + "block.gtceu.light_concrete_windmill_a": "Светлая бетонная плитка \"Ветряная мельница\" А", + "block.gtceu.light_concrete_windmill_b": "Светлая бетонная плитка \"Ветряная мельница\" Б", + "block.gtceu.marble_windmill_a": "Мраморная плитка \"Ветряная мельница\" А", + "block.gtceu.powderbarrel.drops_tooltip": "Немного мощнее, чем TNT. Все взорванные блоки выпадают как предметы", + "compass.node.gtceu.generation/marble": "Мрамор", + "entity.gtceu.industrial_tnt": "Промышленный динамит", + "entity.gtceu.powderbarrel": "Пороховая бочка", + "entity.gtceu.dynamite": "Динамит", + "tagprefix.red_granite": "%s (Красно-гранитная руда)", + "block.gtceu.treated_wood_sign": "Табличка из обработанного дерева", + "block.minecraft.air": "Подвесная табличка из обработанного дерева", + "compass.node.gtceu.generation/red_granite": "Красный гранит", + "item.gtceu.dynamite": "Динамит", + "tagprefix.marble": "%s (Красно-гранитная руда)", + "block.gtceu.rubber_sign": "Каучуковая табличка" } diff --git a/src/main/resources/assets/gtceu/lang/zh_cn.json b/src/main/resources/assets/gtceu/lang/zh_cn.json index fe3aa85a41..2bb46d9eff 100644 --- a/src/main/resources/assets/gtceu/lang/zh_cn.json +++ b/src/main/resources/assets/gtceu/lang/zh_cn.json @@ -76,18 +76,24 @@ "behaviour.soft_hammer.enabled":"已恢复工作", "behaviour.wrench":"右击以旋转方块", "block.filter_casing.tooltip":"创建一个§a无尘§r环境", + "block.gtceu.acid_hazard_sign_block":"强酸危害警示方块", "block.gtceu.active_transformer":"有源变压器", "block.gtceu.advanced_computer_casing":"高级计算机外壳", "block.gtceu.advanced_data_access_hatch":"高级数据访问仓", "block.gtceu.alloy_blast_smelter":"合金冶炼炉", "block.gtceu.aluminium_crate":"铝板条箱", "block.gtceu.aluminium_drum":"铝桶", + "block.gtceu.antimatter_hazard_sign_block":"反物质危害警示方块", "block.gtceu.assembly_line":"装配线", "block.gtceu.assembly_line_casing":"装配线外壳", "block.gtceu.assembly_line_grating":"装配线格栅", "block.gtceu.assembly_line_unit":"装配线控制外壳", "block.gtceu.atomic_casing":"原子机械方块", "block.gtceu.auto_maintenance_hatch":"自动维护仓", + "block.gtceu.bio_hazard_sign_block":"生化危害警示方块", + "block.gtceu.black_lamp":"黑色灯", + "block.gtceu.blue_lamp":"蓝色灯", + "block.gtceu.boss_hazard_sign_block":"Boss危害警示方块", "block.gtceu.bronze_brick_casing":"砖砌青铜外壳", "block.gtceu.bronze_crate":"青铜板条箱", "block.gtceu.bronze_drum":"青铜桶", @@ -96,10 +102,16 @@ "block.gtceu.bronze_large_boiler":"大型青铜锅炉", "block.gtceu.bronze_machine_casing":"青铜机器外壳", "block.gtceu.bronze_pipe_casing":"青铜管道方块", + "block.gtceu.brown_lamp":"棕色灯", "block.gtceu.casing_bronze_bricks":"砖砌青铜外壳", "block.gtceu.casing_coke_bricks":"焦炉砖块", "block.gtceu.casing_grate":"栅格机械方块", "block.gtceu.casing_primitive_bricks":"耐火砖块", + "block.gtceu.causality_hazard_sign_block":"因果律危害警示方块", + "block.gtceu.chiseled_dark_concrete":"錾制深色混凝土", + "block.gtceu.chiseled_light_concrete":"錾制淡色混凝土", + "block.gtceu.chiseled_marble":"錾制大理岩", + "block.gtceu.chiseled_red_granite":"錾制红花岗岩", "block.gtceu.clean_machine_casing":"洁净不锈钢机械方块", "block.gtceu.cleaning_maintenance_hatch":"超净维护仓", "block.gtceu.cleanroom":"超净间", @@ -113,6 +125,10 @@ "block.gtceu.computer_heat_vent":"计算机散热口", "block.gtceu.configurable_maintenance_hatch":"可配置维护仓", "block.gtceu.corrosion_proof_casing":"耐腐蚀机械方块", + "block.gtceu.cracked_dark_concrete_bricks":"裂纹深色混凝土砖", + "block.gtceu.cracked_light_concrete_bricks":"裂纹淡色混凝土砖", + "block.gtceu.cracked_marble_bricks":"裂纹大理岩砖", + "block.gtceu.cracked_red_granite_bricks":"裂纹红花岗岩砖", "block.gtceu.cracker":"裂化机", "block.gtceu.creative_chest":"创造模式箱子", "block.gtceu.creative_data_access_hatch":"创造模式数据访问仓", @@ -120,6 +136,12 @@ "block.gtceu.creative_tank":"创造模式储罐", "block.gtceu.crushing_wheels":"粉碎轮", "block.gtceu.cupronickel_coil_block":"白铜线圈方块", + "block.gtceu.cyan_lamp":"青色灯", + "block.gtceu.dark_concrete":"深色混凝土", + "block.gtceu.dark_concrete_bricks":"深色混凝土砖", + "block.gtceu.dark_concrete_cobblestone":"深色混凝土圆石", + "block.gtceu.dark_concrete_small_tile":"深色混凝土小片瓦", + "block.gtceu.dark_concrete_tile":"深色混凝土瓦", "block.gtceu.data_access_hatch":"数据访问仓", "block.gtceu.data_bank":"数据库", "block.gtceu.data_receiver_hatch":"光学数据靶仓", @@ -147,7 +169,7 @@ "block.gtceu.ev_block_breaker":"§5进阶方块破坏器 III§r", "block.gtceu.ev_brewery":"§5进阶酿造室 III§r", "block.gtceu.ev_canner":"§5进阶装罐机 III§r", - "block.gtceu.ev_centrifuge":"§5进阶离心机 I§r", + "block.gtceu.ev_centrifuge":"§5进阶离心机 III§r", "block.gtceu.ev_charger_4x":"4x超高压闪聚充电箱(§5EV§r)", "block.gtceu.ev_chemical_bath":"§5进阶化学浸洗机 III§r", "block.gtceu.ev_chemical_reactor":"§5进阶化学反应釜 III§r", @@ -215,10 +237,14 @@ "block.gtceu.ev_transformer_4a":"超高压高流变压器(§5EV§r)", "block.gtceu.ev_wiremill":"§5进阶线材轧机 III§r", "block.gtceu.ev_world_accelerator":"§5进阶世界加速器 III§r", + "block.gtceu.explosion_hazard_sign_block":"爆炸危害警示方块", "block.gtceu.extreme_combustion_engine":"极限内燃引擎", "block.gtceu.extreme_engine_intake_casing":"极限引擎进气机械方块", "block.gtceu.filter_casing":"过滤器机械方块", + "block.gtceu.fire_hazard_sign_block":"易燃危害警示方块", "block.gtceu.firebricks":"耐火砖块", + "block.gtceu.foam":"建筑泡沫", + "block.gtceu.frost_hazard_sign_block":"低温危害警示方块", "block.gtceu.frostproof_machine_casing":"铝制防冻机械方块", "block.gtceu.fusion_casing":"聚变机械方块", "block.gtceu.fusion_casing_mk2":"聚变机械方块 MK-II", @@ -226,12 +252,19 @@ "block.gtceu.fusion_coil":"聚变线圈方块", "block.gtceu.fusion_glass":"聚变玻璃", "block.gtceu.gas_large_turbine":"大型燃气涡轮", + "block.gtceu.generic_hazard_sign_block":"泛用危害警示方块", "block.gtceu.gold_drum":"金桶", + "block.gtceu.gray_lamp":"灰色灯", + "block.gtceu.green_lamp":"绿色灯", + "block.gtceu.gregification_hazard_sign_block":"格雷化危害警示方块", "block.gtceu.heat_vent":"散热片", "block.gtceu.heatproof_machine_casing":"殷钢隔热机械方块", "block.gtceu.high_performance_computation_array":"高性能计算阵列(HPCA)", "block.gtceu.high_power_casing":"高能机器外壳", + "block.gtceu.high_pressure_hazard_sign_block":"高压力危害警示方块", + "block.gtceu.high_temperature_hazard_sign_block":"高温危害警示方块", "block.gtceu.high_temperature_smelting_casing":"高温冶炼机械方块", + "block.gtceu.high_voltage_hazard_sign_block":"高压电危害警示方块", "block.gtceu.hp_steam_alloy_smelter":"高压蒸汽合金炉", "block.gtceu.hp_steam_compressor":"高压蒸汽压缩机", "block.gtceu.hp_steam_extractor":"高压蒸汽提取机", @@ -440,7 +473,16 @@ "block.gtceu.large_sifting_funnel":"大型筛选漏斗", "block.gtceu.large_solidifier":"大型固化阵列", "block.gtceu.large_wiremill":"大型线材工厂", + "block.gtceu.laser_hazard_sign_block":"激光危害警示方块", "block.gtceu.laser_safe_engraving_casing":"激光安全机械方块", + "block.gtceu.light_blue_lamp":"淡蓝色灯", + "block.gtceu.light_concrete":"淡色混凝土", + "block.gtceu.light_concrete_bricks":"淡色混凝土砖", + "block.gtceu.light_concrete_cobblestone":"淡色混凝土圆石", + "block.gtceu.light_concrete_small_tile":"淡色混凝土小片瓦", + "block.gtceu.light_concrete_tile":"淡色混凝土瓦", + "block.gtceu.light_gray_lamp":"淡灰色灯", + "block.gtceu.lime_lamp":"黄绿色灯", "block.gtceu.long_distance_fluid_pipeline":"长距离流体管道", "block.gtceu.long_distance_fluid_pipeline_endpoint":"长距离流体管道接口", "block.gtceu.long_distance_item_pipeline":"长距离物品管道", @@ -622,7 +664,15 @@ "block.gtceu.lv_transformer_4a":"低压高流变压器(§7LV§r)", "block.gtceu.lv_wiremill":"基础线材轧机§r", "block.gtceu.lv_world_accelerator":"基础世界加速器§r", + "block.gtceu.magenta_lamp":"品红色灯", + "block.gtceu.magic_hazard_sign_block":"魔力危害警示方块", + "block.gtceu.magnetic_hazard_sign_block":"强磁危害警示方块", "block.gtceu.maintenance_hatch":"维护仓", + "block.gtceu.marble":"大理岩", + "block.gtceu.marble_bricks":"大理岩砖", + "block.gtceu.marble_cobblestone":"大理岩圆石", + "block.gtceu.marble_small_tile":"大理岩小片瓦", + "block.gtceu.marble_tile":"大理岩瓦", "block.gtceu.max_16a_energy_converter":"16安§c§lMAX§r能量转换器", "block.gtceu.max_1a_energy_converter":"1安§c§lMAX§r能量转换器", "block.gtceu.max_4a_energy_converter":"4安§c§lMAX§r能量转换器", @@ -650,7 +700,17 @@ "block.gtceu.mega_blast_furnace":"转底炉", "block.gtceu.mega_vacuum_freezer":"巨型真空冷冻机", "block.gtceu.miner_pipe":"采矿管道", + "block.gtceu.mob_infestation_hazard_sign_block":"怪物侵袭危害警示方块", + "block.gtceu.mob_spawner_hazard_sign_block":"刷怪笼危害警示方块", "block.gtceu.molybdenum_disilicide_coil_block":"二硅化钼线圈方块", + "block.gtceu.mossy_dark_concrete_bricks":"覆苔深色混凝土砖", + "block.gtceu.mossy_dark_concrete_cobblestone":"覆苔深色混凝土圆石", + "block.gtceu.mossy_light_concrete_bricks":"覆苔淡色混凝土砖", + "block.gtceu.mossy_light_concrete_cobblestone":"覆苔淡色混凝土圆石", + "block.gtceu.mossy_marble_bricks":"覆苔大理岩砖", + "block.gtceu.mossy_marble_cobblestone":"覆苔大理岩圆石", + "block.gtceu.mossy_red_granite_bricks":"覆苔红花岗岩砖", + "block.gtceu.mossy_red_granite_cobblestone":"覆苔红花岗岩圆石", "block.gtceu.multi_smelter":"工业熔炉", "block.gtceu.mv_16a_energy_converter":"16安§bMV§r能量转换器", "block.gtceu.mv_1a_energy_converter":"1安§bMV§r能量转换器", @@ -730,6 +790,7 @@ "block.gtceu.naquadah_coil_block":"硅岩线圈方块", "block.gtceu.network_switch":"网络交换机", "block.gtceu.nichrome_coil_block":"镍铬合金线圈方块", + "block.gtceu.noise_hazard_sign_block":"噪声危害警示方块", "block.gtceu.nonconducting_casing":"绝缘机械方块", "block.gtceu.normal_laser_pipe":"普通激光管道", "block.gtceu.normal_optical_pipe":"普通光学管道", @@ -806,28 +867,67 @@ "block.gtceu.opv_sifter":"§9§l传奇筛选机§r", "block.gtceu.opv_thermal_centrifuge":"§9§l传奇热力离心机§r", "block.gtceu.opv_wiremill":"§9§l传奇线材轧机§r", + "block.gtceu.orange_lamp":"橙色灯", "block.gtceu.palladium_substation":"镀钯变电站", + "block.gtceu.petrified_foam":"石化建筑泡沫", + "block.gtceu.pink_lamp":"粉红色灯", "block.gtceu.plascrete":"塑料混凝土", "block.gtceu.plasma_large_turbine":"大型等离子涡轮", + "block.gtceu.polished_dark_concrete":"磨制深色混凝土", + "block.gtceu.polished_light_concrete":"磨制淡色混凝土", + "block.gtceu.polished_marble":"磨制大理岩", + "block.gtceu.polished_red_granite":"磨制红花岗岩", "block.gtceu.power_substation":"蓄能变电站", "block.gtceu.primitive_blast_furnace":"土高炉", "block.gtceu.primitive_pump":"原始水泵", "block.gtceu.ptfe_pipe_casing":"聚四氟乙烯管道方块", "block.gtceu.pump_deck":"水泵盖板", "block.gtceu.pump_hatch":"水泵仓", + "block.gtceu.purple_lamp":"紫色灯", "block.gtceu.pyrolyse_oven":"热解炉", + "block.gtceu.radioactive_hazard_sign_block":"辐射危害警示方块", "block.gtceu.reaction_safe_mixing_casing":"惰性搅拌机械方块", + "block.gtceu.red_granite":"红花岗岩", + "block.gtceu.red_granite_bricks":"红花岗岩砖", + "block.gtceu.red_granite_cobblestone":"红花岗岩圆石", + "block.gtceu.red_granite_small_tile":"红花岗岩小片瓦", + "block.gtceu.red_granite_tile":"红花岗岩瓦", + "block.gtceu.red_lamp":"红色灯", + "block.gtceu.reinforced_stone":"防爆石", "block.gtceu.research_station":"研究站", "block.gtceu.robust_machine_casing":"强化钨钢机械方块", "block.gtceu.rtm_alloy_coil_block":"钌钨钼合金线圈方块", + "block.gtceu.rubber_button":"橡胶木按钮", + "block.gtceu.rubber_door":"橡胶木门", + "block.gtceu.rubber_fence":"橡胶木栅栏", + "block.gtceu.rubber_fence_gate":"橡胶木栅栏门", + "block.gtceu.rubber_hanging_sign":"墙上的悬挂式橡胶木告示牌", "block.gtceu.rubber_leaves":"橡胶树叶", "block.gtceu.rubber_log":"橡胶原木", "block.gtceu.rubber_planks":"橡胶木板", + "block.gtceu.rubber_pressure_plate":"橡胶木压力板", "block.gtceu.rubber_sapling":"橡胶树苗", + "block.gtceu.rubber_slab":"橡胶木台阶", + "block.gtceu.rubber_stairs":"橡胶木楼梯", + "block.gtceu.rubber_trapdoor":"橡胶木活板门", + "block.gtceu.rubber_wood":"橡胶木", "block.gtceu.secure_maceration_casing":"安全研磨机械方块", "block.gtceu.shock_proof_cutting_casing":"防震切割机械方块", "block.gtceu.slicing_blades":"切片刀", + "block.gtceu.small_dark_concrete_bricks":"深色混凝土小块砖", + "block.gtceu.small_light_concrete_bricks":"淡色混凝土小块砖", + "block.gtceu.small_marble_bricks":"大理岩小块砖", + "block.gtceu.small_red_granite_bricks":"红花岗岩小块砖", + "block.gtceu.smooth_dark_concrete":"平滑深色混凝土", + "block.gtceu.smooth_light_concrete":"平滑淡色混凝土", + "block.gtceu.smooth_marble":"平滑大理岩", + "block.gtceu.smooth_red_granite":"平滑红花岗岩", "block.gtceu.solid_machine_casing":"脱氧机械方块", + "block.gtceu.spatial_storage_hazard_sign_block":"空间存储危害警示方块", + "block.gtceu.square_dark_concrete_bricks":"深色混凝土方形砖", + "block.gtceu.square_light_concrete_bricks":"淡色混凝土方形砖", + "block.gtceu.square_marble_bricks":"大理岩方形砖", + "block.gtceu.square_red_granite_bricks":"红花岗岩方形砖", "block.gtceu.stable_machine_casing":"加强钛机械方块", "block.gtceu.stainless_steel_crate":"不锈钢板条箱", "block.gtceu.stainless_steel_drum":"不锈钢桶", @@ -864,6 +964,8 @@ "block.gtceu.steel_turbine_casing":"钢涡轮机械方块", "block.gtceu.sterilizing_filter_casing":"除菌过滤器机械方块", "block.gtceu.stress_proof_casing":"耐压机械方块", + "block.gtceu.stripped_rubber_log":"去皮橡胶原木", + "block.gtceu.stripped_rubber_wood":"去皮橡胶木", "block.gtceu.sturdy_machine_casing":"坚固高速钢-E机械方块", "block.gtceu.superconducting_coil":"超导线圈方块", "block.gtceu.tempered_glass":"钢化玻璃", @@ -874,7 +976,16 @@ "block.gtceu.titanium_large_boiler":"大型钛锅炉", "block.gtceu.titanium_pipe_casing":"钛管道方块", "block.gtceu.titanium_turbine_casing":"钛涡轮机械方块", + "block.gtceu.treated_wood_button":"防腐木按钮", + "block.gtceu.treated_wood_door":"防腐木门", + "block.gtceu.treated_wood_fence":"防腐木栅栏", + "block.gtceu.treated_wood_fence_gate":"防腐木栅栏门", + "block.gtceu.treated_wood_hanging_sign":"悬挂式防腐木告示牌", "block.gtceu.treated_wood_planks":"防腐木板", + "block.gtceu.treated_wood_pressure_plate":"防腐木压力板", + "block.gtceu.treated_wood_slab":"防腐木台阶", + "block.gtceu.treated_wood_stairs":"防腐木楼梯", + "block.gtceu.treated_wood_trapdoor":"防腐木活板门", "block.gtceu.trinium_coil_block":"凯金线圈方块", "block.gtceu.tritanium_coil_block":"三钛线圈方块", "block.gtceu.tungsten_steel_crate":"钨钢板条箱", @@ -884,6 +995,7 @@ "block.gtceu.tungstensteel_large_boiler":"大型钨钢锅炉", "block.gtceu.tungstensteel_pipe_casing":"钨钢管道方块", "block.gtceu.tungstensteel_turbine_casing":"钨钢涡轮机械方块", + "block.gtceu.turret_hazard_sign_block":"炮塔危害警示方块", "block.gtceu.uev_1024a_laser_source_hatch":"1024安§aUEV§r激光源仓", "block.gtceu.uev_1024a_laser_target_hatch":"1024安§aUEV§r激光靶仓", "block.gtceu.uev_16a_energy_converter":"16安§aUEV§r能量转换器", @@ -1275,7 +1387,9 @@ "block.gtceu.uxv_wiremill":"§e史诗线材轧机 IV§r", "block.gtceu.vacuum_freezer":"真空冷冻机", "block.gtceu.vibration_safe_casing":"防震机械方块", + "block.gtceu.void_hazard_sign_block":"虚空危害警示方块", "block.gtceu.watertight_casing":"防水机械方块", + "block.gtceu.white_lamp":"白色灯", "block.gtceu.wire_coil.tooltip_cracking":"§8裂化机:", "block.gtceu.wire_coil.tooltip_energy_cracking":"§a耗能:§f%s%%", "block.gtceu.wire_coil.tooltip_energy_smelter":"§a耗能:§8每配方§f%s EU/t", @@ -1290,6 +1404,13 @@ "block.gtceu.wood_wall":"木壁", "block.gtceu.wooden_multiblock_tank":"木制多方块储罐", "block.gtceu.wooden_tank_valve":"木制储罐阀门", + "block.gtceu.yellow_lamp":"黄色灯", + "block.gtceu.yellow_stripes_block.a":"黄色路障方块", + "block.gtceu.yellow_stripes_block.b":"黄色路障方块", + "block.gtceu.yellow_stripes_block.c":"黄色路障方块", + "block.gtceu.yellow_stripes_block.d":"黄色路障方块", + "block.gtceu.yellow_stripes_block_a":"黄色路障方块A", + "block.gtceu.yellow_stripes_block_b":"黄色路障方块B", "block.gtceu.zpm_1024a_laser_source_hatch":"1024安§cZPM§r激光源仓", "block.gtceu.zpm_1024a_laser_target_hatch":"1024安§cZPM§r激光靶仓", "block.gtceu.zpm_16a_energy_converter":"16安§cZPM§r能量转换器", @@ -1316,7 +1437,7 @@ "block.gtceu.zpm_chemical_reactor":"§c精英化学反应釜 III§r", "block.gtceu.zpm_circuit_assembler":"§c精英电路组装机 III§r", "block.gtceu.zpm_compressor":"§c精英压缩机 III§r", - "block.gtceu.zpm_cutter":"§精英切割机 III§r", + "block.gtceu.zpm_cutter":"§c精英切割机 III§r", "block.gtceu.zpm_diode":"§cZPM§r二极管", "block.gtceu.zpm_distillery":"§c精英蒸馏室 III§r", "block.gtceu.zpm_electric_furnace":"§c精英电炉 III§r", @@ -1494,8 +1615,10 @@ "compass.node.gtceu.generation/rubber_log":"橡胶原木", "compass.node.gtceu.generation/rubber_planks":"橡胶木板", "compass.node.gtceu.generation/rubber_sapling":"橡胶树苗", + "compass.node.gtceu.generation/rubber_slab":"橡胶木台阶", "compass.node.gtceu.generation/sand":"沙子", "compass.node.gtceu.generation/stone":"石头", + "compass.node.gtceu.generation/treated_wood_slab":"防腐木台阶", "compass.node.gtceu.generation/tuff":"凝灰岩", "compass.node.gtceu.hv/cleanroom":"超净间", "compass.node.gtceu.hv/implosion_compressor":"聚爆压缩机", @@ -1843,8 +1966,8 @@ "config.gtceu.option.addLoot":"添加战利品", "config.gtceu.option.allUniqueStoneTypes":"所有独特石头类型", "config.gtceu.option.animationTime":"动画时间", + "config.gtceu.option.bedrockOreDistance":"基岩矿石距离", "config.gtceu.option.bedrockOreDropTagPrefix":"基岩矿石掉落Tag", - "config.gtceu.option.bedrockOreMultiplier":"基岩矿石乘数", "config.gtceu.option.casingsPerCraft":"每次合成机械方块数量", "config.gtceu.option.cleanMultiblocks":"多方块结构是否洁净", "config.gtceu.option.client":"客户端", @@ -1920,7 +2043,7 @@ "config.gtceu.option.rubberTreeSpawnChance":"橡胶树生成权重", "config.gtceu.option.sandOresFall":"沙子矿石受重力吗", "config.gtceu.option.sprayCanChainLength":"喷雾罐单次可喷涂长度", - "config.gtceu.option.steelSteamMultiblocks":"用钢的蒸汽多方块机器", + "config.gtceu.option.steelSteamMultiblocks":"用钢的蒸汽多方块结构", "config.gtceu.option.toolCraftingSounds":"使用工具合成时播放声音", "config.gtceu.option.toolUseSounds":"使用工具时播放声音", "config.gtceu.option.tools":"工具", @@ -2821,11 +2944,11 @@ "gtceu.machine.machine_hatch.processing_array":"当在§e处理阵列§7中时,仅可搭载适用于§e处理阵列§7的机器", "gtceu.machine.machine_hatch.tooltip":"仅可容纳有效物品的特型访问总线", "gtceu.machine.maintenance_hatch.tooltip":"用于给多方块结构提供维护", - "gtceu.machine.maintenance_hatch_cleanroom_auto.tooltip.0":"可以自动维修多方块机器,附带清洁功能!", + "gtceu.machine.maintenance_hatch_cleanroom_auto.tooltip.0":"可以自动维修多方块结构,附带清洁功能!", "gtceu.machine.maintenance_hatch_cleanroom_auto.tooltip.1":"清洁方式:", "gtceu.machine.maintenance_hatch_configurable.tooltip.0":"更精细的维修多方块结构", "gtceu.machine.maintenance_hatch_configurable.tooltip.1":"起手无需维护!", - "gtceu.machine.maintenance_hatch_full_auto.tooltip":"可以自动维修多方块机器", + "gtceu.machine.maintenance_hatch_full_auto.tooltip":"可以自动维修多方块结构", "gtceu.machine.maintenance_hatch_tape_slot.tooltip":"放入胶带以防止出现故障", "gtceu.machine.maintenance_hatch_tool_slot.tooltip":"所需工具处于物品栏时空手点击该槽位来进行维修", "gtceu.machine.me.export.tooltip":"在连接到ME网络之前,它具有无限容量。", @@ -2936,7 +3059,7 @@ "gtceu.machine.rotor_holder.tooltip.1":"提供支撑,固定转子使其不能飞走", "gtceu.machine.steam.steam_hatch.tooltip":"§e接受流体:§f蒸汽", "gtceu.machine.steam_boiler.heat_amount":"热容:%s %%", - "gtceu.machine.steam_bus.tooltip":"无法作用于非蒸汽驱动的多方块机器", + "gtceu.machine.steam_bus.tooltip":"无法作用于非蒸汽驱动的多方块结构", "gtceu.machine.steam_grinder.tooltip":"多方块研磨机,但是没有副产物", "gtceu.machine.steam_miner.tooltip":"§7只采掘机器下方的矿石!", "gtceu.machine.steam_oven.tooltip":"不要与工业熔炉混淆", @@ -3060,7 +3183,7 @@ "gtceu.maintenance.configurable_time.unchanged_description":"故障的发生几率为正常值。更改配置以更新。", "gtceu.mixer":"搅拌机", "gtceu.muffler.recovery_tooltip":"§b回收几率:§f%d%%", - "gtceu.multiblock.advanced_processing_array.description":"处理阵列可将最多 64 个单方块机器集成在一个多方块机器中,以实现更高效的自动化。", + "gtceu.multiblock.advanced_processing_array.description":"处理阵列可将最多 64 个单方块机器集成在一个多方块结构中,以实现更高效的自动化。", "gtceu.multiblock.assembly_line.description":"装配线是由5到16“片”组成的大型多方块结构。理论上,它是一个大型组装机,用于生产高级元件。", "gtceu.multiblock.blast_furnace.max_temperature":"热容:%s", "gtceu.multiblock.central_monitor.height":"屏幕高度:%d", @@ -3137,7 +3260,7 @@ "gtceu.multiblock.large_boiler.throttle":"节流:%d", "gtceu.multiblock.large_boiler.throttle.tooltip":"锅炉可以节流,以减少燃料消耗与蒸汽产出,并且不损失效率,不影响加热时间。", "gtceu.multiblock.large_boiler.throttle_modify":"修改节流:", - "gtceu.multiblock.large_chemical_reactor.description":"大型化学反应釜能够以 100% 的能效进行化学反应。超频将使得处理速度与耗能提升 4 倍。该多方块机器需要在中心位置的聚四氟乙烯管道方块旁放置 1 个白铜线圈方块。", + "gtceu.multiblock.large_chemical_reactor.description":"大型化学反应釜能够以 100% 的能效进行化学反应。超频将使得处理速度与耗能提升 4 倍。该多方块结构需要在中心位置的聚四氟乙烯管道方块旁放置 1 个白铜线圈方块。", "gtceu.multiblock.large_combustion_engine.boost_disallowed":"§b升级你的动力仓以激活氧气促燃", "gtceu.multiblock.large_combustion_engine.description":"大型内燃引擎是一种产出§5EV§r能量的多方块结构,工作方式与内燃发电机类似。", "gtceu.multiblock.large_combustion_engine.liquid_oxygen_amount":"液氧存量:%sL", @@ -3158,7 +3281,7 @@ "gtceu.multiblock.large_miner.vent":"排气口受阻!", "gtceu.multiblock.large_miner.working":"工作中……", "gtceu.multiblock.large_turbine.description":"大型涡轮是一种使用蒸汽、燃气或等离子体转动涡轮转子来发电的多方块结构。转子效率和转子转速影响能量的输出。", - "gtceu.multiblock.luv_fusion_reactor.description":"核聚变反应堆MK-I是台大型多方块机器,用于融合元素形成更重的元素。它仅可使用LuV,ZPM或UV等级的能源仓。每个能源仓可增加10MEU的能量缓存,最大能量缓存为160MEU。", + "gtceu.multiblock.luv_fusion_reactor.description":"核聚变反应堆MK-I是台大型多方块结构,用于融合元素形成更重的元素。它仅可使用LuV,ZPM或UV等级的能源仓。每个能源仓可增加10MEU的能量缓存,最大能量缓存为160MEU。", "gtceu.multiblock.max_energy_per_tick":"最大功率:§a%s EU/t(%s§r)", "gtceu.multiblock.max_energy_per_tick_amps":"最大功率:%s(%sA %s)", "gtceu.multiblock.max_energy_per_tick_hover":"可用于运行配方或超频的最大EU/t", @@ -3177,6 +3300,9 @@ "gtceu.multiblock.network_switch.description":"网络交换机是个多方块结构,可以接受任意数量的算力数据靶仓输入,并从任意数量的算力数据源仓输出。对于需要更高算力的研究数据配方,网络交换机的存在是必要的,这是因为研究站只接受一个算力数据靶仓。当与HPCA连接时,HPCA必须具有桥接组件才可以令网络交换机接收其算力。", "gtceu.multiblock.not_enough_energy":"警告:能量不足。", "gtceu.multiblock.not_enough_energy_output":"警告:能源/动力仓等级过低!", + "gtceu.multiblock.ore_rig.drilled_ore_entry":" - %s", + "gtceu.multiblock.ore_rig.drilled_ores_list":"矿石:", + "gtceu.multiblock.ore_rig.ore_amount":"钻进速率:%s", "gtceu.multiblock.page_switcher.io.both":"§5兼顾输入/输出", "gtceu.multiblock.page_switcher.io.export":"§4输出", "gtceu.multiblock.page_switcher.io.import":"§2输入", @@ -3197,8 +3323,10 @@ "gtceu.multiblock.pattern.location_end":"§c最末端§r", "gtceu.multiblock.pattern.replaceable_air":"可为空气", "gtceu.multiblock.pattern.single":"§6仅可使用该种方块§r", - "gtceu.multiblock.power_substation.average_io":"平均输入/输出:%s EU/t", - "gtceu.multiblock.power_substation.average_io_hover":"蓄能变电站内部的平均能量变化", + "gtceu.multiblock.power_substation.average_in":"平均输入:%s EU/t", + "gtceu.multiblock.power_substation.average_in_hover":"蓄能变电站内部的平均功率输入", + "gtceu.multiblock.power_substation.average_out":"平均输出:%s EU/t", + "gtceu.multiblock.power_substation.average_out_hover":"蓄能变电站内部的平均功率输出", "gtceu.multiblock.power_substation.capacity":"容量:%s EU", "gtceu.multiblock.power_substation.passive_drain":"被动损失:%s EU/t", "gtceu.multiblock.power_substation.stored":"存储:%s EU", @@ -3231,7 +3359,7 @@ "gtceu.multiblock.primitive_water_pump.extra2.3":"§7LV§r输出仓:4x", "gtceu.multiblock.primitive_water_pump.extra2.4":"", "gtceu.multiblock.primitive_water_pump.extra2.5":"当水泵所处的生物群系下雨时,总产水量将增加50%%。", - "gtceu.multiblock.processing_array.description":"处理阵列可将最多 16 个单方块机器集成在一个多方块机器中,以实现更高效的自动化。", + "gtceu.multiblock.processing_array.description":"处理阵列可将最多 16 个单方块机器集成在一个多方块结构中,以实现更高效的自动化。", "gtceu.multiblock.progress":"进度:%s%%", "gtceu.multiblock.pyrolyse_oven.description":"热解炉是一种用于将原木处理为木炭、杂酚油、灰烬或重油的多方块结构。", "gtceu.multiblock.pyrolyse_oven.speed":"处理速度:%s%%", @@ -3268,12 +3396,12 @@ "gtceu.multiblock.universal.problem.soft_mallet":"%s§7有什么东西卡住了。(§a软锤§r)", "gtceu.multiblock.universal.problem.wire_cutter":"%s§7有几根线烧焦了(§a剪线钳§r)", "gtceu.multiblock.universal.problem.wrench":"%s§7管道松动了。(§a扳手§r)", - "gtceu.multiblock.uv_fusion_reactor.description":"核聚变反应堆MK-III是台大型多方块机器,用于融合元素形成更重的元素。它仅可使用UV等级的能源仓。每个能源仓可增加40MEU的能量缓存,最大能量缓存为640MEU。", + "gtceu.multiblock.uv_fusion_reactor.description":"核聚变反应堆MK-III是台大型多方块结构,用于融合元素形成更重的元素。它仅可使用UV等级的能源仓。每个能源仓可增加40MEU的能量缓存,最大能量缓存为640MEU。", "gtceu.multiblock.vacuum_freezer.description":"真空冷冻机是一种多方块结构,主要用于将热锭冷却为成品锭。此外,它还可以冻结水等其他物质。", "gtceu.multiblock.validation_failed":"输入仓/输出仓数量无效。", "gtceu.multiblock.waiting":"警告:机器待机", "gtceu.multiblock.work_paused":"暂停。", - "gtceu.multiblock.zpm_fusion_reactor.description":"核聚变反应堆MK-II是台大型多方块机器,用于融合元素形成更重的元素。它仅可使用ZPM或UV等级的能源仓。每个能源仓可增加20MEU的能量缓存,最大能量缓存为320MEU。", + "gtceu.multiblock.zpm_fusion_reactor.description":"核聚变反应堆MK-II是台大型多方块结构,用于融合元素形成更重的元素。它仅可使用ZPM或UV等级的能源仓。每个能源仓可增加20MEU的能量缓存,最大能量缓存为320MEU。", "gtceu.oc.tooltip.0":"最低:%s", "gtceu.oc.tooltip.1":"左键单击增加超频等级", "gtceu.oc.tooltip.2":"右键单击降低超频等级", @@ -3408,7 +3536,7 @@ "gtceu.universal.tooltip.base_production_eut":"§e基础产能功率:§f%d EU/t", "gtceu.universal.tooltip.base_production_fluid":"§e基础产出速率:§f%d L/t", "gtceu.universal.tooltip.chunk_mode":"区块模式:", - "gtceu.universal.tooltip.deprecated":"§5警告:已弃用。将在未来版本中移除§r", + "gtceu.universal.tooltip.deprecated":"§4§l警告:§r§4已弃用。将在未来版本中移除。§r", "gtceu.universal.tooltip.energy_storage_capacity":"§c能量缓存:§r%d EU", "gtceu.universal.tooltip.energy_tier_range":"§a适配电压等级:§f%s§f-%s", "gtceu.universal.tooltip.fluid_storage_capacity":"§9流体容量:§f%d L", @@ -5165,12 +5293,15 @@ "tagprefix.deepslate":"深板岩%s矿石", "tagprefix.dense_plate":"致密%s板", "tagprefix.diorite":"闪长岩%s矿石", + "tagprefix.door":"%s门", "tagprefix.double_plate":"双层%s板", "tagprefix.drill_head":"%s钻头", "tagprefix.dust":"%s粉", "tagprefix.dye":"%s染料", "tagprefix.endstone":"末地石%s矿石", "tagprefix.exquisite_gem":"精致的%s", + "tagprefix.fence":"%s栅栏", + "tagprefix.fence_gate":"%s栅栏门", "tagprefix.fine_wire":"细%s导线", "tagprefix.flawed_gem":"有瑕的%s", "tagprefix.flawless_gem":"无瑕的%s", @@ -5184,6 +5315,7 @@ "tagprefix.impure_dust":"含杂%s粉", "tagprefix.ingot":"%s锭", "tagprefix.lens":"%s透镜", + "tagprefix.log":"%s原木", "tagprefix.long_rod":"长%s杆", "tagprefix.netherrack":"下界岩%s矿石", "tagprefix.nugget":"%s粒", @@ -5227,10 +5359,12 @@ "tagprefix.sand":"沙子%s矿石", "tagprefix.screw":"%s螺丝", "tagprefix.screwdriver_tip":"%s螺丝刀刀头", + "tagprefix.slab":"%s台阶", "tagprefix.small_dust":"小堆%s粉", "tagprefix.small_gear":"小型%s齿轮", "tagprefix.small_spring":"小型%s弹簧", "tagprefix.spring":"%s弹簧", + "tagprefix.stairs":"%s楼梯", "tagprefix.stone":"%s矿石", "tagprefix.tiny_dust":"小撮%s粉", "tagprefix.tuff":"凝灰岩%s矿石", diff --git a/src/main/resources/assets/gtceu/models/block/rubber_door.json b/src/main/resources/assets/gtceu/models/block/rubber_door.json deleted file mode 100644 index 5807e15326..0000000000 --- a/src/main/resources/assets/gtceu/models/block/rubber_door.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "minecraft:block/door", - "textures": { - "bottom": "gtceu:block/rubber_door_bottom", - "top": "gtceu:block/rubber_door_top" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/block/rubber_fence.json b/src/main/resources/assets/gtceu/models/block/rubber_fence.json deleted file mode 100644 index c9839cb9ab..0000000000 --- a/src/main/resources/assets/gtceu/models/block/rubber_fence.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:block/fence", - "textures": { - "texture": "gtceu:block/rubber_planks" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/block/treated_wood_door.json b/src/main/resources/assets/gtceu/models/block/treated_wood_door.json deleted file mode 100644 index 27ab12c7ed..0000000000 --- a/src/main/resources/assets/gtceu/models/block/treated_wood_door.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "minecraft:block/door", - "textures": { - "bottom": "gtceu:block/treated_wood_door_bottom", - "top": "gtceu:block/treated_wood_door_top" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/block/treated_wood_fence.json b/src/main/resources/assets/gtceu/models/block/treated_wood_fence.json deleted file mode 100644 index 56549e2ad8..0000000000 --- a/src/main/resources/assets/gtceu/models/block/treated_wood_fence.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:block/fence", - "textures": { - "texture": "gtceu:block/treated_wood_fence" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/item/aluminium_fluid_cell.json b/src/main/resources/assets/gtceu/models/item/aluminium_fluid_cell.json new file mode 100644 index 0000000000..a34f1e9156 --- /dev/null +++ b/src/main/resources/assets/gtceu/models/item/aluminium_fluid_cell.json @@ -0,0 +1,10 @@ +{ + "loader": "forge:fluid_container", + "parent": "forge:item/default", + "textures": { + "base": "gtceu:item/aluminium_fluid_cell/base", + "fluid": "gtceu:item/aluminium_fluid_cell/overlay", + "cover": "gtceu:item/aluminium_fluid_cell/base" + }, + "fluid": "minecraft:empty" +} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/item/fluid_cell.json b/src/main/resources/assets/gtceu/models/item/fluid_cell.json new file mode 100644 index 0000000000..291326f879 --- /dev/null +++ b/src/main/resources/assets/gtceu/models/item/fluid_cell.json @@ -0,0 +1,10 @@ +{ + "loader": "forge:fluid_container", + "parent": "forge:item/default", + "textures": { + "base": "gtceu:item/fluid_cell/base", + "fluid": "gtceu:item/fluid_cell/overlay", + "cover": "gtceu:item/fluid_cell/base" + }, + "fluid": "minecraft:empty" +} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/item/glass_vial.json b/src/main/resources/assets/gtceu/models/item/glass_vial.json new file mode 100644 index 0000000000..7bc27963d8 --- /dev/null +++ b/src/main/resources/assets/gtceu/models/item/glass_vial.json @@ -0,0 +1,10 @@ +{ + "loader": "forge:fluid_container", + "parent": "forge:item/default", + "textures": { + "base": "gtceu:item/glass_vial/base", + "fluid": "gtceu:item/glass_vial/overlay", + "cover": "gtceu:item/glass_vial/base" + }, + "fluid": "minecraft:empty" +} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/item/liquid_fuel_jetpack.json b/src/main/resources/assets/gtceu/models/item/liquid_fuel_jetpack.json new file mode 100644 index 0000000000..f78691968c --- /dev/null +++ b/src/main/resources/assets/gtceu/models/item/liquid_fuel_jetpack.json @@ -0,0 +1,10 @@ +{ + "loader": "forge:fluid_container", + "parent": "forge:item/default", + "textures": { + "base": "gtceu:item/liquid_fuel_jetpack/base", + "fluid": "gtceu:item/liquid_fuel_jetpack/overlay", + "cover": "gtceu:item/liquid_fuel_jetpack/base" + }, + "fluid": "minecraft:empty" +} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/item/stainless_steel_fluid_cell.json b/src/main/resources/assets/gtceu/models/item/stainless_steel_fluid_cell.json new file mode 100644 index 0000000000..c17aa15f74 --- /dev/null +++ b/src/main/resources/assets/gtceu/models/item/stainless_steel_fluid_cell.json @@ -0,0 +1,10 @@ +{ + "loader": "forge:fluid_container", + "parent": "forge:item/default", + "textures": { + "base": "gtceu:item/stainless_steel_fluid_cell/base", + "fluid": "gtceu:item/stainless_steel_fluid_cell/overlay", + "cover": "gtceu:item/stainless_steel_fluid_cell/base" + }, + "fluid": "minecraft:empty" +} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/item/steel_fluid_cell.json b/src/main/resources/assets/gtceu/models/item/steel_fluid_cell.json new file mode 100644 index 0000000000..595ed11f34 --- /dev/null +++ b/src/main/resources/assets/gtceu/models/item/steel_fluid_cell.json @@ -0,0 +1,10 @@ +{ + "loader": "forge:fluid_container", + "parent": "forge:item/default", + "textures": { + "base": "gtceu:item/steel_fluid_cell/base", + "fluid": "gtceu:item/steel_fluid_cell/overlay", + "cover": "gtceu:item/steel_fluid_cell/base" + }, + "fluid": "minecraft:empty" +} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/item/titanium_fluid_cell.json b/src/main/resources/assets/gtceu/models/item/titanium_fluid_cell.json new file mode 100644 index 0000000000..457126bc8c --- /dev/null +++ b/src/main/resources/assets/gtceu/models/item/titanium_fluid_cell.json @@ -0,0 +1,10 @@ +{ + "loader": "forge:fluid_container", + "parent": "forge:item/default", + "textures": { + "base": "gtceu:item/titanium_fluid_cell/base", + "fluid": "gtceu:item/titanium_fluid_cell/overlay", + "cover": "gtceu:item/titanium_fluid_cell/base" + }, + "fluid": "minecraft:empty" +} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/item/tungstensteel_fluid_cell.json b/src/main/resources/assets/gtceu/models/item/tungstensteel_fluid_cell.json new file mode 100644 index 0000000000..9bc40db57d --- /dev/null +++ b/src/main/resources/assets/gtceu/models/item/tungstensteel_fluid_cell.json @@ -0,0 +1,10 @@ +{ + "loader": "forge:fluid_container", + "parent": "forge:item/default", + "textures": { + "base": "gtceu:item/tungstensteel_fluid_cell/base", + "fluid": "gtceu:item/tungstensteel_fluid_cell/overlay", + "cover": "gtceu:item/tungstensteel_fluid_cell/base" + }, + "fluid": "minecraft:empty" +} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/models/item/universal_fluid_cell.json b/src/main/resources/assets/gtceu/models/item/universal_fluid_cell.json new file mode 100644 index 0000000000..8f0f6d30b3 --- /dev/null +++ b/src/main/resources/assets/gtceu/models/item/universal_fluid_cell.json @@ -0,0 +1,10 @@ +{ + "loader": "forge:fluid_container", + "parent": "forge:item/default", + "textures": { + "base": "gtceu:item/universal_fluid_cell/base", + "fluid": "gtceu:item/universal_fluid_cell/overlay", + "cover": "gtceu:item/universal_fluid_cell/base" + }, + "fluid": "minecraft:empty" +} \ No newline at end of file diff --git a/src/main/resources/assets/gtceu/textures/block/industrial_tnt_side.png b/src/main/resources/assets/gtceu/textures/block/industrial_tnt_side.png new file mode 100644 index 0000000000..5a3264a98c Binary files /dev/null and b/src/main/resources/assets/gtceu/textures/block/industrial_tnt_side.png differ diff --git a/src/main/resources/assets/gtceu/textures/block/powderbarrel.png b/src/main/resources/assets/gtceu/textures/block/powderbarrel.png new file mode 100644 index 0000000000..811df8942d Binary files /dev/null and b/src/main/resources/assets/gtceu/textures/block/powderbarrel.png differ diff --git a/src/main/resources/assets/gtceu/textures/block/treated_wood_door.png b/src/main/resources/assets/gtceu/textures/block/treated_wood_door.png deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/main/resources/assets/gtceu/textures/block/treated_wood_door_bottom.png b/src/main/resources/assets/gtceu/textures/block/treated_wood_door_bottom.png new file mode 100644 index 0000000000..4e4925bd44 Binary files /dev/null and b/src/main/resources/assets/gtceu/textures/block/treated_wood_door_bottom.png differ diff --git a/src/main/resources/assets/gtceu/textures/block/treated_wood_door_top.png b/src/main/resources/assets/gtceu/textures/block/treated_wood_door_top.png new file mode 100644 index 0000000000..aaad6e3e12 Binary files /dev/null and b/src/main/resources/assets/gtceu/textures/block/treated_wood_door_top.png differ diff --git a/src/main/resources/assets/gtceu/textures/block/treated_wood_hanging_sign.png b/src/main/resources/assets/gtceu/textures/block/treated_wood_hanging_sign.png index e69de29bb2..f8085eba53 100644 Binary files a/src/main/resources/assets/gtceu/textures/block/treated_wood_hanging_sign.png and b/src/main/resources/assets/gtceu/textures/block/treated_wood_hanging_sign.png differ diff --git a/src/main/resources/assets/gtceu/textures/block/treated_wood_planks.png b/src/main/resources/assets/gtceu/textures/block/treated_wood_planks.png index 97658eb696..bdb48c6db0 100644 Binary files a/src/main/resources/assets/gtceu/textures/block/treated_wood_planks.png and b/src/main/resources/assets/gtceu/textures/block/treated_wood_planks.png differ diff --git a/src/main/resources/assets/gtceu/textures/block/treated_wood_sign.png b/src/main/resources/assets/gtceu/textures/block/treated_wood_sign.png deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/main/resources/assets/gtceu/textures/block/treated_wood_top.png b/src/main/resources/assets/gtceu/textures/block/treated_wood_top.png deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/main/resources/assets/gtceu/textures/block/treated_wood_trapdoor.png b/src/main/resources/assets/gtceu/textures/block/treated_wood_trapdoor.png index e69de29bb2..b5837cd56c 100644 Binary files a/src/main/resources/assets/gtceu/textures/block/treated_wood_trapdoor.png and b/src/main/resources/assets/gtceu/textures/block/treated_wood_trapdoor.png differ diff --git a/src/main/resources/assets/gtceu/textures/block/treated_wood_wall_hanging_sign.png b/src/main/resources/assets/gtceu/textures/block/treated_wood_wall_hanging_sign.png deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/main/resources/assets/gtceu/textures/block/treated_wood_wall_sign.png b/src/main/resources/assets/gtceu/textures/block/treated_wood_wall_sign.png deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/main/resources/assets/gtceu/textures/entity/signs/hanging/treated_wood.png b/src/main/resources/assets/gtceu/textures/entity/signs/hanging/treated_wood.png new file mode 100644 index 0000000000..a46473687a Binary files /dev/null and b/src/main/resources/assets/gtceu/textures/entity/signs/hanging/treated_wood.png differ diff --git a/src/main/resources/assets/gtceu/textures/entity/signs/treated_wood.png b/src/main/resources/assets/gtceu/textures/entity/signs/treated_wood.png new file mode 100644 index 0000000000..7b035c470d Binary files /dev/null and b/src/main/resources/assets/gtceu/textures/entity/signs/treated_wood.png differ diff --git a/src/main/resources/assets/gtceu/textures/item/qts_advanced_chestplate.png b/src/main/resources/assets/gtceu/textures/item/advanced_quarktech_chestplate.png similarity index 100% rename from src/main/resources/assets/gtceu/textures/item/qts_advanced_chestplate.png rename to src/main/resources/assets/gtceu/textures/item/advanced_quarktech_chestplate.png diff --git a/src/main/resources/assets/gtceu/textures/item/nms_advanced_chestplate.png b/src/main/resources/assets/gtceu/textures/item/avanced_nanomuscle_chestplate.png similarity index 100% rename from src/main/resources/assets/gtceu/textures/item/nms_advanced_chestplate.png rename to src/main/resources/assets/gtceu/textures/item/avanced_nanomuscle_chestplate.png diff --git a/src/main/resources/assets/gtceu/textures/item/nms_boots.png b/src/main/resources/assets/gtceu/textures/item/nanomuscle_boots.png similarity index 100% rename from src/main/resources/assets/gtceu/textures/item/nms_boots.png rename to src/main/resources/assets/gtceu/textures/item/nanomuscle_boots.png diff --git a/src/main/resources/assets/gtceu/textures/item/nms_chestplate.png b/src/main/resources/assets/gtceu/textures/item/nanomuscle_chestplate.png similarity index 100% rename from src/main/resources/assets/gtceu/textures/item/nms_chestplate.png rename to src/main/resources/assets/gtceu/textures/item/nanomuscle_chestplate.png diff --git a/src/main/resources/assets/gtceu/textures/item/nms_helmet.png b/src/main/resources/assets/gtceu/textures/item/nanomuscle_helmet.png similarity index 100% rename from src/main/resources/assets/gtceu/textures/item/nms_helmet.png rename to src/main/resources/assets/gtceu/textures/item/nanomuscle_helmet.png diff --git a/src/main/resources/assets/gtceu/textures/item/nms_leggings.png b/src/main/resources/assets/gtceu/textures/item/nanomuscle_leggings.png similarity index 100% rename from src/main/resources/assets/gtceu/textures/item/nms_leggings.png rename to src/main/resources/assets/gtceu/textures/item/nanomuscle_leggings.png diff --git a/src/main/resources/assets/gtceu/textures/item/qts_boots.png b/src/main/resources/assets/gtceu/textures/item/quarktech_boots.png similarity index 100% rename from src/main/resources/assets/gtceu/textures/item/qts_boots.png rename to src/main/resources/assets/gtceu/textures/item/quarktech_boots.png diff --git a/src/main/resources/assets/gtceu/textures/item/qts_chestplate.png b/src/main/resources/assets/gtceu/textures/item/quarktech_chestplate.png similarity index 100% rename from src/main/resources/assets/gtceu/textures/item/qts_chestplate.png rename to src/main/resources/assets/gtceu/textures/item/quarktech_chestplate.png diff --git a/src/main/resources/assets/gtceu/textures/item/qts_helmet.png b/src/main/resources/assets/gtceu/textures/item/quarktech_helmet.png similarity index 100% rename from src/main/resources/assets/gtceu/textures/item/qts_helmet.png rename to src/main/resources/assets/gtceu/textures/item/quarktech_helmet.png diff --git a/src/main/resources/assets/gtceu/textures/item/qts_leggings.png b/src/main/resources/assets/gtceu/textures/item/quarktech_leggings.png similarity index 100% rename from src/main/resources/assets/gtceu/textures/item/qts_leggings.png rename to src/main/resources/assets/gtceu/textures/item/quarktech_leggings.png diff --git a/src/main/resources/assets/gtceu/textures/item/treated_wood_door.png b/src/main/resources/assets/gtceu/textures/item/treated_wood_door.png new file mode 100644 index 0000000000..8af1640793 Binary files /dev/null and b/src/main/resources/assets/gtceu/textures/item/treated_wood_door.png differ diff --git a/src/main/resources/assets/gtceu/textures/item/treated_wood_hanging_sign.png b/src/main/resources/assets/gtceu/textures/item/treated_wood_hanging_sign.png new file mode 100644 index 0000000000..608c1e863d Binary files /dev/null and b/src/main/resources/assets/gtceu/textures/item/treated_wood_hanging_sign.png differ diff --git a/src/main/resources/assets/gtceu/textures/item/treated_wood_sign.png b/src/main/resources/assets/gtceu/textures/item/treated_wood_sign.png new file mode 100644 index 0000000000..526817b13c Binary files /dev/null and b/src/main/resources/assets/gtceu/textures/item/treated_wood_sign.png differ diff --git a/src/main/resources/gtceu.accesswidener b/src/main/resources/gtceu.accesswidener deleted file mode 100644 index ebd7e09361..0000000000 --- a/src/main/resources/gtceu.accesswidener +++ /dev/null @@ -1,40 +0,0 @@ -accessWidener v2 named - -accessible field net/minecraft/world/level/levelgen/placement/HeightRangePlacement height Lnet/minecraft/world/level/levelgen/heightproviders/HeightProvider; -accessible field net/minecraft/world/level/levelgen/heightproviders/UniformHeight minInclusive Lnet/minecraft/world/level/levelgen/VerticalAnchor; -accessible field net/minecraft/world/level/levelgen/heightproviders/UniformHeight maxInclusive Lnet/minecraft/world/level/levelgen/VerticalAnchor; - -accessible method net/minecraft/data/loot/BlockLootSubProvider createSingleItemTable (Lnet/minecraft/world/level/ItemLike;Lnet/minecraft/world/level/storage/loot/providers/number/NumberProvider;)Lnet/minecraft/world/level/storage/loot/LootTable$Builder; -accessible method net/minecraft/data/loot/BlockLootSubProvider applyExplosionDecay (Lnet/minecraft/world/level/ItemLike;Lnet/minecraft/world/level/storage/loot/functions/FunctionUserBuilder;)Lnet/minecraft/world/level/storage/loot/functions/FunctionUserBuilder; -accessible method net/minecraft/data/loot/BlockLootSubProvider createSilkTouchDispatchTable (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/storage/loot/entries/LootPoolEntryContainer$Builder;)Lnet/minecraft/world/level/storage/loot/LootTable$Builder; -accessible method net/minecraft/data/loot/BlockLootSubProvider createLeavesDrops (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/Block;[F)Lnet/minecraft/world/level/storage/loot/LootTable$Builder; -accessible field net/minecraft/data/loot/BlockLootSubProvider HAS_NO_SILK_TOUCH Lnet/minecraft/world/level/storage/loot/predicates/LootItemCondition$Builder; -accessible method net/minecraft/world/level/storage/loot/entries/LootItem (Lnet/minecraft/world/item/Item;II[Lnet/minecraft/world/level/storage/loot/predicates/LootItemCondition;[Lnet/minecraft/world/level/storage/loot/functions/LootItemFunction;)V - -accessible method net/minecraft/data/models/BlockModelGenerators createFacingDispatch ()Lnet/minecraft/data/models/blockstates/PropertyDispatch; -accessible method net/minecraft/data/models/BlockModelGenerators createSimpleBlock (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/data/models/blockstates/MultiVariantGenerator; - -extendable method net/minecraft/server/packs/resources/SimplePreparableReloadListener reload (Lnet/minecraft/server/packs/resources/PreparableReloadListener$PreparationBarrier;Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/util/profiling/ProfilerFiller;Lnet/minecraft/util/profiling/ProfilerFiller;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture; -accessible method net/minecraft/data/models/model/TextureSlot create (Ljava/lang/String;)Lnet/minecraft/data/models/model/TextureSlot; -accessible method net/minecraft/data/models/model/TexturedModel createDefault (Ljava/util/function/Function;Lnet/minecraft/data/models/model/ModelTemplate;)Lnet/minecraft/data/models/model/TexturedModel$Provider; - -accessible field net/minecraft/world/item/HoeItem TILLABLES Ljava/util/Map; -accessible field net/minecraft/world/item/ShovelItem FLATTENABLES Ljava/util/Map; -accessible field net/minecraft/world/item/AxeItem STRIPPABLES Ljava/util/Map; - - - - -accessible method net/minecraft/world/level/block/state/properties/BlockSetType register (Lnet/minecraft/world/level/block/state/properties/BlockSetType;)Lnet/minecraft/world/level/block/state/properties/BlockSetType; - -accessible method net/minecraft/world/level/block/state/properties/WoodType register (Lnet/minecraft/world/level/block/state/properties/WoodType;)Lnet/minecraft/world/level/block/state/properties/WoodType; -accessible field net/minecraft/world/item/Item BASE_ATTACK_DAMAGE_UUID Ljava/util/UUID; -accessible field net/minecraft/world/item/Item BASE_ATTACK_SPEED_UUID Ljava/util/UUID; -accessible method net/minecraft/world/entity/LivingEntity breakItem (Lnet/minecraft/world/item/ItemStack;)V -accessible method net/minecraft/world/item/context/UseOnContext getHitResult ()Lnet/minecraft/world/phys/BlockHitResult; - -accessible field net/minecraft/world/item/crafting/ShapedRecipe result Lnet/minecraft/world/item/ItemStack; - -accessible method net/minecraft/world/level/block/Block popExperience (Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/core/BlockPos;I)V - -accessible field net/minecraft/world/entity/item/ItemEntity pickupDelay I diff --git a/src/main/resources/gtceu.mixins.json b/src/main/resources/gtceu.mixins.json index 61dc86f260..42b64213e8 100644 --- a/src/main/resources/gtceu.mixins.json +++ b/src/main/resources/gtceu.mixins.json @@ -6,6 +6,7 @@ "plugin": "com.gregtechceu.gtceu.core.mixins.GregTechMixinPlugin", "client": [ "BlockModelMixin", + "ForgeGuiMixin", "ItemRendererMixin", "LevelRendererMixin", "ModelManagerMixin", @@ -18,23 +19,28 @@ "BlockPropertiesAccessor", "ChunkGeneratorMixin", "ChunkMixin", + "EntityMixin", "IFoliagePlacerTypeAccessor", "IHolderReferenceAccessor", "IngredientAccessor", "IntersectionIngredientAccessor", "InventoryMixin", + "ItemAccessor", "ItemValueAccessor", "ITrunkPlacerTypeAccessor", "LevelMixin", + "LivingEntityMixin", "LootDataManagerMixin", "LootPoolAccessor", "OreConfigurationMixin", "OreVeinifierMixin", + "PrimedTntAccessor", "RecipeManagerAccessor", "RecipeManagerInvoker", "RecipeManagerMixin", "RepairItemRecipeMixin", "ServerChunkProviderMixin", + "ServerGamePacketListenerImplAccessor", "ShapedRecipeAccessor", "SidedRedstoneConnectivityMixin", "StrictNBTIngredientAccessor",