Skip to content

Commit

Permalink
feat: Caves
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jan 17, 2025
1 parent b284343 commit 07beaec
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 76 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mappings_mc_ver=1.21
mappings=2024.06.23

# Required Dependencies
zenith_version=1.2.16
zenith_version=1.2.17
unity_version=0.1.05
aether_version=1.5.2
nitrogen_version=1.1.22
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/net/zepalesque/redux/Redux.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,4 @@ public void packSetup(AddPackFindersEvent event) {
public static ResourceLocation loc(String path) {
return ResourceLocation.fromNamespaceAndPath(MODID, path);
}

public static boolean compat(String modid) {
return ModList.get().isLoaded(modid);
}


}
26 changes: 14 additions & 12 deletions src/main/java/net/zepalesque/redux/config/ReduxConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ public static class Server extends DataSerializableConfig {
// TODO: Item component?
public final ModConfigSpec.IntValue max_veridium_tool_infusion;
public final ModConfigSpec.ConfigValue<Boolean> consistent_break_speeds;
// TODO: Other Ores
public final ModConfigSpec.ConfigValue<Boolean> raw_ores;
public final ModConfigSpec.ConfigValue<Boolean> gummy_swet_nerf;

public Server(ModConfigSpec.Builder builder) {
super(() -> SERVER_SPEC, "redux_server");
builder.push("Tweaks");
builder.push("Worldgen Tweaks");
redux_sky_colors = builder
.comment("Use Redux's alternative sky colors for the Aether")
.define("Redux Sky Colors", true);
Expand All @@ -31,20 +33,25 @@ public Server(ModConfigSpec.Builder builder) {
cloudbed = builder
.comment("Replace the Aether's large Aercloud features with a noise-based cloudbed")
.define("Cloudbed", true);
raw_ores = builder
.comment("Use raw ores like modern vanilla versions, instead of just getting the ore block when mining it")
.define("Raw Ores", true);

builder.pop();
builder.push("Gameplay");
max_veridium_tool_infusion = builder
.comment("The maximum amount of infusion a Veridium tool is able to carry. Note that by default, a tools infusion level is increased by 4 when it is infused with a single Ambrosium Shard.")
.defineInRange("Max Veridium Tool Infusion", 64, 1, 127);
.defineInRange("Max Veridium Tool Infusion", 64, 1, Short.MAX_VALUE);
revamped_quicksoil_movement = builder
.comment("Changes quicksoil to make it use a better movement system, based on the way it worked in the Aether II: Highlands in 1.12")
.define("Revamped Quicksoil Movement", true);
consistent_break_speeds = builder
.comment("Slows down the mining speeds of some Aether blocks, to be more vanilla-consistent")
.define("Consistent Break Speeds", false);
raw_ores = builder
.comment("Use raw ores like modern vanilla versions, instead of just getting the ore block when mining it")
.define("Raw Ores", true);
gummy_swet_nerf = builder
.comment("Nerfs Gummy Swets and makes them craftable.")
.gameRestart()
.define("Gummy Swet Nerf", true);
builder.pop();
}
}
Expand All @@ -54,11 +61,10 @@ public static class Common extends DataSerializableConfig {
public final ModConfigSpec.ConfigValue<Boolean> bronze_dungeon_upgrade;
public final ModConfigSpec.EnumValue<AACompatType> redux_noise;

public final ModConfigSpec.ConfigValue<Boolean> gummy_swet_nerf;

// TODO: Move this stuff to server when switching to PackConfig? assuming the configs are loaded before data stuff is initially loaded
public Common(ModConfigSpec.Builder builder) {
super(() -> COMMON_SPEC, "redux_common");
builder.push("TODO");
builder.push("Datapack Registration");
redux_noise = builder
.comment("Uses an alternative noise for the Aether. By default, this is disabled with the Ancient Aether mod installed.")
.worldRestart()
Expand All @@ -67,10 +73,6 @@ public Common(ModConfigSpec.Builder builder) {
.comment("Upgrades the Bronze Dungeon structure with new blocks and more depth")
.worldRestart()
.define("Bronze Dungeon Upgrade", true);
gummy_swet_nerf = builder
.comment("Nerfs Gummy Swets and makes them craftable.")
.gameRestart()
.define("Gummy Swet Nerf", true);
builder.pop();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package net.zepalesque.redux.config.enums;

import net.neoforged.fml.ModList;
import net.zepalesque.redux.Redux;
import net.zepalesque.zenith.core.Zenith;
import org.jetbrains.annotations.NotNull;

import java.util.function.Supplier;

// Idk if this is a good idea lul
public enum AACompatType implements CharSequence, Supplier<Boolean> {
TRUE("true", () -> true), FALSE("false", () -> false), WITHOUT_AA("without_aa", () -> !Redux.compat("ancient_aether"));
ALWAYS_TRUE("always_true", () -> true), ALWAYS_FALSE("always_false", () -> false), WITHOUT_AA("without_aa", () -> !Zenith.loaded("ancient_aether"));

private final String serialized;
private final Supplier<Boolean> value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected void buildRecipes(@NotNull RecipeOutput output) {
.save(output);

CompoundTag infusionInfo = new CompoundTag();
infusionInfo.putByte(InfusionRecipe.ADDED_INFUSION, (byte) 4);
infusionInfo.putShort(InfusionRecipe.ADDED_INFUSION, (short) 4);
Holder<SoundEvent> infusionSound = ReduxSounds.INFUSE_ITEM;

infuse(ReduxItems.INFUSED_VERIDIUM_PICKAXE.get(), ReduxItems.VERIDIUM_PICKAXE.get())
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ default ItemStack transformStack(Ingredient ingredient, ItemStack original, Reci
if (i >= max) {
return null;
} else {
int infusion = (byte) Math.min(i + additional.getByte(InfusionRecipe.ADDED_INFUSION), max);
int infusion = Math.min(i + additional.getShort(InfusionRecipe.ADDED_INFUSION), max);
original.applyComponents(DataComponentPatch.builder().set(ReduxDataComponents.INFUSION.get(), infusion).build());
return original;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package net.zepalesque.redux.mixin.mixins.common.item;

import com.aetherteam.aether.item.food.GummySwetItem;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.ItemStack;
import net.zepalesque.redux.config.ReduxConfig;
import net.zepalesque.redux.item.property.ReduxFoods;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(GummySwetItem.class)
public abstract class GummySwetItemMixin {

@WrapOperation(method = "getFoodProperties", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/Item;getFoodProperties(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/entity/LivingEntity;)Lnet/minecraft/world/food/FoodProperties;"))
public FoodProperties getFoodProperties(GummySwetItem instance, ItemStack stack, LivingEntity living, Operation<FoodProperties> original) {
if (ReduxConfig.SERVER.gummy_swet_nerf.get()) return ReduxFoods.GUMMY_SWET_NERF;
else return original.call(instance, stack, living);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public static Particles decode(FriendlyByteBuf buf) {
return new Particles(x, y, z);
}


public static void execute(Particles packet, IPayloadContext context) {
Player player = Minecraft.getInstance().player;
if (player != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ public static Signal decode(FriendlyByteBuf buf) {
return new Signal(mobID);
}



@Override
public Type<? extends CustomPacketPayload> type() {
return TYPE;
}


public static void execute(Signal payload, IPayloadContext context) {
ClientLevel level = Minecraft.getInstance().level;
if (level != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ public class ReduxRecipes {
public static class Serializers {
public static final DeferredRegister<RecipeSerializer<?>> SERIALIZERS = DeferredRegister.create(BuiltInRegistries.RECIPE_SERIALIZER, Redux.MODID);
public static final DeferredHolder<RecipeSerializer<?>, StackingRecipeSerializer<InfusionRecipe>> INFUSION = SERIALIZERS.register("infusion", InfusionRecipe.Serializer::new);

}
}
2 changes: 1 addition & 1 deletion src/main/resources/aether_redux.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"common.entity.ai.SliderBackOffMixin",
"common.entity.ai.SliderUpDownMixin",
"common.item.DiggerItemMixin",
"common.item.ItemMixin",
"common.item.GummySwetItemMixin",
"common.item.PickaxeItemMixin",
"common.world.structure.AetherTemplateStructurePieceMixin",
"common.world.structure.BronzeBossMixin",
Expand Down

0 comments on commit 07beaec

Please sign in to comment.