Medieval & Fantasy Minecraft Roleplaying

Greetings Explorer, Navigate into the Lobby!

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Be sure to "Get Whitelisted" to join the community on server!

Tyoung's Bukkit Dumpyard

TyoungBD

Lord of Altera
Legend
Tyoung_
Tyoung_
Legend
I sometimes write programs in Java. If you want to run any other these yourselves, I'd recommend downloading Eclipse compiler. But there's this website that will run them online https://www.compilejava.net/

Here's a relatively simple random loot generator I made for Abbo's gravedigging event. I wanted a random dispersion of loot in all the coffins, and this was the result. It facilitates three tiers of loot for dead bodies with varying degrees of wealth. I remember Squidziod 's char Rohrer actually twigged this early on, which was cool. It's a pity we didn't get to dig up some more but oh well haha. There's another loot level in there for filler like bones, and skulls and stuff.
import java.util.concurrent.ThreadLocalRandom;

public class RandomNumber {

public static void main(String[] args) {

int min = 1;
int max = 10;
int randomNum1 = ThreadLocalRandom.current().nextInt(min, max + 1);
int randomNum2 = ThreadLocalRandom.current().nextInt(min, max + 1);
int randomNum3 = ThreadLocalRandom.current().nextInt(min, max + 1);
int randomNum4 = ThreadLocalRandom.current().nextInt(min, max + 1);
int randomNum5 = ThreadLocalRandom.current().nextInt(min, max + 1);
int randomNum6 = ThreadLocalRandom.current().nextInt(min, max + 1);

char lootLevel = '3';
// Input your loot level here - Either 'J', '1', '2', or '3'.

switch (lootLevel) {

case 'J':

int bones = (randomNum1 - 5);
bones = bones < 0? 0 : bones;
int flesh = (randomNum2 - 6);
flesh = flesh < 0? 0 : flesh;
int skull = (randomNum3 - 8);
skull = skull < 0? 0 : skull;
skull = skull > 1? skull : 1;
int emeraldJ = (randomNum4 - 7);
emeraldJ = emeraldJ < 0? 0 : emeraldJ;
int clothes = (randomNum5 - 8);
clothes = clothes < 0? 0 : clothes;
int books = (randomNum6 - 8);
books = books < 0? 0 : books;

System.out.println( "This grave needs " + bones + " Bone(s), " + flesh + " rotton flesh, " + skull + " skull(s), " + emeraldJ + " emeralds, " + clothes + " Rotten Clothes and " + books + " Rotten Books!");
break;

case '1':

int jewelry1 = ((randomNum1)/3);
jewelry1 = jewelry1 < 0? 0 : jewelry1;
int emerald1 = (3 * (randomNum2 - 3));
emerald1 = emerald1 < 0? 0 : emerald1;
int diamonds = (randomNum3 - 6);
diamonds = diamonds < 0? 0 : diamonds;


System.out.println( "This grave needs " + jewelry1 + " pieces of jewelry " + emerald1 + " emeralds " + diamonds + " diamonds." );

break;

case '2':

int jewelry2 = ((randomNum1/3) - 1);
jewelry2 = jewelry2 < 0? 0 : jewelry2;
int emerald2 = (2 * (randomNum2 - 3));
emerald2 = emerald2 < 0? 0 : emerald2;
char weapon2 = 'y';
int wep2 = (randomNum3 -7);
wep2 = wep2 > 0? (weapon2 = 'y') : (weapon2 = 'n');

int weptier2 = ((randomNum4/3) + 1);
weptier2 = weptier2 <= 0? 1 : weptier2;

System.out.println( "This grave needs " + jewelry2 + " piece(s) of jewelry and " + emerald2 + " emerald(s). " + "Does this need a weapon? " + weapon2 + " . ");

if (randomNum3 > 7)
{
System.out.println(weptier2 + " Is the weapon tier!");
}
else
{
System.out.println("There is no weapon tier!");
}

break;

case '3':

int jewelry3 = ((randomNum1/3) - 1);
jewelry3 = jewelry3 < 0? 0 : jewelry3;
int emerald3 = (randomNum2 - 4);
emerald3 = emerald3 < 0? 0 : emerald3;
char weapon3 = 'y';
int wep3 = (randomNum3 -7);
wep3 = wep3 > 0? (weapon3 = 'y') : (weapon3 = 'n');
int weptier3 = (randomNum4/3);
weptier3 = weptier3 <= 0? 1 : weptier3;

System.out.println( "This grave needs " + jewelry3 + " piece(s) of jewelry and " + emerald3 + " emerald(s). " + "Does this need a weapon? " + weapon3 + ". " );

if (randomNum3 > 7)
{
System.out.println(weptier3 + " Is the weapon tier!");
}
else
{
System.out.println("There is no weapon tier!");
}

break;

default:
System.out.println( "Please input the correct loot level - 1, 2, 3 or J" );

}
}
}
This is what I'm working on atm, messing around with something called jsoup, which lets you take information from webpages as a Java outputs. Note: This code won't work with the online compiler I linked about because you have to import jsoup as an external jar.
Trying to isolate some rumors from the rumors thread on their own. I can get the first one, but any of them after that are a bit harder. If anyone wants to help, it would be handy if there were some rumors on the most recent page starting with "Rumor has it" and not just OOC stuff like. . . this. . .
jsoupcontent.png
package me.[myname];

