-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Switched from MidnightLib to the Yet Another Config Lib config API for Fabric&Quilt - Added support for YACL config screen rendering for NeoForge
- Loading branch information
1 parent
a8cc4c2
commit b5305a8
Showing
16 changed files
with
353 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,6 @@ | ||
- **Support for Minecraft 1.21** ⚔️ (closes [#13](https://github.com/Tschipcraft/make_bubbles_pop/issues/13), [#14](https://github.com/Tschipcraft/make_bubbles_pop/issues/14), [#15](https://github.com/Tschipcraft/make_bubbles_pop/issues/15)) | ||
- **Added config file and settings menu when installed alongside [MidnightLib](https://modrinth.com/mod/midnightlib)** (closes [#4](https://github.com/Tschipcraft/make_bubbles_pop/issues/4)) | ||
<details> | ||
<summary>🔎 In game screenshot</summary> | ||
<img src="demo/settings.png" alt="Ingame screenshot of the settings menu"> | ||
</details> | ||
- **Added entity interaction physics to bubbles** (configurable) | ||
<details> | ||
<summary>🔎 In game demo</summary> | ||
<video src="demo/bubble_entity_interactions.mp4" autoplay loop muted>Your browser does not support the video tag or the video doesn't exist anymore.</video> | ||
</details> | ||
- **Added biome dependent tint to all bubble types** (configurable) | ||
<details> | ||
<summary>🔎 In game screenshot</summary> | ||
<img src="demo/bubble_tints.png" alt="Ingame screenshot of the bubble tints"> | ||
</details> | ||
- **Fixed barrels opened by other players on servers not emitting bubbles** (closes [#11](https://github.com/Tschipcraft/make_bubbles_pop/issues/11)) (Thanks @AViewFromTheTop) | ||
- Adjusted current down bubbles to pop on top of magma blocks rather than inside them (closes [#9](https://github.com/Tschipcraft/make_bubbles_pop/issues/9)) | ||
<details> | ||
<summary>🔎 In game demo</summary> | ||
<video src="demo/overhauled_magma_block_bubbles-v0.3.0.mp4" autoplay loop muted>Your browser does not support the video tag or the video doesn't exist anymore.</video> | ||
</details> | ||
- Added varied pitch and volume to bubble pop and bubble swirl sounds (closes [#8](https://github.com/Tschipcraft/make_bubbles_pop/issues/8)) (Thanks @AViewFromTheTop) | ||
- Barrel bubbling is now reliable on the client and will no longer bubble when a chunk with an already opened Barrel is loaded (Thanks @AViewFromTheTop) | ||
- Fixed checking incorrect side of barrels for bubble particles | ||
- Changed the default behavior to not maintain bubble particle velocity when popping (configurable) (Thanks @AViewFromTheTop) | ||
- Tweaked explosion bubbles and used better variable names | ||
- Restructured bubble particle logic and used better variable types | ||
- Adjusted barrel bubble spawn locations | ||
- Moved bubble pop logic to a separate utility class to reduce code duplication | ||
- Simplified water checks to use the already provided helper function in world or level | ||
- Fixed literal new line in fabric.mod.json after building (closes [#12](https://github.com/Tschipcraft/make_bubbles_pop/issues/12)) | ||
- **Native NeoForge support** 🦊 | ||
- Switched from using MidnightLib to Yet Another Config Library for configuration | ||
- Added support for the native NeoForge&Forge config system | ||
- Switched to Architectury Loom in favor of a combined codebase and native NeoForge support | ||
- Lowered mixin defaultRequire to 0 to avoid crashes even when mixins fail to apply | ||
- Added South Korean language support (Thanks @Merhaf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
common/src/main/java/net/tschipcraft/make_bubbles_pop/MakeBubblesPopConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
139 changes: 139 additions & 0 deletions
139
common/src/main/java/net/tschipcraft/make_bubbles_pop/config/ConfigScreen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
package net.tschipcraft.make_bubbles_pop.config; | ||
|
||
import dev.isxander.yacl3.api.YetAnotherConfigLib; | ||
import dev.isxander.yacl3.api.*; | ||
import dev.isxander.yacl3.api.controller.DoubleSliderControllerBuilder; | ||
import dev.isxander.yacl3.api.controller.FloatSliderControllerBuilder; | ||
import dev.isxander.yacl3.api.controller.TickBoxControllerBuilder; | ||
import dev.isxander.yacl3.api.controller.ValueFormatter; | ||
import net.minecraft.client.gui.screen.Screen; | ||
import net.minecraft.text.Text; | ||
import net.tschipcraft.make_bubbles_pop.MakeBubblesPopConfig; | ||
|
||
public class ConfigScreen { | ||
|
||
/** | ||
* Create the config screen for Make Bubbles Pop using Yet Another Config Lib. | ||
* | ||
* @param parent The parent screen | ||
* @param config The config handler (Can be either a new PlatformConfig or a direct MakeBubblesPopConfig implementing PlatformConfig) | ||
* @return The config screen | ||
*/ | ||
public static Screen getScreen(Screen parent, PlatformConfig config) { | ||
// Reload config from file before opening the screen | ||
config.load(); | ||
|
||
// Create options | ||
var POP_PARTICLE_ENABLED = Option.<Boolean>createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.POP_PARTICLE_ENABLED")) | ||
.description(OptionDescription.of(Text.translatable("make_bubbles_pop.midnightconfig.POP_PARTICLE_ENABLED.tooltip"))) | ||
.controller(TickBoxControllerBuilder::create) | ||
.binding(true, () -> MakeBubblesPopConfig.POP_PARTICLE_ENABLED, newVal -> MakeBubblesPopConfig.POP_PARTICLE_ENABLED = newVal) | ||
.build(); | ||
|
||
var BUBBLE_POP_VOLUME = Option.<Float>createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.BUBBLE_POP_VOLUME")) | ||
.description(OptionDescription.of(Text.translatable("make_bubbles_pop.midnightconfig.BUBBLE_POP_VOLUME.tooltip"))) | ||
.customController(opt -> FloatSliderControllerBuilder.create(opt).range(0F, 1.0F).step(0.01F).formatValue(new ValueFormatter<Float>() { | ||
@Override | ||
public Text format(Float aFloat) { | ||
// Format as percentage | ||
return Text.of(String.format("%.0f%%", aFloat * 100)); | ||
} | ||
}).build()) | ||
.binding(0.1F, () -> MakeBubblesPopConfig.BUBBLE_POP_VOLUME, newVal -> MakeBubblesPopConfig.BUBBLE_POP_VOLUME = newVal) | ||
.build(); | ||
|
||
var POPPED_BUBBLES_MAINTAIN_VELOCITY = Option.<Boolean>createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.POPPED_BUBBLES_MAINTAIN_VELOCITY")) | ||
.description(OptionDescription.of(Text.translatable("make_bubbles_pop.midnightconfig.POPPED_BUBBLES_MAINTAIN_VELOCITY.tooltip"))) | ||
.controller(TickBoxControllerBuilder::create) | ||
.binding(false, () -> MakeBubblesPopConfig.POPPED_BUBBLES_MAINTAIN_VELOCITY, newVal -> MakeBubblesPopConfig.POPPED_BUBBLES_MAINTAIN_VELOCITY = newVal) | ||
.build(); | ||
|
||
var BUBBLE_PHYSICS_ENABLED = Option.<Boolean>createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.BUBBLE_PHYSICS_ENABLED")) | ||
.description(OptionDescription.of(Text.translatable("make_bubbles_pop.midnightconfig.BUBBLE_PHYSICS_ENABLED.tooltip"))) | ||
.controller(TickBoxControllerBuilder::create) | ||
.binding(true, () -> MakeBubblesPopConfig.BUBBLE_PHYSICS_ENABLED, newVal -> MakeBubblesPopConfig.BUBBLE_PHYSICS_ENABLED = newVal) | ||
.build(); | ||
|
||
var BUBBLE_LIFETIME_MULTIPLIER = Option.<Double>createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.BUBBLE_LIFETIME_MULTIPLIER")) | ||
.description(OptionDescription.of(Text.translatable("make_bubbles_pop.midnightconfig.BUBBLE_LIFETIME_MULTIPLIER.tooltip"))) | ||
.customController(opt -> DoubleSliderControllerBuilder.create(opt).range(1D, 100D).step(0.5D).build()) | ||
.binding(32D, () -> MakeBubblesPopConfig.BUBBLE_LIFETIME_MULTIPLIER, newVal -> MakeBubblesPopConfig.BUBBLE_LIFETIME_MULTIPLIER = newVal) | ||
.build(); | ||
|
||
var BIOME_COLORS_ENABLED = Option.<Boolean>createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.BIOME_COLORS_ENABLED")) | ||
.description(OptionDescription.of(Text.translatable("make_bubbles_pop.midnightconfig.BIOME_COLORS_ENABLED.tooltip"))) | ||
.controller(TickBoxControllerBuilder::create) | ||
.binding(true, () -> MakeBubblesPopConfig.BIOME_COLORS_ENABLED, newVal -> MakeBubblesPopConfig.BIOME_COLORS_ENABLED = newVal) | ||
.build(); | ||
|
||
var BIOME_COLOR_INTENSITY = Option.<Float>createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.BIOME_COLOR_INTENSITY")) | ||
.description(OptionDescription.of(Text.translatable("make_bubbles_pop.midnightconfig.BIOME_COLOR_INTENSITY.tooltip"))) | ||
.customController(opt -> FloatSliderControllerBuilder.create(opt).range(0F, 1.0F).step(0.01F).formatValue(new ValueFormatter<Float>() { | ||
@Override | ||
public Text format(Float aFloat) { | ||
// Format as percentage | ||
return Text.of(String.format("%.0f%%", aFloat * 100)); | ||
} | ||
}).build()) | ||
.binding(0.65F, () -> MakeBubblesPopConfig.BIOME_COLOR_INTENSITY, newVal -> MakeBubblesPopConfig.BIOME_COLOR_INTENSITY = newVal) | ||
.build(); | ||
|
||
var CHEST_BUBBLES_ENABLED = Option.<Boolean>createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.CHEST_BUBBLES_ENABLED")) | ||
.description(OptionDescription.of(Text.translatable("make_bubbles_pop.midnightconfig.CHEST_BUBBLES_ENABLED.tooltip"))) | ||
.controller(TickBoxControllerBuilder::create) | ||
.binding(true, () -> MakeBubblesPopConfig.CHEST_BUBBLES_ENABLED, newVal -> MakeBubblesPopConfig.CHEST_BUBBLES_ENABLED = newVal) | ||
.build(); | ||
|
||
var BARREL_BUBBLES_ENABLED = Option.<Boolean>createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.BARREL_BUBBLES_ENABLED")) | ||
.description(OptionDescription.of(Text.translatable("make_bubbles_pop.midnightconfig.BARREL_BUBBLES_ENABLED.tooltip"))) | ||
.controller(TickBoxControllerBuilder::create) | ||
.binding(true, () -> MakeBubblesPopConfig.BARREL_BUBBLES_ENABLED, newVal -> MakeBubblesPopConfig.BARREL_BUBBLES_ENABLED = newVal) | ||
.build(); | ||
|
||
var CONTAINER_SOUND_ENABLED = Option.<Boolean>createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.CONTAINER_SOUND_ENABLED")) | ||
.description(OptionDescription.of(Text.translatable("make_bubbles_pop.midnightconfig.CONTAINER_SOUND_ENABLED.tooltip"))) | ||
.controller(TickBoxControllerBuilder::create) | ||
.binding(true, () -> MakeBubblesPopConfig.CONTAINER_SOUND_ENABLED, newVal -> MakeBubblesPopConfig.CONTAINER_SOUND_ENABLED = newVal) | ||
.build(); | ||
|
||
var EXPLOSION_BUBBLES_ENABLED = Option.<Boolean>createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.EXPLOSION_BUBBLES_ENABLED")) | ||
.description(OptionDescription.of(Text.translatable("make_bubbles_pop.midnightconfig.EXPLOSION_BUBBLES_ENABLED.tooltip"))) | ||
.controller(TickBoxControllerBuilder::create) | ||
.binding(true, () -> MakeBubblesPopConfig.EXPLOSION_BUBBLES_ENABLED, newVal -> MakeBubblesPopConfig.EXPLOSION_BUBBLES_ENABLED = newVal) | ||
.build(); | ||
|
||
// Build screen | ||
return YetAnotherConfigLib.createBuilder() | ||
.title(Text.translatable("make_bubbles_pop.midnightconfig.title")) | ||
.category(ConfigCategory.createBuilder() | ||
.name(Text.translatable("make_bubbles_pop.midnightconfig.title")) | ||
// Add options | ||
.option(POP_PARTICLE_ENABLED) | ||
.option(BUBBLE_POP_VOLUME) | ||
.option(POPPED_BUBBLES_MAINTAIN_VELOCITY) | ||
.option(BUBBLE_PHYSICS_ENABLED) | ||
.option(BUBBLE_LIFETIME_MULTIPLIER) | ||
.option(BIOME_COLORS_ENABLED) | ||
.option(BIOME_COLOR_INTENSITY) | ||
.option(CHEST_BUBBLES_ENABLED) | ||
.option(BARREL_BUBBLES_ENABLED) | ||
.option(CONTAINER_SOUND_ENABLED) | ||
.option(EXPLOSION_BUBBLES_ENABLED) | ||
.build()) | ||
.save(config::save) // Link save button to config save method | ||
.build() | ||
.generateScreen(parent); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
common/src/main/java/net/tschipcraft/make_bubbles_pop/config/PlatformConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package net.tschipcraft.make_bubbles_pop.config; | ||
|
||
/** | ||
* Interface used for passing platform-specific config classes to ConfigScreen.getScreen(). | ||
*/ | ||
public interface PlatformConfig { | ||
|
||
void load(); | ||
|
||
void save(); | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
common/src/main/resources/assets/make_bubbles_pop/lang/en_us.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.