Skip to content

Commit

Permalink
Add me output emptying & mk3 speed configs (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursivePineapple authored Feb 12, 2025
1 parent e39a8d6 commit 2d9f77a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class GlobalMMConfig {

@Config(modid = Names.MATTER_MANIPULATOR, category = "Interaction")
@Config(modid = Names.MATTER_MANIPULATOR, category = "interaction")
public static class InteractionConfig {

@Config.Comment("Clear the paste region when the copy or cut regions are marked")
Expand All @@ -21,7 +21,7 @@ public static class InteractionConfig {
public static boolean resetTransform;
}

@Config(modid = Names.MATTER_MANIPULATOR, category = "Rendering")
@Config(modid = Names.MATTER_MANIPULATOR, category = "rendering")
public static class RenderingConfig {

@Config.Comment("Controls how many blocks are shown in the preview. Client only.")
Expand All @@ -45,21 +45,38 @@ public static class RenderingConfig {
public static boolean hintsOnTopAir;
}

@Config(modid = Names.MATTER_MANIPULATOR, category = "Debug")
@Config(modid = Names.MATTER_MANIPULATOR, category = "debug")
public static class DebugConfig {

@Config.DefaultBoolean(false)
@Config.Name("Enable Debug Logging")
public static boolean debug;
}

@Config(modid = Names.MATTER_MANIPULATOR, category = "building")
public static class BuildingConfig {

@Config.Comment("Empty ME Output Hatches/Busses when they're removed. Server only.")
@Config.DefaultBoolean(true)
@Config.Name("Empty ME Outputs")
public static boolean meEmptying;

@Config.Comment("High values may cause world desync and lag. Server only. Requires restart.")
@Config.DefaultInt(256)
@Config.RangeInt(min = 1)
@Config.Name("MK3 Block Place Speed")
@Config.RequiresMcRestart
public static int mk3BlocksPerPlace;
}

public static boolean DEVENV = false;

public static void init() {
try {
ConfigurationManager.registerConfig(InteractionConfig.class);
ConfigurationManager.registerConfig(RenderingConfig.class);
ConfigurationManager.registerConfig(DebugConfig.class);
ConfigurationManager.registerConfig(BuildingConfig.class);
} catch (ConfigException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.oredict.OreDictionary;

import com.recursive_pineapple.matter_manipulator.GlobalMMConfig.BuildingConfig;
import gregtech.api.interfaces.tileentity.IColoredTileEntity;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
Expand Down Expand Up @@ -131,7 +132,7 @@ protected void removeBlock(World world, int x, int y, int z, ImmutableBlockSpec
boolean eio = Mods.EnderIO.isModLoaded();

if (ae && gt) emptySuperchest(te);
if (ae && gt) emptyMEOutput(te);
if (ae && gt && BuildingConfig.meEmptying) emptyMEOutput(te);
emptyTileInventory(te);
emptyTank(te);
if (gt) removeCovers(te);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.event.entity.living.LivingDeathEvent;

import com.recursive_pineapple.matter_manipulator.GlobalMMConfig;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.common.Optional.InterfaceList;
Expand Down Expand Up @@ -145,10 +146,30 @@ public ItemMatterManipulator(ManipulatorTier tier) {
public static enum ManipulatorTier {

// spotless:off
Tier0(32, 16, 20, 3, 1_000_000d, ALLOW_GEOMETRY),
Tier1(64, 32, 10, 5, 100_000_000d, ALLOW_GEOMETRY | CONNECTS_TO_AE | ALLOW_REMOVING | ALLOW_EXCHANGING | ALLOW_CONFIGURING | ALLOW_CABLES),
Tier2(128, 64, 5, 6, 1_000_000_000d, ALLOW_GEOMETRY | CONNECTS_TO_AE | ALLOW_REMOVING | ALLOW_EXCHANGING | ALLOW_CONFIGURING | ALLOW_CABLES | ALLOW_COPYING | ALLOW_MOVING),
Tier3(-1, 256, 5, 7, 10_000_000_000d, ALLOW_GEOMETRY | CONNECTS_TO_AE | ALLOW_REMOVING | ALLOW_EXCHANGING | ALLOW_CONFIGURING | ALLOW_CABLES | ALLOW_COPYING | ALLOW_MOVING | CONNECTS_TO_UPLINK);
Tier0(
32,
16, 20,
3,
1_000_000d,
ALLOW_GEOMETRY),
Tier1(
64,
32, 10,
5,
100_000_000d,
ALLOW_GEOMETRY | CONNECTS_TO_AE | ALLOW_REMOVING | ALLOW_EXCHANGING | ALLOW_CONFIGURING | ALLOW_CABLES),
Tier2(
128,
64, 5,
6,
1_000_000_000d,
ALLOW_GEOMETRY | CONNECTS_TO_AE | ALLOW_REMOVING | ALLOW_EXCHANGING | ALLOW_CONFIGURING | ALLOW_CABLES | ALLOW_COPYING | ALLOW_MOVING),
Tier3(
-1,
GlobalMMConfig.BuildingConfig.mk3BlocksPerPlace, 5,
7,
10_000_000_000d,
ALLOW_GEOMETRY | CONNECTS_TO_AE | ALLOW_REMOVING | ALLOW_EXCHANGING | ALLOW_CONFIGURING | ALLOW_CABLES | ALLOW_COPYING | ALLOW_MOVING | CONNECTS_TO_UPLINK);
// spotless:on

public final int tier = ordinal();
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/assets/matter-manipulator/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ key.mm-cut=Mark Cut
key.mm-copy=Mark Copy
key.mm-paste=Mark Paste
key.mm-reset=Reset Coords

# Config
interaction=Interaction
rendering=Rendering
debug=Debug
building=Building

0 comments on commit 2d9f77a

Please sign in to comment.