import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class JSoupContent {

public static void main(String[] args) throws IOException {

String url = "http://hollowworld.co.uk/threads/rumours-thread.20930/page-145";

Document document = Jsoup.connect(url).get();

String rumor1 = document.select("meta[name=description]").attr("content");
System.out.println(rumor1);



}
}
I'm a man of my word. Here is the indecency you were promised.
package [myname];

public class Nood {

public static void main(String[] args) {

int yourAge = 18;
// Input your age before the semicolon

boolean no0ds;
if (yourAge >= 18) {
no0ds = true;
System.out.println("(.)(.)");
} else {
no0ds = false;
System.out.println("Get off my christian thread and go look at any other of the art threads on the forums!");
}

}

}
And finally, because this is the Game Development subforum, here is me messing around with Bukkit.
welcomeplugin1.png
Your standard welcome message. Nothing new here.

welcomeplugin2.png
A special message to a new player. You can't see it here but it also gives the player 32 bread.
 

TyoungBD

Lord of Altera
Legend
Tyoung_
Tyoung_
Legend
Was playing around with some more Bukkit tonight and made a makeshift magic wand plugin. Right click any block with a stick in hand and the block disappear, along with playing a sound and creating some particles. BadScreenCaptureNo.1 Won't make mobs disappear yet, imma work on that tomorrow. The only block it won't make disappear are weeds. Instead it turns them into living flowers again, along with playing different sounds and particles. BadScreenCaptureNo.2
 

TyoungBD

Lord of Altera
Legend
Tyoung_
Tyoung_
Legend
wip wip
Made the magic wand shout out the names of random Harry Potter spells when you hit a mob with it. Particles
Incendio lights them on fire, Stupefy will stun them, Expelliarmus damages them and Wingardium Leviosa levivates them. There's also a water one that does nothing except create particles atm. Effects
The wand also shoots snowballs if you right click, Imma work on making each spell a different projectile tonight. Snowballs
 

TyoungBD

Lord of Altera
Legend
Tyoung_
Tyoung_
Legend
Trails and projectiles are hard! No work on them atm

HPplugin1.png
Here's what I did instead.
While it was fun to cast random spells like a Mudblood with Tourette's, I decided to change it up a bit.
Now if you right click with a book in hand you will open your Spellbook where you can choose whatever spell you want to use.
You will continue to cast that spell until you choose another one. The default is Expelliarmus if you never pick
It'll also send you a message, as you can see here.
 

TyoungBD

Lord of Altera
Legend
Tyoung_
Tyoung_
Legend
I've been meaning to do some more bukkit and today I finally got around to it. Here's me messing around with custom heads I guess

2018-01-03_14.41.11.png
Flower pots you can interact with and store items in, having only a limited amount of space though.
2018-01-03_22.32.39.png
A flower pot inside a flower pot. "Flower pot"-ception?
 
Last edited:

TyoungBD

Lord of Altera
Legend
Tyoung_
Tyoung_
Legend
So here's something I made called the "Herbalist" plugin. It lets you plant your own flowers, watch them grow and eventually watch them die.
2018-01-05_20.55.30.png
This is the start! Right click any kind of dirt with the desired flower and watch as the plant begins to grow. You can see the seeds poking out of the ground there (along with some sounds and particles when you plant it)
Screenshot 2018-01-05 at 21.16.35.png
You can right click the at any time stem to get information about your flower. Think egg-hatching messages in Pokemon. These will change as time goes on until (and after) your flower has grown.
Growth Messages (right click):
Seeds/ Stem - "Your [flower] has just been planted. You should check again later!"
- "The beginnings of a stem is poking out of the ground"
- "Your stem looks healthy and strong. It will be a [flower] soon"
Flower - "This [flower] looks younger than the others"
- "A pretty [flower] grows here"
- "This [flower] won't be around much longer"
Dead Bush - "There was once a pretty [flower] here"

Time in Bukkit, just like on Hollowworld, is pretty confusing so I used a melon to give me times. The server would check if it had grown every time I logged on. If it found that the melon had grown it would delete the melon, leave the seeds and increase the value of an integer by 1. This integer is effectively the age of the flower.
Flower's Age (integer value):
Seeds/ Stem - Between 0 and 5 melon growth times.
Flower - Between 5 and 25 melon growth times.
Dead Bush - Between 25 and 30 melon growth times. After 30 it deleted the bush.
 

TyoungBD

Lord of Altera
Legend
Tyoung_
Tyoung_
Legend
Hit me up with all your crazy plugin ideas (Skype = Tyoung_)

The only real idea I have right now is a Star Wars plugin. Save me from myself, I want to have free time
 
Top