diff --git a/Fabric/src/main/java/hantonik/fbp/config/FBPConfig.java b/Fabric/src/main/java/hantonik/fbp/config/FBPConfig.java index a87446e..d82b7f0 100644 --- a/Fabric/src/main/java/hantonik/fbp/config/FBPConfig.java +++ b/Fabric/src/main/java/hantonik/fbp/config/FBPConfig.java @@ -35,6 +35,7 @@ public final class FBPConfig { private static final boolean DEFAULT_FROZEN = false; private static final boolean DEFAULT_INFINITE_DURATION = false; private static final boolean DEFAULT_CARTOON_MODE = false; + private static final boolean DEFAULT_CULL_PARTICLES = false; private static final boolean DEFAULT_FANCY_FLAME = true; private static final boolean DEFAULT_FANCY_SMOKE = true; @@ -73,7 +74,7 @@ public final class FBPConfig { public static final FBPConfig DEFAULT_CONFIG = new FBPConfig( DEFAULT_ENABLED, DEFAULT_LOCKED, - DEFAULT_FROZEN, DEFAULT_INFINITE_DURATION, DEFAULT_CARTOON_MODE, + DEFAULT_FROZEN, DEFAULT_INFINITE_DURATION, DEFAULT_CARTOON_MODE, DEFAULT_CULL_PARTICLES, DEFAULT_FANCY_FLAME, DEFAULT_FANCY_SMOKE, DEFAULT_FANCY_RAIN, DEFAULT_FANCY_SNOW, DEFAULT_SMOOTH_ANIMATION_LIGHTING, DEFAULT_SMART_BREAKING, DEFAULT_LOW_TRACTION, DEFAULT_SPAWN_WHILE_FROZEN, DEFAULT_SMOOTH_ANIMATION_LIGHTING, DEFAULT_SPAWN_PLACE_PARTICLES, @@ -91,6 +92,7 @@ public final class FBPConfig { private boolean frozen; private boolean infiniteDuration; private boolean cartoonMode; + private boolean cullParticles; private boolean fancyFlame; private boolean fancySmoke; @@ -169,6 +171,7 @@ public void setConfig(FBPConfig config) { this.frozen = config.frozen; this.infiniteDuration = config.infiniteDuration; this.cartoonMode = config.cartoonMode; + this.cullParticles = config.cullParticles; this.fancyFlame = config.fancyFlame; this.fancySmoke = config.fancySmoke; @@ -212,6 +215,7 @@ public void applyConfig(FBPConfig config) { this.frozen = config.frozen; this.infiniteDuration = config.infiniteDuration; this.cartoonMode = config.cartoonMode; + this.cullParticles = config.cullParticles; this.fancyFlame = config.fancyFlame; this.fancySmoke = config.fancySmoke; @@ -279,6 +283,7 @@ public void reload() { this.frozen = GsonHelper.getAsBoolean(json, "frozen", DEFAULT_FROZEN); this.infiniteDuration = GsonHelper.getAsBoolean(json, "infiniteDuration", DEFAULT_INFINITE_DURATION); this.cartoonMode = GsonHelper.getAsBoolean(json, "cartoonMode", DEFAULT_CARTOON_MODE); + this.cullParticles = GsonHelper.getAsBoolean(json, "cullParticles", DEFAULT_CULL_PARTICLES); this.fancyFlame = GsonHelper.getAsBoolean(json, "fancyFlame", DEFAULT_FANCY_FLAME); this.fancySmoke = GsonHelper.getAsBoolean(json, "fancySmoke", DEFAULT_FANCY_SMOKE); @@ -342,6 +347,7 @@ public void save() { json.addProperty("frozen", this.frozen); json.addProperty("infiniteDuration", this.infiniteDuration); json.addProperty("cartoonMode", this.cartoonMode); + json.addProperty("cullParticles", this.cullParticles); json.addProperty("fancyFlame", this.fancyFlame); json.addProperty("fancySmoke", this.fancySmoke); @@ -394,7 +400,7 @@ public void save() { public FBPConfig copy() { return new FBPConfig( this.enabled, this.locked, - this.frozen, this.infiniteDuration, this.cartoonMode, + this.frozen, this.infiniteDuration, this.cartoonMode, this.cullParticles, this.fancyFlame, this.fancySmoke, this.fancyRain, this.fancySnow, this.fancyPlaceAnimation, this.smartBreaking, this.lowTraction, this.spawnWhileFrozen, this.smoothAnimationLighting, this.spawnPlaceParticles, diff --git a/Fabric/src/main/java/hantonik/fbp/screen/FBPOptionsScreen.java b/Fabric/src/main/java/hantonik/fbp/screen/FBPOptionsScreen.java index f7fa87c..2ef5396 100644 --- a/Fabric/src/main/java/hantonik/fbp/screen/FBPOptionsScreen.java +++ b/Fabric/src/main/java/hantonik/fbp/screen/FBPOptionsScreen.java @@ -43,7 +43,7 @@ public FBPOptionsScreen() { this.config = FancyBlockParticles.CONFIG.copy(); - this.pageCount = 3; + this.pageCount = 4; this.page = 1; } @@ -137,6 +137,9 @@ protected void init() { helper.addChild(SpacerElement.width(75)); helper.addChild(new FBPToggleButton(0, 0, 275, 20, Component.translatable("button.fbp.cartoon_mode"), this.config::isCartoonMode, button -> this.config.setCartoonMode(!this.config.isCartoonMode())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.cartoon_mode").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isCartoonMode())))); helper.addChild(SpacerElement.width(75)); + helper.addChild(SpacerElement.width(75)); + helper.addChild(new FBPToggleButton(0, 0, 275, 20, Component.translatable("button.fbp.cull_particles"), this.config::isCullParticles, button -> this.config.setCullParticles(!this.config.isCullParticles())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.cull_particles").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isCullParticles())))); + helper.addChild(SpacerElement.width(75)); helper.addChild(SpacerElement.width(75)); helper.addChild(new FBPToggleButton(0, 0, 275, 20, Component.translatable("button.fbp.smart_breaking"), this.config::isSmartBreaking, button -> this.config.setSmartBreaking(!this.config.isSmartBreaking())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.smart_breaking").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSmartBreaking())))); @@ -144,14 +147,11 @@ protected void init() { helper.addChild(SpacerElement.width(75)); helper.addChild(new FBPToggleButton(0, 0, 275, 20, Component.translatable("button.fbp.low_traction"), this.config::isLowTraction, button -> this.config.setLowTraction(!this.config.isLowTraction())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.low_traction").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isLowTraction())))); helper.addChild(SpacerElement.width(75)); - helper.addChild(SpacerElement.width(75)); - helper.addChild(new FBPToggleButton(0, 0, 275, 20, Component.translatable("button.fbp.spawn_while_frozen"), this.config::isSpawnWhileFrozen, button -> this.config.setSpawnWhileFrozen(!this.config.isSpawnWhileFrozen())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.spawn_while_frozen").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSpawnWhileFrozen())))); - helper.addChild(SpacerElement.width(75)); } case 3 -> { helper.addChild(SpacerElement.width(75)); - helper.addChild(new FBPToggleButton(0, 0, 275, 20, Component.translatable("button.fbp.smooth_animation_lighting"), this.config::isSmoothAnimationLighting, button -> this.config.setSmoothAnimationLighting(!this.config.isSmoothAnimationLighting())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.smooth_animation_lighting").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSmoothAnimationLighting())))); + helper.addChild(new FBPToggleButton(0, 0, 275, 20, Component.translatable("button.fbp.spawn_while_frozen"), this.config::isSpawnWhileFrozen, button -> this.config.setSpawnWhileFrozen(!this.config.isSpawnWhileFrozen())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.spawn_while_frozen").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSpawnWhileFrozen())))); helper.addChild(SpacerElement.width(75)); helper.addChild(SpacerElement.width(75)); helper.addChild(new FBPToggleButton(0, 0, 275, 20, Component.translatable("button.fbp.spawn_place_particles"), this.config::isSpawnPlaceParticles, button -> this.config.setSpawnPlaceParticles(!this.config.isSpawnPlaceParticles())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.spawn_place_particles").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSpawnPlaceParticles())))); @@ -180,6 +180,21 @@ protected void init() { helper.addChild(new FBPToggleButton(0, 0, 275, 20, Component.translatable("button.fbp.random_fading_speed"), this.config::isRandomFadingSpeed, button -> this.config.setRandomFadingSpeed(!this.config.isRandomFadingSpeed())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.random_fading_speed").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isRandomFadingSpeed())))); helper.addChild(SpacerElement.width(75)); } + + case 4 -> { + helper.addChild(SpacerElement.width(75)); + helper.addChild(new FBPToggleButton(0, 0, 275, 20, Component.translatable("button.fbp.smooth_animation_lighting"), this.config::isSmoothAnimationLighting, button -> this.config.setSmoothAnimationLighting(!this.config.isSmoothAnimationLighting())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.smooth_animation_lighting").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSmoothAnimationLighting())))); + helper.addChild(SpacerElement.width(75)); + + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + } } var previousButton = helper.addChild(Button.builder(Component.translatable("button.fbp.previous"), button -> { diff --git a/Fabric/src/main/java/hantonik/fbp/util/FBPConstants.java b/Fabric/src/main/java/hantonik/fbp/util/FBPConstants.java index 855746e..a1e8929 100644 --- a/Fabric/src/main/java/hantonik/fbp/util/FBPConstants.java +++ b/Fabric/src/main/java/hantonik/fbp/util/FBPConstants.java @@ -79,7 +79,10 @@ public void begin(BufferBuilder buffer, TextureManager manager) { RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShader(GameRenderer::getRendertypeTranslucentShader); - RenderSystem.enableCull(); + if (FancyBlockParticles.CONFIG.isCullParticles()) + RenderSystem.enableCull(); + else + RenderSystem.disableCull(); buffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); } diff --git a/Fabric/src/main/resources/assets/fbp/lang/de_de.json b/Fabric/src/main/resources/assets/fbp/lang/de_de.json index 0504295..b218cc2 100644 --- a/Fabric/src/main/resources/assets/fbp/lang/de_de.json +++ b/Fabric/src/main/resources/assets/fbp/lang/de_de.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "Elegante Platzierungsanimation", "button.fbp.cartoon_mode": "Cartoon-Modus", + "button.fbp.cull_particles": "Partikel eliminieren", "button.fbp.smart_breaking": "Intelligentes Abbauen", "button.fbp.low_traction": "Geringe Traktion", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "Aktiviere oder deaktiviere schicke Blockplatzierungsanimation.", "tooltip.fbp.cartoon_mode": "Aktivieren oder deaktivieren Sie den Partikel-Cartoon-Modus.", + "tooltip.fbp.cull_particles": "Aktiviere oder deaktiviere das Aussortieren von Partikeln.", "tooltip.fbp.smart_breaking": "Aktiviere oder deaktiviere intelligentes Brechen.", "tooltip.fbp.low_traction": "Aktiviere oder deaktiviere Partikel mit geringer Traktion.", diff --git a/Fabric/src/main/resources/assets/fbp/lang/en_us.json b/Fabric/src/main/resources/assets/fbp/lang/en_us.json index 9b46379..e7f3428 100644 --- a/Fabric/src/main/resources/assets/fbp/lang/en_us.json +++ b/Fabric/src/main/resources/assets/fbp/lang/en_us.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "Fancy placing animation", "button.fbp.cartoon_mode": "Cartoon mode", + "button.fbp.cull_particles": "Cull particles", "button.fbp.smart_breaking": "Smart breaking", "button.fbp.low_traction": "Low traction", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "Enable or disable fancy block placing animation.", "tooltip.fbp.cartoon_mode": "Enable or disable particles cartoon mode.", + "tooltip.fbp.cull_particles": "Enable or disable particle culling.", "tooltip.fbp.smart_breaking": "Enable or disable smart breaking.", "tooltip.fbp.low_traction": "Enable or disable particle low traction.", diff --git a/Fabric/src/main/resources/assets/fbp/lang/es_es.json b/Fabric/src/main/resources/assets/fbp/lang/es_es.json index a0284a2..796a20b 100644 --- a/Fabric/src/main/resources/assets/fbp/lang/es_es.json +++ b/Fabric/src/main/resources/assets/fbp/lang/es_es.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "Animación de Colocación Elegante", "button.fbp.cartoon_mode": "Modo caricatura", + "button.fbp.cull_particles": "Eliminar partículas", "button.fbp.smart_breaking": "Ruptura Inteligente", "button.fbp.low_traction": "Baja Tracción", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "Activar o desactivar animación elegante al colocar bloques.", "tooltip.fbp.cartoon_mode": "Activar o desactivar el modo caricatura de partículas.", + "tooltip.fbp.cull_particles": "Activar o desactivar el eliminado de partículas.", "tooltip.fbp.smart_breaking": "Activar o desactivar ruptura inteligente.", "tooltip.fbp.low_traction": "Activar o desactivar partículas de baja tracción.", diff --git a/Fabric/src/main/resources/assets/fbp/lang/fr_fr.json b/Fabric/src/main/resources/assets/fbp/lang/fr_fr.json index 0c71237..92ba725 100644 --- a/Fabric/src/main/resources/assets/fbp/lang/fr_fr.json +++ b/Fabric/src/main/resources/assets/fbp/lang/fr_fr.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "Animation de placement élégante", "button.fbp.cartoon_mode": "Mode dessin animé", + "button.fbp.cull_particles": "Éliminer les particules", "button.fbp.smart_breaking": "Cassage intelligent", "button.fbp.low_traction": "Faible traction", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "Activer ou désactiver l'animation de placement élégante.", "tooltip.fbp.cartoon_mode": "Activer ou désactiver le mode dessin animé des particules.", + "tooltip.fbp.cull_particles": "Activer ou désactiver l'élimination des particules.", "tooltip.fbp.smart_breaking": "Activer ou désactiver le cassage intelligent.", "tooltip.fbp.low_traction": "Activer ou désactiver la faible traction des particules.", diff --git a/Fabric/src/main/resources/assets/fbp/lang/pl_pl.json b/Fabric/src/main/resources/assets/fbp/lang/pl_pl.json index bb32b74..275dcf2 100644 --- a/Fabric/src/main/resources/assets/fbp/lang/pl_pl.json +++ b/Fabric/src/main/resources/assets/fbp/lang/pl_pl.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "Fantazyjna animacja stawiania", "button.fbp.cartoon_mode": "Tryb kreskówkowy", + "button.fbp.cull_particles": "Eliminacja cząsteczek", "button.fbp.smart_breaking": "Inteligentne burzenie", "button.fbp.low_traction": "Niska trakcja", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "Włącz lub wyłącz fantazyjną animację stawiania.", "tooltip.fbp.cartoon_mode": "Włącz lub wyłącz tryb kreskówkowy cząsteczek.", + "tooltip.fbp.cull_particles": "Włącz lub wyłącz eliminację cząsteczek.", "tooltip.fbp.smart_breaking": "Włącz lub wyłącz inteligentne burzenie.", "tooltip.fbp.low_traction": "Włącz lub wyłącz niską trakcję cząsteczek.", diff --git a/Fabric/src/main/resources/assets/fbp/lang/zh_cn.json b/Fabric/src/main/resources/assets/fbp/lang/zh_cn.json index 1612657..0894850 100644 --- a/Fabric/src/main/resources/assets/fbp/lang/zh_cn.json +++ b/Fabric/src/main/resources/assets/fbp/lang/zh_cn.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "华丽放置动画", "button.fbp.cartoon_mode": "卡通模式", + "button.fbp.cull_particles": "剔除粒子", "button.fbp.smart_breaking": "智能破坏", "button.fbp.low_traction": "低牵引力", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "启用或禁用华丽的方块放置动画。", "tooltip.fbp.cartoon_mode": "启用或禁用颗粒卡通模式。", + "tooltip.fbp.cull_particles": "启用或禁用粒子剔除。", "tooltip.fbp.smart_breaking": "启用或禁用智能破坏。", "tooltip.fbp.low_traction": "启用或禁用粒子低牵引力。", diff --git a/Forge/src/main/java/hantonik/fbp/config/FBPConfig.java b/Forge/src/main/java/hantonik/fbp/config/FBPConfig.java index 89a644e..c901d49 100644 --- a/Forge/src/main/java/hantonik/fbp/config/FBPConfig.java +++ b/Forge/src/main/java/hantonik/fbp/config/FBPConfig.java @@ -36,6 +36,7 @@ public final class FBPConfig { private static final boolean DEFAULT_FROZEN = false; private static final boolean DEFAULT_INFINITE_DURATION = false; private static final boolean DEFAULT_CARTOON_MODE = false; + private static final boolean DEFAULT_CULL_PARTICLES = false; private static final boolean DEFAULT_FANCY_FLAME = true; private static final boolean DEFAULT_FANCY_SMOKE = true; @@ -74,7 +75,7 @@ public final class FBPConfig { public static final FBPConfig DEFAULT_CONFIG = new FBPConfig( DEFAULT_ENABLED, DEFAULT_LOCKED, - DEFAULT_FROZEN, DEFAULT_INFINITE_DURATION, DEFAULT_CARTOON_MODE, + DEFAULT_FROZEN, DEFAULT_INFINITE_DURATION, DEFAULT_CARTOON_MODE, DEFAULT_CULL_PARTICLES, DEFAULT_FANCY_FLAME, DEFAULT_FANCY_SMOKE, DEFAULT_FANCY_RAIN, DEFAULT_FANCY_SNOW, DEFAULT_SMOOTH_ANIMATION_LIGHTING, DEFAULT_SMART_BREAKING, DEFAULT_LOW_TRACTION, DEFAULT_SPAWN_WHILE_FROZEN, DEFAULT_SMOOTH_ANIMATION_LIGHTING, DEFAULT_SPAWN_PLACE_PARTICLES, @@ -92,6 +93,7 @@ public final class FBPConfig { private boolean frozen; private boolean infiniteDuration; private boolean cartoonMode; + private boolean cullParticles; private boolean fancyFlame; private boolean fancySmoke; @@ -170,6 +172,7 @@ public void setConfig(FBPConfig config) { this.frozen = config.frozen; this.infiniteDuration = config.infiniteDuration; this.cartoonMode = config.cartoonMode; + this.cullParticles = config.cullParticles; this.fancyFlame = config.fancyFlame; this.fancySmoke = config.fancySmoke; @@ -213,6 +216,7 @@ public void applyConfig(FBPConfig config) { this.frozen = config.frozen; this.infiniteDuration = config.infiniteDuration; this.cartoonMode = config.cartoonMode; + this.cullParticles = config.cullParticles; this.fancyFlame = config.fancyFlame; this.fancySmoke = config.fancySmoke; @@ -280,6 +284,7 @@ public void reload() { this.frozen = GsonHelper.getAsBoolean(json, "frozen", DEFAULT_FROZEN); this.infiniteDuration = GsonHelper.getAsBoolean(json, "infiniteDuration", DEFAULT_INFINITE_DURATION); this.cartoonMode = GsonHelper.getAsBoolean(json, "cartoonMode", DEFAULT_CARTOON_MODE); + this.cullParticles = GsonHelper.getAsBoolean(json, "cullParticles", DEFAULT_CULL_PARTICLES); this.fancyFlame = GsonHelper.getAsBoolean(json, "fancyFlame", DEFAULT_FANCY_FLAME); this.fancySmoke = GsonHelper.getAsBoolean(json, "fancySmoke", DEFAULT_FANCY_SMOKE); @@ -343,6 +348,7 @@ public void save() { json.addProperty("frozen", this.frozen); json.addProperty("infiniteDuration", this.infiniteDuration); json.addProperty("cartoonMode", this.cartoonMode); + json.addProperty("cullParticles", this.cullParticles); json.addProperty("fancyFlame", this.fancyFlame); json.addProperty("fancySmoke", this.fancySmoke); @@ -395,7 +401,7 @@ public void save() { public FBPConfig copy() { return new FBPConfig( this.enabled, this.locked, - this.frozen, this.infiniteDuration, this.cartoonMode, + this.frozen, this.infiniteDuration, this.cartoonMode, this.cullParticles, this.fancyFlame, this.fancySmoke, this.fancyRain, this.fancySnow, this.fancyPlaceAnimation, this.smartBreaking, this.lowTraction, this.spawnWhileFrozen, this.smoothAnimationLighting, this.spawnPlaceParticles, diff --git a/Forge/src/main/java/hantonik/fbp/screen/FBPOptionsScreen.java b/Forge/src/main/java/hantonik/fbp/screen/FBPOptionsScreen.java index 7efaa6a..008d7da 100644 --- a/Forge/src/main/java/hantonik/fbp/screen/FBPOptionsScreen.java +++ b/Forge/src/main/java/hantonik/fbp/screen/FBPOptionsScreen.java @@ -43,7 +43,7 @@ public FBPOptionsScreen() { this.config = FancyBlockParticles.CONFIG.copy(); - this.pageCount = 3; + this.pageCount = 4; this.page = 1; } @@ -137,6 +137,9 @@ protected void init() { helper.addChild(SpacerElement.width(75)); helper.addChild(new FBPToggleButton(Component.translatable("button.fbp.cartoon_mode"), this.config::isCartoonMode, builder -> builder.width(275), button -> this.config.setCartoonMode(!this.config.isCartoonMode())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.cartoon_mode").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isCartoonMode())))); helper.addChild(SpacerElement.width(75)); + helper.addChild(SpacerElement.width(75)); + helper.addChild(new FBPToggleButton(Component.translatable("button.fbp.cull_particles"), this.config::isCullParticles, builder -> builder.width(275), button -> this.config.setCullParticles(!this.config.isCullParticles())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.cull_particles").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isCullParticles())))); + helper.addChild(SpacerElement.width(75)); helper.addChild(SpacerElement.width(75)); helper.addChild(new FBPToggleButton(Component.translatable("button.fbp.smart_breaking"), this.config::isSmartBreaking, builder -> builder.width(275), button -> this.config.setSmartBreaking(!this.config.isSmartBreaking())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.smart_breaking").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSmartBreaking())))); @@ -144,14 +147,11 @@ protected void init() { helper.addChild(SpacerElement.width(75)); helper.addChild(new FBPToggleButton(Component.translatable("button.fbp.low_traction"), this.config::isLowTraction, builder -> builder.width(275), button -> this.config.setLowTraction(!this.config.isLowTraction())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.low_traction").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isLowTraction())))); helper.addChild(SpacerElement.width(75)); - helper.addChild(SpacerElement.width(75)); - helper.addChild(new FBPToggleButton(Component.translatable("button.fbp.spawn_while_frozen"), this.config::isSpawnWhileFrozen, builder -> builder.width(275), button -> this.config.setSpawnWhileFrozen(!this.config.isSpawnWhileFrozen())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.spawn_while_frozen").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSpawnWhileFrozen())))); - helper.addChild(SpacerElement.width(75)); } case 3 -> { helper.addChild(SpacerElement.width(75)); - helper.addChild(new FBPToggleButton(Component.translatable("button.fbp.smooth_animation_lighting"), this.config::isSmoothAnimationLighting, builder -> builder.width(275), button -> this.config.setSmoothAnimationLighting(!this.config.isSmoothAnimationLighting())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.smooth_animation_lighting").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSmoothAnimationLighting())))); + helper.addChild(new FBPToggleButton(Component.translatable("button.fbp.spawn_while_frozen"), this.config::isSpawnWhileFrozen, builder -> builder.width(275), button -> this.config.setSpawnWhileFrozen(!this.config.isSpawnWhileFrozen())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.spawn_while_frozen").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSpawnWhileFrozen())))); helper.addChild(SpacerElement.width(75)); helper.addChild(SpacerElement.width(75)); helper.addChild(new FBPToggleButton(Component.translatable("button.fbp.spawn_place_particles"), this.config::isSpawnPlaceParticles, builder -> builder.width(275), button -> this.config.setSpawnPlaceParticles(!this.config.isSpawnPlaceParticles())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.spawn_place_particles").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSpawnPlaceParticles())))); @@ -180,6 +180,21 @@ protected void init() { helper.addChild(new FBPToggleButton(Component.translatable("button.fbp.random_fading_speed"), this.config::isRandomFadingSpeed, builder -> builder.width(275), button -> this.config.setRandomFadingSpeed(!this.config.isRandomFadingSpeed())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.random_fading_speed").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isRandomFadingSpeed())))); helper.addChild(SpacerElement.width(75)); } + + case 4 -> { + helper.addChild(SpacerElement.width(75)); + helper.addChild(new FBPToggleButton(Component.translatable("button.fbp.smooth_animation_lighting"), this.config::isSmoothAnimationLighting, builder -> builder.width(275), button -> this.config.setSmoothAnimationLighting(!this.config.isSmoothAnimationLighting())), 4).setTooltip(Tooltip.create(Component.translatable("tooltip.fbp.smooth_animation_lighting").append(CommonComponents.NEW_LINE).append(CommonComponents.NEW_LINE).append(Component.translatable("tooltip.fbp.default")).append(Component.translatable("button.fbp." + defaultConfig.isSmoothAnimationLighting())))); + helper.addChild(SpacerElement.width(75)); + + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + helper.addChild(SpacerElement.height(20), 6); + } } var previousButton = helper.addChild(Button.builder(Component.translatable("button.fbp.previous"), button -> { diff --git a/Forge/src/main/java/hantonik/fbp/util/FBPConstants.java b/Forge/src/main/java/hantonik/fbp/util/FBPConstants.java index fa59e89..9837a08 100644 --- a/Forge/src/main/java/hantonik/fbp/util/FBPConstants.java +++ b/Forge/src/main/java/hantonik/fbp/util/FBPConstants.java @@ -79,7 +79,10 @@ public void begin(BufferBuilder buffer, TextureManager manager) { RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShader(GameRenderer::getRendertypeTranslucentShader); - RenderSystem.enableCull(); + if (FancyBlockParticles.CONFIG.isCullParticles()) + RenderSystem.enableCull(); + else + RenderSystem.disableCull(); buffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); } diff --git a/Forge/src/main/resources/assets/fbp/lang/de_de.json b/Forge/src/main/resources/assets/fbp/lang/de_de.json index 0504295..b218cc2 100644 --- a/Forge/src/main/resources/assets/fbp/lang/de_de.json +++ b/Forge/src/main/resources/assets/fbp/lang/de_de.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "Elegante Platzierungsanimation", "button.fbp.cartoon_mode": "Cartoon-Modus", + "button.fbp.cull_particles": "Partikel eliminieren", "button.fbp.smart_breaking": "Intelligentes Abbauen", "button.fbp.low_traction": "Geringe Traktion", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "Aktiviere oder deaktiviere schicke Blockplatzierungsanimation.", "tooltip.fbp.cartoon_mode": "Aktivieren oder deaktivieren Sie den Partikel-Cartoon-Modus.", + "tooltip.fbp.cull_particles": "Aktiviere oder deaktiviere das Aussortieren von Partikeln.", "tooltip.fbp.smart_breaking": "Aktiviere oder deaktiviere intelligentes Brechen.", "tooltip.fbp.low_traction": "Aktiviere oder deaktiviere Partikel mit geringer Traktion.", diff --git a/Forge/src/main/resources/assets/fbp/lang/en_us.json b/Forge/src/main/resources/assets/fbp/lang/en_us.json index 9b46379..e7f3428 100644 --- a/Forge/src/main/resources/assets/fbp/lang/en_us.json +++ b/Forge/src/main/resources/assets/fbp/lang/en_us.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "Fancy placing animation", "button.fbp.cartoon_mode": "Cartoon mode", + "button.fbp.cull_particles": "Cull particles", "button.fbp.smart_breaking": "Smart breaking", "button.fbp.low_traction": "Low traction", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "Enable or disable fancy block placing animation.", "tooltip.fbp.cartoon_mode": "Enable or disable particles cartoon mode.", + "tooltip.fbp.cull_particles": "Enable or disable particle culling.", "tooltip.fbp.smart_breaking": "Enable or disable smart breaking.", "tooltip.fbp.low_traction": "Enable or disable particle low traction.", diff --git a/Forge/src/main/resources/assets/fbp/lang/es_es.json b/Forge/src/main/resources/assets/fbp/lang/es_es.json index a0284a2..796a20b 100644 --- a/Forge/src/main/resources/assets/fbp/lang/es_es.json +++ b/Forge/src/main/resources/assets/fbp/lang/es_es.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "Animación de Colocación Elegante", "button.fbp.cartoon_mode": "Modo caricatura", + "button.fbp.cull_particles": "Eliminar partículas", "button.fbp.smart_breaking": "Ruptura Inteligente", "button.fbp.low_traction": "Baja Tracción", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "Activar o desactivar animación elegante al colocar bloques.", "tooltip.fbp.cartoon_mode": "Activar o desactivar el modo caricatura de partículas.", + "tooltip.fbp.cull_particles": "Activar o desactivar el eliminado de partículas.", "tooltip.fbp.smart_breaking": "Activar o desactivar ruptura inteligente.", "tooltip.fbp.low_traction": "Activar o desactivar partículas de baja tracción.", diff --git a/Forge/src/main/resources/assets/fbp/lang/fr_fr.json b/Forge/src/main/resources/assets/fbp/lang/fr_fr.json index 0c71237..92ba725 100644 --- a/Forge/src/main/resources/assets/fbp/lang/fr_fr.json +++ b/Forge/src/main/resources/assets/fbp/lang/fr_fr.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "Animation de placement élégante", "button.fbp.cartoon_mode": "Mode dessin animé", + "button.fbp.cull_particles": "Éliminer les particules", "button.fbp.smart_breaking": "Cassage intelligent", "button.fbp.low_traction": "Faible traction", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "Activer ou désactiver l'animation de placement élégante.", "tooltip.fbp.cartoon_mode": "Activer ou désactiver le mode dessin animé des particules.", + "tooltip.fbp.cull_particles": "Activer ou désactiver l'élimination des particules.", "tooltip.fbp.smart_breaking": "Activer ou désactiver le cassage intelligent.", "tooltip.fbp.low_traction": "Activer ou désactiver la faible traction des particules.", diff --git a/Forge/src/main/resources/assets/fbp/lang/pl_pl.json b/Forge/src/main/resources/assets/fbp/lang/pl_pl.json index bb32b74..275dcf2 100644 --- a/Forge/src/main/resources/assets/fbp/lang/pl_pl.json +++ b/Forge/src/main/resources/assets/fbp/lang/pl_pl.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "Fantazyjna animacja stawiania", "button.fbp.cartoon_mode": "Tryb kreskówkowy", + "button.fbp.cull_particles": "Eliminacja cząsteczek", "button.fbp.smart_breaking": "Inteligentne burzenie", "button.fbp.low_traction": "Niska trakcja", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "Włącz lub wyłącz fantazyjną animację stawiania.", "tooltip.fbp.cartoon_mode": "Włącz lub wyłącz tryb kreskówkowy cząsteczek.", + "tooltip.fbp.cull_particles": "Włącz lub wyłącz eliminację cząsteczek.", "tooltip.fbp.smart_breaking": "Włącz lub wyłącz inteligentne burzenie.", "tooltip.fbp.low_traction": "Włącz lub wyłącz niską trakcję cząsteczek.", diff --git a/Forge/src/main/resources/assets/fbp/lang/zh_cn.json b/Forge/src/main/resources/assets/fbp/lang/zh_cn.json index 1612657..0894850 100644 --- a/Forge/src/main/resources/assets/fbp/lang/zh_cn.json +++ b/Forge/src/main/resources/assets/fbp/lang/zh_cn.json @@ -36,6 +36,7 @@ "button.fbp.fancy_place_animation": "华丽放置动画", "button.fbp.cartoon_mode": "卡通模式", + "button.fbp.cull_particles": "剔除粒子", "button.fbp.smart_breaking": "智能破坏", "button.fbp.low_traction": "低牵引力", @@ -81,6 +82,7 @@ "tooltip.fbp.fancy_place_animation": "启用或禁用华丽的方块放置动画。", "tooltip.fbp.cartoon_mode": "启用或禁用颗粒卡通模式。", + "tooltip.fbp.cull_particles": "启用或禁用粒子剔除。", "tooltip.fbp.smart_breaking": "启用或禁用智能破坏。", "tooltip.fbp.low_traction": "启用或禁用粒子低牵引力。", diff --git a/update.json b/update.json index fe60160..b4164d7 100644 --- a/update.json +++ b/update.json @@ -4,7 +4,7 @@ "promos": { "1.20.4-latest": "1.0.2.5-beta", - "1.20.1-latest": "1.1.0.2-beta" + "1.20.1-latest": "1.1.1.0-beta" }, "1.20.4": { @@ -19,6 +19,7 @@ }, "1.20.1": { + "1.1.1.0-beta": "Fix the position of the Done button. Add particle culling toggle option", "1.1.0.2-beta": "[Forge] Fix unexpected Snow Particles in the desert", "1.1.0.1-beta": "Fix crash with SereneSeasons mod", "1.1.0.0-beta": "Backport to Minecraft 1.20.1"