-
-
Notifications
You must be signed in to change notification settings - Fork 415
Copper Golem + Copper Block Support #8244
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
base: dev/feature
Are you sure you want to change the base?
Copper Golem + Copper Block Support #8244
Conversation
…to dev/feature
…to dev/feature
…to dev/feature
…to dev/feature
src/main/java/ch/njol/skript/expressions/ExprCopperGolemOxidationTime.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprCopperGolemOxidationTime.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprCopperGolemOxidationTime.java
Outdated
Show resolved
Hide resolved
|
Forgot to write this in the last review, but this should all be in the skriptlang package. |
src/main/java/org/skriptlang/skript/bukkit/elements/effects/EffWax.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/elements/expressions/ExprCopperState.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/paperutil/CopperState.java
Outdated
Show resolved
Hide resolved
...ain/java/org/skriptlang/skript/bukkit/elements/expressions/ExprCopperGolemOxidationTime.java
Outdated
Show resolved
Hide resolved
...ain/java/org/skriptlang/skript/bukkit/elements/expressions/ExprCopperGolemOxidationTime.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/paperutil/CopperState.java
Outdated
Show resolved
Hide resolved
APickledWalrus
left a comment
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.
Overall this looks good. I have some suggestions about the organization/modularization.
src/main/java/org/skriptlang/skript/bukkit/elements/conditions/CondIsWaxed.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/elements/effects/EffWax.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/elements/effects/EffWax.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/elements/effects/EffWax.java
Outdated
Show resolved
Hide resolved
# Conflicts: # src/main/java/org/skriptlang/skript/bukkit/misc/expressions/ExprTextOf.java
APickledWalrus
left a comment
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.
Almost ready :)
| public void load(SkriptAddon addon) { | ||
| ExprCopperGolemOxidationTime.register(addon.syntaxRegistry()); | ||
|
|
||
| CopperGolemData.register(); |
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.
I would override the init method and register this there instead
| if (!(entity instanceof CopperGolem golem)) | ||
| continue; | ||
| long worldTime = golem.getWorld().getGameTime(); | ||
| golem.setOxidizing(Oxidizing.atTime(worldTime + ticks)); |
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.
Probably need to check for negative values from overflow here
|
|
||
| @Override | ||
| public Class<?> @Nullable [] acceptChange(ChangeMode mode) { | ||
| if (mode == ChangeMode.SET || mode == ChangeMode.RESET) |
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.
ADD/REMOVE? 🙂
Problem
No proper support for setting and getting attributes of copper golems and copper blocks.
Solution
Removes 'copper golem' from SimpleEntityData and adds CopperGolemData allowing users to specify the copper state of the copper golem and whether they're waxed.
Adds a condition to check if a copper golem or a copper block is waxed.
Adds an effect to wax or unwax a copper golem or a copper block.
Adds an expression to get/set the time until the next oxidation for a copper golem.
Adds an expression to get/set the pose of a copper golem statue.
Adds an expression to get/set the copper state of a copper golem or a copper block.
Adds 'CopperState' that mimics 'WeatheringCopperState' for the versions that don't have it. Allowing easy use for getting and setting the copper states.
Registers ClassInfo for copper golem statue poses
Registers ClassInfo for 'CopperState' or 'WeatheringCopperState' if it exists.
Adds 'ReflectUtils' that is a utility class for common reflection and caches where possible. Reflection was needed for 'CopperState', 'ExprCopperState', and 'ExprCopperGolemOxidationTime' which led to the creation of ReflectUtils.
Testing Completed
EntityData.sk
EffWax.sk
ExprCopperGolemOxidationTime.sk
ExprCopperGolemPose.sk
ExprCopperState.sk
EffSecSpawn.sk
Supporting Information
N/A
Completes: none
Related: none