-
Notifications
You must be signed in to change notification settings - Fork 150
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
Prototype configuration tool #1663
base: master
Are you sure you want to change the base?
Conversation
…n to chat messages and tooltips
For point (1) above, I have added an IConfigurable.getConfigurationName() This implementation feels very hacky, but it does work. |
I changed the IConfigurable to not use an EntityPlayer directly and instead use a context object. This will allow additional information to be passed, e.g. whether it should use advanced tool behaviour It also allows things other than the tool to use the api without having to do the FakePlayer hack. |
I have done an implementation for points 4/5 above. Rather than try to guess/define what advanced features should be enabled, I have done this by making the ConfigurationContext passed into the IConfigurable api an ICapabilityProvider. For the configurator item this has been implemented as proxying the player capabilities when it is the advanced version with the basic version having no capabilities. Enabling this for the item is as simple as:
I also made the isAdvanced() available on the ConfigurationContext and IConfiguratorItem in case somebody wants to do some advanced behaviour that does not neatly map to a capability or a capability would be overkill. |
With the above changes, the "magic wand" behaviour now works for an advanced configurator. The ItemFilterContainer will now check if there is an IItemHandler capability and use that as the inventory to check to obtain filters when the one in the cover is wrong (or place an unwanted filter into it if no filter is required in the new configuration). I also made these features usable outside the IConfigurable api. |
I am marking this as ready for review, even though there are obviously missing pieces like;
These require feedback before proceeding. |
What:
This is a prototype configuration tool for #1588
How solved:
Added 2 new capabilities
IConfigurable implemented by machines and covers that gets and sets a subset of the NBT that is just the configuration.
IConfiguratorItem a tool that can retrieve this config from one machine/cover and apply it to another
Outcome:
WIP
Additional info:
This has been implemented as "opt in", each individual machine and cover has to expose the IConfigurable capability.
This is because each machine/cover needs to decide what is configuration and what is other state.
For now the SimpleMachine and Conveyor cover (including item filters) have been implemented.
NOTE: item filters as covers themselves have not been implemented (though it would be easy to do).
It is only a subset so people can try it without me having to unpick everything if people don't like it.
The configurator tool is actually the FILE (this is because it is only a prototype and the file has no other real use).
It has 2 modes, you change it (like similar tools in other mods) by pointing away from blocks and right clicking.
COVER - this is the normal mode that respects the machine grid and lets you configure covers
MACHINE - this ignores the grid and lets you see through covers - it is mainly for people who are having difficulty finding somewhere to click to change their machine
For the use of the tool itself, shift right click is to save the configuration and normal right click applies it.
Some issues: