energy storage or something #198

Merged
justliliandev merged 14 commits from feature/cap-banks into dev/1.20.1 2023-07-06 11:31:22 +00:00
justliliandev commented 2023-07-02 21:24:27 +00:00 (Migrated from github.com)

Description

Added Capacitor Banks. Connected Textures are done using the Athena mod

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 Added Capacitor Banks. Connected Textures are done using the Athena mod # 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
Rover656 commented 2023-07-03 11:43:30 +00:00 (Migrated from github.com)

This closes #177

This closes #177
Rover656 (Migrated from github.com) requested changes 2023-07-03 11:49:20 +00:00
Rover656 (Migrated from github.com) left a comment

Most of this goes over my head tbh, but seems sensible.
Don't worry about the NBT stuff until #165 is merged.

Most of this goes over my head tbh, but seems sensible. Don't worry about the NBT stuff until #165 is merged.
@ -27,2 +27,2 @@
case WEST -> renderFace(pose, normal, consumer, texture, color, 1.0f - z, 1.0f - z, y + h, y, x, x + w, x + w, x, x, x + w, y, y + h);
case EAST -> renderFace(pose, normal, consumer, texture, color, z, z, y, y + h, x, x + w, x + w, x, x + w, x, y + h, y);
case DOWN -> renderFace(pose, normal, consumer, texture, color, light, x, x + w, 1.0f - z, 1.0f - z, y, y, y + h, y + h, x, x + w, y, y + h);
case UP -> renderFace(pose, normal, consumer, texture, color, light, x, x + w, z, z, y + h, y + h, y, y, x, x + w, y, y + h);
Rover656 (Migrated from github.com) commented 2023-07-03 06:27:04 +00:00

Is it possible for us to document this better for future, now that (i hope) you understand whats goin on :P

Is it possible for us to document this better for future, now that (i hope) you understand whats goin on :P
Rover656 (Migrated from github.com) commented 2023-07-03 11:41:06 +00:00

This should possibly be above addProvider

