Skip to content

Commit

Permalink
configurable slime color
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkGoosik committed Jun 25, 2024
1 parent 13258e1 commit 4de48f3
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 29 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "fabric-loom" version "1.6-SNAPSHOT"
id "fabric-loom" version "1.7-SNAPSHOT"
}

version = project.mod_version
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx2G
org.gradle.parallel = true

# Mod Properties
mod_version = 0.7.4+1.21
mod_version = 0.7.5+1.21
maven_group = ru.pinkgoosik
archives_base_name = visuality
minecraft_version_range = >=1.21 <1.22
Expand All @@ -12,7 +12,7 @@ minecraft_version_range = >=1.21 <1.22
minecraft_version = 1.21
yarn_mappings = 1.21+build.2
fabric_loader = 0.15.11
fabric_api = 0.100.1+1.21
fabric_api = 0.100.3+1.21

cloth_config = 15.0.127
modmenu_version = 11.0.0-rc.2
modmenu_version = 11.0.1
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions src/main/java/visuality/config/VisualityClothConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.text.Text;
import net.minecraft.text.TextColor;
import visuality.VisualityMod;
import visuality.registry.HitParticleRegistry;
import visuality.registry.ShinyArmorRegistry;
Expand All @@ -35,6 +36,11 @@ private static void setupEntries(ConfigCategory category, ConfigEntryBuilder ent
.setSaveConsumer(newValue -> config.slimeEnabled = newValue)
.build());

category.addEntry(entryBuilder.startColorField(text("option.slime.color"), config.slimeColor)
.setDefaultValue(TextColor.fromRgb(8978297))
.setSaveConsumer(newValue -> config.slimeColor = TextColor.fromRgb(newValue))
.build());

category.addEntry(entryBuilder.startBooleanToggle(text("option.charge"), config.chargeEnabled)
.setDefaultValue(true)
.setSaveConsumer(newValue -> config.chargeEnabled = newValue)
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/visuality/config/VisualityConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package visuality.config;

import net.minecraft.text.TextColor;

import java.util.ArrayList;
import java.util.List;

Expand All @@ -22,6 +24,7 @@ public class VisualityConfig {
"minecraft:deepslate_emerald_ore"));

public boolean slimeEnabled = true;
public TextColor slimeColor = TextColor.fromRgb(8978297);
public boolean chargeEnabled = true;
public boolean sparkleEnabled = true;
public boolean soulEnabled = true;
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/visuality/mixin/SlimeEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import visuality.VisualityMod;
import visuality.registry.VisualityParticles;
import visuality.util.ParticleUtils;
import visuality.util.SlimeColors;

