Closed alec016 closed 8 months ago
That's awesome work, feature-wise it seems to be what I had in mind. I have a few problems with your PR :
IExperienceStorage
interface.That's the observations I made for now by just browsing your PR on Github, I will do some testing as soon as I have the time.
Ok. I will check all of that and fix it.
Finally had some time to test this, there are a few bugs that need to be fixed before merging :
ExperienceGuiElementWidget#getTooltips
method instead of the constructor.ExperienceGuiElementWidget#isClickable
must return false if the gui element is in display mode as it's not a button then.ExperienceMachineComponent
seems redundant, you could make the requirement use the other methods instead and remove the recipe specific ones.ExperienceMachineComponent.Template
CODEC you can put the default values directly in optionalFieldOf
methods instead of using Optional#orElse
after.With these few bugs fixed it should be fine to merge this PR.
If you have any questions about that feel free to ping me on discord.
Added Experience Requirement(json, CT, KJS)
Added Experience PerTick Requirement(json, CT, KJS)
Added Experience Component
Added Experience GuiElement (see images below)
Machine Experience Component example:
{ "type": "custommachinery:experience", "id": "xp", "capacity": 10000, "maxInput": 10000, "maxOutput": 10000, "retrieveFromSlots": true, "retrieveSlotsId": [ "output1", "input1" ] }
Experience GuiElement examples:
{ "id": "xp", "x": 65, "y": 15, "type": "custommachinery:experience", "mode": "input_all" }
{ "id": "xp", "x": 65, "y": 15, "type": "custommachinery:experience", "mode": "input_ten" }
{ "id": "xp", "x": 65, "y": 15, "type": "custommachinery:experience", "mode": "input_one" }
{ "id": "xp", "x": 65, "y": 15, "type": "custommachinery:experience", "mode": "output_all" }
{ "id": "xp", "x": 65, "y": 15, "type": "custommachinery:experience", "mode": "output_ten" }
{ "id": "xp", "x": 65, "y": 15, "type": "custommachinery:experience", "mode": "output_one" }
{ "id": "xp", "x": 113, "y": 15, "type": "custommachinery:experience", "display": "literal", "mode": "display" }
{ "id": "xp", "x": 113, "y": 15, "type": "custommachinery:experience", "display": "level", "mode": "display" }
{ "id": "xp", "x": 113, "y": 15, "type": "custommachinery:experience", "display": "both", "mode": "display" }
Experience Requirement:
.requireXp(float amount)
.produceXp(float amount)
.requireXpPerTick(float amount)
.produceXpPerTick(float amount)
{ "type": "custommachinery:experience", "mode": ["input", "output"], "amount": [float number], "chance": [double number between 0.0 and 1.0] }
{ "type": "custommachinery:experience_per_tick", "mode": ["input", "output"], "amount": [float number], "chance": [double number between 0.0 and 1.0] }
JEI rendering ingredient: