Start soulbinder #92

Merged
ferriarnus merged 26 commits from feature/soulbinder into dev/1.19.x 2023-03-31 14:35:18 +00:00
ferriarnus commented 2022-09-19 02:04:32 +00:00 (Migrated from github.com)

Soul Binder and recipes

Description

Please write a summary of the changes you have implemented; explaining your design choices if necessary. Please also include a list of things to test if it isn't clear.
Please also disclose whether this is a breaking change.

Todo

  • powered spawner + recipe
  • model
  • gui

Checklist:

  • My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
Soul Binder and recipes # Description Please write a summary of the changes you have implemented; explaining your design choices if necessary. Please also include a list of things to test if it isn't clear. Please also disclose whether this is a breaking change. # Todo <!-- Remove this section if you're submitting an already-complete PR --> - [x] powered spawner + recipe - [x] model - [x] gui # Checklist: - [x] My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you) - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation <!-- Thanks to: https://embeddedartistry.com/blog/2017/08/04/a-github-pull-request-template-for-your-projects/ for the building blocks of this template -->
justliliandev (Migrated from github.com) reviewed 2023-02-07 19:07:18 +00:00
@ -0,0 +1,155 @@
package com.enderio.machines.common.blockentity;
justliliandev (Migrated from github.com) commented 2023-02-07 13:00:34 +00:00

use slotaccess

use slotaccess
@ -0,0 +1,182 @@
package com.enderio.machines.common.blockentity.task;
justliliandev (Migrated from github.com) commented 2023-02-07 13:21:07 +00:00

yep, move to config

yep, move to config
justliliandev (Migrated from github.com) commented 2023-02-07 13:24:09 +00:00

filter to livingentity, as the spawning should not be stopped by fishingbobber, partentities or items

filter to livingentity, as the spawning should not be stopped by fishingbobber, partentities or items
justliliandev (Migrated from github.com) commented 2023-02-07 13:24:34 +00:00

why should there be a limit for this?

why should there be a limit for this?
justliliandev (Migrated from github.com) commented 2023-02-07 13:25:58 +00:00

should we allow exact copise? could result to dupes when entities hold shulkers or in general items

should we allow exact copise? could result to dupes when entities hold shulkers or in general items
justliliandev (Migrated from github.com) commented 2023-02-07 13:27:04 +00:00

use instanceof cast

use instanceof cast
justliliandev (Migrated from github.com) commented 2023-02-07 13:27:11 +00:00

use instanceof cast

