Comments (1)
I believe this can be done by defining custom variables (such as private float customPitch = 0;
and private float customYaw = 0;
) and making the appropriate changes to the onEnable()
and doAfterRewarpRotation()
methods.
I could apply a PR, but I don't know if this will be maintained by the developers, however, I have written a draft for future guidance, and if it is approved, it can be maintained and inserted into the code.
onEnable()
@Override
public void onEnable() {
super.onEnable();
if (!FarmHelperConfig.customPitch && !isRestoredState()) {
customPitch = 50 + (float) (Math.random() * 6 - 3); // -3 - 3
setPitch(customPitch);
}
if (!FarmHelperConfig.customYaw && !isRestoredState()) {
customYaw = AngleUtils.getClosestDiagonal();
setYaw(customYaw);
setClosest90Deg(Optional.of(AngleUtils.getClosest(getYaw())));
}
// Existing code...
}
doAfterRewarpRotation()
@Override
public void doAfterRewarpRotation() {
if (!getRotation().isRotating()) {
setPitch(customPitch);
if (getCurrentState() == State.RIGHT) {
getRotation().easeTo(
new RotationConfiguration(
new Rotation((float) (getClosest90Deg().orElse(AngleUtils.getClosest()) + (ROTATION_DEGREE + (Math.random() * 2))), customPitch),
FarmHelperConfig.getRandomRotationTime(),
null
).easeOutBack(true)
);
} else if (getCurrentState() == State.LEFT) {
getRotation().easeTo(
new RotationConfiguration(
new Rotation((float) (getClosest90Deg().orElse(AngleUtils.getClosest()) - (ROTATION_DEGREE + (Math.random() * 2))), customPitch),
FarmHelperConfig.getRandomRotationTime(),
null
).easeOutBack(true)
);
}
// Add the following lines to update the customPitch and customYaw variables
customPitch = getPitch();
customYaw = getYaw();
}
}
The codes are just sketches and examples to make it easier to understand. Please forgive syntax or semantic errors.
from farmhelper.
Related Issues (20)
- Build error HOT 1
- Sometimes admin accelerate u when changing row and the mod cant check
- Performance regressions with scoreboard parsing HOT 1
- Manual rewarp triggers teleport failsafe HOT 1
- Too much pest notifications HOT 2
- "Farm manually" when stopping and restarting after server restart HOT 1
- Pingless cactus incompatible with SkyHanni BPS meter HOT 4
- Jump check HOT 1
- Interferes with SimpleToggleSprint
- Macro didn't stop on teleport check HOT 1
- Evacuation says "You are during staff check" HOT 1
- Can't unstuck with trapdoors
- Pest destroyer bugs out with sprayed plots.
- Visitor macro infinitely loops.
- Autobuy on pest repellant not working due to new skymart interface.
- listed as disallowed modification HOT 3
- Ban analytcs server connect error
- Mushroom macro rotating back issue HOT 1
- How to rotate this kind of wheat farm?
- features randomly toggle off
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from farmhelper.