Skip to content

Commit

Permalink
add null check
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Oct 22, 2024
1 parent 0ca332a commit 5e1889d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,10 @@ private static void readOccupiedCouplers(CompoundTag tag, Map<UUID, TrackGraph>

@WrapOperation(method = "burnFuel", at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/trains/entity/Train;fuelTicks:I", opcode = Opcodes.PUTFIELD))
private void railways$modifyFuelUsage(Train instance, int value, Operation<Void> original) {
Level level = railways$level.get();

int config = CRConfigs.server().realism.netherExtraFuelUsage.get();
if (railways$level.get().dimension() == Level.NETHER)
if (level != null && level.dimension() == Level.NETHER)
value -= (config - 1);
original.call(instance, value);
}
Expand Down

0 comments on commit 5e1889d

Please sign in to comment.