Skip to content

Port Ender Collector#50

Draft
Spicierspace153 wants to merge 6 commits intoGTNewHorizons:masterfrom
Spicierspace153:kat/collect-dn
Draft

Port Ender Collector#50
Spicierspace153 wants to merge 6 commits intoGTNewHorizons:masterfrom
Spicierspace153:kat/collect-dn

Conversation

@Spicierspace153
Copy link
Collaborator

should work exactly like the EU2 One, just needs textures and tooltips 👍

# Conflicts:
#	src/main/java/com/fouristhenumber/utilitiesinexcess/ClientProxy.java
#	src/main/java/com/fouristhenumber/utilitiesinexcess/ModBlocks.java
#	src/main/java/com/fouristhenumber/utilitiesinexcess/UtilitiesInExcess.java
#	src/main/java/com/fouristhenumber/utilitiesinexcess/config/blocks/BlockConfig.java
@Spicierspace153
Copy link
Collaborator Author

image

image some images

image

Copy link
Member

@chrombread chrombread left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple things

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: i think this name can be more specific. it doesn't just draw a line. it draws the box and lines(plural)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah agreed, it was originally just going to draw the line but it evolved and the name never changed 🙃

import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;

import com.fouristhenumber.utilitiesinexcess.common.blocks.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no star imports (change ur intellij settings?)

import com.fouristhenumber.utilitiesinexcess.common.renderers.BlackoutCurtainsRenderer;
import com.fouristhenumber.utilitiesinexcess.common.renderers.LapisAetheriusRenderer;
import com.fouristhenumber.utilitiesinexcess.common.renderers.SpikeRenderer;
import com.fouristhenumber.utilitiesinexcess.common.tileentities.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here

}
TileEntityCollector collector = (TileEntityCollector) tile;

collector.incrementSize();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe incrementing size initially just displays the border and then sequential activation of the TE grow the border (given the display is active)

also a little bit of a feature req in shift-click decrementing the size, if its not a pain

@chrombread
Copy link
Member

apart from tooltips and what not, this is more or less good

}

@Override
public void updateEntity() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method could be divided.

@Override
public void updateEntity() {
    AxisAlignedBB area = getRadiusAABB();

    if (worldObj.isRemote) {
        updateClientEffects(area);
        return;
    }

    updateServerItemInsertion(area);
}

private void updateClientEffects(AxisAlignedBB area) {
    if (borderTimer > 0 && --borderTimer <= 0) {
        showBorder = false;
    }

    itemPositions.clear();

    for (EntityItem item :
        worldObj.getEntitiesWithinAABB(EntityItem.class, area)) {

        if (item.isDead || !item.onGround) {
            continue;
        }

        itemPositions.add(
            Vec3.createVectorHelper(
                item.posX,
                item.posY + 0.25,
                item.posZ
            )
        );
    }
}

private void updateServerItemInsertion(AxisAlignedBB area) {
    TileEntity te = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
    if (!(te instanceof IInventory chest)) {
        return;
    }

    ItemSink sink = ItemUtil.getItemSink(chest, ForgeDirection.UP);
    if (sink == null) {
        return;
    }

    for (EntityItem item :
        worldObj.getEntitiesWithinAABB(EntityItem.class, area)) {

        if (item.isDead || !item.onGround || item.delayBeforeCanPickup > 0) {
            continue;
        }

        ItemStack stack = item.getEntityItem();
        if (stack == null) {
            continue;
        }

        int leftover = sink.store(new InsertionItemStack(stack));

        if (leftover <= 0) {
            item.setDead();
        } else {
            stack.stackSize = leftover;
        }
    }
}

@FourIsTheNumber FourIsTheNumber marked this pull request as draft February 15, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments