diff options
| author | Maxim <maxim235@gmx.de> | 2023-07-17 08:21:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-17 08:21:31 +0200 |
| commit | d19af1ef7a570c046f1f851cdba1e5d316df1419 (patch) | |
| tree | 4427c04c4e5907fe756603021b734413b6867d8f /src | |
| parent | 6aea9dde39a89f7c9144a8aab94e06246468d256 (diff) | |
| download | GT5-Unofficial-d19af1ef7a570c046f1f851cdba1e5d316df1419.tar.gz GT5-Unofficial-d19af1ef7a570c046f1f851cdba1e5d316df1419.tar.bz2 GT5-Unofficial-d19af1ef7a570c046f1f851cdba1e5d316df1419.zip | |
Don't require both hatch parameters to be non-null to copy them (#232)
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java index 40ba4e9ecd..06d9ab9253 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java @@ -114,11 +114,8 @@ public final class ParametrizerMemoryCard extends Item { NBTTagList tagList = tNBT.getTagList("paramList", Constants.NBT.TAG_COMPOUND); for (int hatch = 0; hatch < 10; hatch++) { NBTTagCompound tag = tagList.getCompoundTagAt(hatch); - if (tag.hasKey("value0D", Constants.NBT.TAG_DOUBLE) - && tag.hasKey("value1D", Constants.NBT.TAG_DOUBLE)) { - controller.parametrization - .trySetParameters(hatch, tag.getDouble("value0D"), tag.getDouble("value1D")); - } + controller.parametrization + .trySetParameters(hatch, tag.getDouble("value0D"), tag.getDouble("value1D")); } } else { // from parametrizer @@ -134,8 +131,10 @@ public final class ParametrizerMemoryCard extends Item { for (int hatch = 0; hatch < 10; hatch++) { NBTTagCompound tagChild = new NBTTagCompound(); Parameters.Group.ParameterIn[] parameters = controller.parametrization.getGroup(hatch).parameterIn; - if (parameters[0] != null && parameters[1] != null) { + if (parameters[0] != null) { tagChild.setDouble("value0D", parameters[0].get()); + } + if (parameters[1] != null) { tagChild.setDouble("value1D", parameters[1].get()); } tagList.appendTag(tagChild); |
