Better Cushion Placement 图标

Better Cushion Placement

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 1.3.0
本资源为搬运资源,原资源地址: https://modrinth.com/mod/better-cushion-placement
资源信息

Minecraft 版本: 26.3-snapshot-4 26.3-snapshot-5 26.3-snapshot-6

平台: fabric

标签: decoration game-mechanics

资源介绍

Visual Summary

Cushion Placement







Placement Mechanics

Block GridVertical Pixel Grid Snap: On

Holding Shift

  • Place a cushion horizontally centered on the closest vertex of the block grid.
  • Stack a held cushion on one in the world by interacting with it (if it will have block support).


Pixel Grid

Holding Control

  • Place a cushion horizontally centered on the closest vertex of the pixel grid.


Off-Grid

Holding Shift + Control

  • Place a cushion horizontally centered exactly where clicked, completely off-grid.


Block Center

Holding neither (Vanilla behavior)

  • Place a cushion horizontally centered on the closest block grid tile center.



Placement Preview

Cushion Placement Preview

A box renders where a cushion will place with the color it will have when placed.



Block Tags

  • ID
    • #normal_cushion_placement
  • Description
    • Forces the normal center-of-block placement of cushions when placing them against blocks with this tag.
  • Default
    • Contains blocks with the #signs block tag.



Configs

Folder: config/bettercushionplacement/

Config Screen

  • Yet Another Config Lib config screen is accessible through Mod Menu for changing configs in-game.
    • Only when Mod Menu and Yet Another Config Lib are both installed.
    • Localized mod name, description, and summary can still be viewed if only Mod Menu is installed.
Config GUI

Client Config bcp-client.conf

Placement Preview: Configures how to render a placement preview box for cushions

  • Enabled
    • Whether to render a placement preview box for cushions.
  • Line Width Override
    • If positive, the lines of the box will render with this.
      • If negative, they will render with the default size.
      • If zero, rendering will be skipped.
  • Opacity
    • The box will render with this alpha value.
      • If zero, rendering will be skipped.
  • Color
    • The color the box will render as. The color will be:
      • CUSHION_COLOR: The dye color the cushion will be when placed.
      • DYE_COLOR_OVERRIDE: The dye color specified by the Dye Color Override confg.
      • In both cases, the variant of the dye color will be specified by the 'Dye Color Variant' config.
      • COLOR_OVERRIDE: The color specified by the Color Override confg.
  • Dye Color Override
    • If the Color config is set to DYE_COLOR_OVERRIDE, the box will render as this dye color.
      • Otherwise, this will be ignored.
  • Color Override
    • If the Color config is set to COLOR_OVERRIDE, the box will render as this color.
      • Otherwise, this will be ignored.
  • Dye Color Variant
    • If the Color config is set to COLOR_OVERRIDE, the box will render as this color.
      • Otherwise, this will be ignored.

Common Config bcp-common.conf

Game rule features (Cushions Support Each Other and Snap Cushion Elevation To Pixel Grid, see below) can be set to always enabled or always disabled in the bettercushionplacement-gamerules.properties file in the config folder.

  • If set to always enabled/disabled the corresponding rule will not exist, but the feature will.
  • If set to always disabled, the corresponding mixin that provides the feature will not be applied.
    • This means that even the negligible performance cost of the method call the mixin results in will be prevented.



Game Rules

Stack cushions directly on one another without block support

  • ID
    • bettercushionplacement:cushions_support_each_other
  • Name
    • Cushions Support Each Other
  • Description
    • Instead of only being supported by blocks, cushions can also be supported by other cushions, allowing direct stacking.
  • Default
    • Disabled

Background Explanation

Vanilla cushion support is as follows Cushion_wouldSuriveAt:

  • L156-158 Make an anchor box by taking the bounding box a cushion is or might be, and slightly horizontally shrinking it and vertically expanding it down by 1/4 pixel.
  • 159 Iterate the blocks intersecting that area additionally expanded down by another 4 pixels.
    • 160 For each block, get its general shape.
    • 161 Consider it supported if that shape is not empty and if it intersects the anchor box.

If no block support is found, this game rule additionally checks for other cushion entities below it, and considers it supported if one is found.


Flush placement w/o datapack Close to flush via a sign
Cushion Flush With Block Cushion Almost Flush With Block

Bypass block tags for inner wall sub-pixel placement with a game rule

  • ID
    • bettercushionplacement:allow_inner_wall_cushion_placement
  • Name
    • Allow Inner Wall Cushion Placement
  • Description
    • Ignores #cushion_uses_collision_shape block tags, thus allowing sub-pixel cushion placement on the inner walls of cauldrons, composters, and hoppers without a data pack.
  • Default
    • Disabled

Background Explanation

Vanilla block interaction behavior is as follows BlockGetter_clipWithInteractionOverride:

  • L87 Raytrace a block's main shape.
  • L88 Check for hit.
    • L89 If hit, raytrace the block's interaction shape.
    • L90 Check for hit, and check if it's closer to the eyes than the main shape hit.
      • L91 If the interaction shape hit is closer than main shape hit, substitute the direction of the hit result with the new direction.

Blocks by default have no interaction shape BlockBehaviour_getInteractionShape, with the following exceptions:

Whether returning a full block shape or just the inner void shape, all of these blocks have interactions shapes with solid flat tops flush with the top of the block space.

Composter interaction shape Hopper interaction shape
Composter Interaction Shape Hopper Interaction Shape

The only way to get a raytrace hit on the inner walls of the shapes of these blocks is to get an even closer hit on the top face of their interaction shapes. This means that any inner hit will have the expected inner location vector, but with a direction of Direction.UP. So although cushions require interacting with an upward face CushionItem_useOn#L38, these blocks uniquely bypass this requirement.

While sub-pixel placement is still possible (on signs WallSignBlock_SHAPES, for example), placement on horizontal faces and arbitrary Y positioning was not intended. This is why Mojang added the #cushion_uses_collision_shape block tag, which forces the use of the collision shape raytrace result CushionItem_recalculateContextForSpecialCollisionShapes#L81-88.

Wall collision placement Soul Sand collision placement
Wall Collision Placement Soul Sand Collision Placement

Note that raytrace is from the eyes L84 to the slightly past the exiting hit result vector L85-86, and that hit failure defaults to the original hit result L88. This means that when a collision shape hit is closer to the eyes than the main shape hit, as with wall blocks WallBlock_collisionShapes, the collision shape will be used. But when the main shape hit is closer, as with soul sand blocks SoulSandBlock_SHAPE, the main shape will be used in spite of having the tag.



Server-only Installation

If this mod is installed on a server, but not a client, everything will work as intended, with the following purely visual exceptions:

  1. The player's hand will swing
    • Even when cushion placement fails due to intersection with an existing cushion.
  2. The player's hand will not swing
    • When placing a cushion on the inner wall of a cauldron, composter, or hopper.
    • When stacking a cushion on another cushion.
下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
Naturalist X Alex's Mobs Compat (Deni's Edition)

价格:0 墨喵币
下载量:0

查看详情
Vegan Names

价格:0 墨喵币
下载量:0

查看详情
Chance's Scorched Weapons

价格:0 墨喵币
下载量:0

查看详情
Doggy Talents Next X New Wolves

价格:0 墨喵币
下载量:0

查看详情