Conduits #127

Merged
Rover656 merged 54 commits from collab/conduits into dev/1.19.4 2023-06-24 17:23:08 +00:00
Rover656 commented 2023-06-18 20:31:01 +00:00 (Migrated from github.com)

Description

Merging work on conduits into main branches.
Thanks a bunch to @agnor99 who did all of the work, I'm just helping merge this stuff in.

Todo

  • Full review of everything

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 Merging work on conduits into main branches. Thanks a bunch to @agnor99 who did all of the work, I'm just helping merge this stuff in. # Todo <!-- Remove this section if you're submitting an already-complete PR --> - [x] Full review of everything # 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 -->
Rover656 (Migrated from github.com) reviewed 2023-06-24 11:22:07 +00:00
Rover656 (Migrated from github.com) left a comment

A big review, mostly formatting things and future works, but a couple questions for @agnor99 if you have time please :) I verified mostly code health rather than validating functionality as this has been pretty extensively tested thusfar anyway.

A big review, mostly formatting things and future works, but a couple questions for @agnor99 if you have time please :) I verified mostly code health rather than validating functionality as this has been pretty extensively tested thusfar anyway.
Rover656 (Migrated from github.com) commented 2023-06-24 11:05:20 +00:00

Remove this

Remove this
Rover656 (Migrated from github.com) commented 2023-06-24 11:05:37 +00:00

This will be re-enabled when merging in #129

This will be re-enabled when merging in #129
@ -0,0 +1,28 @@
package com.enderio.api.conduit;
Rover656 (Migrated from github.com) commented 2023-06-24 11:06:00 +00:00

Newline

Newline
@ -0,0 +56,4 @@
return Minecraft.getInstance().getModelManager().getModel(model);
}
/**
Rover656 (Migrated from github.com) commented 2023-06-24 11:06:13 +00:00

Newline

Newline
@ -0,0 +12,4 @@
boolean hasUpgrade();
default boolean showBarSeperator() {
Rover656 (Migrated from github.com) commented 2023-06-24 11:06:22 +00:00

newline

newline
@ -0,0 +81,4 @@
return cast();
}
static Supplier<EmptyExtendedConduitData> dummy() {
Rover656 (Migrated from github.com) commented 2023-06-24 11:06:55 +00:00

newlines

newlines
@ -0,0 +1,76 @@
package com.enderio.api.conduit;
Rover656 (Migrated from github.com) commented 2023-06-24 11:07:04 +00:00

newline

newline
@ -0,0 +1,74 @@
package com.enderio.api.conduit;
Rover656 (Migrated from github.com) commented 2023-06-24 11:07:18 +00:00

newline

newline
@ -0,0 +22,4 @@
import java.util.List;
public interface IIOAwareConduitTicker extends ILoadedAwareConduitTicker {
@Override
Rover656 (Migrated from github.com) commented 2023-06-24 11:07:34 +00:00

newline

newline
@ -0,0 +23,4 @@
public interface IIOAwareConduitTicker extends ILoadedAwareConduitTicker {
@Override
default void tickGraph(IConduitType<?> type, List<NodeIdentifier<?>> loadedNodes, ServerLevel level, Graph<Mergeable.Dummy> graph) {
Rover656 (Migrated from github.com) commented 2023-06-24 11:07:47 +00:00

Method formatting

Method formatting
@ -0,0 +62,4 @@
}
}
return state.control().isActive(hasRedstone);
}
Rover656 (Migrated from github.com) commented 2023-06-24 11:07:51 +00:00

newline

newline
@ -0,0 +36,4 @@
inserted += insert.receiveEnergy(availableForExtraction - inserted, false);
if (inserted == availableForExtraction)
break;
}
Rover656 (Migrated from github.com) commented 2023-06-24 11:08:09 +00:00

Newlines

Newlines
@ -0,0 +15,4 @@
}
default void onModConstruct() {
Rover656 (Migrated from github.com) commented 2023-06-24 11:08:20 +00:00

newline

newline
@ -0,0 +12,4 @@
public static Component REDSTONE_ACTIVE_WITH_SIGNAL;
public static Component REDSTONE_ACTIVE_WITHOUT_SIGNAL;
public static Component REDSTONE_NEVER_ACTIVE;
Rover656 (Migrated from github.com) commented 2023-06-24 11:08:27 +00:00

newline

newline
@ -0,0 +1,59 @@
package com.enderio.conduits.client;
Rover656 (Migrated from github.com) commented 2023-06-24 11:09:38 +00:00

Format

Format
Rover656 (Migrated from github.com) commented 2023-06-24 11:09:55 +00:00

@agnor99 Where was this method from so I can AT it?

@agnor99 Where was this method from so I can AT it?
@ -0,0 +32,4 @@
private static TextureAtlas blockAtlas() {
return Minecraft.getInstance().getModelManager().getAtlas(InventoryMenu.BLOCK_ATLAS);
}
Rover656 (Migrated from github.com) commented 2023-06-24 11:10:25 +00:00

newline

newline
@ -0,0 +45,4 @@
@Override
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, RandomSource rand, ModelData extraData,
@Nullable RenderType renderType) {
List<BakedQuad> quads = new ArrayList<>();
Rover656 (Migrated from github.com) commented 2023-06-24 11:10:34 +00:00

Formatting

Formatting
@ -0,0 +1,188 @@
package com.enderio.conduits.common;
Rover656 (Migrated from github.com) commented 2023-06-24 11:11:08 +00:00

Can this be removed?

Can this be removed?
@ -0,0 +26,4 @@
private VoxelShape totalShape = core;
public ConduitShape() {
Rover656 (Migrated from github.com) commented 2023-06-24 11:10:53 +00:00

Newline

Newline
@ -0,0 +1,523 @@
package com.enderio.conduits.common.blockentity;
Rover656 (Migrated from github.com) commented 2023-06-24 11:11:22 +00:00

Can these be removed?

Can these be removed?
@ -0,0 +267,4 @@
}
}
if (level instanceof ServerLevel serverLevel) {
Rover656 (Migrated from github.com) commented 2023-06-24 11:11:38 +00:00

Newline

Newline
@ -0,0 +479,4 @@
@Override
public boolean isItemValid(int slot, @NotNull ItemStack stack) {
//TODO implement
Rover656 (Migrated from github.com) commented 2023-06-24 11:12:03 +00:00

Does this need implementing? If so what does it need?

Does this need implementing? If so what does it need?
@ -0,0 +49,4 @@
* @return the type that is now not in this bundle
*/
public RightClickAction addType(Level level, IConduitType<?> type, Player player) {
if (types.size() == MAX_CONDUIT_TYPES)
Rover656 (Migrated from github.com) commented 2023-06-24 11:12:20 +00:00

Format

Format
@ -0,0 +251,4 @@
}
//TODO: RFC
Rover656 (Migrated from github.com) commented 2023-06-24 11:12:48 +00:00

Whats this for, shall we discuss here @agnor99?

Whats this for, shall we discuss here @agnor99?
@ -0,0 +279,4 @@
facadeTextures.put(direction, facade);
}
//TODO, make this method more useable
Rover656 (Migrated from github.com) commented 2023-06-24 11:12:57 +00:00

What does this mean?

