Skip to content

Commit d049d72

Browse files
committed
调整时间判断防止玩家通过指令锁定了世界时间
1 parent 8437dc3 commit d049d72

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/main/java/github/kasuminova/novaeng/common/handler/MachineAssemblyHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ object MachineAssemblyHandler {
8484
fun onPlayerTick(event: TickEvent.PlayerTickEvent) {
8585
val player = event.player
8686
val world = player.world
87-
if (player is EntityPlayerMP && world.worldTime % NovaEngCoreConfig.MACHINE_ASSEMBLY_TOOL.buildSpeed == 0L) {
87+
if (player is EntityPlayerMP && world.totalWorldTime % NovaEngCoreConfig.MACHINE_ASSEMBLY_TOOL.buildSpeed == 0L) {
8888
val ma = NEWMachineAssemblyManager.getMachineAssembly(player) ?: return
8989
var restart: Boolean
9090
for (i in 0..<NovaEngCoreConfig.MACHINE_ASSEMBLY_TOOL.buildQuantity) {

src/main/java/github/kasuminova/novaeng/common/machine/DreamEnergyCore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public void SInit(DynamicMachine machine) {
195195
if (event.phase == Phase.START) {
196196
var ctrl = event.getController();
197197
var world = ctrl.getWorld();
198-
if (world.getWorldTime() % (1200 / MinuteScale) == 0) {
198+
if (world.getTotalWorldTime() % (1200 / MinuteScale) == 0) {
199199
var data = ctrl.getCustomDataTag();
200200
var energyStored = data.getString("energyStored").isEmpty() ? "0" : data.getString("energyStored");
201201
getEnergyInfo(world, ctrl.getPos()).addFirst(energyStored);

src/main/java/github/kasuminova/novaeng/common/util/AssemblyBlockArray.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class AssemblyBlockArray : BlockArray {
161161
}
162162
}
163163

164-
fun isFluid(state: IBlockState): Boolean {
164+
private fun isFluid(state: IBlockState): Boolean {
165165
val block = state.getBlock()
166166
return block is BlockLiquid || block is BlockFluidBase
167167
}

src/main/java/github/kasuminova/novaeng/mixin/extrabotany/MixinTileManaLiquefaction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public abstract class MixinTileManaLiquefaction extends TileMod {
2727
public void updateMixin(CallbackInfo ci) {
2828
if (ConfigHandler.DISABLE_MANALIQUEFICATION) {
2929
var world = this.world;
30-
if (world.getWorldTime() % 20 != 0) return;
30+
if (world.getTotalWorldTime() % 20 != 0) return;
3131

3232
var uppos = this.pos.up();
3333

src/main/java/github/kasuminova/novaeng/mixin/rftools/MixinBuilderTileEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public MixinBuilderTileEntity(long maxEnergy, long maxReceive) {
2626
private void commonQuarryBlockI(CallbackInfo ci) {
2727
if (CommandBuilder.INSTANCE.isTickWork) {
2828
if (this.getWorld() instanceof WorldServer w) {
29-
if (w.getWorldTime() % 200 != 0) return;
29+
if (w.getTotalWorldTime() % 200 != 0) return;
3030
if (w.getMinecraftServer() != null) {
3131
var server = w.getMinecraftServer();
3232
var playerList = server.getPlayerList();

0 commit comments

Comments
 (0)