[Plugin] Shoebill 1.1 - SA-MP Java Development Kit

yes i am, after removing command register, it worked, but without commands xD
Reply

Please show me, how you register the commands.
Reply

Tutorial for this?
Reply

Yes, you can try this tutorial here:
https://sampforum.blast.hk/showthread.php?tid=508509
Reply

Quote:
Originally Posted by 123marvin123
Посмотреть сообщение
Yes, you can try this tutorial here:
https://sampforum.blast.hk/showthread.php?tid=508509
Tutorial for netbeans?
Reply

Код:
private PlayerCommandManager commandManager;
Код:
		eventManager = rootEventManager.createChildNode();
		
		commandManager = new PlayerCommandManager(eventManager);		
		commandManager.installCommandHandler(HandlerPriority.NORMAL);
		commandManager.registerCommands(new PlayerCommands())
Reply

Quote:
Originally Posted by CoaPsyFactor
Посмотреть сообщение
Код:
private PlayerCommandManager commandManager;
Код:
		eventManager = rootEventManager.createChildNode();
		
		commandManager = new PlayerCommandManager(eventManager);		
		commandManager.installCommandHandler(HandlerPriority.NORMAL);
		commandManager.registerCommands(new PlayerCommands())
Show me the resouces.yml & shoebill.yml, please
Reply

resources.yml
Код:
repositories:
  - id: central
    url: http://repo1.maven.org/maven2/nl674231d0...3.49448761  - id: gtaun-public-repo
    url: http://repo.gtaun.net/content/groups/pub...3.49448761  - id: sonatype-oss-snapshots
    url: https://oss.sonatype.org/content/reposit...3.49448761# When to update cache?
# Options: always / daily / interval:[minutes]
cacheUpdatePolicy: always

# If Maven checks for Updates or use old artifacts
offlineMode: false

# Your needed runtimes
runtimes:
  - net.gtaun:shoebill-runtime:1.0-SNAPSHOT

# Additional plugins
#plugins:
 # - net.gtaun.mk:mk-plugin-manager:1.0-SNAPSHOT
#  - net.gtaun.shoebill:example-vehicle-manager-plugin:1.0-SNAPSHOT

# Your gamemode
gamemode: newdimension-0.0.1-SNAPSHOT
shoebill.yml
Код:
# Shoebill foldername
shoebillPath: shoebill

folder:
    bootstrap: bootstrap
    repository: repository
    libraries: libraries
    plugins: plugins
    gamemodes: gamemodes

# Let dependencymanager try to resolve needed dependencies
resolveDependencies: true

# Allows to override the artifact from maven repo with local file
allowArtifactOverrideIgnoreGroupId: true

# See: http://en.wikipedia.org/wiki/Windows_cod...erCodepage: 1252

# Custom maven path
#customRepositoryPath: ''
Reply

If you don't use maven in your project, you need to resolve all the dependencies yourself. So you have to add shoebill-common to the runtimes.

- net.gtaunhoebill-common:1.0-SNAPSHOT
Reply

I owe you one
Now, there is another problem not all events works, for example PlayerWeaponShotEvent never calls
Reply

Maybe you forgot to register the handler?
Reply

I'm currently not near PC where I coded, but I've registered event same as OnPlayerConnect, and die and etc, all works fine all but this one xD
Reply

Okay, make sure that you use the latest API. Maybe you can post the code you used later.
Reply

Код:
eventManager.registerHandler(PlayerWeaponShotEvent.class, (e) -> {
			Player pPlayer = e.getPlayer();
			pPlayer.sendMessage(Color.GREEN, "SHOT!!!");

			WeaponModel wModel = e.getWeapon();
			PlayerInventory playerInventory = Inventories.pInventory.get(pPlayer.getId());
			
			pPlayer.sendMessage(Color.GREEN, "SHOT!!!");
			pPlayer.sendMessage(Color.GREEN, "Before: %d", playerInventory.getWeapon(wModel).getAmmo());
			if (playerInventory.getWeapon(wModel).getAmmo() <= 0) {
				playerInventory.giveWeapon(pPlayer, wModel, 0);
				pPlayer.sendMessage(Color.GREEN, "Out of ammo.");
			} else {
				playerInventory.giveWeapon(pPlayer, wModel, playerInventory.getWeapon(wModel).getAmmo() - 1);
			}
			
			pPlayer.sendMessage(Color.GREEN, "After: %d", playerInventory.getWeapon(wModel).getAmmo());
		});
Reply

Looks good. Are you sure that you use the latest shoebill-api artifacts on your server?
Reply

Quote:
Originally Posted by CoaPsyFactor
Посмотреть сообщение
resources.yml
Код:
repositories:
  - id: central
    url: http://repo1.maven.org/maven2/nl674231d0...7.42317688  - id: gtaun-public-repo
    url: http://repo.gtaun.net/content/groups/pub...7.42317688  - id: sonatype-oss-snapshots
    url: https://oss.sonatype.org/content/reposit...7.42317688# When to update cache?
# Options: always / daily / interval:[minutes]
cacheUpdatePolicy: always

# If Maven checks for Updates or use old artifacts
offlineMode: false

# Your needed runtimes
runtimes:
  - net.gtaun:shoebill-runtime:1.0-SNAPSHOT

# Additional plugins
#plugins:
 # - net.gtaun.mk:mk-plugin-manager:1.0-SNAPSHOT
#  - net.gtaun.shoebill:example-vehicle-manager-plugin:1.0-SNAPSHOT

# Your gamemode
gamemode: newdimension-0.0.1-SNAPSHOT
shoebill.yml
Код:
# Shoebill foldername
shoebillPath: shoebill

folder:
    bootstrap: bootstrap
    repository: repository
    libraries: libraries
    plugins: plugins
    gamemodes: gamemodes

# Let dependencymanager try to resolve needed dependencies
resolveDependencies: true

# Allows to override the artifact from maven repo with local file
allowArtifactOverrideIgnoreGroupId: true

# See: http://en.wikipedia.org/wiki/Windows_cod...erCodepage: 1252

# Custom maven path
#customRepositoryPath: ''
Please change "runtimes" section to:

Код:
runtimes: 
  - net.gtaun:shoebill-runtime:1.0-SNAPSHOT
  - net.gtaun:shoebill-common:1.0-SNAPSHOT
I guess the reason is because your gamemode jar does not contain maven dependency info, so you need to manually add the dependency library(shoebill-common) to resources.yml .
Reply

Because all the dependencies were already resolved. Thats not a problem, or is your gamemode not working?
Reply

Ah, it wasn't working... But the problem was elsewhere and I finally found it. Also, I managed to setup a batch file to create a jar.


Where should I add the MySQL connector? Should it be in the libraries folder?
Reply

Another question here. Can I add my own methods to Player class? Well I extended the interface and kept the same name.

Let's say I add some get method... So when will it actually be defined?
Reply

You can create your own class, and implement player into it, and in that class add your methods
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)