Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

* Notifications

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - JD9999

Pages: [1] 2 3 ... 51
Plugin Development / Re: How does onPlayerDeath work?
« on: October 04, 2017, 03:30:31 PM »
plrVictim is always the player who died. But I think the onPlayerDeath event is slightly broken, it's not being called when death messages are disabled. I'll fix that when I get around. Should be called on kill command though.

OK, thanks! I will look into the plugin and see if it is a problem at my end.

Plugin Development / How does onPlayerDeath work?
« on: October 03, 2017, 07:58:47 PM »
Hi everybody,

I was testing RainbowDeathChest and I have noticed something interesting.

For some reason, when I use the /kill command, the items of the player victim are NOT stored in the chests, but when a player kills another player, the items are stored.

Is the plrVictim argument always the player when they die?


Plugin Development / Re: Is it possible to serialize a block...
« on: September 15, 2017, 06:27:48 AM »
Serialisation at the moment only applies to entities. Sorry, but no.

Sorry, I don't think so.

You can use MC_CommandSenderInfo.lastCommand to return the command currently in the command block.

Theoretically, you could call this after the onAttemptPlaceOrInteract method, by checking if it is a command block, and then calling MC_Server.getExecutingCommandInfo() to obtain an MC_CommandSenderInfo object.

Sorry, there isn't a mostLikelyValue function. I meant to call my private method mostLikelyValue but instead called it mostLikelyInt. I've changed it now.

To fix your issue, you could load the locations of all weighted plates into memory on startup. For example:

NOTE: This also hasn't been tested, and may not work as expected
Code: [Select]
private List<MC_Location> locations = new ArrayList<>(); //Can be protected or public if required.

