Started Zombie Generators #114

Closed
Trytoon wants to merge 4 commits from dev/1.19.x into dev/1.19.x
Trytoon commented 2023-03-27 13:42:32 +00:00 (Migrated from github.com)

Description

I started working on the zombie generators (zombie / franken / ender) as a starting point for implementing all basic generators (issue #27). I'm not sure why the fluid capacity is not fully working here but works for Fluid Tank (cannot push any fluid using mekanism fluid conduits).

Closes #139

Todo

  • Models
  • Allow fluid fuels to be inserted into the generators

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
# Description I started working on the zombie generators (zombie / franken / ender) as a starting point for implementing all basic generators (issue #27). I'm not sure why the fluid capacity is not fully working here but works for Fluid Tank (cannot push any fluid using mekanism fluid conduits). Closes #139 # Todo <!-- Remove this section if you're submitting an already-complete PR --> - [ ] Models - [ ] Allow fluid fuels to be inserted into the generators # 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 - [ ] 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 -->
ferriarnus commented 2023-03-27 13:47:33 +00:00 (Migrated from github.com)

If I were to guess for the fluid input, it's cause the IOConfig right now is probably not pulling in anything.

If I were to guess for the fluid input, it's cause the IOConfig right now is probably not pulling in anything.
Rover656 (Migrated from github.com) requested changes 2023-03-29 15:41:09 +00:00
Rover656 (Migrated from github.com) left a comment

Nice work for your first contribution to Ender IO, thank you! Just left you a few comments to get you started :)

Nice work for your first contribution to Ender IO, thank you! Just left you a few comments to get you started :)
@ -69,7 +69,7 @@ public class XPVacuumBlockEntity extends VacuumMachineEntity<ExperienceOrb> {
@Override
public void load(CompoundTag pTag) {
Rover656 (Migrated from github.com) commented 2023-03-29 15:35:03 +00:00

Why was this modified?

Why was this modified?
@ -0,0 +24,4 @@
import static com.enderio.base.common.init.EIOFluids.DEW_OF_THE_VOID;
import static com.enderio.base.common.init.EIOFluids.NUTRIENT_DISTILLATION;
public class ZombieGeneratorBlockEntity extends PowerGeneratingMachineEntity {
Rover656 (Migrated from github.com) commented 2023-03-29 15:38:23 +00:00

Maybe rename this to something along these lines to make slightly more sense? And also for clarity, make this an abstract class and the default behaviour another subclass :)

public class MobGeneratorBlockEntity extends PowerGeneratingMachineEntity {
Maybe rename this to something along these lines to make slightly more sense? And also for clarity, make this an abstract class and the default behaviour another subclass :) ```suggestion public class MobGeneratorBlockEntity extends PowerGeneratingMachineEntity { ```
@ -0,0 +35,4 @@
public ZombieGeneratorBlockEntity(QuadraticScalable capacity, QuadraticScalable transfer, QuadraticScalable use, BlockEntityType<?> type,
BlockPos worldPosition, BlockState blockState) {
super(capacity, transfer, use, type, worldPosition, blockState);
fluidTank = new FluidTank(10000) {
Rover656 (Migrated from github.com) commented 2023-03-29 15:35:32 +00:00

Could we store this 10,000 as a constant in this file or a config value? This goes for any of the magic numbers in here :)

Could we store this 10,000 as a constant in this file or a config value? This goes for any of the magic numbers in here :)
@ -30,6 +30,15 @@ public class MachineBlockEntities {
MachineBlocks.CREATIVE_POWER);
Rover656 (Migrated from github.com) commented 2023-03-29 15:37:33 +00:00

This class shouldn't be double nested.

        ZombieGeneratorBlockEntity.EnderGeneratorBlockEntity::new, MachineBlocks.ENDER_GENERATOR);
This class shouldn't be double nested. ```suggestion ZombieGeneratorBlockEntity.EnderGeneratorBlockEntity::new, MachineBlocks.ENDER_GENERATOR); ```
@ -0,0 +9,4 @@
import org.apache.logging.log4j.LogManager;
import org.jetbrains.annotations.Nullable;
public class ZombieGeneratorMenu extends MachineMenu<ZombieGeneratorBlockEntity> {
Rover656 (Migrated from github.com) commented 2023-03-29 15:40:37 +00:00

The same rename can be applied to these classes again to aid visibility.

The same rename can be applied to these classes again to aid visibility.
Trytoon (Migrated from github.com) reviewed 2023-03-29 17:04:19 +00:00
@ -69,7 +69,7 @@ public class XPVacuumBlockEntity extends VacuumMachineEntity<ExperienceOrb> {
@Override
public void load(CompoundTag pTag) {
Trytoon (Migrated from github.com) commented 2023-03-29 17:04:19 +00:00

Isn't the NBT id supposed to be the same in saveAdditional() and load() ? It's "tank" in saveAdditional().

Isn't the NBT id supposed to be the same in saveAdditional() and load() ? It's "tank" in saveAdditional().
Rover656 (Migrated from github.com) reviewed 2023-03-30 01:31:56 +00:00
@ -69,7 +69,7 @@ public class XPVacuumBlockEntity extends VacuumMachineEntity<ExperienceOrb> {
@Override
public void load(CompoundTag pTag) {
Rover656 (Migrated from github.com) commented 2023-03-30 01:31:55 +00:00

Dang yeah it is, nice catch!

Dang yeah it is, nice catch!
ferriarnus (Migrated from github.com) reviewed 2023-04-01 21:32:38 +00:00
ferriarnus (Migrated from github.com) left a comment

Just 2 small ones. I'm not sure what way we'll move with using the soul binder on them, but for now that's not a concern.

Just 2 small ones. I'm not sure what way we'll move with using the soul binder on them, but for now that's not a concern.
@ -0,0 +106,4 @@
@Override
public void serverTick() {
if (canAct() && isGenerating()) {
ferriarnus (Migrated from github.com) commented 2023-04-01 20:49:53 +00:00

Is the canAct() here not redundant?

Is the canAct() here not redundant?
@ -0,0 +140,4 @@
return fluidTank;
}
public Fluid getFluidType() {
ferriarnus (Migrated from github.com) commented 2023-04-01 20:51:34 +00:00

It could be more useful to make this a predicate of fluidstack?

It could be more useful to make this a predicate of fluidstack?
Trytoon (Migrated from github.com) reviewed 2023-04-05 11:05:34 +00:00
@ -0,0 +140,4 @@
return fluidTank;
}
public Fluid getFluidType() {
Trytoon (Migrated from github.com) commented 2023-04-05 11:05:33 +00:00

I actually don't know how to implement a predicate.

I looked at the 1.12 implementation and they had this getFluidType() method.
As one type of generator = one type of fluid, I think that makes sense to use this method.

I actually don't know how to implement a predicate. I looked at the 1.12 implementation and they had this getFluidType() method. As one type of generator = one type of fluid, I think that makes sense to use this method.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
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#114
No description provided.