Skip to content

Commit

Permalink
Fix two porting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Raycoms committed Sep 8, 2024
1 parent 266e13e commit 2193757
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ else if (removeBranches.contains(ResourceLocation.parse(researchJson.get(RESEARC
}
for (SizedIngredient itemS : research.getCostList())
{
Log.getLogger().debug("Cost: {}x {}", itemS.count(), String.join("/", Arrays.stream(itemS.ingredient().getItems()).map(ItemStack::toString).toList()));
// Can't log the contents or otherwise bad caching occurs.
Log.getLogger().debug("Cost: {}x {}", itemS.count(), String.join("/", itemS.toString()));
}
for (IResearchEffect<?> researchEffect : research.getEffects())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ public TransferRecipeCraftingTeachingMessage(final Map<Integer, ItemStack> itemS
protected TransferRecipeCraftingTeachingMessage(final RegistryFriendlyByteBuf buf, final PlayMessageType<?> type)
{
super(buf, type);
itemStacks = buf.readMap(FriendlyByteBuf::readInt, b -> ItemStack.STREAM_CODEC.decode((RegistryFriendlyByteBuf) b));
itemStacks = buf.readMap(FriendlyByteBuf::readInt, b -> ItemStack.OPTIONAL_STREAM_CODEC.decode((RegistryFriendlyByteBuf) b));
complete = buf.readBoolean();
}

@Override
protected void toBytes(final RegistryFriendlyByteBuf buf)
{
buf.writeMap(itemStacks, FriendlyByteBuf::writeInt, (b, v) -> ItemStack.STREAM_CODEC.encode((RegistryFriendlyByteBuf) b, v));
buf.writeMap(itemStacks, FriendlyByteBuf::writeInt, (b, v) -> ItemStack.OPTIONAL_STREAM_CODEC.encode((RegistryFriendlyByteBuf) b, v));
buf.writeBoolean(complete);
}

Expand Down

0 comments on commit 2193757

Please sign in to comment.