Add Vacuum Blocks #80

Merged
dphaldes merged 30 commits from dev/vacuum into dev/1.19.x 2023-01-13 18:15:53 +00:00
dphaldes commented 2022-08-17 19:33:25 +00:00 (Migrated from github.com)

Co-authored-by: ferriarnus ferriarnus@users.noreply.github.com

Description

Adds Vacuum Blocks - Vacuum Chest and XP Vacuum blocks
supersedes #22

Todo (Vacuum Chest)

  • Work with hopper
  • Model
  • GUI layout
  • lang
  • IO config
  • Check render screen resize

Todo (XP Vacuum)

  • Work with tank
  • Model
  • Liquid
  • GUI layout
  • lang
  • IO config

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
Co-authored-by: ferriarnus <ferriarnus@users.noreply.github.com> # Description Adds Vacuum Blocks - Vacuum Chest and XP Vacuum blocks supersedes #22 # Todo (Vacuum Chest) - [x] Work with hopper - [x] Model - [x] GUI layout - [x] lang - [ ] ~~IO config~~ - [x] ~~Check render screen resize~~ # Todo (XP Vacuum) - [x] Work with tank - [x] Model - [x] Liquid - [x] GUI layout - [x] lang - [ ] ~~IO config~~ # 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 -->
EpicSquid (Migrated from github.com) reviewed 2022-08-17 19:33:25 +00:00
EpicSquid (Migrated from github.com) requested changes 2022-09-30 11:15:23 +00:00
EpicSquid (Migrated from github.com) left a comment

Looks mostly good from the code, just a few small things to fix up.

Looks mostly good from the code, just a few small things to fix up.
@ -10,6 +10,7 @@ import net.minecraft.core.Direction;
import net.minecraftforge.client.model.IQuadTransformer;
EpicSquid (Migrated from github.com) commented 2022-09-30 06:49:58 +00:00

Please undo the changes to the formatting here

Please undo the changes to the formatting here
EpicSquid (Migrated from github.com) commented 2022-09-30 06:52:48 +00:00

Please remove the changes to this file since its just formatting changes. Even if they are correct we can save it for a refactoring commit separately to the whole repo.

Please remove the changes to this file since its just formatting changes. Even if they are correct we can save it for a refactoring commit separately to the whole repo.
@ -0,0 +1,72 @@
package com.enderio.machines.common.blockentity;
EpicSquid (Migrated from github.com) commented 2022-09-30 06:58:03 +00:00

Can you remove this if its not longer relevant

Can you remove this if its not longer relevant
@ -0,0 +1,112 @@
package com.enderio.machines.common.blockentity;
EpicSquid (Migrated from github.com) commented 2022-09-30 07:01:16 +00:00

If this file doesn't already exist, make a common NBTUtils class in base and put it in there.

If this file doesn't already exist, make a common NBTUtils class in base and put it in there.
EpicSquid (Migrated from github.com) commented 2022-09-30 07:01:30 +00:00

Go with tank

Go with tank
@ -0,0 +41,4 @@
this.rCol = (float)Integer.parseInt(color.substring(4,6), 16) / 255;
// Create fluid tank.
this.fluidTank = createFluidTank(Integer.MAX_VALUE);
EpicSquid (Migrated from github.com) commented 2022-09-30 06:59:52 +00:00

Can we make this a configurable value?

Can we make this a configurable value?
@ -0,0 +68,4 @@
@Override
protected IIOConfig createIOConfig() {
return new FixedIOConfig(IOMode.PUSH);
EpicSquid (Migrated from github.com) commented 2022-09-30 07:49:41 +00:00

Correct me if I am wrong, but did we have a way to configure sides to be push or none in 1.12? I know the gui for side configuration isn't ready but it would be worth making sure the inventory is just accessible rather than actively pushing by default

Correct me if I am wrong, but did we have a way to configure sides to be push or none in 1.12? I know the gui for side configuration isn't ready but it would be worth making sure the inventory is just accessible rather than actively pushing by default
EpicSquid (Migrated from github.com) commented 2022-09-30 08:04:42 +00:00

Please undo the formatting changes for the non-vacuum entries

Please undo the formatting changes for the non-vacuum entries
EpicSquid (Migrated from github.com) commented 2022-09-30 08:05:02 +00:00

Also remove the formatting changes for non-vacuum entries here

Also remove the formatting changes for non-vacuum entries here
@ -0,0 +1,125 @@
package com.enderio.base.client.particle;
EpicSquid (Migrated from github.com) commented 2022-09-30 10:59:15 +00:00

Can you change these var's to floats/vecs (for the ones below) since they are simple enough types

Can you change these var's to floats/vecs (for the ones below) since they are simple enough types
@ -0,0 +13,4 @@
public static final DeferredRegister<ParticleType<?>> PARTICLE_TYPES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, EnderIO.MODID);
public static final RegistryObject<RangeParticleType> RANGE_PARTICLE = PARTICLE_TYPES.register("range_particle", RangeParticleType::new);
EpicSquid (Migrated from github.com) commented 2022-09-30 11:03:13 +00:00

