Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Don't require both hatch parameters to be non-null to copy them (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
minecraft7771 authored Jul 17, 2023
1 parent 6aea9dd commit d19af1e
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,8 @@ public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWor
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
Expand All @@ -134,8 +131,10 @@ public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWor
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);
Expand Down

0 comments on commit d19af1e

Please sign in to comment.