This should possibly be above addProvider
@ -0,0 +66,4 @@
}
int length = 1;
//some random limit
while(length < 16) {
Rover656 (Migrated from github.com) commented 2023-07-03 11:44:34 +00:00

What is this limit?

What is this limit?
@ -0,0 +99,4 @@
}
}
}
private static void renderIO(CapacitorBankBlockEntity capacitorBank, PoseStack poseStack, MultiBufferSource bufferSource, Direction facing) {
Rover656 (Migrated from github.com) commented 2023-07-03 11:44:56 +00:00

I am going to trust that this works 😂

I am going to trust that this works 😂
@ -0,0 +1,332 @@
package com.enderio.machines.common.blockentity.capacitorbank;
Rover656 (Migrated from github.com) commented 2023-07-03 06:32:00 +00:00

Depending on merge order, you may have to convert these to use constants, like the approach in #165

Depending on merge order, you may have to convert these to use constants, like the approach in #165
@ -0,0 +29,4 @@
return new BlockEntityEnergyStorage(stack, ((CapacitorBankBlock)getBlock()).getTier().getStorageCapacity());
}
private static class BlockEntityEnergyStorage implements IEnergyStorage, ICapabilityProvider {
Rover656 (Migrated from github.com) commented 2023-07-03 11:48:31 +00:00

Why does this need a capability? If it is necessary then maybe we should be giving this to all of our powered blocks?

Why does this need a capability? If it is necessary then maybe we should be giving this to all of our powered blocks?
@ -0,0 +71,4 @@
}
public void setEnergyStored(int stored) {
CompoundTag nbt = container.getOrCreateTag();
Rover656 (Migrated from github.com) commented 2023-07-03 11:48:46 +00:00

Same here; will need to use NBT constants

Same here; will need to use NBT constants
ferriarnus (Migrated from github.com) reviewed 2023-07-03 12:18:58 +00:00
ferriarnus (Migrated from github.com) left a comment

A quick look, will give it a second pass later on.

A quick look, will give it a second pass later on.
@ -0,0 +1,318 @@
package com.enderio.machines.client.rendering.blockentity;
ferriarnus (Migrated from github.com) commented 2023-07-03 12:07:23 +00:00

very minor, but is it needed to recreate this array every time?

very minor, but is it needed to recreate this array every time?
@ -0,0 +66,4 @@
}
int length = 1;
//some random limit
while(length < 16) {
ferriarnus (Migrated from github.com) commented 2023-07-03 12:06:20 +00:00

I think how many screens/bars can connect to each other?

I think how many screens/bars can connect to each other?
@ -0,0 +29,4 @@
return new BlockEntityEnergyStorage(stack, ((CapacitorBankBlock)getBlock()).getTier().getStorageCapacity());
}
private static class BlockEntityEnergyStorage implements IEnergyStorage, ICapabilityProvider {
ferriarnus (Migrated from github.com) commented 2023-07-03 12:16:54 +00:00

I have made an itemstack energy capability, but that one does not store it in the block entity tag (we could maybe change that, but I'm not sure that is needed). The reason this one is different, is because our machines don't expose the energy when they are in item form, while the powerbanks due.

I have made an itemstack energy capability, but that one does not store it in the block entity tag (we could maybe change that, but I'm not sure that is needed). The reason this one is different, is because our machines don't expose the energy when they are in item form, while the powerbanks due.
Rover656 (Migrated from github.com) reviewed 2023-07-03 16:26:29 +00:00
@ -0,0 +29,4 @@
return new BlockEntityEnergyStorage(stack, ((CapacitorBankBlock)getBlock()).getTier().getStorageCapacity());
}
private static class BlockEntityEnergyStorage implements IEnergyStorage, ICapabilityProvider {
Rover656 (Migrated from github.com) commented 2023-07-03 16:26:29 +00:00

Yeah I mean it'd be nice to break this out into its own class

Yeah I mean it'd be nice to break this out into its own class
Rover656 (Migrated from github.com) reviewed 2023-07-03 16:26:47 +00:00
@ -0,0 +1,318 @@
package com.enderio.machines.client.rendering.blockentity;
Rover656 (Migrated from github.com) commented 2023-07-03 16:26:47 +00:00

Could use Direction.valuees()

Could use Direction.valuees()
justliliandev (Migrated from github.com) reviewed 2023-07-03 18:38:40 +00:00
@ -27,2 +27,2 @@
case WEST -> renderFace(pose, normal, consumer, texture, color, 1.0f - z, 1.0f - z, y + h, y, x, x + w, x + w, x, x, x + w, y, y + h);
case EAST -> renderFace(pose, normal, consumer, texture, color, z, z, y, y + h, x, x + w, x + w, x, x + w, x, y + h, y);
case DOWN -> renderFace(pose, normal, consumer, texture, color, light, x, x + w, 1.0f - z, 1.0f - z, y, y, y + h, y + h, x, x + w, y, y + h);
case UP -> renderFace(pose, normal, consumer, texture, color, light, x, x + w, z, z, y + h, y + h, y, y, x, x + w, y, y + h);
justliliandev (Migrated from github.com) commented 2023-07-03 18:38:39 +00:00

there is still the problem of horizontal flipping of textures (I've flipped the textures again to counteract this)
the biggest problem is, that there is just a lot of things going on and I'm not sure how to make it that much better

there is still the problem of horizontal flipping of textures (I've flipped the textures again to counteract this) the biggest problem is, that there is just a lot of things going on and I'm not sure how to make it that much better
justliliandev (Migrated from github.com) reviewed 2023-07-03 18:43:33 +00:00
@ -0,0 +66,4 @@
}
int length = 1;
//some random limit
while(length < 16) {
justliliandev (Migrated from github.com) commented 2023-07-03 18:43:32 +00:00

yeah, basically, I don't want the BER to be as computationally expensive and as the energy bar is rendered from the topmost one, I would have to make the BlockEntity Render Box larger and larger which would just cost more on the rendering side. I thought that 16 blocks is a reasonable limit

yeah, basically, I don't want the BER to be as computationally expensive and as the energy bar is rendered from the topmost one, I would have to make the BlockEntity Render Box larger and larger which would just cost more on the rendering side. I thought that 16 blocks is a reasonable limit
justliliandev (Migrated from github.com) reviewed 2023-07-03 18:45:00 +00:00
@ -0,0 +1,318 @@
package com.enderio.machines.client.rendering.blockentity;
justliliandev (Migrated from github.com) commented 2023-07-03 18:45:00 +00:00

no, that would include Up and down which would just be annoying later down the line to deal with. I'll create a static array having only those 4 in them

no, that would include Up and down which would just be annoying later down the line to deal with. I'll create a static array having only those 4 in them
justliliandev (Migrated from github.com) reviewed 2023-07-03 18:46:25 +00:00
@ -0,0 +99,4 @@
}
}
}
private static void renderIO(CapacitorBankBlockEntity capacitorBank, PoseStack poseStack, MultiBufferSource bufferSource, Direction facing) {
justliliandev (Migrated from github.com) commented 2023-07-03 18:46:24 +00:00

thanks

thanks
justliliandev (Migrated from github.com) reviewed 2023-07-03 18:47:00 +00:00
@ -0,0 +29,4 @@
return new BlockEntityEnergyStorage(stack, ((CapacitorBankBlock)getBlock()).getTier().getStorageCapacity());
}
private static class BlockEntityEnergyStorage implements IEnergyStorage, ICapabilityProvider {
justliliandev (Migrated from github.com) commented 2023-07-03 18:47:00 +00:00

I would do that once we have the requirement, not now

I would do that once we have the requirement, not now
Rover656 (Migrated from github.com) approved these changes 2023-07-05 20:03:32 +00:00
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#198
No description provided.