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 - Fredashay

Pages: [1] 2 3 ... 18
API Requests / Re: built in SnakeYAML
« on: September 21, 2017, 06:50:28 PM »
Seems to be good a yaml parser for Rainbow. If i can suggest, what you think to add comments on yaml files configurations? I have writen a class for my plugin but you can take part of this and add on API.


Good to see Rainbow still alive ^^

I would have voted for "plain old Java properties," but since everybody seems to be agreeing on YAML, I can live with that.  My plugins use CSV files for configuration and data storage, anyway :-p

Plugin Development / Is it possible to serialize a block...
« on: September 14, 2017, 04:41:09 PM »
...and then reconstruct that block from the serial data string from the original block?  I use the same technique in my book.jar plugin to create custom books.

Bummer.  But thanks!

Thanks!  But can I set the command?

Is there, huh?

Oh!  I didn't think of that, d'oh!  Thanks! :-)

Is there a method I can use to know if someone changed the setting of a repeater or comparator, and then cancel the changed setting?

FYI, follow up.... the plugin works great now! :-)  You get a subway map whenever you pass through a turnstyle if you don't already have one in your inventory!

Thanks!  I'll try that.  But there's more to it than just a single pressure plate -- lots of players use pressure plates for various reasons that aren't all subway turnstyles, lol.  There's a certain configuration of specific blocks surrounding the player that the plugin will recognize as a "turnstyle" and gives the player a subway map. 

Maybe I'll use your idea of just hard-coding all the x-y-z locations of all the "turnstyles" in the plugin, but that'll be a pain to check them all.  Over the years, my server has an grown an extensive "subway" system with a great many stations...

Thanks!  It turns out that my problem is what you suspected: the fractions contained in plr.location weren't being resolved to the correct integer values for the actual block the player is standing on.  Grrr!  I experimented with floor, ceil, round, etc., and discovered that
Code: [Select]
int plrX = (int) Math.round(plr.getLocation().x;
gives the correct block coords that the player is standing on.  It seems to work correctly for positive and negative X and Z values.

P.S.  I had no idea there was a mostLikelyValue() function...

My next problem is doing all this math every time a player moves really lags my server :-(  So I think the whole plugin is doa (I want to give my players a subway map every time they pass through a turnstyle to enter my minecart subway, lol)....

Can I just do something like:

Code: [Select]
public void onAttemptPlayerMove(MC_Player plr, MC_Location locFrom, MC_Location locTo, MC_EventInfo ei) {
int plrD = plr.getLocation().dimension;
int plrX = (int) plr.getLocation().x;
int plrY = (int) plr.getLocation().y;
int plrZ = (int) plr.getLocation().z;
if (myServer.getWorld(plrD).getBlockAt(plrX, plrY - 1, plrZ).getId() == MC_BlockType.HEAVY_WEIGHTED_PRESSURE_PLATE) {
    plr.sendMessage("<Subway> You stepped on a pressure plate. ");

Or is a pressure plate an entity for which I need to use
Code: [Select]

General Discussion / Re: Mojang released 1.12.1
« on: August 03, 2017, 06:22:38 PM »
Wow!  That was quick!  Thanks, Codecrafter :-)

General Discussion / Re: Is anyone else still here?
« on: May 14, 2017, 06:46:02 PM »
Cool.  I'm not on that often myself, but I'm glad to see that people still check in periodically. 

General Discussion / Is anyone else still here?
« on: May 13, 2017, 02:38:56 PM »
Is there?

Ah, as always, CodeCrafter provides the best solution: use the correct classes, duh.   Thanks, CodeCrafter! :-)

Pages: [1] 2 3 ... 18