@Mixin(SlimeEntity.class)
public abstract class SlimeEntityMixin extends MobEntity implements Monster {
Expand All @@ -41,13 +40,13 @@ void addParticle(World world, ParticleEffect particle, double x, double y, doubl
@Unique
private void spawnSlimeParticle(double x, double y, double z) {
if(getDataTracker().get(SLIME_SIZE) == 1) {
ParticleUtils.add(this.getWorld(), VisualityParticles.SMALL_SLIME_BLOB, x, y, z, SlimeColors.VANILLA, 1.0D);
ParticleUtils.add(this.getWorld(), VisualityParticles.SMALL_SLIME_BLOB, x, y, z, VisualityMod.config.slimeColor.getRgb(), 1.0D);
}
else if(getDataTracker().get(SLIME_SIZE) == 2) {
ParticleUtils.add(this.getWorld(), VisualityParticles.MEDIUM_SLIME_BLOB, x, y, z, SlimeColors.VANILLA, 1.0D);
ParticleUtils.add(this.getWorld(), VisualityParticles.MEDIUM_SLIME_BLOB, x, y, z, VisualityMod.config.slimeColor.getRgb(), 1.0D);
}
else {
ParticleUtils.add(this.getWorld(), VisualityParticles.BIG_SLIME_BLOB, x, y, z, SlimeColors.VANILLA, 2.0D);
ParticleUtils.add(this.getWorld(), VisualityParticles.BIG_SLIME_BLOB, x, y, z, VisualityMod.config.slimeColor.getRgb(), 2.0D);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/visuality/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"config.visuality.title": "Visuality Config",
"config.visuality.general": "General",
"config.visuality.option.slime": "Slime Blobs Enabled",
"config.visuality.option.slime.color": "Slime Blobs Color",
"config.visuality.option.charge": "Charge Particle Enabled",
"config.visuality.option.sparkle": "Sparkle Particle Enabled",
"config.visuality.option.soul": "Soul Particle Enabled",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/visuality/lang/es_mx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"config.visuality.title": "Configuración de Visuality",
"config.visuality.general": "General",
"config.visuality.option.slime": "Salpicado de Slime activado",
"config.visuality.option.slime.color": "Slime Blobs Color",
"config.visuality.option.charge": "Charge Particle Enabled",
"config.visuality.option.sparkle": "Partícula de Destello Activada",
"config.visuality.option.soul": "Partícula de Alma Activada",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/visuality/lang/fr_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"config.visuality.title": "Configuration de la Visibilité",
"config.visuality.general": "Général",
"config.visuality.option.slime": "Blobs de Slime Activés",
"config.visuality.option.slime.color": "Slime Blobs Color",
"config.visuality.option.charge": "Particules de Charge Activées",
"config.visuality.option.sparkle": "Particules d'Étincelle Activées",
"config.visuality.option.soul": "Particules d'Âme Activées",
Expand Down
37 changes: 19 additions & 18 deletions src/main/resources/assets/visuality/lang/pt_br.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"modmenu.descriptionTranslation.visuality": "Melhorias visuais adicionando um monte de novas partículas.",
"config.visuality.title": "Configuração de Visualidade",
"config.visuality.general": "Geral",
"config.visuality.option.slime": "Slime Blobs ativado",
"config.visuality.option.charge": "Partícula de carga ativada",
"config.visuality.option.sparkle": "Partícula de brilho ativada",
"config.visuality.option.soul": "Partícula de alma ativada",
"config.visuality.option.waterCircle": "Círculos de água ativados",
"config.visuality.option.waterCircle.colored": "Círculos de água coloridos",
"config.visuality.option.waterCircle.density": "Densidade dos círculos de água",
"config.visuality.option.waterCircle.radius": "Raio dos círculos de água",
"config.visuality.option.hitParticles": "Partículas de hit ativadas",
"config.visuality.option.hitParticles.entries": "Entradas de Partículas de Acerto",
"config.visuality.option.shinyArmor": "Armadura Brilhante Ativada",
"config.visuality.option.shinyArmor.entries": "Entradas de Armadura Brilhante",
"config.visuality.option.shinyBlocks": "Blocos brilhantes ativados",
"config.visuality.option.shinyBlocks.entries": "Entradas de blocos brilhantes"
}
"modmenu.descriptionTranslation.visuality": "Melhorias visuais adicionando um monte de novas partículas.",
"config.visuality.title": "Configuração de Visualidade",
"config.visuality.general": "Geral",
"config.visuality.option.slime": "Slime Blobs ativado",
"config.visuality.option.slime.color": "Slime Blobs Color",
"config.visuality.option.charge": "Partícula de carga ativada",
"config.visuality.option.sparkle": "Partícula de brilho ativada",
"config.visuality.option.soul": "Partícula de alma ativada",
"config.visuality.option.waterCircle": "Círculos de água ativados",
"config.visuality.option.waterCircle.colored": "Círculos de água coloridos",
"config.visuality.option.waterCircle.density": "Densidade dos círculos de água",
"config.visuality.option.waterCircle.radius": "Raio dos círculos de água",
"config.visuality.option.hitParticles": "Partículas de hit ativadas",
"config.visuality.option.hitParticles.entries": "Entradas de Partículas de Acerto",
"config.visuality.option.shinyArmor": "Armadura Brilhante Ativada",
"config.visuality.option.shinyArmor.entries": "Entradas de Armadura Brilhante",
"config.visuality.option.shinyBlocks": "Blocos brilhantes ativados",
"config.visuality.option.shinyBlocks.entries": "Entradas de blocos brilhantes"
}
3 changes: 2 additions & 1 deletion src/main/resources/assets/visuality/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"config.visuality.title": "Настройки Visuality",
"config.visuality.general": "Общее",
"config.visuality.option.slime": "Включены слизевые шарики",
"config.visuality.option.slime.color": "Цвет слизевых шариков",
"config.visuality.option.charge": "Частицы зарядов включены",
"config.visuality.option.sparkle": "Частицы искр включены",
"config.visuality.option.soul": "Частицы души включены",
Expand All @@ -16,4 +17,4 @@
"config.visuality.option.shinyArmor.entries": "Список блестящей брони",
"config.visuality.option.shinyBlocks": "Блестящие блоки включены",
"config.visuality.option.shinyBlocks.entries": "Список блестящих блоков"
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/visuality/lang/uk_ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"config.visuality.title": "Налаштування Visuality",
"config.visuality.general": "Загальне",
"config.visuality.option.slime": "Слизневі краплі увімкнені",
"config.visuality.option.slime.color": "Slime Blobs Color",
"config.visuality.option.charge": "Заряджені частинки увімкнені",
"config.visuality.option.sparkle": "Іскристі частинки увімкнені",
"config.visuality.option.soul": "Частинки душі увімкнені",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/visuality/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"config.visuality.title": "Visuality 设置",
"config.visuality.general": "通用",
"config.visuality.option.slime": "启用黏液液滴",
"config.visuality.option.slime.color": "Slime Blobs Color",
"config.visuality.option.charge": "启用充能粒子",
"config.visuality.option.sparkle": "启用闪烁粒子",
"config.visuality.option.soul": "启用灵魂粒子",
Expand Down

0 comments on commit 4de48f3

Please sign in to comment.