Post a screenshot of the error and maybe some of the code related to it
|
Hi, I'm using Solace 1.1 right now, I've followed these snippets, & have added Woodcutting & Mining from here:
https://www.rune-server.ee/runescape...xes-tools.html
I'm stuck on one part however. This line: ObjectManager.registerObject(new GameObject(location, ore.getReplacementId(), objectId, ore.getRespawnTimer())); It wont compile with this.
So far I've figured out that 'registerObject' is 'submitPrivateObject' I believe.
Here is the download to the server if you'd like to take a look:
https://www.mediafire.com/file/0h4i3...e-e46.zip/file
Thank you! Any help is appreciated. =)
- Snow.
Post a screenshot of the error and maybe some of the code related to it
Seems like an outdated source so some issues could be with higher revision of compiler.
However what issue in the compiler do you have about 'ObjectManager.registerObject(new GameObject(location, ore.getReplacementId(), objectId, ore.getRespawnTimer()));' ?
Hi, thank you for the replies~! =)
I get this error:
Line 283 is what I gave before, but this is the full section:Code:Solace-e47\src\org\solace\game\content\skills\mining\Mining.java:282:43 java: constructor GameObject in class org.solace.game.entity.object.GameObject cannot be applied to given types; required: org.solace.game.map.Location,int,int,int,org.solace.game.entity.mobile.player.Player found: org.solace.game.map.Location,int,int,int reason: actual and formal argument lists differ in length
Nvm, I think I found out the issue, 'player' wasn't included.Code:/** * Creates a new object and handles player details when it comes to mining * * @Param player * The player mining * @Param location * the location of the ore * @Param ore * The ore the player is mining * @Param objectId * The id of the ore the player is mining */ private static void handleObjectReplacement(Player player, Location location, OreDefinitions ore, int objectId) { ObjectManager.submitPrivateObject(new GameObject(location, ore.getReplacementId(), objectId, ore.getRespawnTimer())); player.getSkills().addSkillExp(SkillHandler.MINING, ore.getExperience()); player.setAnimation(Animation.create(65535)); player.getPacketDispatcher().sendMessage("You managed to mine some " + ore.getOreName() + " ore."); player.getInventory().add(new Item(ore.getItemId(), 1)); }Thanks! =)Code:ObjectManager.submitPrivateObject(new GameObject(location, ore.getReplacementId(), objectId, ore.getRespawnTimer(), player));
- Snow
Per the error, you should just change
ObjectManager.submitPrivateObject(new GameObject(location, ore.getReplacementId(), objectId, ore.getRespawnTimer()));
to
ObjectManager.submitPrivateObject(new GameObject(location, ore.getReplacementId(), objectId, ore.getRespawnTimer(), player));
The constructor GameObject in class org.solace.game.entity.object.GameObject requires
org.solace.game.map.Location,int,int,int,org.solac e.game.entity.mobile.player.Player
but you gave it org.solace.game.map.Location,int,int,int
Thanks all! So it was the 'player' not being included. Good to know. Cheers!
Snow.
You should download an IDE like eclipse/intellij. They will give you "error" information and let you know that something is wrong.
In this case the IDE would of told you that you are missing a parameter and usually they have quick fix options which will auto fill to fix your issues.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |