SA-MP Forums Archive
[Plugin] Shoebill 1.1 - SA-MP Java Development Kit - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Plugin] Shoebill 1.1 - SA-MP Java Development Kit (/showthread.php?tid=397735)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - CoaPsyFactor - 14.08.2014

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


AW: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - 123marvin123 - 14.08.2014

Please show me, how you register the commands.


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - JacobEdwards - 14.08.2014

Tutorial for this?


AW: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - 123marvin123 - 14.08.2014

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


Re: AW: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - JacobEdwards - 15.08.2014

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


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - CoaPsyFactor - 15.08.2014

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



Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 15.08.2014

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


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - CoaPsyFactor - 16.08.2014

resources.yml
Код:
repositories:
  - id: central
    url: http://repo1.maven.org/maven2/

  - id: gtaun-public-repo
    url: http://repo.gtaun.net/content/groups/public

  - id: sonatype-oss-snapshots
    url: https://oss.sonatype.org/content/repositories/snapshots/

# 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_code_pages#List
serverCodepage: 1252

# Custom maven path
#customRepositoryPath: ''



AW: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - 123marvin123 - 16.08.2014

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


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - CoaPsyFactor - 16.08.2014

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


AW: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - 123marvin123 - 16.08.2014

Maybe you forgot to register the handler?


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - CoaPsyFactor - 16.08.2014

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


AW: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - 123marvin123 - 16.08.2014

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


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - CoaPsyFactor - 16.08.2014

Код:
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());
		});



AW: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - 123marvin123 - 16.08.2014

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


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 17.08.2014

Quote:
Originally Posted by CoaPsyFactor
Посмотреть сообщение
resources.yml
Код:
repositories:
  - id: central
    url: http://repo1.maven.org/maven2/

  - id: gtaun-public-repo
    url: http://repo.gtaun.net/content/groups/public

  - id: sonatype-oss-snapshots
    url: https://oss.sonatype.org/content/repositories/snapshots/

# 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_code_pages#List
serverCodepage: 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 .


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - 123marvin123 - 23.08.2014

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


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - dusk - 23.08.2014

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?


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - dusk - 24.08.2014

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?


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - CoaPsyFactor - 24.08.2014

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