issue-149: Use ItemStackUtils.spawnAsEntity when dropping robot items - #150
Open
zachanator070 wants to merge 1 commit into
Open
issue-149: Use ItemStackUtils.spawnAsEntity when dropping robot items#150zachanator070 wants to merge 1 commit into
zachanator070 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses issue #149 where the drop function from the
inventory_operationsdevice does not respect the given direction. As shown in the issue, items always spawned in the north direction. Not going to lie I'm not a forge dev by any means, so I don't entirely understand this behavior since thespawnAtLocationmethod doesn't accept any direction parameter.My AI agent found and suggested to use
ItemStackUtils.spawnAsEntitythat you already have in the mod. It looks to spawn entities with a direction so a quick swap to use this method instead does the trick.Technical Changes
InventoryOperationsModuleDeviceto use theItemStackUtils.spawnAsEntitywith a direction argument in favor ofentity.spawnAtLocationScreenshot
See #149 for the source of
test.lua. Also note that the bot is facing west whereas before all items were spawning to the north regardless of the direction argument given.