13.02.2016, 13:48
I had a suspicion that there's an issue with returning floats(specifically from MapAndreas), but while testing I encountered another issue.
Pawn function:
Java code
Output
Pawn function:
pawn Код:
forward GetFloatVal(Float:x, Float:y, &Float:z);
public GetFloatVal(Float:x, Float:y, &Float:z)
{
z = x * y;
}
Код:
eventManager.registerHandler(AmxLoadEvent.class, e -> { AmxCallable func = e.getAmxInstance().getPublic("GetFloatVal"); if(func != null) { System.out.println("Function found in handler " + e.getAmxInstance().getHandle() + " callbable name:" + func.getName() + " callable return type:" + func.getReturnType()); float z = 0f; ReferenceFloat refZ = new ReferenceFloat(z); func.call(2395.3972f, -1548.5687f, refZ); z = refZ.getValue(); System.out.println("Z:" + z); } else { System.out.println("Function not found in handle " + e.getAmxInstance().getHandle()); } });
Код:
[2016-02-13 16:48:02][INFO][out] Function not found in handle 903863776 [2016-02-13 16:48:02][INFO][out] Function found in handler 903939152 callbable name:GetFloatVal callable return type:INTEGER [2016-02-13 16:48:02][ERROR][err] java.lang.NoSuchMethodError: net.gtaun.shoebill.SampNativeFunction.callPublic(III[Ljava/lang/Object;)Ljava/lang/Object; [2016-02-13 16:48:02][ERROR][err] at net.gtaun.shoebill.amx.AmxCallableImpl.call(AmxCallableImpl.java:48) [2016-02-13 16:48:02][ERROR][err] at lt.maze.MyGamemode.lambda$onEnable$0(MyGamemode.java:28) [2016-02-13 16:48:02][ERROR][err] at lt.maze.MyGamemode$$Lambda$33/17775924.handleEvent(Unknown Source) [2016-02-13 16:48:02][ERROR][err] at net.gtaun.util.event.EventManagerRoot.dispatchEvent(EventManagerRoot.java:189) [2016-02-13 16:48:02][ERROR][err] at net.gtaun.util.event.EventManager.dispatchEvent(EventManager.java:129) [2016-02-13 16:48:02][ERROR][err] at net.gtaun.shoebill.amx.AmxInstanceManagerImpl.onAmxLoad(AmxInstanceManagerImpl.java:34) [2016-02-13 16:48:02][ERROR][err] at net.gtaun.shoebill.ShoebillImpl$1.onAmxLoad(ShoebillImpl.java:230) [2016-02-13 16:48:02][ERROR][err] at net.gtaun.shoebill.samp.SampCallbackManagerImpl$1.lambda$null$80(SampCallbackManagerImpl.java:60) [2016-02-13 16:48:02][ERROR][err] at net.gtaun.shoebill.samp.SampCallbackManagerImpl$1$$Lambda$31/27184720.call(Unknown Source) [2016-02-13 16:48:02][ERROR][err] at net.gtaun.shoebill.util.TryUtils.tryTo(TryUtils.java:21) [2016-02-13 16:48:02][ERROR][err] at net.gtaun.shoebill.util.TryUtils.tryTo(TryUtils.java:14) [2016-02-13 16:48:02][ERROR][err] at net.gtaun.shoebill.samp.SampCallbackManagerImpl$1.lambda$onAmxLoad$81(SampCallbackManagerImpl.java:60) [2016-02-13 16:48:02][ERROR][err] at net.gtaun.shoebill.samp.SampCallbackManagerImpl$1$$Lambda$30/31100424.accept(Unknown Source) [2016-02-13 16:48:02][ERROR][err] at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) [2016-02-13 16:48:02][ERROR][err] at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) [2016-02-13 16:48:02][ERROR][err] at java.util.concurrent.ConcurrentLinkedQueue$CLQSpliterator.forEachRemaining(ConcurrentLinkedQueue.java:851) [2016-02-13 16:48:02][ERROR][err] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512) [2016-02-13 16:48:02][ERROR][err] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) [2016-02-13 16:48:02][ERROR][err] at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) [2016-02-13 16:48:02][ERROR][err] at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) [2016-02-13 16:48:02][ERROR][err] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [2016-02-13 16:48:02][ERROR][err] at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) [2016-02-13 16:48:02][ERROR][err] at net.gtaun.shoebill.samp.SampCallbackManagerImpl$1.onAmxLoad(SampCallbackManagerImpl.java:60) [2016-02-13 16:48:02][INFO][out] Z:0.0