mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 04:17:44 +01:00
SPIGOT-4872: LootTables missing a few loot tables
By: md_5 <git@md-5.net>
This commit is contained in:
parent
e917cff666
commit
4ed27a6eca
@ -30,9 +30,13 @@ Contributions of all sorts are welcome. To manage community contributions, we us
|
||||
* Create an account on [JIRA](http://hub.spigotmc.org/jira/).
|
||||
* Fill in the [SpigotMC CLA](http://www.spigotmc.org/go/cla) and wait up to 24 hours for your Stash account to be activated. Please ensure that your username and email addresses match.
|
||||
* Log into Stash using your JIRA credentials.
|
||||
|
||||
|
||||
Once you have performed these steps you can create a fork, push your code changes, and then submit it for review.
|
||||
|
||||
If you submit a PR involving both Bukkit and CraftBukkit, each PR should link the other.
|
||||
|
||||
Although the minimum requirement for compilation & usage is Java 8, we prefer all contributions to be written in Java 7 style code unless there is a compelling reason otherwise.
|
||||
|
||||
Bukkit's Goals
|
||||
--------------
|
||||
As a rough guideline, ask yourself the following questions to determine if the proposed change fits the Bukkit project's goals. Please remember that this is only a rough guideline
|
||||
@ -64,10 +68,15 @@ Code Requirements
|
||||
* Empty lines should contain no spaces.
|
||||
* No trailing whitespaces.
|
||||
* No 80 character column limit, or 'weird' mid-statement newlines unless absolutely necessary.
|
||||
* The 80 character column limit still applies to documentation.
|
||||
* No one-line methods.
|
||||
* All major additions should have documentation(e.g. javadocs).
|
||||
* All major additions should have documentation.
|
||||
* Try to follow test driven development where available.
|
||||
* All code should be free of magic values. If this is not possible, it should be marked with a TODO comment indicating it should be addressed in the future.
|
||||
* If magic values are absolutely necessary for your change, what those values represent should be documented in the code as well as an explanation in the Pull Request description on why those values are necessary.
|
||||
* No unnecessary code changes. Look through all your changes before you submit it.
|
||||
* Do not attempt to fix multiple problems with a single patch or pull request.
|
||||
* Avoid moving or renaming classes.
|
||||
* All non-private methods and constructors must have specified nullability through [annotations](https://github.com/JetBrains/java-annotations)
|
||||
|
||||
Bukkit/CraftBukkit employs [JUnit 4](http://www.vogella.com/articles/JUnit/article.html) for testing. Pull Requests(PR) should attempt to integrate within that framework as appropriate.
|
||||
@ -75,4 +84,8 @@ Bukkit is a large project and what seems simple to a PR author at the time of wr
|
||||
will help to ensure the PR can be easily maintained over time and encourage the Spigot team to pull the PR.
|
||||
|
||||
* There needs to be a new line at the end of every file.
|
||||
* Absolutely no wildcard imports.
|
||||
* Imports should be organised in a logical manner.
|
||||
* Do not group packages
|
||||
* __Absolutely no wildcard imports outside of tests.__
|
||||
|
||||
Any questions about these requirements can be asked in #spigot-dev in IRC.
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
<properties>
|
||||
<skipTests>true</skipTests>
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
@ -203,7 +203,7 @@
|
||||
<configuration>
|
||||
<signature>
|
||||
<groupId>org.codehaus.mojo.signature</groupId>
|
||||
<artifactId>java17</artifactId>
|
||||
<artifactId>java18</artifactId>
|
||||
<version>1.0</version>
|
||||
</signature>
|
||||
</configuration>
|
||||
|
@ -1,9 +1,11 @@
|
||||
package org.bukkit;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
import org.bukkit.advancement.Advancement;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.boss.KeyedBossBar;
|
||||
@ -98,7 +100,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
*
|
||||
* @see EntityType
|
||||
*/
|
||||
Registry<EntityType> ENTITY_TYPE = new SimpleRegistry<>(EntityType.class);
|
||||
Registry<EntityType> ENTITY_TYPE = new SimpleRegistry<>(EntityType.class, (entity) -> entity != EntityType.UNKNOWN);
|
||||
/**
|
||||
* Default server loot tables.
|
||||
*
|
||||
@ -110,7 +112,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
*
|
||||
* @see Material
|
||||
*/
|
||||
Registry<Material> MATERIAL = new SimpleRegistry<>(Material.class);
|
||||
Registry<Material> MATERIAL = new SimpleRegistry<>(Material.class, (mat) -> !mat.isLegacy());
|
||||
/**
|
||||
* Server statistics.
|
||||
*
|
||||
@ -144,10 +146,16 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
private final Map<NamespacedKey, T> map;
|
||||
|
||||
protected SimpleRegistry(@NotNull Class<T> type) {
|
||||
this(type, Predicates.<T>alwaysTrue());
|
||||
}
|
||||
|
||||
protected SimpleRegistry(@NotNull Class<T> type, @NotNull Predicate<T> predicate) {
|
||||
ImmutableMap.Builder<NamespacedKey, T> builder = ImmutableMap.builder();
|
||||
|
||||
for (T entry : type.getEnumConstants()) {
|
||||
builder.put(entry.getKey(), entry);
|
||||
if (predicate.test(entry)) {
|
||||
builder.put(entry.getKey(), entry);
|
||||
}
|
||||
}
|
||||
|
||||
map = builder.build();
|
||||
|
@ -25,6 +25,7 @@ public enum LootTables implements Keyed {
|
||||
JUNGLE_TEMPLE("chests/jungle_temple"),
|
||||
JUNGLE_TEMPLE_DISPENSER("chests/jungle_temple_dispenser"),
|
||||
NETHER_BRIDGE("chests/nether_bridge"),
|
||||
PILLAGER_OUTPOST("chests/pillager_outpost"),
|
||||
SHIPWRECK_MAP("chests/shipwreck_map"),
|
||||
SHIPWRECK_SUPPLY("chests/shipwreck_supply"),
|
||||
SHIPWRECK_TREASURE("chests/shipwreck_treasure"),
|
||||
@ -35,11 +36,28 @@ public enum LootTables implements Keyed {
|
||||
STRONGHOLD_LIBRARY("chests/stronghold_library"),
|
||||
UNDERWATER_RUIN_BIG("chests/underwater_ruin_big"),
|
||||
UNDERWATER_RUIN_SMALL("chests/underwater_ruin_small"),
|
||||
VILLAGE_BLACKSMITH("chests/village_blacksmith"),
|
||||
VILLAGE_ARMORER("chests/village/village_armorer"),
|
||||
VILLAGE_BUTCHER("chests/village/village_butcher"),
|
||||
VILLAGE_CARTOGRAPHER("chests/village/village_cartographer"),
|
||||
VILLAGE_DESERT_HOUSE("chests/village/village_desert_house"),
|
||||
VILLAGE_FISHER("chests/village/village_fisher"),
|
||||
VILLAGE_FLETCHER("chests/village/village_fletcher"),
|
||||
VILLAGE_MASON("chests/village/village_mason"),
|
||||
VILLAGE_PLAINS_HOUSE("chests/village/village_plains_house"),
|
||||
VILLAGE_SAVANNA_HOUSE("chests/village/village_savanna_house"),
|
||||
VILLAGE_SHEPHERD("chests/village/village_shepherd"),
|
||||
VILLAGE_SNOWY_HOUSE("chests/village/village_snowy_house"),
|
||||
VILLAGE_TAIGA_HOUSE("chests/village/village_taiga_house"),
|
||||
VILLAGE_TANNERY("chests/village/village_tannery"),
|
||||
VILLAGE_TEMPLE("chests/village/village_temple"),
|
||||
VILLAGE_TOOLSMITH("chests/village/village_toolsmith"),
|
||||
VILLAGE_WEAPONSMITH("chests/village/village_weaponsmith"),
|
||||
WOODLAND_MANSION("chests/woodland_mansion"),
|
||||
// Entities
|
||||
ARMOR_STAND("entities/armor_stand"),
|
||||
BAT("entities/bat"),
|
||||
BLAZE("entities/blaze"),
|
||||
CAT("entities/cat"),
|
||||
CAVE_SPIDER("entities/cave_spider"),
|
||||
CHICKEN("entities/chicken"),
|
||||
COD("entities/cod"),
|
||||
@ -53,23 +71,28 @@ public enum LootTables implements Keyed {
|
||||
ENDERMITE("entities/endermite"),
|
||||
ENDER_DRAGON("entities/ender_dragon"),
|
||||
EVOKER("entities/evoker"),
|
||||
FOX("entities/fox"),
|
||||
GHAST("entities/ghast"),
|
||||
GIANT("entities/giant"),
|
||||
GUARDIAN("entities/guardian"),
|
||||
HORSE("entities/horse"),
|
||||
HUSK("entities/husk"),
|
||||
ILLUSIONER("entities/illusioner"),
|
||||
IRON_GOLEM("entities/iron_golem"),
|
||||
LLAMA("entities/llama"),
|
||||
MAGMA_CUBE("entities/magma_cube"),
|
||||
MOOSHROOM("entities/mooshroom"),
|
||||
MULE("entities/mule"),
|
||||
MUSHROOM_COW("entities/mushroom_cow"),
|
||||
OCELOT("entities/ocelot"),
|
||||
PANDA("entities/panda"),
|
||||
PARROT("entities/parrot"),
|
||||
PHANTOM("entities/phantom"),
|
||||
PIG("entities/pig"),
|
||||
PILLAGER("entities/pillager"),
|
||||
POLAR_BEAR("entities/polar_bear"),
|
||||
PUFFERFISH("entities/pufferfish"),
|
||||
RABBIT("entities/rabbit"),
|
||||
RAVAGER("entities/ravager"),
|
||||
SALMON("entities/salmon"),
|
||||
// Sheep entry here, moved below for organizational purposes
|
||||
SHULKER("entities/shulker"),
|
||||
@ -81,12 +104,15 @@ public enum LootTables implements Keyed {
|
||||
SPIDER("entities/spider"),
|
||||
SQUID("entities/squid"),
|
||||
STRAY("entities/stray"),
|
||||
TRADER_LLAMA("entities/trader_llama"),
|
||||
TROPICAL_FISH("entities/tropical_fish"),
|
||||
TURTLE("entities/turtle"),
|
||||
VEX("entities/vex"),
|
||||
VILLAGER("entities/villager"),
|
||||
VINDICATOR("entities/vindicator"),
|
||||
WANDERING_TRADER("entities/wandering_trader"),
|
||||
WITCH("entities/witch"),
|
||||
WITHER("entities/wither"),
|
||||
WITHER_SKELETON("entities/wither_skeleton"),
|
||||
WOLF("entities/wolf"),
|
||||
ZOMBIE("entities/zombie"),
|
||||
@ -94,10 +120,24 @@ public enum LootTables implements Keyed {
|
||||
ZOMBIE_PIGMAN("entities/zombie_pigman"),
|
||||
ZOMBIE_VILLAGER("entities/zombie_villager"),
|
||||
// Gameplay
|
||||
ARMORER_GIFT("gameplay/hero_of_the_village/armorer_gift"),
|
||||
BUTCHER_GIFT("gameplay/hero_of_the_village/butcher_gift"),
|
||||
CARTOGRAPHER_GIFT("gameplay/hero_of_the_village/cartographer_gift"),
|
||||
CAT_MORNING_GIFT("gameplay/cat_morning_gift"),
|
||||
CLERIC_GIFT("gameplay/hero_of_the_village/cleric_gift"),
|
||||
FARMER_GIFT("gameplay/hero_of_the_village/farmer_gift"),
|
||||
FISHERMAN_GIFT("gameplay/hero_of_the_village/fisherman_gift"),
|
||||
FISHING("gameplay/fishing"),
|
||||
FISHING_FISH("gameplay/fishing/fish"),
|
||||
FISHING_JUNK("gameplay/fishing/junk"),
|
||||
FISHING_TREASURE("gameplay/fishing/treasure"),
|
||||
FLETCHER_GIFT("gameplay/hero_of_the_village/fletcher_gift"),
|
||||
LEATHERWORKER_GIFT("gameplay/hero_of_the_village/leatherworker_gift"),
|
||||
LIBRARIAN_GIFT("gameplay/hero_of_the_village/librarian_gift"),
|
||||
MASON_GIFT("gameplay/hero_of_the_village/mason_gift"),
|
||||
SHEPHERD_GIFT("gameplay/hero_of_the_village/shepherd_gift"),
|
||||
TOOLSMITH_GIFT("gameplay/hero_of_the_village/toolsmith_gift"),
|
||||
WEAPONSMITH_GIFT("gameplay/hero_of_the_village/weaponsmith_gift"),
|
||||
// Sheep
|
||||
SHEEP("entities/sheep"),
|
||||
SHEEP_BLACK("entities/sheep/black"),
|
||||
@ -107,6 +147,7 @@ public enum LootTables implements Keyed {
|
||||
SHEEP_GRAY("entities/sheep/gray"),
|
||||
SHEEP_GREEN("entities/sheep/green"),
|
||||
SHEEP_LIGHT_BLUE("entities/sheep/light_blue"),
|
||||
SHEEP_LIGHT_GRAY("entities/sheep/light_gray"),
|
||||
SHEEP_LIME("entities/sheep/lime"),
|
||||
SHEEP_MAGENTA("entities/sheep/magenta"),
|
||||
SHEEP_ORANGE("entities/sheep/orange"),
|
||||
|
Loading…
Reference in New Issue
Block a user