-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
MaterialTag.half,faces,distance Property Modernization #2660
base: dev
Are you sure you want to change the base?
Conversation
public static MaterialDistance getFrom(MaterialTag _material) { | ||
if (!describes(_material)) { | ||
return null; | ||
} | ||
else { | ||
return new MaterialDistance(_material); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's shouldn't be any need to keep getFrom
- if anything is using this property directly, can use describes
& add a constructor that directs to super
.
In general should ideally remove the older methods when updating a property, any is/getX
methods can just be instanceof
pattern matching, any get/setDistance
sorta methods can usually just be put directly in get/setPropertyValue
, etc..
It's not an absolute requirement, but it'd be nicer to have the properties fully match the modern format.
return new MaterialDistance((MaterialTag) _material); | ||
} | ||
} | ||
MaterialTag material; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove the old field and use the built-in object
field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And with that, should use the MaterialProperty
methods (e.g. getBlockData()
instead of material.getModernData()
)
// For "Bisected" blocks (doors/double plants/...), values are either "BOTTOM" or "TOP". | ||
// For beds, values are either "HEAD" or "FOOT". | ||
// For chests, values are either "LEFT" or "RIGHT". | ||
// For the half name, see <@link tag MaterialTag.half>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that just linking to itself? should already automatically be in the mechanism's tag link
MaterialTag.half
property.MaterialTag.faces
property.MaterialTag.distance
property.