Is this possible with Registrate? I believe it should be possible with Registrate.simple()

Is this possible with Registrate? I believe it should be possible with Registrate.simple()
EpicSquid (Migrated from github.com) commented 2022-09-30 11:10:43 +00:00

Please rename this file given we aren't calling it "tesseract". Just go with "vacuum_portal" or similar

Please rename this file given we aren't calling it "tesseract". Just go with "vacuum_portal" or similar
dphaldes (Migrated from github.com) reviewed 2022-09-30 13:37:19 +00:00
@ -0,0 +41,4 @@
this.rCol = (float)Integer.parseInt(color.substring(4,6), 16) / 255;
// Create fluid tank.
this.fluidTank = createFluidTank(Integer.MAX_VALUE);
dphaldes (Migrated from github.com) commented 2022-09-30 13:37:18 +00:00

Do you mean like configurable through client.toml file ?

Do you mean like configurable through client.toml file ?
dphaldes (Migrated from github.com) reviewed 2022-09-30 13:51:15 +00:00
@ -0,0 +13,4 @@
public static final DeferredRegister<ParticleType<?>> PARTICLE_TYPES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, EnderIO.MODID);
public static final RegistryObject<RangeParticleType> RANGE_PARTICLE = PARTICLE_TYPES.register("range_particle", RangeParticleType::new);
dphaldes (Migrated from github.com) commented 2022-09-30 13:51:14 +00:00

what would be the value for ResourceKey<Registry<R>> registryType

what would be the value for `ResourceKey<Registry<R>> registryType`
dphaldes (Migrated from github.com) reviewed 2022-09-30 14:32:58 +00:00
@ -0,0 +1,72 @@
package com.enderio.machines.common.blockentity;
dphaldes (Migrated from github.com) commented 2022-09-30 14:32:58 +00:00

@ferriarnus added this. Is this still needed/or to be done ?

@ferriarnus added this. Is this still needed/or to be done ?
dphaldes (Migrated from github.com) reviewed 2022-09-30 14:45:28 +00:00
@ -0,0 +68,4 @@
@Override
protected IIOConfig createIOConfig() {
return new FixedIOConfig(IOMode.PUSH);
dphaldes (Migrated from github.com) commented 2022-09-30 14:45:28 +00:00

In 1.12, Both the vacuum block don't have an option to configure automatic push/pull. However, XP vacuum has a very small internal buffer and thus requires an external storage connected to it. It pushes automatically to a tank next to it. On the other hand, Vacuum chest doesn't push anything automatically.

In 1.12, Both the vacuum block don't have an option to configure automatic push/pull. However, XP vacuum has a very small internal buffer and thus requires an external storage connected to it. It pushes automatically to a tank next to it. On the other hand, Vacuum chest doesn't push anything automatically.
EpicSquid (Migrated from github.com) reviewed 2022-09-30 21:43:07 +00:00
@ -0,0 +41,4 @@
this.rCol = (float)Integer.parseInt(color.substring(4,6), 16) / 255;
// Create fluid tank.
this.fluidTank = createFluidTank(Integer.MAX_VALUE);
EpicSquid (Migrated from github.com) commented 2022-09-30 21:43:07 +00:00

Should be configured through the server toml and synced to the client

Should be configured through the server toml and synced to the client
EpicSquid (Migrated from github.com) reviewed 2022-09-30 21:43:57 +00:00
@ -0,0 +13,4 @@
public static final DeferredRegister<ParticleType<?>> PARTICLE_TYPES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, EnderIO.MODID);
public static final RegistryObject<RangeParticleType> RANGE_PARTICLE = PARTICLE_TYPES.register("range_particle", RangeParticleType::new);
EpicSquid (Migrated from github.com) commented 2022-09-30 21:43:57 +00:00

I don't remember currently, might have to experiment and find out

I don't remember currently, might have to experiment and find out
dphaldes (Migrated from github.com) reviewed 2022-10-24 16:03:59 +00:00
@ -0,0 +41,4 @@
this.rCol = (float)Integer.parseInt(color.substring(4,6), 16) / 255;
// Create fluid tank.
this.fluidTank = createFluidTank(Integer.MAX_VALUE);
dphaldes (Migrated from github.com) commented 2022-10-24 16:03:59 +00:00

Done!

Done!
ferriarnus (Migrated from github.com) reviewed 2022-11-08 17:25:53 +00:00
@ -0,0 +1,72 @@
package com.enderio.machines.common.blockentity;
ferriarnus (Migrated from github.com) commented 2022-11-08 17:25:53 +00:00

it seems this can go now yeah, probably legacy. It matches the super method

