Skip to content

CE Foam Sprayer#4931

Open
YoungOnionMC wants to merge 8 commits into
1.20.1from
yo/foam-sprayer
Open

CE Foam Sprayer#4931
YoungOnionMC wants to merge 8 commits into
1.20.1from
yo/foam-sprayer

Conversation

@YoungOnionMC

Copy link
Copy Markdown
Member

What

Ports the foam sprayer, allows the player to make colored foam with the spray can

Implementation Details

copied impl from CEu

AI Usage

  • [no ] No AI driven tools were used for this pull request.

Outcome

lot more building blocks

How Was This Tested

in game

… into yo/foam-sprayer

# Conflicts:
#	src/main/java/com/gregtechceu/gtceu/common/CommonEventListener.java
#	src/main/java/com/gregtechceu/gtceu/common/data/GTItems.java
#	src/main/java/com/gregtechceu/gtceu/common/data/models/GTModels.java
#	src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java
@YoungOnionMC YoungOnionMC requested a review from a team as a code owner June 15, 2026 07:04
@YoungOnionMC YoungOnionMC added type: feature New feature or request bundled for a 0.X.0 Update Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. labels Jun 15, 2026
@github-actions github-actions Bot added 1.20.1 Tests: Passed Game Tests have passed on this PR labels Jun 15, 2026
Comment thread src/main/resources/assets/gtceu/models/item/foam_sprayer.json Outdated
Comment thread src/main/resources/assets/gtceu/models/block/foam_reinforced_petrified.json Outdated
Comment thread src/main/resources/assets/gtceu/models/block/foam_reinforced.json Outdated
Comment thread src/main/resources/assets/gtceu/models/block/foam_petrified.json Outdated
Comment thread src/main/resources/assets/gtceu/models/block/foam.json Outdated
Comment thread src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java
Comment thread src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java Outdated
Comment thread src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java Outdated
Comment thread src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java Outdated
Comment thread src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java Outdated

@screret screret left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can't unresolve threads so you'll have to do that yourself, I guess.

Also, I would've kept the original "uncolored" foam blocks around used them if a spray can isn't held, akin to shulker boxes.

Also also, you do know that a blockstate being "replaceable" means a block can be placed to replace it like tall grass, right? Currently I don't see there being a way to just place foam on the ground.

Comment on lines +2044 to +2047
// .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop())
.model((ctx, provider) -> {
provider.handheld(ctx::getEntry);
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop())
.model((ctx, provider) -> {
provider.handheld(ctx::getEntry);
})
.model((ctx, provider) -> provider.handheld(ctx::getEntry))

Comment on lines +72 to +73
FluidStack fluidStack = fluidHandler.get().getFluidInTank(0);
if (fluidStack.getAmount() >= ConfigHolder.INSTANCE.tools.foamSprayerFluidUse) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the simulated drain comment isn't resolved but IDK where it's gone

@Override
public InteractionResult useOn(UseOnContext context) {
if (context.getPlayer() == null) return InteractionResult.FAIL;
ItemStack stack = context.getItemInHand();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this can be the offhand item if the main hand is empty.

fluidHandler.get().drain(ConfigHolder.INSTANCE.tools.foamSprayerFluidUse * framesFoamed,
IFluidHandler.FluidAction.EXECUTE);
}
return InteractionResult.SUCCESS;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
return InteractionResult.SUCCESS;
return InteractionResult.sidedSuccess(context.getLevel().isClientSide);

fluidHandler.get().drain(ConfigHolder.INSTANCE.tools.foamSprayerFluidUse * blocksFoamed,
IFluidHandler.FluidAction.EXECUTE);
}
return InteractionResult.SUCCESS;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
return InteractionResult.SUCCESS;
return InteractionResult.sidedSuccess(context.getLevel().isClientSide);

IFluidHandler.FluidAction.EXECUTE);
}
return InteractionResult.SUCCESS;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMO there should be an else branch that returns InteractionResult.FAIL here

public static final TagKey<Item> RUBBER_LOGS = TagUtil.createModItemTag("rubber_logs");

public static final TagKey<Block> CLEANROOM_DOORS = TagUtil.createModBlockTag("cleanroom_doors");
public static final TagKey<Block> REINFORCED_FOAM_MAKING_BLOCKS = TagUtil.createBlockTag("reinforced_frames");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
public static final TagKey<Block> REINFORCED_FOAM_MAKING_BLOCKS = TagUtil.createBlockTag("reinforced_frames");
public static final TagKey<Block> REINFORCED_FOAM_MAKING_BLOCKS = TagUtil.createBlockTag("reinforced_foam_making");

@Ghostipedia

Copy link
Copy Markdown
Member

I can't unresolve threads so you'll have to do that yourself, I guess.

Also, I would've kept the original "uncolored" foam blocks around used them if a spray can isn't held, akin to shulker boxes.

Also also, you do know that a blockstate being "replaceable" means a block can be placed to replace it like tall grass, right? Currently I don't see there being a way to just place foam on the ground.

Mentioned this to him as well, default right click action currently sprays a sphere of foam, realistically should be

  • No usage of Wooden/Steel frames causes you to place a single foam block from the sprayer as if you are building with blocks
  • usage of wood frames or steel frames respectively make the sprayer sprawl outwards more and fill all frames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20.1 Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. Tests: Passed Game Tests have passed on this PR type: feature New feature or request bundled for a 0.X.0 Update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants