Skip to content

Commit

Permalink
1.21-pre4
Browse files Browse the repository at this point in the history
  • Loading branch information
orifu committed Jun 9, 2024
1 parent 85d9adc commit ab02615
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 42 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ org.gradle.jvmargs=-Xmx1G

# minecraft, mappings and loader dependencies
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21-pre2
quilt_mappings=3
minecraft_version=1.21-pre4
quilt_mappings=1
loader_version=0.15.11

# mod properties
Expand All @@ -15,4 +15,4 @@ archives_base_name=rainglow
# other dependencies
java_version=21
mod_menu_version=11.0.0-beta.1
fabric_api_version=0.99.4+1.21
fabric_api_version=0.100.0+1.21
2 changes: 1 addition & 1 deletion src/main/java/io/ix0rai/rainglow/Rainglow.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void onInitialize() {
}

public static Identifier id(String id) {
return Identifier.method_60655(MOD_ID, id);
return Identifier.of(MOD_ID, id);
}

public static String generateRandomColourId(World world, RandomGenerator random) {
Expand Down
48 changes: 24 additions & 24 deletions src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ public CustomModeScreen(Screen parent) {
super(parent, MinecraftClient.getInstance().options, TITLE);

this.saveButton = ButtonWidget.builder(
Rainglow.translatableText("config.save"),
button -> {
boolean hasColourSelected = false;
for (DeferredSaveOption<Boolean> option : this.options) {
if (option.deferredValue) {
hasColourSelected = true;
break;
Rainglow.translatableText("config.save"),
button -> {
boolean hasColourSelected = false;
for (DeferredSaveOption<Boolean> option : this.options) {
if (option.deferredValue) {
hasColourSelected = true;
break;
}
}
}

if (!hasColourSelected) {
sendNoColoursToast();
} else {
this.save();
}
}).build();

if (!hasColourSelected) {
sendNoColoursToast();
} else {
this.save();
}
}).build();
this.saveButton.active = false;
}

Expand All @@ -54,15 +54,15 @@ private void createColourToggles() {

for (RainglowColour colour : RainglowColour.values()) {
this.options.add(DeferredSaveOption.createDeferredBoolean(
"colour." + colour.getId(),
null,
Rainglow.CONFIG.customColours.getRealValue().contains(colour.getId()),
enabled -> {
if (enabled) {
Rainglow.CONFIG.customColours.getRealValue().add(colour.getId());
}
},
enabled -> this.saveButton.active = true
"colour." + colour.getId(),
null,
Rainglow.CONFIG.customColours.getRealValue().contains(colour.getId()),
enabled -> {
if (enabled) {
Rainglow.CONFIG.customColours.getRealValue().add(colour.getId());
}
},
enabled -> this.saveButton.active = true
));
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ public void init() {

contentLayout.add(gridWidget);
contentLayout.add(ButtonWidget.builder(
Rainglow.translatableText("config.custom"),
button -> MinecraftClient.getInstance().setScreen(new CustomModeScreen(this))
).width(308).position(4, 0).build(),
LayoutSettings.create().setPadding(4, 0));
Rainglow.translatableText("config.custom"),
button -> MinecraftClient.getInstance().setScreen(new CustomModeScreen(this))
).width(308).position(4, 0).build(),
LayoutSettings.create().setPadding(4, 0));

headerFooterWidget.addToContents(contentLayout);

Expand Down Expand Up @@ -132,14 +132,14 @@ private DeferredSaveOption<Boolean> createEntityToggle(RainglowEntity entity) {

private DeferredSaveOption<Integer> createColourRaritySlider(RainglowEntity entity) {
return sliders.computeIfAbsent(entity, e -> DeferredSaveOption.createDeferredRangedInt(
"config." + e.getId() + "_rarity",
"tooltip.rarity",
Rainglow.CONFIG.rarities.getRealValue().get(e.getId()),
0,
100,
rarity -> Rainglow.CONFIG.rarities.getRealValue().put(e.getId(), rarity),
"config." + e.getId() + "_rarity",
"tooltip.rarity",
Rainglow.CONFIG.rarities.getRealValue().get(e.getId()),
0,
100,
rarity -> Rainglow.CONFIG.rarities.getRealValue().put(e.getId(), rarity),
rarity -> this.saveButton.active = true
));
));
}

public CyclingButtonWidget<RainglowMode> createModeButton() {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/ix0rai/rainglow/data/RainglowColour.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ public Identifier getTexture(RainglowEntity entityType) {
switch (entity) {
case GLOW_SQUID -> {
String textureName = RainglowEntity.GLOW_SQUID.getDefaultColour() == this ? "glow_squid" : this.getId();
this.textures.put(entity, Identifier.method_60656("textures/entity/squid/" + textureName + ".png"));
this.textures.put(entity, Identifier.ofDefault("textures/entity/squid/" + textureName + ".png"));
}
case ALLAY -> {
String textureName = RainglowEntity.ALLAY.getDefaultColour() == this ? "allay" : this.getId();
this.textures.put(entity, Identifier.method_60656("textures/entity/allay/" + textureName + ".png"));
this.textures.put(entity, Identifier.ofDefault("textures/entity/allay/" + textureName + ".png"));
}
case SLIME -> {
String textureName = RainglowEntity.SLIME.getDefaultColour() == this ? "slime" : this.getId();
this.textures.put(entity, Identifier.method_60656("textures/entity/slime/" + textureName + ".png"));
this.textures.put(entity, Identifier.ofDefault("textures/entity/slime/" + textureName + ".png"));
}
}
}
Expand Down

0 comments on commit ab02615

Please sign in to comment.