Skip to content

Commit

Permalink
Avoid master double tick
Browse files Browse the repository at this point in the history
  • Loading branch information
Edivad99 committed Dec 23, 2023
1 parent 83287f3 commit d451ec7
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ public static void serverTick(Level level, BlockPos blockPos, BlockState blockSt
BlastFurnaceBlockEntity blockEntity) {
blockEntity.serverTick();
blockEntity.moduleDispatcher.serverTick();
if (blockEntity.isMaster()) {
blockEntity.blastFurnaceModule.serverTick();
}

blockEntity.getMasterBlockEntity()
.ifPresent(master -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ public static void serverTick(Level level, BlockPos blockPos, BlockState blockSt
CokeOvenBlockEntity blockEntity) {
blockEntity.serverTick();
blockEntity.moduleDispatcher.serverTick();
if (blockEntity.isMaster()) {
blockEntity.cokeOvenModule.serverTick();
}

blockEntity.getMasterBlockEntity()
.ifPresent(master -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ public static void serverTick(Level level, BlockPos blockPos, BlockState blockSt
CrusherBlockEntity blockEntity) {
blockEntity.serverTick();
blockEntity.moduleDispatcher.serverTick();
if (blockEntity.isMaster()) {
blockEntity.crusherModule.serverTick();
}

if (++blockEntity.tick % 8 == 0) {
blockEntity.tick = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mods/railcraft/world/module/CrafterModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public abstract class CrafterModule<T extends ModuleProvider> extends ContainerModule<T> {

protected static final int PROGRESS_STEP = 1;
protected static final int PROGRESS_STEP = 16;

protected int progress;
protected int duration;
Expand Down Expand Up @@ -58,7 +58,7 @@ public final void setDuration(int duration) {
}

public final int getDuration() {
return duration;
return this.duration;
}

protected abstract int calculateDuration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public abstract class SteamBoilerModule<T extends SteamBoilerBlockEntity>
protected final SteamBoiler boiler;

private final LazyOptional<IFluidHandler> fluidHandler = LazyOptional.of(() -> this.tankManager);
private final LazyOptional<
IItemHandler> itemHandler = LazyOptional.of(() -> new InvWrapper(this) {
private final LazyOptional<IItemHandler> itemHandler = LazyOptional.of(
() -> new InvWrapper(this) {
@NotNull
@Override
public ItemStack extractItem(int slot, int amount, boolean simulate) {
Expand Down

0 comments on commit d451ec7

Please sign in to comment.