mirror of
https://github.com/SimplexDevelopment/FreedomNetworkSuite.git
synced 2025-06-26 19:44:27 +00:00
Beans
This commit is contained in:
@ -20,6 +20,6 @@ public class Fossil extends JavaPlugin
|
||||
|
||||
registration.getServiceTaskRegistry()
|
||||
.registerService(
|
||||
SubscriptionProvider.syncService(this, trailer));
|
||||
SubscriptionProvider.syncService(this, trailer));
|
||||
}
|
||||
}
|
||||
|
@ -32,17 +32,18 @@ public class PadHolder implements Listener
|
||||
*/
|
||||
public PadHolder()
|
||||
{
|
||||
Bukkit.getPluginManager().registerEvents(this, CommonsBase
|
||||
.getInstance()
|
||||
.getRegistrations()
|
||||
.getModuleRegistry()
|
||||
.getProvider(Fossil.class)
|
||||
.getModule());
|
||||
Bukkit.getPluginManager()
|
||||
.registerEvents(this, CommonsBase
|
||||
.getInstance()
|
||||
.getRegistrations()
|
||||
.getModuleRegistry()
|
||||
.getProvider(Fossil.class)
|
||||
.getModule());
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a pad for the given player. If the player already has a pad stored in the map,
|
||||
* it will be overwritten with the new pad.
|
||||
* Adds a pad for the given player. If the player already has a pad stored in the map, it will be overwritten with
|
||||
* the new pad.
|
||||
*
|
||||
* @param player The player to add the pad for.
|
||||
* @param pad The pad to add.
|
||||
@ -63,8 +64,8 @@ public class PadHolder implements Listener
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the pad for the given player, if the player has one.
|
||||
* If the player has no active pad, this will return null.
|
||||
* Gets the pad for the given player, if the player has one. If the player has no active pad, this will return
|
||||
* null.
|
||||
*
|
||||
* @param player The player to get the pad for.
|
||||
* @return The pad for the given player.
|
||||
@ -98,8 +99,8 @@ public class PadHolder implements Listener
|
||||
|
||||
/**
|
||||
* Handles player pad interaction. This will check the relative block for each acceptible direction, and pass the
|
||||
* resulting block face (if any) to the bounce pad. See {@link BouncyPad#bouncePad(Player, org.bukkit.block.BlockFace)}
|
||||
* for how the resulting block face is processed.
|
||||
* resulting block face (if any) to the bounce pad. See
|
||||
* {@link BouncyPad#bouncePad(Player, org.bukkit.block.BlockFace)} for how the resulting block face is processed.
|
||||
*
|
||||
* @param event The event which gets called when a player moves.
|
||||
*/
|
||||
@ -122,10 +123,10 @@ public class PadHolder implements Listener
|
||||
final Block yNeg1 = getRelative(location, 0, -1, 0);
|
||||
|
||||
Stream.of(xNeg1, xPos1, zNeg1, zPos1, yNeg1)
|
||||
.filter(this::isWool)
|
||||
.map(block -> block.getFace(location.getBlock()))
|
||||
.findFirst()
|
||||
.ifPresent(face -> pad.bouncePad(player, face));
|
||||
.filter(this::isWool)
|
||||
.map(block -> block.getFace(location.getBlock()))
|
||||
.findFirst()
|
||||
.ifPresent(face -> pad.bouncePad(player, face));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,7 +140,8 @@ public class PadHolder implements Listener
|
||||
*/
|
||||
private Block getRelative(final Location location, final int x, final int y, final int z)
|
||||
{
|
||||
return location.getBlock().getRelative(x, y, z);
|
||||
return location.getBlock()
|
||||
.getRelative(x, y, z);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,8 +12,8 @@ public enum PadType
|
||||
*/
|
||||
NORMAL,
|
||||
/**
|
||||
* A pad which will bounce the player on {@link BlockFace#NORTH}, {@link BlockFace#SOUTH}, {@link BlockFace#EAST}
|
||||
* or {@link BlockFace#WEST}.
|
||||
* A pad which will bounce the player on {@link BlockFace#NORTH}, {@link BlockFace#SOUTH}, {@link BlockFace#EAST} or
|
||||
* {@link BlockFace#WEST}.
|
||||
*/
|
||||
SIDES,
|
||||
/**
|
||||
|
@ -47,8 +47,8 @@ public class CakeCommand extends Commander
|
||||
public void broadcastCake(final CommandSender sender)
|
||||
{
|
||||
Bukkit.broadcast(FreedomMiniMessage.deserialize(true,
|
||||
"<rainbow>But there's no sense crying over every mistake. You just keep on trying till you run out of " +
|
||||
"cake.</rainbow>"));
|
||||
"<rainbow>But there's no sense crying over every mistake. You just keep on trying till you run out of " +
|
||||
"cake.</rainbow>"));
|
||||
|
||||
final ItemStack stack = new ItemStack(Material.CAKE, 1);
|
||||
final ItemMeta meta = stack.getItemMeta();
|
||||
|
@ -8,11 +8,11 @@ public class SimpleTransactionResult implements TransactionResult
|
||||
{
|
||||
public static final TransactionResult SUCCESSFUL = new SimpleTransactionResult("Successful transaction.", true);
|
||||
public static final TransactionResult UNAUTHORIZED = new SimpleTransactionResult("Unauthorized transaction.",
|
||||
false);
|
||||
false);
|
||||
public static final TransactionResult AMOUNT_TOO_SMALL = new SimpleTransactionResult(
|
||||
"Transaction balance too small.", false);
|
||||
"Transaction balance too small.", false);
|
||||
public static final TransactionResult INSUFFICIENT_FUNDS = new SimpleTransactionResult(
|
||||
"The source has an insufficient balance to carry out this transaction.", false);
|
||||
"The source has an insufficient balance to carry out this transaction.", false);
|
||||
private final String message;
|
||||
private final Component component;
|
||||
private final boolean successful;
|
||||
@ -20,8 +20,8 @@ public class SimpleTransactionResult implements TransactionResult
|
||||
public SimpleTransactionResult(final String message, final boolean successful)
|
||||
{
|
||||
this(message, Component.text(message, successful
|
||||
? NamedTextColor.GREEN
|
||||
: NamedTextColor.RED), successful);
|
||||
? NamedTextColor.GREEN
|
||||
: NamedTextColor.RED), successful);
|
||||
}
|
||||
|
||||
public SimpleTransactionResult(final String message, final Component component, final boolean successful)
|
||||
|
@ -38,18 +38,21 @@ public final class CopyCatReaction extends Reaction
|
||||
@Override
|
||||
public void display(final Audience audience)
|
||||
{
|
||||
final BossBar bossBar = BossBarDisplay.builder().setName(getRandomCharacterString())
|
||||
.setProgress(0.0F)
|
||||
.build();
|
||||
final BossBar bossBar = BossBarDisplay.builder()
|
||||
.setName(getRandomCharacterString())
|
||||
.setProgress(0.0F)
|
||||
.build();
|
||||
}
|
||||
|
||||
public String getRandomCharacterString() {
|
||||
public String getRandomCharacterString()
|
||||
{
|
||||
final SplittableRandom random = new SplittableRandom();
|
||||
final StringBuilder sb = new StringBuilder(10);
|
||||
|
||||
final String chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
sb.append(chars.charAt(random.nextInt(chars.length())));
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,6 @@ public final class FlameTrail extends SimpleTrail
|
||||
final Vector direction = location.getDirection();
|
||||
location.getWorld()
|
||||
.spawnParticle(getTrailType().getType(), location, 0, direction.getX(), direction.getY(),
|
||||
direction.getZ(), 0.1);
|
||||
direction.getZ(), 0.1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user