What does this mean?
@ -0,0 +163,4 @@
private Optional<InteractionResult> addConduit(ConduitBlockEntity conduit, Player player, ItemStack stack, boolean isClientSide) {
if (!(stack.getItem() instanceof ConduitBlockItem conduitBlockItem))
return Optional.empty();
EnderIO.LOGGER.info("rightclicked with conduititem: " + ConduitTypes.getRegistry().getKey(conduitBlockItem.getType()) + " @ " + conduit.getBlockPos().toShortString());
Rover656 (Migrated from github.com) commented 2023-06-24 11:14:19 +00:00

Tbh we should do a PR reviewing all logger uses, because to me these should all be debug logs.

Tbh we should do a PR reviewing all logger uses, because to me these should all be debug logs.
@ -0,0 +24,4 @@
public static final ItemEntry<Item> POWER = createConduitItem(() -> EnderConduitTypes.POWER.get(), "power1");
public static final ItemEntry<Item> POWER2 = createConduitItem(() -> EnderConduitTypes.POWER2.get(), "power2");
public static final ItemEntry<Item> POWER3 = createConduitItem(() -> EnderConduitTypes.POWER3.get(), "power3");
Rover656 (Migrated from github.com) commented 2023-06-24 11:15:02 +00:00

Going to keep the 3 tiers here for now, but I believe consensus was we're going to rework power and remove transfer caps, is that right @agnor99?

Going to keep the 3 tiers here for now, but I believe consensus was we're going to rework power and remove transfer caps, is that right @agnor99?
@ -0,0 +15,4 @@
public static final ResourceLocation ICON_TEXTURE = EnderIO.loc("textures/gui/conduit_icon.png");
public static final RegistryObject<PowerConduitType> POWER = powerConduit(1, 1280, new Vector2i(0,24));
public static final RegistryObject<PowerConduitType> POWER2 = powerConduit(2, 5120, new Vector2i(0,48));
public static final RegistryObject<PowerConduitType> POWER3 = powerConduit(3, 20480, new Vector2i(0,72));
Rover656 (Migrated from github.com) commented 2023-06-24 11:15:19 +00:00

Same story with power here

Same story with power here
@ -0,0 +1,143 @@
package com.enderio.conduits.common.integrations.ae2;
Rover656 (Migrated from github.com) commented 2023-06-24 11:15:34 +00:00

Newline

Newline
@ -0,0 +61,4 @@
mainNode.loadFromNBT(nbt);
}
void onSecurityBreach() {
Rover656 (Migrated from github.com) commented 2023-06-24 11:16:08 +00:00

Note for 1.20.1 porting: This will all be binned I believe as AE2 doesnt have security stuff anymore.

Note for 1.20.1 porting: This will all be binned I believe as AE2 doesnt have security stuff anymore.
@ -0,0 +87,4 @@
}
public boolean canPlayerModify(Player player) {
//TODO add check
Rover656 (Migrated from github.com) commented 2023-06-24 11:16:24 +00:00

What check are we missing here?

What check are we missing here?
@ -0,0 +35,4 @@
}
private ConduitSavedData() {
Rover656 (Migrated from github.com) commented 2023-06-24 11:17:07 +00:00

Newline

Newline
@ -0,0 +1,151 @@
package com.enderio.conduits.common.types;
Rover656 (Migrated from github.com) commented 2023-06-24 11:17:37 +00:00

Yeup forgot I still had to do these

Yeup forgot I still had to do these
@ -0,0 +1,87 @@
package com.enderio.conduits.common.types;
Rover656 (Migrated from github.com) commented 2023-06-24 11:17:44 +00:00

Newline

Newline
@ -122,6 +122,11 @@ public class EnumIconWidget<T extends Enum<T> & IIcon, U extends Screen & IEnder
Rover656 (Migrated from github.com) commented 2023-06-24 11:18:39 +00:00

Tooltips here too :)

