Skip to content

Commit

Permalink
Fixed a NullPointerException for Error-Reports for generators
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBusyBiscuit committed Jul 12, 2020
1 parent 3fd6e88 commit 9af9083
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
* Fixed an issue with moving androids getting stuck
* Fixed Cargo nodes sometimes preventing chunks from unloading
* Fixed #2081
* Fixed a NullPointerException when Generators throw an Error Report

## Release Candidate 13 (16 Jun 2020)
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#13
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Here is a full summary of the differences between the two different versions of

| | development (latest) | "stable" |
| ------------------ | -------- | -------- |
| **Minecraft version(s)** | :video_game: **1.13.\* - 1.16.\*** | :video_game: **1.13.\* - 1.15.\*** |
| **Minecraft version(s)** | :video_game: **1.13.\* - 1.16.\*** | :video_game: **1.13.\* - 1.16.\*** |
| **automatic updates** | :heavy_check_mark: | :heavy_check_mark: |
| **frequent updates** | :heavy_check_mark: | :x: |
| **latest content** | :heavy_check_mark: | :x: |
Expand Down Expand Up @@ -114,6 +114,8 @@ To compile Slimefun yourself, follow these steps:

If you are already using an IDE, make sure to import the project via git and set it as a *Maven project*. Then you should be able build it via Maven using the goals `clean package`.

If you have any further questions, then please join our [Discord Support Server](#discord) and ask your questions in the `#programming-help` channel. Note that we will not accept any bug reports from custom-compiled versions of Slimefun.

### Code Quality
Slimefun uses [Sonarcloud.io](https://sonarcloud.io/dashboard?id=TheBusyBiscuit_Slimefun4) to monitor Code Quality.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.thebusybiscuit.slimefun4.api;

import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
Expand Down Expand Up @@ -92,7 +91,7 @@ public ErrorReport(Throwable throwable, SlimefunAddon addon, Consumer<PrintStrea

addon.getLogger().log(Level.WARNING, "");
}
catch (IOException x) {
catch (Exception x) {
addon.getLogger().log(Level.SEVERE, x, () -> "An Error occurred while saving an Error-Report for Slimefun " + SlimefunPlugin.getVersion());
}
});
Expand All @@ -109,9 +108,19 @@ public ErrorReport(Throwable throwable, Location l, SlimefunItem item) {
stream.println(" Block Data: " + l.getBlock().getBlockData().getClass().getName());
stream.println(" State: " + l.getBlock().getState().getClass().getName());
stream.println();
stream.println("Ticker-Info:");
stream.println(" Type: " + (item.getBlockTicker().isSynchronized() ? "Synchronized" : "Asynchronous"));
stream.println();

if (item.getBlockTicker() != null) {
stream.println("Ticker-Info:");
stream.println(" Type: " + (item.getBlockTicker().isSynchronized() ? "Synchronized" : "Asynchronous"));
stream.println();
}

if (item.getEnergyTicker() != null) {
stream.println("Ticker-Info:");
stream.println(" Type: Indirect (Energy Network)");
stream.println();
}

stream.println("Slimefun Data:");
stream.println(" ID: " + item.getID());
stream.println(" Inventory: " + BlockStorage.getStorage(l.getWorld()).hasInventory(l));
Expand Down

0 comments on commit 9af9083

Please sign in to comment.