Skip to content

Improve itemframes #7749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: dev/feature
Choose a base branch
from

Conversation

TheLimeGlass
Copy link
Contributor

Description

Improves Item Frames as Snow always wanted.

Sets the entity data pattern to

item[ ]frame(|1¦s) [(with|of) %-itemtype%] [[with rotation|rotated] %-rotation%]

for more proper support of ItemFrames while also registering ItemFrames as a classinfo for dedicated syntaxes.
Adds org.bukkit.Rotation and a utility effect for easily rotating an expression that returns a rotation and/or itemframes and rotation's self.

Examples:

# Spawning
spawn an item frame with lime stained glass rotated 225 degrees at target block
spawn an item frame of stone rotated 90 degrees in the direction of player from target block:
    rotate event-item frame by 90 degrees
    set item of event-item frame to lime stained glass named "example"

# EffRotate
rotate the event-item frame clockwise 2 times
rotate the event-item frame by 225 degrees

Target Minecraft Versions: any
Requirements: none
Related Issues: #414 (non-closing) and #2874

@TheLimeGlass TheLimeGlass requested a review from a team as a code owner March 26, 2025 00:12
@TheLimeGlass TheLimeGlass requested review from sovdeeth and Romitou and removed request for a team March 26, 2025 00:12
@TheLimeGlass TheLimeGlass changed the title Feature/itemframes Improve itemframes Mar 26, 2025
Copy link
Contributor

@Absolutionism Absolutionism left a comment

Choose a reason for hiding this comment

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

What do we think about making an expression to grab the rotation of an itemframe?
Also, not sure if possible, but combined with that expression, make a test structure within EffSecSpawn.sk spawning item frames with a rotation and ensuring the rotation is correct.

Comment on lines +87 to +91
if (!(entityData instanceof ItemFrameData))
return false;
ItemFrameData itemFrameData = (ItemFrameData) entityData;
if (type != null)
return itemFrameData.type != null && type.equals(itemFrameData.type) && rotation == itemFrameData.rotation;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (!(entityData instanceof ItemFrameData))
return false;
ItemFrameData itemFrameData = (ItemFrameData) entityData;
if (type != null)
return itemFrameData.type != null && type.equals(itemFrameData.type) && rotation == itemFrameData.rotation;
if (!(entityData instanceof ItemFrameData other))
return false;
if (type != null)
return other.type != null && type.equals(other.type) && rotation == other.rotation;

Comment on lines +125 to +131
String string;
if (itemFrames != null) {
string = "rotate " + itemFrames.toString(event, debug) + " " + rotations.toString(event, debug);
} else {
string = "rotate " + rotations.toString(event, debug) + (counter ? " counter " : "") + " clockwise";
}
return string + " " + amount + " time" + (amount <= 1 ? "" : "s");
Copy link
Contributor

Choose a reason for hiding this comment

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

SSB?

Copy link
Contributor

@Fusezion Fusezion left a comment

Choose a reason for hiding this comment

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

T-te-test!

@sovdeeth
Copy link
Member

sovdeeth commented Mar 26, 2025

I'm concerned that this rotate effect will add a lot of ambiguity to the existing rotate effect for displays, vectors, and quaternions. I'd like to see the two integrated if possible. I'm also concerned about adding the Rotation class, as I think it will cause confusion with the existing ExprAngle expression.

Can we not treat item frames as any other rotatable object and just snap their alignment to 45 degree angles if the rotation would result in something like 60 degrees?

Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
@sovdeeth sovdeeth added the feature Pull request adding a new feature. label Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull request adding a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants