Skip to content

Commit 2d9f77a

Browse files
Add me output emptying & mk3 speed configs (#45)
1 parent e39a8d6 commit 2d9f77a

File tree

4 files changed

+53
-8
lines changed

4 files changed

+53
-8
lines changed

src/main/java/com/recursive_pineapple/matter_manipulator/GlobalMMConfig.java

+20-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
public class GlobalMMConfig {
99

10-
@Config(modid = Names.MATTER_MANIPULATOR, category = "Interaction")
10+
@Config(modid = Names.MATTER_MANIPULATOR, category = "interaction")
1111
public static class InteractionConfig {
1212

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

24-
@Config(modid = Names.MATTER_MANIPULATOR, category = "Rendering")
24+
@Config(modid = Names.MATTER_MANIPULATOR, category = "rendering")
2525
public static class RenderingConfig {
2626

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

48-
@Config(modid = Names.MATTER_MANIPULATOR, category = "Debug")
48+
@Config(modid = Names.MATTER_MANIPULATOR, category = "debug")
4949
public static class DebugConfig {
5050

5151
@Config.DefaultBoolean(false)
5252
@Config.Name("Enable Debug Logging")
5353
public static boolean debug;
5454
}
5555

56+
@Config(modid = Names.MATTER_MANIPULATOR, category = "building")
57+
public static class BuildingConfig {
58+
59+
@Config.Comment("Empty ME Output Hatches/Busses when they're removed. Server only.")
60+
@Config.DefaultBoolean(true)
61+
@Config.Name("Empty ME Outputs")
62+
public static boolean meEmptying;
63+
64+
@Config.Comment("High values may cause world desync and lag. Server only. Requires restart.")
65+
@Config.DefaultInt(256)
66+
@Config.RangeInt(min = 1)
67+
@Config.Name("MK3 Block Place Speed")
68+
@Config.RequiresMcRestart
69+
public static int mk3BlocksPerPlace;
70+
}
71+
5672
public static boolean DEVENV = false;
5773

5874
public static void init() {
5975
try {
6076
ConfigurationManager.registerConfig(InteractionConfig.class);
6177
ConfigurationManager.registerConfig(RenderingConfig.class);
6278
ConfigurationManager.registerConfig(DebugConfig.class);
79+
ConfigurationManager.registerConfig(BuildingConfig.class);
6380
} catch (ConfigException e) {
6481
throw new RuntimeException(e);
6582
}

src/main/java/com/recursive_pineapple/matter_manipulator/common/building/AbstractBuildable.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import net.minecraftforge.fluids.IFluidHandler;
2727
import net.minecraftforge.oredict.OreDictionary;
2828

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

133134
if (ae && gt) emptySuperchest(te);
134-
if (ae && gt) emptyMEOutput(te);
135+
if (ae && gt && BuildingConfig.meEmptying) emptyMEOutput(te);
135136
emptyTileInventory(te);
136137
emptyTank(te);
137138
if (gt) removeCovers(te);

src/main/java/com/recursive_pineapple/matter_manipulator/common/items/manipulator/ItemMatterManipulator.java

+25-4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import net.minecraftforge.common.util.ForgeDirection;
4242
import net.minecraftforge.event.entity.living.LivingDeathEvent;
4343

44+
import com.recursive_pineapple.matter_manipulator.GlobalMMConfig;
4445
import cpw.mods.fml.common.FMLCommonHandler;
4546
import cpw.mods.fml.common.Optional.Interface;
4647
import cpw.mods.fml.common.Optional.InterfaceList;
@@ -145,10 +146,30 @@ public ItemMatterManipulator(ManipulatorTier tier) {
145146
public static enum ManipulatorTier {
146147

147148
// spotless:off
148-
Tier0(32, 16, 20, 3, 1_000_000d, ALLOW_GEOMETRY),
149-
Tier1(64, 32, 10, 5, 100_000_000d, ALLOW_GEOMETRY | CONNECTS_TO_AE | ALLOW_REMOVING | ALLOW_EXCHANGING | ALLOW_CONFIGURING | ALLOW_CABLES),
150-
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),
151-
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);
149+
Tier0(
150+
32,
151+
16, 20,
152+
3,
153+
1_000_000d,
154+
ALLOW_GEOMETRY),
155+
Tier1(
156+
64,
157+
32, 10,
158+
5,
159+
100_000_000d,
160+
ALLOW_GEOMETRY | CONNECTS_TO_AE | ALLOW_REMOVING | ALLOW_EXCHANGING | ALLOW_CONFIGURING | ALLOW_CABLES),
161+
Tier2(
162+
128,
163+
64, 5,
164+
6,
165+
1_000_000_000d,
166+
ALLOW_GEOMETRY | CONNECTS_TO_AE | ALLOW_REMOVING | ALLOW_EXCHANGING | ALLOW_CONFIGURING | ALLOW_CABLES | ALLOW_COPYING | ALLOW_MOVING),
167+
Tier3(
168+
-1,
169+
GlobalMMConfig.BuildingConfig.mk3BlocksPerPlace, 5,
170+
7,
171+
10_000_000_000d,
172+
ALLOW_GEOMETRY | CONNECTS_TO_AE | ALLOW_REMOVING | ALLOW_EXCHANGING | ALLOW_CONFIGURING | ALLOW_CABLES | ALLOW_COPYING | ALLOW_MOVING | CONNECTS_TO_UPLINK);
152173
// spotless:on
153174

154175
public final int tier = ordinal();

src/main/resources/assets/matter-manipulator/lang/en_US.lang

+6
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ key.mm-cut=Mark Cut
4242
key.mm-copy=Mark Copy
4343
key.mm-paste=Mark Paste
4444
key.mm-reset=Reset Coords
45+
46+
# Config
47+
interaction=Interaction
48+
rendering=Rendering
49+
debug=Debug
50+
building=Building

0 commit comments

Comments
 (0)