10.02.2016, 07:52
(
Последний раз редактировалось dusk; 10.02.2016 в 12:02.
)
Just add this to your pom.xml dependency list
Add it as a plugin in resources.yml and place the .jar in shoebill/plugins
EDIT: I actually tested it and well it almost works. The only issue is that it fails if I use it in my gamemodes onEnable method with the following exception:
I tracked it down and this is the cause
So basically it can't find the CreateDynamicObject function(which I'm sure exists)... I printed out to be sure, this does return null. I created a 1sec timer in my onEnable with the same code - it worked, an object was created.
EDIT2: the NullPointer is solved by loading the streamer first. http://forum.sa-mp.com/showpost.php?...&postcount=705
Код:
<dependency> <groupId>net.gtaun.shoebill</groupId> <artifactId>streamer-wrapper</artifactId> <version>1.0-SNAPSHOT</version> </dependency>
EDIT: I actually tested it and well it almost works. The only issue is that it fails if I use it in my gamemodes onEnable method with the following exception:
Код:
2016-02-10 10:48:16,420 ERROR [err] - java.lang.NullPointerException 2016-02-10 10:48:16,420 ERROR [err] - at net.gtaun.shoebill.streamer.Functions.createDynamicObject(Functions.java:115) 2016-02-10 10:48:16,420 ERROR [err] - at net.gtaun.shoebill.streamer.Functions.createDynamicObject(Functions.java:110) 2016-02-10 10:48:16,421 ERROR [err] - at net.gtaun.shoebill.streamer.data.DynamicObject.create(DynamicObject.java:60) 2016-02-10 10:48:16,421 ERROR [err] - at net.gtaun.shoebill.streamer.data.DynamicObject.create(DynamicObject.java:56) 2016-02-10 10:48:16,421 ERROR [err] - at net.gtaun.shoebill.streamer.data.DynamicObject.create(DynamicObject.java:52) 2016-02-10 10:48:16,422 ERROR [err] - at lt.ltrp.LtrpGamemode.onEnable(LtrpGamemode.java:81) 2016-02-10 10:48:16,424 ERROR [err] - at net.gtaun.shoebill.resource.Resource.enable(Resource.java:91) 2016-02-10 10:48:16,424 ERROR [err] - at net.gtaun.shoebill.resource.ResourceManagerImpl.loadGamemode(ResourceManagerImpl.java:179) 2016-02-10 10:48:16,424 ERROR [err] - at net.gtaun.shoebill.resource.ResourceManagerImpl.loadAllResource(ResourceManagerImpl.java:62) 2016-02-10 10:48:16,425 ERROR [err] - at net.gtaun.shoebill.ShoebillImpl.loadPluginsAndGamemode(ShoebillImpl.java:289) 2016-02-10 10:48:16,426 ERROR [err] - at net.gtaun.shoebill.ShoebillImpl.access$100(ShoebillImpl.java:47) 2016-02-10 10:48:16,426 ERROR [err] - at net.gtaun.shoebill.ShoebillImpl$1.onAmxLoad(ShoebillImpl.java:233) 2016-02-10 10:48:16,428 ERROR [err] - at net.gtaun.shoebill.samp.SampCallbackManagerImpl$1.lambda$null$80(SampCallbackManagerImpl.java:60) 2016-02-10 10:48:16,428 ERROR [err] - at net.gtaun.shoebill.samp.SampCallbackManagerImpl$1$$Lambda$31/17272983.call(Unknown Source) 2016-02-10 10:48:16,428 ERROR [err] - at net.gtaun.shoebill.util.TryUtils.tryTo(TryUtils.java:21) 2016-02-10 10:48:16,431 ERROR [err] - at net.gtaun.shoebill.util.TryUtils.tryTo(TryUtils.java:14) 2016-02-10 10:48:16,432 ERROR [err] - at net.gtaun.shoebill.samp.SampCallbackManagerImpl$1.lambda$onAmxLoad$81(SampCallbackManagerImpl.java:60) 2016-02-10 10:48:16,432 ERROR [err] - at net.gtaun.shoebill.samp.SampCallbackManagerImpl$1$$Lambda$30/5764627.accept(Unknown Source) 2016-02-10 10:48:16,432 ERROR [err] - at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) 2016-02-10 10:48:16,433 ERROR [err] - at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) 2016-02-10 10:48:16,433 ERROR [err] - at java.util.concurrent.ConcurrentLinkedQueue$CLQSpliterator.forEachRemaining(ConcurrentLinkedQueue.java:851) 2016-02-10 10:48:16,433 ERROR [err] - at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512) 2016-02-10 10:48:16,435 ERROR [err] - at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) 2016-02-10 10:48:16,435 ERROR [err] - at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) 2016-02-10 10:48:16,435 ERROR [err] - at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) 2016-02-10 10:48:16,436 ERROR [err] - at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) 2016-02-10 10:48:16,436 ERROR [err] - at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) 2016-02-10 10:48:16,436 ERROR [err] - at net.gtaun.shoebill.samp.SampCallbackManagerImpl$1.onAmxLoad(SampCallbackManagerImpl.java:60)
Код:
hoebill.get().getAmxInstanceManager().getAmxInstances().iterator().next().getNative("CreateDynamicObject");
EDIT2: the NullPointer is solved by loading the streamer first. http://forum.sa-mp.com/showpost.php?...&postcount=705