Tooltips here too :)
@ -224,15 +229,15 @@ public class EnumIconWidget<T extends Enum<T> & IIcon, U extends Screen & IEnder
if (getter.get() != value) {
Rover656 (Migrated from github.com) commented 2023-06-24 11:18:57 +00:00

Fix what? I'll take another look in a bit

Fix what? I'll take another look in a bit
@ -0,0 +13,4 @@
public class ListDataSlot<T, V extends Tag> extends EnderDataSlot<List<T>> {
private final Function<T, V> serializer;
private final Function<V, T> deSerializer;
Rover656 (Migrated from github.com) commented 2023-06-24 11:19:18 +00:00

Newline

Newline
@ -283,2 +283,4 @@
ResourceLocation id = new ResourceLocation(obj.get("tag").getAsString());
TagKey<Item> tag = ItemTags.create(id);
// TODO: move these tests into OutputItem instead..
Rover656 (Migrated from github.com) commented 2023-06-24 11:20:32 +00:00

What are these checks added for? I think I can leave these for a future 1.20 todo cleanup pass though.

What are these checks added for? I think I can leave these for a future 1.20 todo cleanup pass though.
@ -0,0 +15,4 @@
import java.util.List;
public record PaintingQuadTransformer(BlockState paint, RenderType type) implements IQuadTransformer {
Rover656 (Migrated from github.com) commented 2023-06-24 11:21:09 +00:00

If this is what I think it is; is there any way to make the purple and grey box things render with a nicer texture?

If this is what I think it is; is there any way to make the purple and grey box things render with a nicer texture?
justliliandev (Migrated from github.com) reviewed 2023-06-24 12:57:45 +00:00
@ -283,2 +283,4 @@
ResourceLocation id = new ResourceLocation(obj.get("tag").getAsString());
TagKey<Item> tag = ItemTags.create(id);
// TODO: move these tests into OutputItem instead..
justliliandev (Migrated from github.com) commented 2023-06-24 12:57:45 +00:00

I think that invalid recipes (ingredients without valid items (empty tags, missing mods) etc. ) are not registered and don't pollute the recipe search, but it really shouldn't be in this PR

I think that invalid recipes (ingredients without valid items (empty tags, missing mods) etc. ) are not registered and don't pollute the recipe search, but it really shouldn't be in this PR
Rover656 (Migrated from github.com) reviewed 2023-06-24 13:03:31 +00:00
@ -283,2 +283,4 @@
ResourceLocation id = new ResourceLocation(obj.get("tag").getAsString());
TagKey<Item> tag = ItemTags.create(id);
// TODO: move these tests into OutputItem instead..
Rover656 (Migrated from github.com) commented 2023-06-24 13:03:30 +00:00

That's all good then, I'll leave it in there and it can get picked up again (one day ™️)

That's all good then, I'll leave it in there and it can get picked up again (one day ™️)
Rover656 (Migrated from github.com) reviewed 2023-06-24 13:03:43 +00:00
@ -0,0 +15,4 @@
import java.util.List;
public record PaintingQuadTransformer(BlockState paint, RenderType type) implements IQuadTransformer {
Rover656 (Migrated from github.com) commented 2023-06-24 13:03:43 +00:00

Resolved in discord, i didn't understand this part :P

Resolved in discord, i didn't understand this part :P
Rover656 (Migrated from github.com) reviewed 2023-06-24 17:19:01 +00:00
@ -0,0 +1,188 @@
package com.enderio.conduits.common;
Rover656 (Migrated from github.com) commented 2023-06-24 17:19:01 +00:00

Removing

Removing
Rover656 (Migrated from github.com) reviewed 2023-06-24 17:19:04 +00:00
@ -0,0 +1,523 @@
package com.enderio.conduits.common.blockentity;
Rover656 (Migrated from github.com) commented 2023-06-24 17:19:04 +00:00

Removing

Removing
Rover656 commented 2023-06-24 17:19:32 +00:00 (Migrated from github.com)

Going to merge this for now; TODOs left over can be addressed in future. Going to try for a swifter pace.

Going to merge this for now; TODOs left over can be addressed in future. Going to try for a swifter pace.
Rover656 commented 2023-06-24 17:23:51 +00:00 (Migrated from github.com)

Thanks a lot @agnor99 and @wahfl2 for your ace work on this!

Thanks a lot @agnor99 and @wahfl2 for your ace work on this!
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#127
No description provided.