Skip to content

Add creativeNoClipNoProjectileImpact - #286

Merged
Fallen-Breath merged 15 commits into
TISUnion:masterfrom
jcw780:creativeNoClipNoProjectileImpact
Sep 29, 2026
Merged

Fallen-Breath merged 15 commits into
TISUnion:masterfrom
jcw780:creativeNoClipNoProjectileImpact

Conversation

@jcw780

@jcw780 jcw780 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Add rule: CreativeNoClipNoProjectileImpact
Disables projectiles hitting creative noclipping players

Note:

  • This could be made to work in earlier versions but a lot of the logic is rearranged.
  • Missing Chinese translation if added

@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

@jcw780 is attempting to deploy a commit to the Fallen_Breath's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Fallen-Breath

Copy link
Copy Markdown
Contributor

imo the rule is not needed. Just make it always on. It's hacking carpet (a mod) to refine a feature that should have been there, not modifying vanilla Minecraft

Using @Override public boolean canBeHitByProjectile() is not that perfect for me. you can modify these 2 codes for better compatibility:

  1. caller of net.minecraft.world.entity.Entity#canBeHitByProjectile. there are not many callers
  2. net.minecraft.world.entity.Entity#canBeHitByProjectile itself. use instance of check

Also please use carpettisaddition.helpers.carpet.tweaks.rule.creativeNoClip.CreativeNoClipHelper#isNoClipPlayer, and make this feature support mc < 1.19

@jcw780

jcw780 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

imo the rule is not needed. Just make it always on. It's hacking carpet (a mod) to refine a feature that should have been there, not modifying vanilla Minecraft

I wanted to be able to toggle it in case someone for some reason used that old behavior

Using @Override public boolean canBeHitByProjectile() is not that perfect for me. you can modify these 2 codes for better compatibility:

  1. caller of net.minecraft.world.entity.Entity#canBeHitByProjectile. there are not many callers
  2. net.minecraft.world.entity.Entity#canBeHitByProjectile itself. use instance of check

Correct me if I'm wrong, but wouldn't those proposed fixes cause Lithium's projectile collisions optimizations to always fail?

@jcw780

jcw780 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Older versions should be supported now.
Checked versions: 1.15.2, 1.18.2, 1.19.4, 1.21.11 and 26.2

@Fallen-Breath

Copy link
Copy Markdown
Contributor

but wouldn't those proposed fixes cause Lithium's projectile collisions optimizations to always fail?

it won't. Actually your old implemetaion would cause Lithium's projectile collisions optimizations to always fail, since it overriden the canBeHitByProjectile method

@jcw780

jcw780 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor Author

but wouldn't those proposed fixes cause Lithium's projectile collisions optimizations to always fail?

it won't. Actually your old implemetaion would cause Lithium's projectile collisions optimizations to always fail, since it overriden the canBeHitByProjectile method

Changing callers of Entity::canBeHitByProjectile like Projectile::canHitEntity should cause projectiles to always fail to use the optimized search logic - they won't count as OPTIMIZED_PROJECTILES.

You would have to modify Entity::canBeHitByProjectile in a subclass like LivingEntity or Player otherwise that would make almost every entity fall under CAN_MAYBE_BE_HIT_BY_OPTIMIZED_PROJECTILE.

Unless I'm mistaking something, the override only applies to players - which won't be optimized by Lithium anyway i.e. always fall under CAN_MAYBE_BE_HIT_BY_OPTIMIZED_PROJECTILE.

@Fallen-Breath

Copy link
Copy Markdown
Contributor

Changing callers of Entity::canBeHitByProjectile like Projectile::canHitEntity should cause projectiles to always fail to use the optimized search logic - they won't count as OPTIMIZED_PROJECTILES

any source for this?

@jcw780

jcw780 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@Fallen-Breath

Copy link
Copy Markdown
Contributor

Changing callers of Entity::canBeHitByProjectile like Projectile::canHitEntity should cause projectiles to always fail to use the optimized search logic - they won't count as OPTIMIZED_PROJECTILES

any source for this?

https://github.com/CaffeineMC/lithium/blob/01597fb879b7a6d17c2420ec4e25a98df3bc8e7b/common/src/main/java/net/caffeinemc/mods/lithium/common/entity/projectile/ProjectileEntityClassGroups.java#L32

https://github.com/CaffeineMC/lithium/blob/develop/common/src/main/java/net/caffeinemc/mods/lithium/common/entity/projectile/ProjectileEntityClassGroups.java#L50

That's just a hasMethodOverride call on canHitEntity method. "Changing callers of Entity::canBeHitByProjectile like Projectile::canHitEntity" will not affect that. You don't need to override any canHitEntity methods. You just need to e.g. @ModifyExpressionValue on xxx.canHitEntity() calls

@jcw780

jcw780 commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Requested changes applied.

@Fallen-Breath

Copy link
Copy Markdown
Contributor

Requested changes also include "imo the rule is not needed. Just make it always on. It's hacking carpet (a mod) to refine a feature that should have been there, not modifying vanilla Minecraft"

@Fallen-Breath
Fallen-Breath force-pushed the creativeNoClipNoProjectileImpact branch from c47e610 to d456bc8 Compare September 26, 2026 08:13
@Fallen-Breath
Fallen-Breath merged commit 2fbdcd0 into TISUnion:master Sep 29, 2026
1 of 3 checks passed
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.

2 participants