Hey man, nice work. Can you provide me with some example code, or a setup procedure for Eclipse? I've got this..
package org.slowbro.mymod;
import Mod;
public class MyMod implements Mod {
void onMobDeath(Mob mob) {
//do stuff
}
}
But eclpise says it can't find the import.. and the implement is an unknown type. I "Added external jar..." of API.jar, what am I doing wrong? Pardon my extreme java noobiness.
Also, am I even formatting it right?
Thanks :3
EDIT: Aaaalright, after much dicking around, I got this to load and work:
public class StatsMod implements Mod {
public boolean onPlayerChat(Player player, java.lang.String message, boolean isAdmin) {
//do ****
System.out.println("test");
return false;
}
@Override
public void activate() {
// TODO Auto-generated method stub
}
@Override
public void deacivate() {
// TODO Auto-generated method stub
}
@Override
public void onIpBan(String arg0) {
// TODO Auto-generated method stub
}
@Override
public void onMobDeath(Mob arg0) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerBan(Player arg0, String arg1) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerChangeCurrentItem(Player arg0, int arg1) {
// TODO Auto-generated method stub
}
@Override
public boolean onPlayerCommand(Player arg0, String[] arg1, boolean arg2) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean onPlayerDestroyBlock(Player arg0, Block arg1) {
// TODO Auto-generated method stub
return false;
}
@Override
public void onPlayerDisconnect(Player arg0) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerDropItem(Player arg0, Miniblock arg1) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerHitBlock(Player arg0, Block arg1) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerIpBan(Player arg0, String arg1) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerKick(Player arg0, String arg1) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerLogin(Player arg0) {
// TODO Auto-generated method stub
}
@Override
public String onPlayerLoginCheck(String arg0) {
// TODO Auto-generated method stub
return null;
}
@Override
public void onPlayerMove(Player arg0) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerPickupItem(Player arg0, Miniblock arg1) {
// TODO Auto-generated method stub
}
@Override
public boolean onPlayerPlaceBlock(Player arg0, Block arg1) {
// TODO Auto-generated method stub
return false;
}
@Override
public void onPlayerRightClick(Player arg0, Location arg1) {
// TODO Auto-generated method stub
}
@Override
public void onServerCommand(String arg0) {
// TODO Auto-generated method stub
}
@Override
public void onTick() {
// TODO Auto-generated method stub
}
}
EDIT2:
Also, while I'm here, I can't get onPlayerDropItem to work reliably. It worked once.. and then stopped working altogether. Latest server.jar, API 0.9, not sure if it's a bug or me just derpin'.
Rollback Post to RevisionRollBack
Per-slot Minecraft Beta Server hosting at http://Minecraft-Servers.com starting at $11.34/mo! 6-32 slots!
help a small start-up business
Also, while I'm here, I can't get onPlayerDropItem to work reliably. It worked once.. and then stopped working altogether. Latest server.jar, API 0.9, not sure if it's a bug or me just derpin'.
It's probably a 0.9 problem. Tonight I will focus on fixing and stabilizing the API instead of adding more content.
I've been desperately wanting exactly this kind of thing for minecraft!
but:
There seems to be a bug in the part of the API that maintains World.players. It works fine for normal login/logout, but if players disconnect with an exception, they're left in the list. (Right now my server has two players online and 14 entries in World.players.) Examining my server log, I see a bunch of cases of:
These lines correspond one-to-one with the extra players in World.players, so that's very likely the problem. A halfway fix would remove duplicate players from World.players on login, so it'd fix itself after they logout normally.
I've been desperately wanting exactly this kind of thing for minecraft!
but:
There seems to be a bug in the part of the API that maintains World.players. It works fine for normal login/logout, but if players disconnect with an exception, they're left in the list. (Right now my server has two players online and 14 entries in World.players.) Examining my server log, I see a bunch of cases of:
These lines correspond one-to-one with the extra players in World.players, so that's very likely the problem. A halfway fix would remove duplicate players from World.players on login, so it'd fix itself after they logout normally.
For right now you can add a new mod while the server is open, but when you unload the file it is still connected to the jar and can't be replaced with an updated one until the server restarts. Hopefully I can figure out how to drop the filestream on unload so mod updates will not interrupt server usage.
Is there a way to retrieve the spawnpoint of players?
I can add a function to return the general spawn location of players. Luckily I already know how to. It just seemed unnecessary at that time because there wasnt much control over players before. This will also be included tonight.
"Added Human Mob with disabled AI (Mob.Mobs.HUMAN). I will allow people to make custom AI for him in V1."
I'm a bit interested in this. How could you give it an AI? And I see how you spawn it, it looks human because it falls back to the default model renderer which happens to be the human one. Would've thought spawning it would crash the game but I guess I was wrong.
Quote from oddsheogorath »
Quote from Clavus »
Which gave me another idea, is it possible to add callbacks on the terrain generator? Like when new areas are created and so on.
There is, but it's painfully annoying to read and understand notch's generation code.
Some guy already edited generation so you could edit where ores and such are located and how many are in a sliver.
I'm a bit interested in this. How could you give it an AI? And I see how you spawn it, it looks human because it falls back to the default model renderer which happens to be the human one. Would've thought spawning it would crash the game but I guess I was wrong.
There are two function that you can edit to control his movement and actions. I'll give you them when I get home.
Quote from hey0 »
Some guy already edited generation so you could edit where ores and such are located and how many are in a sliver.
I'm a bit interested in this. How could you give it an AI? And I see how you spawn it, it looks human because it falls back to the default model renderer which happens to be the human one. Would've thought spawning it would crash the game but I guess I was wrong.
There are two function that you can edit to control his movement and actions. I'll give you them when I get home.
Quote from hey0 »
Some guy already edited generation so you could edit where ores and such are located and how many are in a sliver.
Do you have a link? Or did he not release yet.
It was released a while ago on a different forum. It's outdated by a few weeks but it should be easy enough to update. http://www.megaupload.com/?d=KMV8VIVD
It was made by the same guy who made simple map iirc.
Maybe I just missed it but there is currently no way to write something to the server logs, is there?
If not I'd like to have one.
If there is, could anyone here please be so kind and tell me where?
Maybe I just missed it but there is currently no way to write something to the server logs, is there?
If not I'd like to have one.
If there is, could anyone here please be so kind and tell me where?
You could call a.info from the id class of a player, but just wait and I'll add a world function to do it.
Update 0.9_2 is out! All suggestions except the onWorldExpand() callback was added so far. Feel free to use the google moderator for suggestions and bugs.
Edit: I felt bad for not attempting it, so I added the onWorldExpand(). Later on I will give it the chunk array and location.
But eclpise says it can't find the import.. and the implement is an unknown type. I "Added external jar..." of API.jar, what am I doing wrong? Pardon my extreme java noobiness.
Also, am I even formatting it right?
Thanks :3
EDIT: Aaaalright, after much dicking around, I got this to load and work:
EDIT2:
Also, while I'm here, I can't get onPlayerDropItem to work reliably. It worked once.. and then stopped working altogether. Latest server.jar, API 0.9, not sure if it's a bug or me just derpin'.
help a small start-up business
Looking forward to using it for individualizing our server.
And again a new version since yesterday.
Good job and keep it going!
It's probably a 0.9 problem. Tonight I will focus on fixing and stabilizing the API instead of adding more content.
but:
There seems to be a bug in the part of the API that maintains World.players. It works fine for normal login/logout, but if players disconnect with an exception, they're left in the list. (Right now my server has two players online and 14 entries in World.players.) Examining my server log, I see a bunch of cases of:
These lines correspond one-to-one with the extra players in World.players, so that's very likely the problem. A halfway fix would remove duplicate players from World.players on login, so it'd fix itself after they logout normally.
Here's the tiny mod I was using at the time: http://pastebin.com/hU7izcaB
Incidentally, I'm using API version 0.8-2, so it might be fixed in 0.9 already. I'll upgrade later today and test again.
Btw, is there a way to dynamically reload the plugins with a command like in Hey0, or do we have to restart the server every time ?
MoveCraft !
Chunks Removal Tool
BackupArea plugin
It wont be fixed in 0.9 since I haven't touched the player system for a few updates. However I will fix this tonight.
/load <jarname.classname>
/unload <jarname.classname>
/reload <jarname.classname>
For right now you can add a new mod while the server is open, but when you unload the file it is still connected to the jar and can't be replaced with an updated one until the server restarts. Hopefully I can figure out how to drop the filestream on unload so mod updates will not interrupt server usage.
I can add a function to return the general spawn location of players. Luckily I already know how to. It just seemed unnecessary at that time because there wasnt much control over players before. This will also be included tonight.
There is, but it's painfully annoying to read and understand notch's generation code.
Kay :wink.gif:
I'm a bit interested in this. How could you give it an AI? And I see how you spawn it, it looks human because it falls back to the default model renderer which happens to be the human one. Would've thought spawning it would crash the game but I guess I was wrong.
Some guy already edited generation so you could edit where ores and such are located and how many are in a sliver.
There are two function that you can edit to control his movement and actions. I'll give you them when I get home.
Do you have a link? Or did he not release yet.
It was released a while ago on a different forum. It's outdated by a few weeks but it should be easy enough to update.
http://www.megaupload.com/?d=KMV8VIVD
It was made by the same guy who made simple map iirc.
If not I'd like to have one.
If there is, could anyone here please be so kind and tell me where?
You could call a.info from the id class of a player, but just wait and I'll add a world function to do it.
help a small start-up business
Just tested and it works fine for me. Either post or pm me the code you were using.
Edit: I felt bad for not attempting it, so I added the onWorldExpand(). Later on I will give it the chunk array and location.