trajectory-preview's People
trajectory-preview's Issues
5v does not work
Forge
1.19.4
mod v5.0.1
It just doesn't work, no errors, no crashes, just the trajectory is not displayed anywhere
Plugin does not register
Hey, I tried to create a plugin but it does not register
I also cannot find the log message Loaded and prepared {} plugin(s)
(debug or latest) even though the Main plugin is loaded / working
The log I added is also not appearing
Am I missing something?
@TrajectoryPlugin
public class TrialErrorPlugin implements PreviewProvider {
public TrialErrorPlugin() {}
@Override
public Class<? extends PreviewEntity<? extends Entity>> getPreviewEntityFor(final Player player, final Item shootable) {
Main.LOG.info("Called `getPreviewEntityFor` with: " + shootable.getDescriptionId() + " " + shootable.getClass());
if (shootable instanceof SpearItem) {
return CactemSpearPreview.class;
}
return null;
}
}
public class CactemSpearPreview extends BowArrowPreview implements PreviewEntity<AbstractArrow> {
public CactemSpearPreview(final Level level) {
super(level);
}
@Override
public List<AbstractArrow> initializeEntities(final Player player, final ItemStack associatedItem) {
if (associatedItem.getItem() instanceof SpearItem) {
int timeLeft = player.getUseItemRemainingTicks();
if (timeLeft > 0) {
int maxDuration = player.getMainHandItem().getUseDuration();
int difference = maxDuration - timeLeft;
if (difference >= 10) {
ThrownCactemSpearEntity cactemSpear = new ThrownCactemSpearEntity(level, player, associatedItem);
cactemSpear.shootFromRotation(player, player.getXRot(), player.getYRot(), 0.0F, 2.5F, 0);
return Collections.singletonList(cactemSpear);
}
}
}
return null;
}
@Override
public void simulateShot(final AbstractArrow simulatedEntity) {
super.simulateShot(simulatedEntity);
}
}
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.