it seems this can go now yeah, probably legacy. It matches the super method
ferriarnus (Migrated from github.com) reviewed 2022-11-08 17:28:56 +00:00
@ -0,0 +68,4 @@
@Override
protected IIOConfig createIOConfig() {
return new FixedIOConfig(IOMode.PUSH);
ferriarnus (Migrated from github.com) commented 2022-11-08 17:28:56 +00:00

I felt like giving these blocks also control over the sides be a good idea. And as a correction, from what I could see in the 1.12 code, the buffer of the xp vacuum is really large (to the point it may need a nerf).

I felt like giving these blocks also control over the sides be a good idea. And as a correction, from what I could see in the 1.12 code, the buffer of the xp vacuum is really large (to the point it may need a nerf).
ferriarnus commented 2022-11-08 17:36:27 +00:00 (Migrated from github.com)

I had a look in game and it all still worked like a remember it does (and a new range indicator that seems to be doing it's job quiet well, though some angles don't render, but I think this is a mc limit? If that's the reason it should be fine). If no one else has any remarks about the code (I'm really bad at checking code like this). I think it's ready to be merged (after fixing the conflicts and 1 comment).

I had a look in game and it all still worked like a remember it does (and a new range indicator that seems to be doing it's job quiet well, though some angles don't render, but I think this is a mc limit? If that's the reason it should be fine). If no one else has any remarks about the code (I'm really bad at checking code like this). I think it's ready to be merged (after fixing the conflicts and 1 comment).
dphaldes (Migrated from github.com) reviewed 2022-11-11 08:01:01 +00:00
@ -0,0 +68,4 @@
@Override
protected IIOConfig createIOConfig() {
return new FixedIOConfig(IOMode.PUSH);
dphaldes (Migrated from github.com) commented 2022-11-11 08:01:00 +00:00

Should I keep it default or change it ?

Should I keep it default or change it ?
dphaldes commented 2022-12-02 09:55:16 +00:00 (Migrated from github.com)

Fixed merge conflicts. Waiting for IO widget to complete this PR.

Fixed merge conflicts. Waiting for IO widget to complete this PR.
justliliandev (Migrated from github.com) reviewed 2022-12-29 14:20:32 +00:00
@ -0,0 +13,4 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
public class VacuumChestScreen extends EIOScreen<VacuumChestMenu> {
justliliandev (Migrated from github.com) commented 2022-12-29 14:10:17 +00:00

don't use this. for variables you can access without the prefix

don't use `this.` for variables you can access without the prefix
@ -0,0 +1,65 @@
package com.enderio.machines.client.gui.screen;
justliliandev (Migrated from github.com) commented 2022-12-29 14:11:38 +00:00

widgetsv2 isn't used, extract the things you need from there to a seperate texture file

widgetsv2 isn't used, extract the things you need from there to a seperate texture file
@ -0,0 +1,34 @@
package com.enderio.machines.common.menu;
justliliandev (Migrated from github.com) commented 2022-12-29 14:17:44 +00:00

use the other Nullable Annotation

use the other Nullable Annotation
justliliandev (Migrated from github.com) requested changes 2023-01-05 21:55:40 +00:00
justliliandev (Migrated from github.com) left a comment

No need to remove some characters. We aren't limited to storage

No need to remove some characters. We aren't limited to storage
@ -0,0 +15,4 @@
import net.minecraft.world.entity.player.Inventory;
public class XPVacuumScreen extends EIOScreen<XPVacuumMenu> {
justliliandev (Migrated from github.com) commented 2023-01-05 21:53:04 +00:00
    private static final ResourceLocation RANGE_BUTTON_TEXTURE = EnderIO.loc("textures/gui/icons/range_buttons.png");
```suggestion private static final ResourceLocation RANGE_BUTTON_TEXTURE = EnderIO.loc("textures/gui/icons/range_buttons.png"); ```
@ -0,0 +28,4 @@
@Override
protected void init() {
super.init();
addRenderableOnly(new FluidStackStaticWidget(this, getMenu().getBlockEntity()::getFluidTank, leftPos + 27, topPos + 22, 32, 32));
justliliandev (Migrated from github.com) commented 2023-01-05 21:53:59 +00:00
        addRenderableWidget(new ToggleImageButton<>(this, leftPos + imageWidth - 8 - 16, topPos + 34, 16, 16, 0, 0, 16, 0, RANGE_BUTTON_TEXTURE,
```suggestion addRenderableWidget(new ToggleImageButton<>(this, leftPos + imageWidth - 8 - 16, topPos + 34, 16, 16, 0, 0, 16, 0, RANGE_BUTTON_TEXTURE, ```
justliliandev (Migrated from github.com) approved these changes 2023-01-06 11:52:47 +00:00
justliliandev (Migrated from github.com) left a comment

looks good to me

looks good to me
Sign in to join this conversation.
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#80
No description provided.