Skip to content

Commit

Permalink
update craftbukkit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Oct 23, 2024
1 parent 79962fc commit 18b5635
Show file tree
Hide file tree
Showing 784 changed files with 16,620 additions and 13,180 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/bukkit/Bukkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ public static ItemStack createExplorerMap(@NotNull World world, @NotNull Locatio
*/
public static void reload() {
server.reload();
org.spigotmc.CustomTimingsHandler.reload(); // Spigot
}

/**
Expand Down Expand Up @@ -2151,4 +2152,9 @@ public static <T extends Keyed> Registry<T> getRegistry(@NotNull Class<T> tClass
public static UnsafeValues getUnsafe() {
return server.getUnsafe();
}

@NotNull
public static Server.Spigot spigot() {
return server.spigot();
}
}
181 changes: 159 additions & 22 deletions src/main/java/org/bukkit/ChatColor.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,91 +15,223 @@ public enum ChatColor {
/**
* Represents black
*/
BLACK('0', 0x00),
BLACK('0', 0x00) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.BLACK;
}
},
/**
* Represents dark blue
*/
DARK_BLUE('1', 0x1),
DARK_BLUE('1', 0x1) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.DARK_BLUE;
}
},
/**
* Represents dark green
*/
DARK_GREEN('2', 0x2),
DARK_GREEN('2', 0x2) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.DARK_GREEN;
}
},
/**
* Represents dark blue (aqua)
*/
DARK_AQUA('3', 0x3),
DARK_AQUA('3', 0x3) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.DARK_AQUA;
}
},
/**
* Represents dark red
*/
DARK_RED('4', 0x4),
DARK_RED('4', 0x4) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.DARK_RED;
}
},
/**
* Represents dark purple
*/
DARK_PURPLE('5', 0x5),
DARK_PURPLE('5', 0x5) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.DARK_PURPLE;
}
},
/**
* Represents gold
*/
GOLD('6', 0x6),
GOLD('6', 0x6) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.GOLD;
}
},
/**
* Represents gray
*/
GRAY('7', 0x7),
GRAY('7', 0x7) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.GRAY;
}
},
/**
* Represents dark gray
*/
DARK_GRAY('8', 0x8),
DARK_GRAY('8', 0x8) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.DARK_GRAY;
}
},
/**
* Represents blue
*/
BLUE('9', 0x9),
BLUE('9', 0x9) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.BLUE;
}
},
/**
* Represents green
*/
GREEN('a', 0xA),
GREEN('a', 0xA) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.GREEN;
}
},
/**
* Represents aqua
*/
AQUA('b', 0xB),
AQUA('b', 0xB) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.AQUA;
}
},
/**
* Represents red
*/
RED('c', 0xC),
RED('c', 0xC) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.RED;
}
},
/**
* Represents light purple
*/
LIGHT_PURPLE('d', 0xD),
LIGHT_PURPLE('d', 0xD) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.LIGHT_PURPLE;
}
},
/**
* Represents yellow
*/
YELLOW('e', 0xE),
YELLOW('e', 0xE) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.YELLOW;
}
},
/**
* Represents white
*/
WHITE('f', 0xF),
WHITE('f', 0xF) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.WHITE;
}
},
/**
* Represents magical characters that change around randomly
*/
MAGIC('k', 0x10, true),
MAGIC('k', 0x10, true) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.MAGIC;
}
},
/**
* Makes the text bold.
*/
BOLD('l', 0x11, true),
BOLD('l', 0x11, true) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.BOLD;
}
},
/**
* Makes a line appear through the text.
*/
STRIKETHROUGH('m', 0x12, true),
STRIKETHROUGH('m', 0x12, true) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.STRIKETHROUGH;
}
},
/**
* Makes the text appear underlined.
*/
UNDERLINE('n', 0x13, true),
UNDERLINE('n', 0x13, true) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.UNDERLINE;
}
},
/**
* Makes the text italic.
*/
ITALIC('o', 0x14, true),
ITALIC('o', 0x14, true) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.ITALIC;
}
},
/**
* Resets all previous chat colors or formats.
*/
RESET('r', 0x15);
RESET('r', 0x15) {
@NotNull
@Override
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.RESET;
}
};