use instanceof cast
@ -0,0 +28,4 @@
public void addCommonTooltips(ItemStack itemStack, @Nullable Player player, List<Component> tooltips) {
itemStack
.getCapability(EIOCapabilities.ENTITY_STORAGE)
.ifPresent(entityStorage -> entityStorage
justliliandev (Migrated from github.com) commented 2023-02-07 13:30:14 +00:00

would resolve and map calls work to prevent 2 nested ifPresents? if not, this is fine

would resolve and map calls work to prevent 2 nested ifPresents? if not, this is fine
@ -0,0 +1,31 @@
package com.enderio.machines.common.menu;
justliliandev (Migrated from github.com) commented 2023-02-07 13:31:24 +00:00

merge to one if statement

merge to one if statement
justliliandev (Migrated from github.com) commented 2023-02-07 19:03:15 +00:00

the tag used by cyclic is forge:experience, we should use that as well

the tag used by cyclic is `forge:experience`, we should use that as well
@ -0,0 +1,105 @@
package com.enderio.base.common.util;
justliliandev (Migrated from github.com) commented 2023-02-07 19:06:43 +00:00

put 24 in a private static final field

put 24 in a private static final field
ferriarnus (Migrated from github.com) reviewed 2023-02-09 10:23:11 +00:00
@ -0,0 +1,182 @@
package com.enderio.machines.common.blockentity.task;
ferriarnus (Migrated from github.com) commented 2023-02-09 10:23:10 +00:00

There was one in the past, I guess to stop massive farms?

There was one in the past, I guess to stop massive farms?
ferriarnus (Migrated from github.com) reviewed 2023-02-09 10:24:02 +00:00
@ -0,0 +1,182 @@
package com.enderio.machines.common.blockentity.task;
ferriarnus (Migrated from github.com) commented 2023-02-09 10:24:02 +00:00

Hmm good point, maybe just getting the entitytype would be enough.

Hmm good point, maybe just getting the entitytype would be enough.
justliliandev (Migrated from github.com) reviewed 2023-02-09 10:26:33 +00:00
@ -0,0 +1,182 @@
package com.enderio.machines.common.blockentity.task;
justliliandev (Migrated from github.com) commented 2023-02-09 10:26:33 +00:00

If we add a limit it should be discoverable in the gui. We could also reduce the efficiency, if too many spawners are there, so their cummulative speed would stay the same. So if there are 11 spawner, max is 10, there should be a 10/11 chance to succeed the spawn. Also make that shown in the gui.
that's my opinion, but we could also discuss this

If we add a limit it should be discoverable in the gui. We could also reduce the efficiency, if too many spawners are there, so their cummulative speed would stay the same. So if there are 11 spawner, max is 10, there should be a 10/11 chance to succeed the spawn. Also make that shown in the gui. that's my opinion, but we could also discuss this
justliliandev (Migrated from github.com) reviewed 2023-02-09 12:00:19 +00:00
@ -0,0 +1,182 @@
package com.enderio.machines.common.blockentity.task;
justliliandev (Migrated from github.com) commented 2023-02-09 12:00:19 +00:00

maybe put it in a config, multiple copymodes like none, health and all and add a comment what each mode does

maybe put it in a config, multiple copymodes like none, health and all and add a comment what each mode does
ferriarnus (Migrated from github.com) reviewed 2023-02-10 22:23:08 +00:00
@ -0,0 +1,182 @@
package com.enderio.machines.common.blockentity.task;
ferriarnus (Migrated from github.com) commented 2023-02-10 22:23:07 +00:00

Make this an enum somewhere or how do you see it?

Make this an enum somewhere or how do you see it?
justliliandev (Migrated from github.com) reviewed 2023-02-11 00:03:23 +00:00
@ -0,0 +1,182 @@
package com.enderio.machines.common.blockentity.task;
justliliandev (Migrated from github.com) commented 2023-02-11 00:03:22 +00:00

enum sounds reasonable

enum sounds reasonable
dphaldes (Migrated from github.com) reviewed 2023-03-19 08:57:03 +00:00
@ -0,0 +1,168 @@
package com.enderio.machines.common.blockentity;
dphaldes (Migrated from github.com) commented 2023-02-27 14:16:22 +00:00

Should this be configurable through the config like Vacuum Blocks ?

Should this be configurable through the config like Vacuum Blocks ?
@ -0,0 +1,155 @@
package com.enderio.machines.common.blockentity;
dphaldes (Migrated from github.com) commented 2023-03-19 08:30:11 +00:00

This capability is present in both the soul vial and broken spawner. The recipe only allows for soul vials in the first position

This capability is present in both the soul vial and broken spawner. The recipe only allows for soul vials in the first position
dphaldes (Migrated from github.com) reviewed 2023-03-19 08:57:52 +00:00
@ -0,0 +1,155 @@
package com.enderio.machines.common.blockentity;
dphaldes (Migrated from github.com) commented 2023-03-19 08:57:51 +00:00

You can also add Powered Spawners in the first slot which shouldn't happen

You can also add Powered Spawners in the first slot which shouldn't happen
justliliandev (Migrated from github.com) reviewed 2023-03-19 13:37:36 +00:00
@ -0,0 +1,105 @@
package com.enderio.base.common.util;
import com.enderio.core.common.util.Vector2i;
justliliandev (Migrated from github.com) commented 2023-03-19 13:37:36 +00:00

either fix comment or fix number

rename to EXP_TO_FLUID

either fix comment or fix number rename to EXP_TO_FLUID
albinaask (Migrated from github.com) reviewed 2023-03-19 15:19:16 +00:00
@ -0,0 +119,4 @@
public static class Container extends RecipeWrapper {
private final FluidTank fluidTank;
albinaask (Migrated from github.com) commented 2023-03-19 15:19:16 +00:00

You may want to swap this for a machineFluidTank, since you only want fluid xp to flow in. You can do both of those things automatically through that class ;)

You may want to swap this for a machineFluidTank, since you only want fluid xp to flow in. You can do both of those things automatically through that class ;)
ferriarnus (Migrated from github.com) reviewed 2023-03-21 12:04:53 +00:00
@ -0,0 +28,4 @@
public void addCommonTooltips(ItemStack itemStack, @Nullable Player player, List<Component> tooltips) {
itemStack
.getCapability(EIOCapabilities.ENTITY_STORAGE)
.ifPresent(entityStorage -> entityStorage
ferriarnus (Migrated from github.com) commented 2023-03-21 12:04:53 +00:00

I mean probably. Do you prefer it over this?

I mean probably. Do you prefer it over this?
ferriarnus (Migrated from github.com) reviewed 2023-03-21 12:08:16 +00:00
@ -0,0 +1,155 @@
package com.enderio.machines.common.blockentity;
ferriarnus (Migrated from github.com) commented 2023-03-21 12:08:15 +00:00

This is part of the design when I made it. It needs the first slot to have the capability for the recipe to work. It doesn't impose other restriction besides that, so yeah, powered spawners could also fit in it. I didn't want to limit the first slot to just soul vials, though maybe that's just simpler?

This is part of the design when I made it. It needs the first slot to have the capability for the recipe to work. It doesn't impose other restriction besides that, so yeah, powered spawners could also fit in it. I didn't want to limit the first slot to just soul vials, though maybe that's just simpler?
ferriarnus (Migrated from github.com) reviewed 2023-03-21 12:14:11 +00:00
@ -0,0 +119,4 @@
public static class Container extends RecipeWrapper {
private final FluidTank fluidTank;
ferriarnus (Migrated from github.com) commented 2023-03-21 12:14:11 +00:00

This container is purely used for the recipe and is just a reference to the real tank. But you do raise a good point of having a second look at the real tank, as it might be replaced by machineFluidTank. It also seems to miss somethings right now, good catch.

This container is purely used for the recipe and is just a reference to the real tank. But you do raise a good point of having a second look at the real tank, as it might be replaced by machineFluidTank. It also seems to miss somethings right now, good catch.
ferriarnus (Migrated from github.com) reviewed 2023-03-21 12:42:46 +00:00
ferriarnus (Migrated from github.com) commented 2023-03-21 12:42:45 +00:00

Hmm this is actually more complex maybe. If the tank has one type of experience fluid, will it allow another to be "merged" into it? Should we make this happen? The safest is to only use our own experience though.

Hmm this is actually more complex maybe. If the tank has one type of experience fluid, will it allow another to be "merged" into it? Should we make this happen? The safest is to only use our own experience though.
justliliandev (Migrated from github.com) reviewed 2023-03-21 18:58:08 +00:00
justliliandev (Migrated from github.com) commented 2023-03-21 18:58:07 +00:00

it would be the safest, but I think it should accept all of them

it would be the safest, but I think it should accept all of them
ferriarnus (Migrated from github.com) reviewed 2023-03-21 19:10:31 +00:00
ferriarnus (Migrated from github.com) commented 2023-03-21 19:10:31 +00:00

The thing is that it would need some special code and care, since it would need to ignore the (stack) fluid and still fill when it's not the same. And than we get to the issue of what to return inside the tank. And possible mods using different units...

The thing is that it would need some special code and care, since it would need to ignore the (stack) fluid and still fill when it's not the same. And than we get to the issue of what to return inside the tank. *And possible mods using different units...*
justliliandev (Migrated from github.com) reviewed 2023-03-21 19:15:39 +00:00
@ -0,0 +28,4 @@
public void addCommonTooltips(ItemStack itemStack, @Nullable Player player, List<Component> tooltips) {
itemStack
.getCapability(EIOCapabilities.ENTITY_STORAGE)
.ifPresent(entityStorage -> entityStorage
justliliandev (Migrated from github.com) commented 2023-03-21 19:15:39 +00:00

map and flatmap would probably look nicer , but it's not important and personal preference

map and flatmap would probably look nicer , but it's not important and personal preference
justliliandev (Migrated from github.com) reviewed 2023-03-21 19:17:03 +00:00
justliliandev (Migrated from github.com) commented 2023-03-21 19:17:03 +00:00

mods using different amounts for the same thing is not the case I think. And if so a standard would be better, because why should the tag exist if it's not meant for equality

mods using different amounts for the same thing is not the case I think. And if so a standard would be better, because why should the tag exist if it's not meant for equality
ferriarnus (Migrated from github.com) reviewed 2023-03-21 20:03:03 +00:00
ferriarnus (Migrated from github.com) commented 2023-03-21 20:03:03 +00:00

I'll give it a go, but I might need to rewrite some stuff. And it will need some good testing.

I'll give it a go, but I might need to rewrite some stuff. And it will need some good testing.
ferriarnus (Migrated from github.com) reviewed 2023-03-21 20:04:52 +00:00
@ -0,0 +119,4 @@
public static class Container extends RecipeWrapper {
private final FluidTank fluidTank;
ferriarnus (Migrated from github.com) commented 2023-03-21 20:04:51 +00:00

machineFluidTank isn't a thing though, as far as I can see. We do have a MachineFluidHandler is that what you ment?

`machineFluidTank` isn't a thing though, as far as I can see. We do have a `MachineFluidHandler` is that what you ment?
ferriarnus (Migrated from github.com) reviewed 2023-03-24 22:31:48 +00:00
@ -0,0 +1,168 @@
package com.enderio.machines.common.blockentity;
ferriarnus (Migrated from github.com) commented 2023-03-24 22:31:47 +00:00

I'm planning on bringing all the range methods to the base machine class in a next PR. Should these colours be in a config, they might have been in the past, but does it have an advantage? Does it even help colour blind people?

I'm planning on bringing all the range methods to the base machine class in a next PR. Should these colours be in a config, they might have been in the past, but does it have an advantage? Does it even help colour blind people?
dphaldes (Migrated from github.com) reviewed 2023-03-25 07:44:12 +00:00
@ -0,0 +1,155 @@
package com.enderio.machines.common.blockentity;
dphaldes (Migrated from github.com) commented 2023-03-25 07:44:12 +00:00

The recipe checks for soul vial and so it probably shouldn't accept other items (since we don't a recipe validity notifier inside the screen). I can see people getting confused when items get accepted in slots but nothing happens.

The recipe checks for soul vial and so it probably shouldn't accept other items (since we don't a recipe validity notifier inside the screen). I can see people getting confused when items get accepted in slots but nothing happens.
dphaldes (Migrated from github.com) reviewed 2023-03-25 07:46:54 +00:00
@ -0,0 +1,168 @@
package com.enderio.machines.common.blockentity;
dphaldes (Migrated from github.com) commented 2023-03-25 07:46:53 +00:00

The config right now resides on the server side and thus not very useful as the colors will be synced to all players. It can be helpful but we need to move it client side for any use. If we do decide to not make it configurable, we will need to find a good default color that works for all

The config right now resides on the server side and thus not very useful as the colors will be synced to all players. It can be helpful but we need to move it client side for any use. If we do decide to not make it configurable, we will need to find a good default color that works for all
ferriarnus (Migrated from github.com) reviewed 2023-03-25 11:45:33 +00:00
@ -0,0 +1,155 @@
package com.enderio.machines.common.blockentity;
ferriarnus (Migrated from github.com) commented 2023-03-25 11:45:32 +00:00

I wanted to be future proof in case we did want a recipe that used something else. But now that I think about it, that's probably not gonna happen. I'll change it to only take soul vials, that's probably fine.

I wanted to be future proof in case we did want a recipe that used something else. But now that I think about it, that's probably not gonna happen. I'll change it to only take soul vials, that's probably fine.
Rover656 (Migrated from github.com) reviewed 2023-03-29 15:33:08 +00:00
@ -0,0 +1,182 @@
package com.enderio.machines.common.blockentity.task;
Rover656 (Migrated from github.com) commented 2023-03-29 15:33:08 +00:00

I'd say an efficiency cap is reasonable to avoid overcrowding; should definitely be configurable and displayed in a tooltip for clarity.

I'd say an efficiency cap is reasonable to avoid overcrowding; should definitely be configurable and displayed in a tooltip for clarity.
ferriarnus (Migrated from github.com) reviewed 2023-03-29 17:03:56 +00:00
@ -0,0 +1,182 @@
package com.enderio.machines.common.blockentity.task;
ferriarnus (Migrated from github.com) commented 2023-03-29 17:03:56 +00:00

Hmm, so simply make there be a chance for them to fail if to many are present? That should be fine, I can add it to the "blocked" enum.

Hmm, so simply make there be a chance for them to fail if to many are present? That should be fine, I can add it to the "blocked" enum.
Rover656 (Migrated from github.com) requested changes 2023-03-30 01:19:06 +00:00
Rover656 (Migrated from github.com) left a comment

Looking good, just leaving a few notes for you here :)

Looking good, just leaving a few notes for you here :)
Rover656 (Migrated from github.com) commented 2023-03-30 01:02:01 +00:00

This can be fully removed now; if its necessary in future I'll put it back with the proper URL :)

This can be fully removed now; if its necessary in future I'll put it back with the proper URL :)
@ -0,0 +1,168 @@
package com.enderio.machines.common.blockentity;
Rover656 (Migrated from github.com) commented 2023-03-30 01:04:40 +00:00

Just a stylistic point; maybe store the RL of the pig in a constant just so its abundantly clear (and we're also not creating new objects regularly)

Just a stylistic point; maybe store the RL of the pig in a constant just so its abundantly clear (and we're also not creating new objects regularly)
Rover656 (Migrated from github.com) commented 2023-03-30 01:11:04 +00:00

Capitalisation of Mobs and Spawners is likely unnecessary here; but could be stylistic preference on my part.

Capitalisation of Mobs and Spawners is likely unnecessary here; but could be stylistic preference on my part.
@ -4,14 +4,9 @@ import net.minecraftforge.common.ForgeConfigSpec;
Rover656 (Migrated from github.com) commented 2023-03-30 01:18:28 +00:00

The clarity here is nice because otherwise it'd be a random dropChance key with no context.

The clarity here is nice because otherwise it'd be a random `dropChance` key with no context.
Rover656 (Migrated from github.com) approved these changes 2023-03-30 10:22:33 +00:00
Rover656 (Migrated from github.com) left a comment

I think this looks pretty good to go now, just need that model and we're golden! Nice work!

I think this looks pretty good to go now, just need that model and we're golden! Nice work!
justliliandev (Migrated from github.com) reviewed 2023-03-30 15:25:40 +00:00
@ -0,0 +30,4 @@
}
@Override
protected void init() {
justliliandev (Migrated from github.com) commented 2023-03-30 15:07:30 +00:00

maybe do that in renderLabels

maybe do that in renderLabels
@ -0,0 +130,4 @@
public void shouldShowRange(Boolean show) {
this.rangeVisible = show;
}
justliliandev (Migrated from github.com) commented 2023-03-30 15:10:15 +00:00

remove !isClientSide() check as that is already forced by ServerLevel

remove !isClientSide() check as that is already forced by ServerLevel
justliliandev (Migrated from github.com) commented 2023-03-30 15:12:51 +00:00

remove unused name parameter

remove unused name parameter
@ -0,0 +116,4 @@
public int getNeededXP() {
return container.getNeededXP();
}
justliliandev (Migrated from github.com) commented 2023-03-30 15:20:29 +00:00

remove question mark and add the comment on the line above

remove question mark and add the comment on the line above
justliliandev (Migrated from github.com) commented 2023-03-30 15:21:05 +00:00
                if (!this.getFluid().getFluid().isSame(EIOFluids.XP_JUICE.getSource()) && this.isFluidValid(resource)) { // Auto convert to own fluid (source) type?
```suggestion if (!this.getFluid().getFluid().isSame(EIOFluids.XP_JUICE.getSource()) && this.isFluidValid(resource)) { // Auto convert to own fluid (source) type? ```
ferriarnus (Migrated from github.com) reviewed 2023-03-30 16:08:15 +00:00
@ -0,0 +116,4 @@
public int getNeededXP() {
return container.getNeededXP();
}
ferriarnus (Migrated from github.com) commented 2023-03-30 16:08:15 +00:00

It was since I wasn't sure we should do it. But if you're fine with it, that's good.

It was since I wasn't sure we should do it. But if you're fine with it, that's good.
justliliandev (Migrated from github.com) reviewed 2023-03-30 16:12:10 +00:00
@ -0,0 +116,4 @@
public int getNeededXP() {
return container.getNeededXP();
}
justliliandev (Migrated from github.com) commented 2023-03-30 16:12:10 +00:00

yeah, I'm fine with that approach

yeah, I'm fine with that approach
Rover656 (Migrated from github.com) approved these changes 2023-03-31 13:45:57 +00:00
Rover656 (Migrated from github.com) left a comment

:shipit:

:shipit:
Sign in to join this conversation.
No reviewers
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Team-EnderIO/EnderIO#92
No description provided.