Skip to content

Commit

Permalink
Fix crash on the server and remove old debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaTheMartian committed Dec 27, 2024
1 parent 841dd30 commit 9bee33e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 4 deletions.
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ publishMods {
.readText(StandardCharsets.UTF_8)
.split(Regex("^#(?!#).*$", RegexOption.MULTILINE))[1]
.trim()
println(changelogText)
changelog = changelogText

// dryRun = true
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 1.1.3+1.21.1

## Bug Fixes

- Fixed `clientTick` existing on the server side and crashing
- Fixed Tweakeruler sending undo/redo debug information to the chat

# 1.1.2+1.21.1

## Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ parchment_mappings_version=2024.07.28
mod_id=minefactorial
mod_name=Mine!
mod_license=MIT
mod_version=1.1.2+1.21.1
mod_version=1.1.3+1.21.1
mod_group_id=martian
mod_authors=EmmaTheMartian
mod_description=MineFactory revived and reimagined for modern versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void handle(PacketServerboundTweakerulerRedo packet, IPayloadConte
LOGGER.info("Redo requested for {}", player.getName());
TweakerulerHistory history = TweakerulerHistoryManager.getHistoryFor(player);
history.redo();
player.sendSystemMessage(Component.literal("Redid changes. data.size: %d, redoHistory.size: %d".formatted(history.dataSize(), history.historySize())));
// player.sendSystemMessage(Component.literal("Redid changes. data.size: %d, redoHistory.size: %d".formatted(history.dataSize(), history.historySize())));
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void handle(PacketServerboundTweakerulerUndo packet, IPayloadConte
LOGGER.info("Undo requested for {}", player.getName());
TweakerulerHistory history = TweakerulerHistoryManager.getHistoryFor(player);
history.undo();
player.sendSystemMessage(Component.literal("Undid changes. data.size: %d, redoHistory.size: %d".formatted(history.dataSize(), history.historySize())));
// player.sendSystemMessage(Component.literal("Undid changes. data.size: %d, redoHistory.size: %d".formatted(history.dataSize(), history.historySize())));
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;

public abstract class AbstractConveyorBE extends BlockEntity implements ITickableBE {
public AbstractConveyorBE(BlockEntityType<? extends AbstractConveyorBE> blockEntityType, BlockPos pos, BlockState blockState) {
Expand Down Expand Up @@ -43,6 +45,7 @@ public void serverTick(ServerLevel level) {
commonTick(level);
}

@OnlyIn(Dist.CLIENT)
@Override
public void clientTick(ClientLevel level) {
commonTick(level);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.server.level.ServerLevel;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;

public interface ITickableBE {
default void serverTick(ServerLevel level) { }

@OnlyIn(Dist.CLIENT)
default void clientTick(ClientLevel level) { }
}

0 comments on commit 9bee33e

Please sign in to comment.