mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
add 1gt features
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||||
|
Date: Thu, 10 Jul 2025 04:21:08 +0300
|
||||||
|
Subject: [PATCH] Disable offline warn if using proxy
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
index 13d85eb366a070bfd6723088412f51af07892362..bdb37afb8f30d19726c4775e1eaa8c1dabacd3a7 100644
|
||||||
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
@@ -311,7 +311,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
|
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
|
||||||
|
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
|
||||||
|
// Paper end - Add Velocity IP Forwarding Support
|
||||||
|
- if (!this.usesAuthentication()) {
|
||||||
|
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) { // DivineMC - Disable offline warn if using proxy
|
||||||
|
LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
||||||
|
LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
||||||
|
// Spigot start
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||||
|
Date: Thu, 10 Jul 2025 04:30:21 +0300
|
||||||
|
Subject: [PATCH] Copper Bulb 1gt delay
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/level/block/CopperBulbBlock.java b/net/minecraft/world/level/block/CopperBulbBlock.java
|
||||||
|
index 25caeb117d9a49fa00f46ec895a35dee8242aacd..3a2b751b150e7930817fd07d50a3baeecb44f7d1 100644
|
||||||
|
--- a/net/minecraft/world/level/block/CopperBulbBlock.java
|
||||||
|
+++ b/net/minecraft/world/level/block/CopperBulbBlock.java
|
||||||
|
@@ -32,16 +32,36 @@ public class CopperBulbBlock extends Block {
|
||||||
|
@Override
|
||||||
|
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) {
|
||||||
|
if (oldState.getBlock() != state.getBlock() && level instanceof ServerLevel serverLevel) {
|
||||||
|
- this.checkAndFlip(state, serverLevel, pos);
|
||||||
|
+ // DivineMC start - Copper Bulb 1gt delay
|
||||||
|
+ if (!org.bxteam.divinemc.config.DivineConfig.MiscCategory.copperBulb1gt) {
|
||||||
|
+ this.checkAndFlip(state, serverLevel, pos);
|
||||||
|
+ } else {
|
||||||
|
+ level.scheduleTick(pos, this, 1);
|
||||||
|
+ }
|
||||||
|
+ // DivineMC end - Copper Bulb 1gt delay
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) {
|
||||||
|
if (level instanceof ServerLevel serverLevel) {
|
||||||
|
- this.checkAndFlip(state, serverLevel, pos);
|
||||||
|
+ // DivineMC start - Copper Bulb 1gt delay
|
||||||
|
+ if (!org.bxteam.divinemc.config.DivineConfig.MiscCategory.copperBulb1gt) {
|
||||||
|
+ this.checkAndFlip(state, serverLevel, pos);
|
||||||
|
+ } else {
|
||||||
|
+ level.scheduleTick(pos, this, 1);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // DivineMC start - Copper Bulb 1gt delay
|
||||||
|
+ @Override
|
||||||
|
+ public void tick(BlockState state, ServerLevel level, BlockPos pos, net.minecraft.util.RandomSource random) {
|
||||||
|
+ if (org.bxteam.divinemc.config.DivineConfig.MiscCategory.copperBulb1gt) {
|
||||||
|
+ checkAndFlip(state, level, pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ // DivineMC end - Copper Bulb 1gt delay
|
||||||
|
|
||||||
|
public void checkAndFlip(BlockState state, ServerLevel level, BlockPos pos) {
|
||||||
|
boolean hasNeighborSignal = level.hasNeighborSignal(pos);
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||||
|
Date: Thu, 10 Jul 2025 04:31:46 +0300
|
||||||
|
Subject: [PATCH] Crafter 1gt delay
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/level/block/CrafterBlock.java b/net/minecraft/world/level/block/CrafterBlock.java
|
||||||
|
index 38b03c7b02bdfc579e5e126c12de3d878e26d188..c3e68a63f6f7d669dca8a08625a04bd7c8ef0327 100644
|
||||||
|
--- a/net/minecraft/world/level/block/CrafterBlock.java
|
||||||
|
+++ b/net/minecraft/world/level/block/CrafterBlock.java
|
||||||
|
@@ -75,7 +75,7 @@ public class CrafterBlock extends BaseEntityBlock {
|
||||||
|
boolean triggeredValue = state.getValue(TRIGGERED);
|
||||||
|
BlockEntity blockEntity = level.getBlockEntity(pos);
|
||||||
|
if (hasNeighborSignal && !triggeredValue) {
|
||||||
|
- level.scheduleTick(pos, this, 4);
|
||||||
|
+ level.scheduleTick(pos, this, !org.bxteam.divinemc.config.DivineConfig.MiscCategory.copperBulb1gt ? 4 : 1); // DivineMC - Crafter 1gt delay
|
||||||
|
level.setBlock(pos, state.setValue(TRIGGERED, true), 2);
|
||||||
|
this.setBlockEntityTriggered(blockEntity, true);
|
||||||
|
} else if (!hasNeighborSignal && triggeredValue) {
|
||||||
|
@@ -125,7 +125,7 @@ public class CrafterBlock extends BaseEntityBlock {
|
||||||
|
@Override
|
||||||
|
public void setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
|
||||||
|
if (state.getValue(TRIGGERED)) {
|
||||||
|
- level.scheduleTick(pos, this, 4);
|
||||||
|
+ level.scheduleTick(pos, this, !org.bxteam.divinemc.config.DivineConfig.MiscCategory.copperBulb1gt ? 4 : 1); // DivineMC - Crafter 1gt delay
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -571,10 +571,15 @@ public class DivineConfig {
|
|||||||
public static String logLevel = "WARN";
|
public static String logLevel = "WARN";
|
||||||
public static boolean onlyLogThrown = true;
|
public static boolean onlyLogThrown = true;
|
||||||
|
|
||||||
|
// Old features
|
||||||
|
public static boolean copperBulb1gt = false;
|
||||||
|
public static boolean crafter1gt = false;
|
||||||
|
|
||||||
public static void load() {
|
public static void load() {
|
||||||
secureSeed();
|
secureSeed();
|
||||||
lagCompensation();
|
lagCompensation();
|
||||||
sentrySettings();
|
sentrySettings();
|
||||||
|
oldFeatures();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void secureSeed() {
|
private static void secureSeed() {
|
||||||
@@ -609,6 +614,13 @@ public class DivineConfig {
|
|||||||
|
|
||||||
if (sentryDsn != null && !sentryDsn.isBlank()) gg.pufferfish.pufferfish.sentry.SentryManager.init(Level.getLevel(logLevel));
|
if (sentryDsn != null && !sentryDsn.isBlank()) gg.pufferfish.pufferfish.sentry.SentryManager.init(Level.getLevel(logLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void oldFeatures() {
|
||||||
|
copperBulb1gt = getBoolean(ConfigCategory.MISC.key("old-features.copper-bulb-1gt"), copperBulb1gt,
|
||||||
|
"Whether to delay the copper lamp by 1 tick when the redstone signal changes.");
|
||||||
|
crafter1gt = getBoolean(ConfigCategory.MISC.key("old-features.crafter-1gt"), crafter1gt,
|
||||||
|
"Whether to reduce the frequency of the crafter outputting items to 1 tick.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class NetworkCategory {
|
public static class NetworkCategory {
|
||||||
|
|||||||
Reference in New Issue
Block a user