public void onServerFullyLoaded(){
    MC_Server server = RainbowUtils.getServer();
    server.broadcastMessage("Enabling Subway plugin. Please wait...");
    MC_World overworld = server.getWorld(0); //If this is for other worlds, you can use MC_Server.getWorlds()
    for(MC_Chunk chk : overworld.getAllLoadedChunks()){
        int lowX = chk.getCX << 4; //I don't know what this does, but it works
        int lowZ = chk.getCZ << 4;
        for(int incrementX = 0; incrementX < 16; incrementX++){
            for(int incrementZ = 0; incrementZ < 16; incrementZ++){
                for(int y = 0; y <= server.getMaxBuildHeight(); y++){
                    int x = lowX + incrementX;
                    int z = lowZ + incrementZ;
                    MC_Location loc = new MC_Location(x, y, z, 0);
                    MC_Block possBlock = overworld.getBlockAt(loc);
                    if(possBlock.getID() == MC_BlockType.HEAVY_WEIGHTED_PRESSURE_PLATE) location.add(loc);
    server.broadcastMessage("Subway plugin enabled!");

public void onAttemptPlayerMove(MC_Player plr, MC_Location locFrom, MC_Location locTo, MC_EventInfo ei){
    for(MC_Location loc : locations){
        if(loc.isSameBlockLocationAs(locTo) plr.sendMessage("<Subway> You stepped on a pressure plate.");

The first one should mostly work. I don't think you need the -1 for the y as the pressure plate counts as being in the same block the player's foot is on, but I could be wrong.

I would also be careful with converting it to an int. If a player has an x value of 59.993 and is partly standing on the pressure plate, the plugin will think it is not (as converting a double to an int will always truncate its decimal).

I'm not sure what exactly the value is when this happens, and whether you will have to do direction-related stuff, but I'm thinking something like below:

NOTE: This has not been tested as is suspect to screwing things up
Code: [Select]
public void onAttemptPlayerMove(MC_Player plr, MC_Location locFrom, MC_Location locTo, MC_EventInfo ei) {
int plrD = locTo.dimension;
double x = locTo.x;
int plrX = mostLikelyValue(x, plr);
double y = locTo.y;
int plrY = mostLikelyValue(y, plr);
double z = locTo.z;
int plrZ = mostLikelyValue(z, plr);
if (myServer.getWorld(plrD).getBlockAt(plrX, plrY, plrZ).getId() == MC_BlockType.HEAVY_WEIGHTED_PRESSURE_PLATE) {
    plr.sendMessage("<Subway> You stepped on a pressure plate. ");

private int mostLikelyValue(double value, MC_Player plr){
    if(plr.getDirection() == MC_DirectionNESWUD.NORTH || plr.getDirection() == MC_DirectionNESWUD.SOUTH){
        int mostLikely = (value - (double)(int)value) > 0.8 ? (int)Math.round(value) : (int)value;
        return mostLikely;
    }else return (int)value;

I doubt the second one will work as there is no entity for a weighted pressure plate (or a pressure plate at all!)

It might be useful for you to look at my Transporter plugin and see what I've done there.

Plugin Releases / Re: Ven Net Authentication Plugin
« on: July 23, 2017, 04:39:15 AM »
Is there a way to edit the file without literally opening the file yourself and changing the data?
A: Which file ?

Don't worry, you answered my question :D

Plugin Releases / Re: Ven Net Authentication Plugin
« on: July 21, 2017, 08:56:52 PM »
Hi Algoru,
Thanks for posting the plugin. I am yet to test it, though I am sure it will be great! :)

Can you please elaborate on the following:
- Are there any commands and permissions?
- How do you sign in/out of an account?
- Is there a way to edit the file without literally opening the file yourself and changing the data?


Help / Re: Run.bat File Not working
« on: July 18, 2017, 02:52:12 AM »
Does the folder C:\Program Files\Java\jre8\bin exist?
No it does not. That was my previous suggestion.

What version of Rainbow are you using?

I don't think it matters. I'm pretty sure the problem is that the path does not point to a java library.
In saying that, I could be wrong. You'd think it'd come up with a command prompt error message "the path... does not point to an executable, script, etc", which hasn't been documented here, so I'm not sure.

@smalakai17 try changing the path to the java path on your system and try again. If that doesn't work, please tell us what version of Rainbow you are using so @UnknownUser500 and I can help you

Help / Re: Run.bat File Not working
« on: July 17, 2017, 04:32:10 AM »

I think I can help you.
In the script above, your path connects to a java 7 library, which should work OK

In the last script, it intends on connecting to a java 8 library, however the path won't exist.
Instead, you need to find the version of java. For example, my latest JRE version is JRE 1.8.0 revision 131.
So my path would be:
"C:\Program Files\Java\jre1.8.0_131\bin\java.exe"

Yours would be different depending on the java version you have

Help / Re: Non-OP Commands
« on: July 12, 2017, 05:31:38 PM »
Sure! The problem is that most of the commands have their own permissions (even those that are non-op), and so players that are not OP will need to add the permissions in separately.

What it sounds like you want is to use is the /perm command.

For the commands above (for example), the commands to give players those permissions would be:
/perm give <username> rainbow.bp
/perm give <username> rainbow.spawn

This is also the same for plugins. If they have permissions, they should tell you on their help page.

General Discussion / Re: Better Together Update: For DiW
« on: July 03, 2017, 05:13:36 AM »
I think we need to get this community back up and running before we consider multi-platform anyway. Theoretically it could be considered a "re-launch" if we were to "re-release" Rainbow as a multi-platform server. While this could help, a more established community would be much more instrumental. And to do this, we need to advertise.

In my opinion, "But I don't think anyone knows what rainbow is tbh" is a very accurate response which first needs to be responded to before we think about this.

Help / Re: Run.bat not working
« on: June 09, 2017, 09:41:44 PM »
There are two things that could be happening:
1) Rainbow.jar requires more RAM (more likely):
Try changing the arguments to allocate more memory:
java -Xmx1G - Xincgc -jar Rainbow.jar nogui

2) Your computer does not have enough memory (less likely):
You will need to close some applications on your computer, or maybe just restart your computer

V1.2.1 is up! Fixed a bug in ListConverter and Converter where an empty list/set would throw a StringIndexOutOfBoundsException

V1.2 is up! Added a toString(String) method to the ListConverter and SetConverter classes to have a custom split between each element in the list!

Pages: [1] 2 3 ... 51