Skip to content

Commit

Permalink
Fix gates not saving wire state.
Browse files Browse the repository at this point in the history
Fix the list GUI not populating examples for all items properly. (We used to call getSubItems(CreativeTabs.MISC), but the fix calls getSubItems(CreativeTabs.SEARCH) instead).
  • Loading branch information
AlexIIL committed Feb 11, 2018
1 parent e585d28 commit d5cff76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions buildcraft_resources/changelog/7.99.15
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Bug fixes:
* Fix fluid tanks sometimes leaving a visible gap between the above and below tanks.
* Fix the quarry not loading enough chunks
* Fix the filler and builder not using power smoothly.
* Fix gates not saving the currently emmited wires, leading to buggy state cells.
* Fix the list item not populating examples from all items at once.
* [#3954] Chisel facades don't render correctly.
* [#3977] The filtered buffer doesn't work properly with inventory level triggers.
* [#3981] Placing a pipe wire will also interact with a gate.
Expand Down
2 changes: 1 addition & 1 deletion common/buildcraft/lib/list/ListHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public NonNullList<ItemStack> getExamples() {
if (handlersCustom.size() > 0) {
for (Item i : ForgeRegistries.ITEMS) {
NonNullList<ItemStack> examples = NonNullList.create();
i.getSubItems(CreativeTabs.MISC, examples);
i.getSubItems(CreativeTabs.SEARCH, examples);
for (ItemStack s : examples) {
for (ListMatchHandler mh : handlersCustom) {
if (mh.matches(type, firstStack, s, false)) {
Expand Down
4 changes: 4 additions & 0 deletions common/buildcraft/transport/gate/GateLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import buildcraft.api.transport.pipe.PipeEventActionActivate;

import buildcraft.lib.misc.MessageUtil;
import buildcraft.lib.misc.NBTUtilBC;
import buildcraft.lib.net.IPayloadWriter;
import buildcraft.lib.net.PacketBufferBC;
import buildcraft.lib.statement.FullStatement;
Expand Down Expand Up @@ -133,6 +134,8 @@ public GateLogic(PluggableGate pluggable, NBTTagCompound nbt) {
statements[i].trigger.readFromNbt(nbt.getCompoundTag(tName));
statements[i].action.readFromNbt(nbt.getCompoundTag(aName));
}

wireBroadcasts.addAll(NBTUtilBC.readEnumSet(nbt.getTag("wireBroadcasts"), EnumDyeColor.class));
}

public NBTTagCompound writeToNbt() {
Expand All @@ -151,6 +154,7 @@ public NBTTagCompound writeToNbt() {
nbt.setTag("trigger[" + s + "]", statements[s].trigger.writeToNbt());
nbt.setTag("action[" + s + "]", statements[s].action.writeToNbt());
}
nbt.setTag("wireBroadcasts", NBTUtilBC.writeEnumSet(wireBroadcasts, EnumDyeColor.class));
return nbt;
}

Expand Down

0 comments on commit d5cff76

Please sign in to comment.