Skip to content

Commit

Permalink
refactor: Move FluidInteractionHelper out of data/ directory
Browse files Browse the repository at this point in the history
Doesn't really make sense to have this on data directory
  • Loading branch information
null2264 committed Dec 5, 2023
1 parent 4502ecf commit d1419d7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/main/java/io/github/null2264/cobblegen/CobbleGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import io.github.null2264.cobblegen.compat.LoaderCompat;
import io.github.null2264.cobblegen.compat.TextCompat;
import io.github.null2264.cobblegen.config.ConfigMetaData;
import io.github.null2264.cobblegen.data.FluidInteractionHelper;
import io.github.null2264.cobblegen.data.model.CGRegistry;
import io.github.null2264.cobblegen.util.CGLog;
import net.minecraft.commands.CommandSourceStack;
Expand Down Expand Up @@ -36,7 +35,7 @@ public class CobbleGen implements net.fabricmc.api.ModInitializer
*/
@Deprecated
@ApiStatus.Internal
public static final FluidInteractionHelper FLUID_INTERACTION = new FluidInteractionHelper();
public static final FluidInteraction FLUID_INTERACTION = new FluidInteraction();
private static final Path configPath = LoaderCompat.getConfigDir();
private static final File configFile = new File(configPath + File.separator + MOD_ID + "-meta.json5");
@ApiStatus.Internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package io.github.null2264.cobblegen.data;
package io.github.null2264.cobblegen;

import com.google.common.collect.ImmutableList;
import io.github.null2264.cobblegen.CobbleGen;
import io.github.null2264.cobblegen.CobbleGenPlugin;
import io.github.null2264.cobblegen.data.CGRegistryImpl;
import io.github.null2264.cobblegen.data.model.CGRegistry;
import io.github.null2264.cobblegen.data.model.Generator;
import io.github.null2264.cobblegen.util.CGLog;
Expand All @@ -13,7 +12,6 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.LevelEvent;
Expand All @@ -37,12 +35,8 @@
/**
* Replacement for BlockGenerator. This will act like Vanilla's registry system
*/
public class FluidInteractionHelper
public class FluidInteraction
{
public static final ImmutableList<Direction> FLOW_DIRECTIONS = ImmutableList.of(
Direction.DOWN, Direction.SOUTH, Direction.NORTH, Direction.EAST, Direction.WEST
);

private final Map<Fluid, List<Generator>> generatorMap = new HashMap<>();
private @Nullable Map<Fluid, List<Generator>> serverGeneratorMap = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import java.util.Optional;

import static io.github.null2264.cobblegen.data.FluidInteractionHelper.FLOW_DIRECTIONS;
import static io.github.null2264.cobblegen.util.Constants.FLOW_DIRECTIONS;

@ApiStatus.Internal
public abstract class BlockGenerator implements BuiltInGenerator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.github.null2264.cobblegen.util;

import com.google.common.collect.ImmutableList;
import net.minecraft.core.Direction;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;

Expand Down Expand Up @@ -36,4 +38,8 @@ public static String fromBlock(Block block) {
return fromId(Util.getBlockId(block));
}
}

public static final ImmutableList<Direction> FLOW_DIRECTIONS = ImmutableList.of(
Direction.DOWN, Direction.SOUTH, Direction.NORTH, Direction.EAST, Direction.WEST
);
}

0 comments on commit d1419d7

Please sign in to comment.