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
1
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.

https://github.com/FabioZumbi12/RedProtect/blob/master/RedProtect-Spigot/src/main/java/br/net/fabiozumbi12/RedProtect/config/RPCommentedConfig.java

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

2
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.

3
Bummer.  But thanks!

4
Thanks!  But can I set the command?

5
Is there, huh?

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

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

8
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!

9
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...

10
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;
etc.
etc.
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)....

11
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]
onEntiryInteract()?

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

13
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. 

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

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

Pages: [1] 2 3 ... 18