Hi !
I'm trying to create a subclass with byteBuddy, and I want to override some methods with a native one.
I have tried this :
Class<?> dynamicType = new ByteBuddy()
.subclass(Block.class)
.name("fr.supersurviveur.rustcraftmod.DynamicBlock")
// .defineMethod("onUse", ActionResult.class, Modifier.PUBLIC)
// .withParameters(BlockState.class, World.class, BlockPos.class, PlayerEntity.class, Hand.class, BlockHitResult.class)
// .intercept(MethodDelegation.to(new Test()))
.defineMethod("onUse", ActionResult.class, Modifier.NATIVE | Modifier.PUBLIC)
.withoutCode()
.make()
.load(getClass().getClassLoader())
.getLoaded();
But i got this error : Caused by: java.lang.IllegalStateException: Cannot define abstract method 'onUse' for non-abstract class
Thank you !