Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Backport 1.20's 'pause-when-empty-seconds' server property (#… #472

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ configurations {
}

dependencies {
api("com.github.GTNewHorizons:GTNHLib:0.6.1:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.0:dev")

compileOnly("com.gtnewhorizons.retrofuturabootstrap:RetroFuturaBootstrap:1.0.2") { transitive = false }

transformedMod("com.github.GTNewHorizons:NotEnoughItems:2.7.15-GTNH:dev") // force a more up-to-date NEI version
transformedModCompileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-518-GTNH")
transformedMod("com.github.GTNewHorizons:NotEnoughItems:2.7.11-GTNH:dev") // force a more up-to-date NEI version
transformedModCompileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-516-GTNH")
transformedModCompileOnly("com.github.GTNewHorizons:Baubles:1.0.4:dev")
// Transitive updates to make runClient17 work
transformedModCompileOnly("com.github.GTNewHorizons:ForgeMultipart:1.6.0:dev")
transformedModCompileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.61:dev")
transformedModCompileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.48:dev")
transformedModCompileOnly("com.github.GTNewHorizons:harvestcraft:1.2.3-GTNH:dev")
transformedModCompileOnly("com.github.GTNewHorizons:HungerOverhaul:1.1.0-GTNH:dev")
transformedModCompileOnly("com.github.GTNewHorizons:MrTJPCore:1.3.0:dev") // Do not update, fixed afterwards
transformedModCompileOnly("com.github.GTNewHorizons:Railcraft:9.16.2:dev") { exclude group: "thaumcraft", module: "Thaumcraft" }
transformedModCompileOnly("com.github.GTNewHorizons:TinkersConstruct:1.13.3-GTNH:dev")
transformedModCompileOnly("com.github.GTNewHorizons:MrTJPCore:1.2.1:dev") // Do not update, fixed afterwards
transformedModCompileOnly("com.github.GTNewHorizons:Railcraft:9.16.1:dev") { exclude group: "thaumcraft", module: "Thaumcraft" }
transformedModCompileOnly("com.github.GTNewHorizons:TinkersConstruct:1.13.2-GTNH:dev")
transformedModCompileOnly(rfg.deobf("curse.maven:bibliocraft-228027:2423369"))
transformedModCompileOnly(rfg.deobf("curse.maven:biomes-o-plenty-220318:2499612"))
transformedModCompileOnly("curse.maven:cofh-core-69162:2388751")
Expand All @@ -45,7 +45,7 @@ dependencies {
transformedModCompileOnly(rfg.deobf("curse.maven:glibys-voice-chat-225110:2301492"))

transformedModCompileOnly(rfg.deobf("curse.maven:automagy-222153:2285272"))
transformedModCompileOnly("com.github.GTNewHorizons:Galacticraft:3.3.1-GTNH:dev")
transformedModCompileOnly("com.github.GTNewHorizons:Galacticraft:3.3.0-GTNH:dev")
transformedModCompileOnly("curse.maven:minechem-368422:2905830")
transformedModCompileOnly("curse.maven:thermal-dynamics-227443:2388756")
transformedModCompileOnly("curse.maven:thermal-expansion-69163:2388759")
Expand All @@ -61,7 +61,7 @@ dependencies {
transformedModCompileOnly(deobf("https://forum.industrial-craft.net/core/attachment/4316-advancedsolarpanel-1-7-10-3-5-1-jar/"))
transformedModCompileOnly(rfg.deobf("curse.maven:candycraft-251118:2330488"))

transformedModCompileOnly(deobf("https://github.com/makamys/CoreTweaks/releases/download/0.3.3.2/CoreTweaks-1.7.10-0.3.3.2+nomixin.jar"))
devOnlyNonPublishable(deobf("https://github.com/makamys/CoreTweaks/releases/download/0.3.3.2/CoreTweaks-1.7.10-0.3.3.2+nomixin.jar"))
}

// Replace when RFG support deobfuscation from notch mappings
Expand Down
49 changes: 6 additions & 43 deletions src/main/java/com/mitchej123/hodgepodge/commands/DebugCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.math.NumberUtils;

import com.mitchej123.hodgepodge.config.TweaksConfig;
import com.mitchej123.hodgepodge.mixins.interfaces.IPauseWhenEmpty;
import com.mitchej123.hodgepodge.util.AnchorAlarm;

public class DebugCommand extends CommandBase {
Expand All @@ -28,31 +26,28 @@ public String getCommandName() {

@Override
public String getCommandUsage(ICommandSender sender) {
return "Usage: hp <subcommand>. Valid subcommands are: toggle, anchor, randomNbt, pauseWhenEmpty.";
return "Usage: hp <subcommand>. Valid subcommands are: toggle, anchor, randomNbt.";
}

private void printHelp(ICommandSender sender) {
sender.addChatMessage(new ChatComponentText("Usage: hp <toggle|anchor|randomNbt|pauseWhenEmpty>"));
sender.addChatMessage(new ChatComponentText("Usage: hp <toggle|anchor|randomNbt>"));
sender.addChatMessage(new ChatComponentText("\"toggle anchordebug\" - toggles RC anchor debugging"));
sender.addChatMessage(
new ChatComponentText(
"\"anchor list [player]\" - list RC anchors placed by the player (empty for current player)"));
sender.addChatMessage(
new ChatComponentText(
"\"randomNbt [bytes]\" - adds a random byte array of the given size to the held item"));
sender.addChatMessage(
new ChatComponentText(
"\"pauseWhenEmpty [seconds]\" - sets the time the server will wait before pausing when no players are online; 0 to disable"));
}

@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] ss) {
List<String> l = new ArrayList<>();
String test = ss.length == 0 ? "" : ss[0].trim();
if (ss.length == 0 || ss.length == 1 && (test.isEmpty()
|| Stream.of("toggle", "anchor", "randomNbt", "pauseWhenEmpty").anyMatch(s -> s.startsWith(test)))) {
Stream.of("toggle", "anchor", "randomNbt", "pauseWhenEmpty")
.filter(s -> test.isEmpty() || s.startsWith(test)).forEach(l::add);
if (ss.length == 0 || ss.length == 1
&& (test.isEmpty() || Stream.of("toggle", "anchor", "randomNbt").anyMatch(s -> s.startsWith(test)))) {
Stream.of("toggle", "anchor", "randomNbt").filter(s -> test.isEmpty() || s.startsWith(test))
.forEach(l::add);
} else if (test.equals("toggle")) {
String test1 = ss[1].trim();
if (test1.isEmpty() || "anchordebug".startsWith(test1)) l.add("anchordebug");
Expand Down Expand Up @@ -117,38 +112,6 @@ public void processCommand(ICommandSender sender, String[] strings) {
stack.stackTagCompound.setByteArray("DebugJunk", randomData);
player.inventory.inventoryChanged = true;
player.inventoryContainer.detectAndSendChanges();
break;
case "pauseWhenEmpty":
if (!TweaksConfig.pauseWhenEmpty) {
sender.addChatMessage(new ChatComponentText("'pauseWhenEmpty' config option is disabled"));
return;
}
if (strings.length < 2) {
printHelp(sender);
return;
}
final int pauseTimeout = NumberUtils.toInt(strings[1], -1);
if (pauseTimeout < 0) {
printHelp(sender);
return;
}

MinecraftServer server = MinecraftServer.getServer();
if (!server.isDedicatedServer()) {
sender.addChatMessage(
new ChatComponentText("'hp pauseWhenEmpty' only applies to dedicated servers"));
return;
}

if (server instanceof IPauseWhenEmpty p) {
p.setPauseWhenEmptySeconds(pauseTimeout);
sender.addChatMessage(
new ChatComponentText(
String.format(
"Server property 'pause-when-empty-seconds' set to %d",
pauseTimeout)));
}

break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ public class TweaksConfig {
@Config.DefaultInt(900)
public static int autoSaveInterval;

@Config.Comment({ "Backports 1.20's 'pause-when-empty-seconds' server property", "Default value: 0 (off)" })
@Config.DefaultBoolean(true)
public static boolean pauseWhenEmpty;

@Config.Comment("Reduces water opacity from 3 to 1, to match modern")
@Config.DefaultBoolean(false)
public static boolean useLighterWater;
Expand Down Expand Up @@ -310,4 +306,5 @@ public class TweaksConfig {
@Config.Comment("Avoids droping items on container close, and instead places them in the player inventory. (Inspired from EFR)")
@Config.DefaultBoolean(true)
public static boolean avoidDroppingItemsWhenClosing;

}
7 changes: 0 additions & 7 deletions src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,6 @@ public enum Mixins {
.addMixinClasses("minecraft.server.MixinMinecraftServer_AutoSaveInterval")
.setApplyIf(() -> TweaksConfig.autoSaveInterval != 900)),

PAUSE_WHEN_EMPTY(new Builder("Pauses the server when empty after X seconds; Servers Only").setPhase(Phase.EARLY)
.setSide(Side.SERVER).addTargetedMod(TargetedMod.VANILLA)
.addMixinClasses(
"minecraft.server.MixinMinecraftServer_PauseWhenEmpty",
"minecraft.server.MixinDedicatedServer_PauseWhenEmpty")
.setApplyIf(() -> TweaksConfig.pauseWhenEmpty)),

LIGHTER_WATER(new Builder("Decreases water opacity from 3 to 1, like in modern").setPhase(Phase.EARLY)
.setSide(Side.BOTH).addTargetedMod(TargetedMod.VANILLA).addMixinClasses("minecraft.MixinBlock_LighterWater")
.setApplyIf(() -> TweaksConfig.useLighterWater)),
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.