Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.20.1-magic-energy-absorber' in…
Browse files Browse the repository at this point in the history
…to 1.20.1-magic-energy-absorber
  • Loading branch information
omergunr100 committed Nov 17, 2024
2 parents 622441b + 24e94be commit 529dd02
Show file tree
Hide file tree
Showing 44 changed files with 466 additions and 145 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ChangeLog

## Version [v1.5.3](https://github.com/GregTechCEu/GregTech-Modern/compare/v1.5.2-1.20.1...v1.5.3-1.20.1)
### Fixed

- Fixed recipe deserialization again so that both SP and MP worlds load ([#2376](https://github.com/GregTechCEu/GregTech-Modern/pull/2376))

## Version [v1.5.2](https://github.com/GregTechCEu/GregTech-Modern/compare/v1.5.1-1.20.1...v1.5.2-1.20.1)
### Added

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx6G
# Mod Info
mod_id = gtceu
mod_name = GregTech
mod_version = 1.5.3
mod_version = 1.5.4
mod_description = GregTech CE Unofficial, ported from 1.12.2
mod_license = LGPL-3.0 license
mod_url = https://github.com/GregTechCEu/GregTech-Modern/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"gtceu:lv_fisher",
"gtceu:mv_fisher",
"gtceu:hv_fisher",
"gtceu:ev_fisher"
"gtceu:ev_fisher",
"gtceu:iv_fisher",
"gtceu:luv_fisher"
],
"page": "gtceu:machines/fisher",
"position": [
Expand Down
21 changes: 13 additions & 8 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@
"block.gtceu.iv_extractor": "ɹ§ ɹoʇɔɐɹʇxƎ ǝʇıןƎ6§",
"block.gtceu.iv_extruder": "ɹ§ ɹǝpnɹʇxƎ ǝʇıןƎ6§",
"block.gtceu.iv_fermenter": "ɹ§ ɹǝʇuǝɯɹǝℲ ǝʇıןƎ6§",
"block.gtceu.iv_fisher": "ɹ§ ɹǝɥsıℲ ǝʇıןƎ6§",
"block.gtceu.iv_fluid_heater": "ɹ§ ɹǝʇɐǝH pınןℲ ǝʇıןƎ6§",
"block.gtceu.iv_fluid_passthrough_hatch": "ɥɔʇɐH ɥbnoɹɥʇssɐԀ pınןℲ ΛI6§",
"block.gtceu.iv_fluid_solidifier": "ɹ§ ɹǝıɟıpıןoS pınןℲ ǝʇıןƎ6§",
Expand Down Expand Up @@ -630,6 +631,7 @@
"block.gtceu.luv_extractor": "ɹ§II ɹoʇɔɐɹʇxƎ ǝʇıןƎp§",
"block.gtceu.luv_extruder": "ɹ§II ɹǝpnɹʇxƎ ǝʇıןƎp§",
"block.gtceu.luv_fermenter": "ɹ§II ɹǝʇuǝɯɹǝℲ ǝʇıןƎp§",
"block.gtceu.luv_fisher": "ɹ§II ɹǝɥsıℲ ǝʇıןƎp§",
"block.gtceu.luv_fluid_heater": "ɹ§II ɹǝʇɐǝH pınןℲ ǝʇıןƎp§",
"block.gtceu.luv_fluid_passthrough_hatch": "ɥɔʇɐH ɥbnoɹɥʇssɐԀ pınןℲ ΛnꞀp§",
"block.gtceu.luv_fluid_solidifier": "ɹ§II ɹǝıɟıpıןoS pınןℲ ǝʇıןƎp§",
Expand Down Expand Up @@ -2248,15 +2250,14 @@
"config.gtceu.option.disableManualCompression": "uoıssǝɹdɯoƆןɐnuɐWǝןqɐsıp",
"config.gtceu.option.doBedrockOres": "sǝɹOʞɔoɹpǝᗺop",
"config.gtceu.option.doSuperflatOres": "sǝɹOʇɐןɟɹǝdnSop",
"config.gtceu.option.doTerrainExplosion": "uoısoןdxƎuıɐɹɹǝ⟘op",
"config.gtceu.option.doesExplosionDamagesTerrain": "uıɐɹɹǝ⟘sǝbɐɯɐᗡuoısoןdxƎsǝop",
"config.gtceu.option.dumpAssets": "sʇǝssⱯdɯnp",
"config.gtceu.option.dumpRecipes": "sǝdıɔǝᴚdɯnp",
"config.gtceu.option.enableCleanroom": "ɯooɹuɐǝןƆǝןqɐuǝ",
"config.gtceu.option.enableCompass": "ssɐdɯoƆǝןqɐuǝ",
"config.gtceu.option.enableFEConverters": "sɹǝʇɹǝʌuoƆƎℲǝןqɐuǝ",
"config.gtceu.option.enableMaintenance": "ǝɔuɐuǝʇuıɐWǝןqɐuǝ",
"config.gtceu.option.enableMoreDualHatchAbility": "ʎʇıןıqⱯɥɔʇɐHןɐnᗡǝɹoWǝןqɐuǝ",
"config.gtceu.option.enablePlatformConverters": "sɹǝʇɹǝʌuoƆɯɹoɟʇɐןԀǝןqɐuǝ",
"config.gtceu.option.enableResearch": "ɥɔɹɐǝsǝᴚǝןqɐuǝ",
"config.gtceu.option.enableTieredCasings": "sbuısɐƆpǝɹǝı⟘ǝןqɐuǝ",
"config.gtceu.option.enableWorldAccelerators": "sɹoʇɐɹǝןǝɔɔⱯpןɹoMǝןqɐuǝ",
Expand All @@ -2266,7 +2267,8 @@
"config.gtceu.option.energyUsageMultiplier": "ɹǝıןdıʇןnWǝbɐs∩ʎbɹǝuǝ",
"config.gtceu.option.environmentalHazardDecayRate": "ǝʇɐᴚʎɐɔǝᗡpɹɐzɐHןɐʇuǝɯuoɹıʌuǝ",
"config.gtceu.option.environmentalHazards": "spɹɐzɐHןɐʇuǝɯuoɹıʌuǝ",
"config.gtceu.option.euToPlatformRatio": "oıʇɐᴚɯɹoɟʇɐןԀo⟘nǝ",
"config.gtceu.option.euToFeRatio": "oıʇɐᴚǝℲo⟘nǝ",
"config.gtceu.option.feToEuRatio": "oıʇɐᴚnƎo⟘ǝɟ",
"config.gtceu.option.flintAndSteelRequireSteel": "ןǝǝʇSǝɹınbǝᴚןǝǝʇSpuⱯʇuıןɟ",
"config.gtceu.option.gameplay": "ʎɐןdǝɯɐb",
"config.gtceu.option.generateLowQualityGems": "sɯǝ⅁ʎʇıןɐnὉʍoꞀǝʇɐɹǝuǝb",
Expand All @@ -2287,8 +2289,8 @@
"config.gtceu.option.harderRods": "spoᴚɹǝpɹɐɥ",
"config.gtceu.option.harmlessActiveTransformers": "sɹǝɯɹoɟsuɐɹ⟘ǝʌıʇɔⱯssǝןɯɹɐɥ",
"config.gtceu.option.hazardsEnabled": "pǝןqɐuƎspɹɐzɐɥ",
"config.gtceu.option.hideFacadesInJEI": "IƎſuIsǝpɐɔɐℲǝpıɥ",
"config.gtceu.option.hideFilledCellsInJEI": "IƎſuIsןןǝƆpǝןןıℲǝpıɥ",
"config.gtceu.option.hideFacadesInRecipeViewer": "ɹǝʍǝıΛǝdıɔǝᴚuIsǝpɐɔɐℲǝpıɥ",
"config.gtceu.option.hideFilledCellsInRecipeViewer": "ɹǝʍǝıΛǝdıɔǝᴚuIsןןǝƆpǝןןıℲǝpıɥ",
"config.gtceu.option.hideOreProcessingDiagrams": "sɯɐɹbɐıᗡbuıssǝɔoɹԀǝɹOǝpıɥ",
"config.gtceu.option.highTierContent": "ʇuǝʇuoƆɹǝı⟘ɥbıɥ",
"config.gtceu.option.hpLiquidBoilerBaseOutput": "ʇndʇnOǝsɐᗺɹǝןıoᗺpınbıꞀdɥ",
Expand All @@ -2312,7 +2314,7 @@
"config.gtceu.option.nanoSaber": "ɹǝqɐSouɐu",
"config.gtceu.option.nanoSaberBaseDamage": "ǝbɐɯɐᗡǝsɐᗺɹǝqɐSouɐu",
"config.gtceu.option.nanoSaberDamageBoost": "ʇsooᗺǝbɐɯɐᗡɹǝqɐSouɐu",
"config.gtceu.option.nativeEUToPlatformNative": "ǝʌıʇɐNɯɹoɟʇɐןԀo⟘∩Ǝǝʌıʇɐu",
"config.gtceu.option.nativeEUToFE": "ƎℲo⟘∩Ǝǝʌıʇɐu",
"config.gtceu.option.nerfPaperCrafting": "buıʇɟɐɹƆɹǝdɐԀɟɹǝu",
"config.gtceu.option.nerfWoodCrafting": "buıʇɟɐɹƆpooMɟɹǝu",
"config.gtceu.option.onlyOwnerBreak": "ʞɐǝɹᗺɹǝuʍOʎןuo",
Expand All @@ -2330,7 +2332,6 @@
"config.gtceu.option.oreVeins": "suıǝΛǝɹo",
"config.gtceu.option.overclockDivisor": "ɹosıʌıᗡʞɔoןɔɹǝʌo",
"config.gtceu.option.ownerOPBypass": "ssɐdʎᗺԀOɹǝuʍo",
"config.gtceu.option.platformToEuRatio": "oıʇɐᴚnƎo⟘ɯɹoɟʇɐןd",
"config.gtceu.option.prospectorEnergyUseMultiplier": "ɹǝıןdıʇןnWǝs∩ʎbɹǝuƎɹoʇɔǝdsoɹd",
"config.gtceu.option.recipeProgressLowEnergy": "ʎbɹǝuƎʍoꞀssǝɹboɹԀǝdıɔǝɹ",
"config.gtceu.option.recipes": "sǝdıɔǝɹ",
Expand All @@ -2345,6 +2346,7 @@
"config.gtceu.option.rngDamageElectricTools": "sןoo⟘ɔıɹʇɔǝןƎǝbɐɯɐᗡbuɹ",
"config.gtceu.option.rubberTreeSpawnChance": "ǝɔuɐɥƆuʍɐdSǝǝɹ⟘ɹǝqqnɹ",
"config.gtceu.option.sandOresFall": "ןןɐℲsǝɹOpuɐs",
"config.gtceu.option.shouldWeatherOrTerrainExplosion": "uoısoןdxƎuıɐɹɹǝ⟘ɹOɹǝɥʇɐǝMpןnoɥs",
"config.gtceu.option.showDimensionTier": "ɹǝı⟘uoısuǝɯıᗡʍoɥs",
"config.gtceu.option.smallBoilers": "sɹǝןıoᗺןןɐɯs",
"config.gtceu.option.solarBoilerBaseOutput": "ʇndʇnOǝsɐᗺɹǝןıoᗺɹɐןos",
Expand Down Expand Up @@ -2797,6 +2799,8 @@
"gtceu.gui.cover_setting.title": "sbuıʇʇǝS ɹǝʌoƆ",
"gtceu.gui.editor.group.recipe_type": "dɐɔ",
"gtceu.gui.editor.tips.citation": "suoıʇɐʇıɔ ɟo ɹǝqɯnN",
"gtceu.gui.fisher_mode.tooltip.0": "sɯǝʇı ʞunظ ǝןbbo⟘",
"gtceu.gui.fisher_mode.tooltip.1": "uoıʇɐɹǝdo ɹǝd buıɹʇs ᄅ sʇsoɔ ɟɟO",
"gtceu.gui.fluid_amount": ":ʇunoɯⱯ pınןℲ",
"gtceu.gui.fluid_auto_input.tooltip.disabled": "pǝןqɐsıᗡ ʇnduI-oʇnⱯ pınןℲ",
"gtceu.gui.fluid_auto_input.tooltip.enabled": "pǝןqɐuƎ ʇnduI-oʇnⱯ pınןℲ",
Expand Down Expand Up @@ -4954,7 +4958,8 @@
"item.gtceu.tool.lv_wrench": ")ΛꞀ( ɥɔuǝɹM %s",
"item.gtceu.tool.lv_wrench.tooltip": "sǝuıɥɔɐW ǝןʇuɐɯsıp oʇ ʞɔıןɔ ʇɟǝן pןoH8§",
"item.gtceu.tool.mallet": "ʇǝןןɐW ʇɟoS %s",
"item.gtceu.tool.mallet.tooltip": "ʎɹǝuıɥɔɐW sʇɹɐʇS/sdoʇS8§",
"item.gtceu.tool.mallet.tooltip.0": "˙ǝdıɔǝᴚ ʇuǝɹɹnƆ ɹǝʇɟⱯ ǝuıɥɔɐW ǝsnɐԀ oʇ ʞɐǝuS8§",
"item.gtceu.tool.mallet.tooltip.1": "sǝuıɥɔɐW sʇɹɐʇS/sdoʇS8§",
"item.gtceu.tool.matchbox.tooltip": "ɹɐƆ ɐ ʇou sı sıɥ⟘ㄥ§",
"item.gtceu.tool.mining_hammer": "ɹǝɯɯɐH buıuıW %s",
"item.gtceu.tool.mining_hammer.tooltip": ")buıɥɔnoɹɔ ǝɹ,noʎ ssǝןun( ǝɔuo ʇɐ ɐǝɹɐ ǝbɹɐן ɐ sǝuıW8§",
Expand Down
21 changes: 13 additions & 8 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@
"block.gtceu.iv_extractor": "§9Elite Extractor §r",
"block.gtceu.iv_extruder": "§9Elite Extruder §r",
"block.gtceu.iv_fermenter": "§9Elite Fermenter §r",
"block.gtceu.iv_fisher": "§9Elite Fisher §r",
"block.gtceu.iv_fluid_heater": "§9Elite Fluid Heater §r",
"block.gtceu.iv_fluid_passthrough_hatch": "§9IV Fluid Passthrough Hatch",
"block.gtceu.iv_fluid_solidifier": "§9Elite Fluid Solidifier §r",
Expand Down Expand Up @@ -630,6 +631,7 @@
"block.gtceu.luv_extractor": "§dElite Extractor II§r",
"block.gtceu.luv_extruder": "§dElite Extruder II§r",
"block.gtceu.luv_fermenter": "§dElite Fermenter II§r",
"block.gtceu.luv_fisher": "§dElite Fisher II§r",
"block.gtceu.luv_fluid_heater": "§dElite Fluid Heater II§r",
"block.gtceu.luv_fluid_passthrough_hatch": "§dLuV Fluid Passthrough Hatch",
"block.gtceu.luv_fluid_solidifier": "§dElite Fluid Solidifier II§r",
Expand Down Expand Up @@ -2248,15 +2250,14 @@
"config.gtceu.option.disableManualCompression": "disableManualCompression",
"config.gtceu.option.doBedrockOres": "doBedrockOres",
"config.gtceu.option.doSuperflatOres": "doSuperflatOres",
"config.gtceu.option.doTerrainExplosion": "doTerrainExplosion",
"config.gtceu.option.doesExplosionDamagesTerrain": "doesExplosionDamagesTerrain",
"config.gtceu.option.dumpAssets": "dumpAssets",
"config.gtceu.option.dumpRecipes": "dumpRecipes",
"config.gtceu.option.enableCleanroom": "enableCleanroom",
"config.gtceu.option.enableCompass": "enableCompass",
"config.gtceu.option.enableFEConverters": "enableFEConverters",
"config.gtceu.option.enableMaintenance": "enableMaintenance",
"config.gtceu.option.enableMoreDualHatchAbility": "enableMoreDualHatchAbility",
"config.gtceu.option.enablePlatformConverters": "enablePlatformConverters",
"config.gtceu.option.enableResearch": "enableResearch",
"config.gtceu.option.enableTieredCasings": "enableTieredCasings",
"config.gtceu.option.enableWorldAccelerators": "enableWorldAccelerators",
Expand All @@ -2266,7 +2267,8 @@
"config.gtceu.option.energyUsageMultiplier": "energyUsageMultiplier",
"config.gtceu.option.environmentalHazardDecayRate": "environmentalHazardDecayRate",
"config.gtceu.option.environmentalHazards": "environmentalHazards",
"config.gtceu.option.euToPlatformRatio": "euToPlatformRatio",
"config.gtceu.option.euToFeRatio": "euToFeRatio",
"config.gtceu.option.feToEuRatio": "feToEuRatio",
"config.gtceu.option.flintAndSteelRequireSteel": "flintAndSteelRequireSteel",
"config.gtceu.option.gameplay": "gameplay",
"config.gtceu.option.generateLowQualityGems": "generateLowQualityGems",
Expand All @@ -2287,8 +2289,8 @@
"config.gtceu.option.harderRods": "harderRods",
"config.gtceu.option.harmlessActiveTransformers": "harmlessActiveTransformers",
"config.gtceu.option.hazardsEnabled": "hazardsEnabled",
"config.gtceu.option.hideFacadesInJEI": "hideFacadesInJEI",
"config.gtceu.option.hideFilledCellsInJEI": "hideFilledCellsInJEI",
"config.gtceu.option.hideFacadesInRecipeViewer": "hideFacadesInRecipeViewer",
"config.gtceu.option.hideFilledCellsInRecipeViewer": "hideFilledCellsInRecipeViewer",
"config.gtceu.option.hideOreProcessingDiagrams": "hideOreProcessingDiagrams",
"config.gtceu.option.highTierContent": "highTierContent",
"config.gtceu.option.hpLiquidBoilerBaseOutput": "hpLiquidBoilerBaseOutput",
Expand All @@ -2312,7 +2314,7 @@
"config.gtceu.option.nanoSaber": "nanoSaber",
"config.gtceu.option.nanoSaberBaseDamage": "nanoSaberBaseDamage",
"config.gtceu.option.nanoSaberDamageBoost": "nanoSaberDamageBoost",
"config.gtceu.option.nativeEUToPlatformNative": "nativeEUToPlatformNative",
"config.gtceu.option.nativeEUToFE": "nativeEUToFE",
"config.gtceu.option.nerfPaperCrafting": "nerfPaperCrafting",
"config.gtceu.option.nerfWoodCrafting": "nerfWoodCrafting",
"config.gtceu.option.onlyOwnerBreak": "onlyOwnerBreak",
Expand All @@ -2330,7 +2332,6 @@
"config.gtceu.option.oreVeins": "oreVeins",
"config.gtceu.option.overclockDivisor": "overclockDivisor",
"config.gtceu.option.ownerOPBypass": "ownerOPBypass",
"config.gtceu.option.platformToEuRatio": "platformToEuRatio",
"config.gtceu.option.prospectorEnergyUseMultiplier": "prospectorEnergyUseMultiplier",
"config.gtceu.option.recipeProgressLowEnergy": "recipeProgressLowEnergy",
"config.gtceu.option.recipes": "recipes",
Expand All @@ -2345,6 +2346,7 @@
"config.gtceu.option.rngDamageElectricTools": "rngDamageElectricTools",
"config.gtceu.option.rubberTreeSpawnChance": "rubberTreeSpawnChance",
"config.gtceu.option.sandOresFall": "sandOresFall",
"config.gtceu.option.shouldWeatherOrTerrainExplosion": "shouldWeatherOrTerrainExplosion",
"config.gtceu.option.showDimensionTier": "showDimensionTier",
"config.gtceu.option.smallBoilers": "smallBoilers",
"config.gtceu.option.solarBoilerBaseOutput": "solarBoilerBaseOutput",
Expand Down Expand Up @@ -2797,6 +2799,8 @@
"gtceu.gui.cover_setting.title": "Cover Settings",
"gtceu.gui.editor.group.recipe_type": "cap",
"gtceu.gui.editor.tips.citation": "Number of citations",
"gtceu.gui.fisher_mode.tooltip.0": "Toggle junk items",
"gtceu.gui.fisher_mode.tooltip.1": "Off costs 2 string per operation",
"gtceu.gui.fluid_amount": "Fluid Amount:",
"gtceu.gui.fluid_auto_input.tooltip.disabled": "Fluid Auto-Input Disabled",
"gtceu.gui.fluid_auto_input.tooltip.enabled": "Fluid Auto-Input Enabled",
Expand Down Expand Up @@ -4954,7 +4958,8 @@
"item.gtceu.tool.lv_wrench": "%s Wrench (LV)",
"item.gtceu.tool.lv_wrench.tooltip": "§8Hold left click to dismantle Machines",
"item.gtceu.tool.mallet": "%s Soft Mallet",
"item.gtceu.tool.mallet.tooltip": "§8Stops/Starts Machinery",
"item.gtceu.tool.mallet.tooltip.0": "§8Sneak to Pause Machine After Current Recipe.",
"item.gtceu.tool.mallet.tooltip.1": "§8Stops/Starts Machines",
"item.gtceu.tool.matchbox.tooltip": "§7This is not a Car",
"item.gtceu.tool.mining_hammer": "%s Mining Hammer",
"item.gtceu.tool.mining_hammer.tooltip": "§8Mines a large area at once (unless you're crouching)",
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/com/gregtechceu/gtceu/api/block/MaterialBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
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.item.FallingBlockEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.BlockItem;
Expand All @@ -40,6 +43,7 @@
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
Expand Down Expand Up @@ -276,4 +280,28 @@ public boolean replaceWithFramedPipe(Level level, BlockPos pos, BlockState state
}
return false;
}

@Override
public void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
if (this.tagPrefix == TagPrefix.frameGt && entity instanceof LivingEntity livingEntity) {
double currentAccel = 0.15D * (livingEntity.getDeltaMovement().y < 0.3D ? 2.5D : 1.0D);
double currentSpeedVertical = 0.9D * (livingEntity.isInWater() ? 0.4D : 1.0D);
Vec3 deltaMovement = livingEntity.getDeltaMovement();
livingEntity.resetFallDistance();
float f = 0.15F;
double d0 = Mth.clamp(deltaMovement.x, -f, f);
double d1 = Mth.clamp(deltaMovement.z, -f, f);
double d2 = Math.max(deltaMovement.y, -f);
if (d2 < 0.0 && !livingEntity.getFeetBlockState().isScaffolding(livingEntity) &&
livingEntity.isSuppressingSlidingDownLadder() &&
livingEntity instanceof Player) {
d2 = Math.min(deltaMovement.y + currentAccel, 0.0D);
}
if (livingEntity.horizontalCollision) {
d2 = 0.3;
}
deltaMovement = new Vec3(d0, d2, d1);
entity.setDeltaMovement(deltaMovement);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public EUToFEProvider(BlockEntity tileEntity) {

@Override
public <T> LazyOptional<T> getCapability(@NotNull Capability<T> capability, Direction facing) {
if (!ConfigHolder.INSTANCE.compat.energy.nativeEUToPlatformNative ||
if (!ConfigHolder.INSTANCE.compat.energy.nativeEUToFE ||
capability != GTCapability.CAPABILITY_ENERGY_CONTAINER)
return LazyOptional.empty();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public class FeCompat {
* Conversion ratio used by energy converters
*/
public static int ratio(boolean feToEu) {
return feToEu ? ConfigHolder.INSTANCE.compat.energy.platformToEuRatio :
ConfigHolder.INSTANCE.compat.energy.euToPlatformRatio;
return feToEu ? ConfigHolder.INSTANCE.compat.energy.feToEuRatio :
ConfigHolder.INSTANCE.compat.energy.euToFeRatio;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,24 @@ public class Tab extends WidgetGroup {
public Tab(IFancyConfigurator configurator) {
super(0, tabs.size() * (getTabSize() + 2), getTabSize(), getTabSize());
this.configurator = configurator;
this.button = new ButtonWidget(0, 0, getTabSize(), getTabSize(), null, this::onClick);
this.button = new ButtonWidget(0, 0, getTabSize(), getTabSize(), null, this::onClick) {

@Override
public boolean mouseWheelMove(double mouseX, double mouseY, double wheelDelta) {
if (!(configurator instanceof IFancyCustomMouseWheelAction hasActions)) return false;
if (isMouseOverElement(mouseX, mouseY))
return hasActions.mouseWheelMove(this::writeClientAction, mouseX, mouseY, wheelDelta);
return false;
}

@Override
public void handleClientAction(int id, FriendlyByteBuf buffer) {
if (configurator instanceof IFancyCustomClientActionHandler handler && id > 1)
handler.handleClientAction(id, buffer);
else
super.handleClientAction(id, buffer);
}
};
if (configurator instanceof IFancyConfiguratorButton) {
this.view = null;
this.addWidget(button);
Expand Down Expand Up @@ -270,7 +287,9 @@ protected void onChildSizeUpdate(Widget child) {
}

private void onClick(ClickData clickData) {
if (configurator instanceof IFancyConfiguratorButton fancyButton) {
if (clickData.button == 2 && configurator instanceof IFancyCustomMiddleClickAction middleAction) {
middleAction.onMiddleClick(this::writeClientAction);
} else if (configurator instanceof IFancyConfiguratorButton fancyButton) {
fancyButton.onClick(clickData);
} else {
if (expanded == this) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.gregtechceu.gtceu.api.gui.fancy;

import net.minecraft.network.FriendlyByteBuf;

public interface IFancyCustomClientActionHandler {

default void handleClientAction(int id, FriendlyByteBuf buffer) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.gregtechceu.gtceu.api.gui.fancy;

import net.minecraft.network.FriendlyByteBuf;

import java.util.function.BiConsumer;
import java.util.function.Consumer;

public interface IFancyCustomMiddleClickAction extends IFancyCustomClientActionHandler {

default void onMiddleClick(BiConsumer<Integer, Consumer<FriendlyByteBuf>> writeClientAction) {}
}
Loading

0 comments on commit 529dd02

Please sign in to comment.