CE Foam Sprayer#4931
Conversation
… 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
screret
left a comment
There was a problem hiding this comment.
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.
| // .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop()) | ||
| .model((ctx, provider) -> { | ||
| provider.handheld(ctx::getEntry); | ||
| }) |
There was a problem hiding this comment.
| // .setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop()) | |
| .model((ctx, provider) -> { | |
| provider.handheld(ctx::getEntry); | |
| }) | |
| .model((ctx, provider) -> provider.handheld(ctx::getEntry)) |
| FluidStack fluidStack = fluidHandler.get().getFluidInTank(0); | ||
| if (fluidStack.getAmount() >= ConfigHolder.INSTANCE.tools.foamSprayerFluidUse) { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
| return InteractionResult.SUCCESS; | |
| return InteractionResult.sidedSuccess(context.getLevel().isClientSide); |
| fluidHandler.get().drain(ConfigHolder.INSTANCE.tools.foamSprayerFluidUse * blocksFoamed, | ||
| IFluidHandler.FluidAction.EXECUTE); | ||
| } | ||
| return InteractionResult.SUCCESS; |
There was a problem hiding this comment.
| return InteractionResult.SUCCESS; | |
| return InteractionResult.sidedSuccess(context.getLevel().isClientSide); |
| IFluidHandler.FluidAction.EXECUTE); | ||
| } | ||
| return InteractionResult.SUCCESS; | ||
| } |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
| 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"); |
Mentioned this to him as well, default right click action currently sprays a sphere of foam, realistically should be
|
What
Ports the foam sprayer, allows the player to make colored foam with the spray can
Implementation Details
copied impl from CEu
AI Usage
Outcome
lot more building blocks
How Was This Tested
in game