/**
* The special character which prefixes all chat colour codes. Use this if
Expand All @@ -126,6 +258,11 @@ private ChatColor(char code, int intCode, boolean isFormat) {
this.toString = new String(new char[] {COLOR_CHAR, code});
}

@NotNull
public net.md_5.bungee.api.ChatColor asBungee() {
return net.md_5.bungee.api.ChatColor.RESET;
};

/**
* Gets the char value associated with this color
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/bukkit/FeatureFlag.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface FeatureFlag extends Keyed {
public static final FeatureFlag VANILLA = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("vanilla"));

/**
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.19.3 - 1.21.1
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.19.3 - 1.21.2
*
* @deprecated not available since 1.21.2
*/
Expand Down
38 changes: 38 additions & 0 deletions src/main/java/org/bukkit/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -1834,4 +1834,42 @@ public interface Server extends PluginMessageRecipient {
@Deprecated
@NotNull
UnsafeValues getUnsafe();

// Spigot start
public class Spigot {

@NotNull
public org.bukkit.configuration.file.YamlConfiguration getConfig() {
throw new UnsupportedOperationException("Not supported yet.");
}

/**
* Sends the component to the player
*
* @param component the components to send
*/
public void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}

/**
* Sends an array of components as a single message to the player
*
* @param components the components to send
*/
public void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}

/**
* Restart the server. If the server administrator has not configured restarting, the server will stop.
*/
public void restart() {
throw new UnsupportedOperationException("Not supported yet.");
}
}

@NotNull
Spigot spigot();
// Spigot end
}
38 changes: 38 additions & 0 deletions src/main/java/org/bukkit/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -2828,6 +2828,44 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Nullable
StructureSearchResult locateNearestStructure(@NotNull Location origin, @NotNull Structure structure, int radius, boolean findUnexplored);

// Spigot start
public class Spigot {

/**
* Strikes lightning at the given {@link Location} and possibly without sound
*
* @param loc The location to strike lightning
* @param isSilent Whether this strike makes no sound
* @return The lightning entity.
* @deprecated sound is now client side and cannot be removed
* @see World#strikeLightning(org.bukkit.Location)
*/
@NotNull
@Deprecated
public LightningStrike strikeLightning(@NotNull Location loc, boolean isSilent) {
throw new UnsupportedOperationException("Not supported yet.");
}

/**
* Strikes lightning at the given {@link Location} without doing damage and possibly without sound
*
* @param loc The location to strike lightning
* @param isSilent Whether this strike makes no sound
* @return The lightning entity.
* @deprecated sound is now client side and cannot be removed
* @see World#strikeLightningEffect(org.bukkit.Location)
*/
@NotNull
@Deprecated
public LightningStrike strikeLightningEffect(@NotNull Location loc, boolean isSilent) {
throw new UnsupportedOperationException("Not supported yet.");
}
}

@NotNull
Spigot spigot();
// Spigot end

/**
* Find the closest nearby location with a biome matching the provided
* {@link Biome}(s). Finding biomes can, and will, block if the world is looking
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/bukkit/command/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public abstract class Command {
protected String usageMessage;
private String permission;
private String permissionMessage;
public org.spigotmc.CustomTimingsHandler timings; // Spigot

protected Command(@NotNull String name) {
this(name, "", "/" + name, new ArrayList<String>());
Expand All @@ -46,6 +47,7 @@ protected Command(@NotNull String name, @NotNull String description, @NotNull St
this.usageMessage = (usageMessage == null) ? "/" + name : usageMessage;
this.aliases = aliases;
this.activeAliases = new ArrayList<String>(aliases);
this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot
}

/**
Expand Down Expand Up @@ -243,6 +245,7 @@ public boolean setLabel(@NotNull String name) {
}
this.nextLabel = name;
if (!isRegistered()) {
this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot
this.label = name;
return true;
}
Expand Down
Loading

0 comments on commit 18b5635

Please sign in to comment.