Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added two helper classes for trading with villagers #75

Merged
merged 1 commit into from
Jul 20, 2017
Merged

Added two helper classes for trading with villagers #75

merged 1 commit into from
Jul 20, 2017

Conversation

KnightMiner
Copy link
Member

Vanilla only implements this for items instead of stacks. Methods provided allow adding a trade using two inputs for an output and a random input for a random output. Any of those can be null to default to emeralds (except the second input, where null makes it a single input trade)

* @param random random number access
* @return A new instance of the input stack, or a stack containing an emerald if null
*/
@Nonnull
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if null is a valid input i'd put @nullable on the random parameter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically it's not, just unused by default. See TradeRandom which extends this (which can easily be done by other classss well for more complicated random functions)

Vanilla only implements this for items instead of stacks. Methods provided allow adding a trade using two inputs for an output and a random input for a random output. Any of those can be empty to default to emeralds
@KnightMiner KnightMiner changed the base branch from master to 1.12 July 20, 2017 00:51
@KnightMiner KnightMiner merged commit e7fab75 into SlimeKnights:1.12 Jul 20, 2017
@KnightMiner KnightMiner deleted the villager-trade branch July 20, 2017 01:22
bonii-xx added a commit that referenced this pull request Apr 10, 2018
* Begin Mantle's update to 1.11. Not everything is 100% completed.

* Add jenkinsfile for building using jenkins 2 blue ocean

* Bump Mod version, and fix the required Forge version and Minecraft versions.

* cleanup build.gradle

* add missing gradle plugin

* more gradle cleanup/updates

* Update Mantle to 1.11.2 + update 1.11 code to match master (1.10.2).

* Whoops undo this change!

* Clean up some checks to use isEmpty(), which is the same as checking the count is equal to 0.

* Reinstate recipematchregistry api

* Update RecipeMatch API to return an Optional

* Itemstacklist util

* Bring itemstacklist.withSize in line with vanilla implementation

* Finish optional update

* Fix connected block textures

* Fix tile inventory

* Fix itemstacklist derp

* More 1.11 fixes/adjustments

* More itemstacklist utility

* Validation annotations to make itemstack shenanigans more obvious

* Inventory support for itemstacklist

* Update Mantle to 1.12, Some things might not work/need to be tested!

* Fix "acceptedMinecraftVersions" not accepting 1.12, and bump the required forge version.

* Allow Pulse Modules to use the new registration events added with the registry rewrite.

* Fix GUI's not having a background as drawDefaultBackground isn't called by drawScreen anymore.

* Bump Forge + Mod version, and clean up any Item using addInformation to incude @nullable for the World input.

* Fix use of tab instead of spaces.

* Fix tooltips not being rendered anymore inside guis.

* Fix loading ITooltipFlag on server side.

* Change up book loading order to load books after they're registered in preInit

* Remove unneeded imports inside Mantle.java and bump the required forge version to the current recommended build.

* Fix mantle not calling init() from the proxy, which is used to reload the books

* Added two helper classes for trading with villagers (#75)

Vanilla only implements this for items instead of stacks. Methods provided allow adding a trade using two inputs for an output and a random input for a random output. Any of those can be empty to default to emeralds

* Change books to be lazily loaded. This also kills all of our loading dependency problems.

* Version bump

* jar tasks gets finalized by reobfJar task

- Fixes #94

* Update Configurate

* Remove @SideOnly(Side.CLIENT) from getSubBlocks as it is no longer only a client side method. (#103) MinecraftForge/MinecraftForge@368d206

* Remove last clientside only from getSubBlocks #103

* Have heart rendering loop correctly if it surpasses 12 rows of hearts #102

* Fix book crashing when trying to display missing items #99

* Bump version to 1.3.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants