mirror of https://github.com/PaperMC/Paper.git
some material switch case
This commit is contained in:
parent
6a881d69cd
commit
9e42d31cf3
File diff suppressed because it is too large
Load Diff
|
@ -7,6 +7,7 @@ import io.papermc.generator.rewriter.types.EnumRegistryRewriter;
|
|||
import io.papermc.generator.rewriter.types.simple.MapPaletteRewriter;
|
||||
import io.papermc.generator.rewriter.types.RegistryFieldRewriter;
|
||||
import io.papermc.generator.rewriter.types.TagRewriter;
|
||||
import io.papermc.generator.rewriter.types.simple.MaterialRewriter;
|
||||
import io.papermc.generator.rewriter.types.simple.PatternTypeRewriter;
|
||||
import io.papermc.generator.utils.ExperimentalSounds;
|
||||
import io.papermc.generator.types.registry.GeneratedKeyType;
|
||||
|
@ -167,6 +168,11 @@ public interface Generators {
|
|||
},
|
||||
new EnumCloneRewriter<>(Boat.Status.class, net.minecraft.world.entity.vehicle.Boat.Status.class, "BoatStatus", false)
|
||||
),
|
||||
CompositeRewriter.bind(
|
||||
//new MaterialRewriter.IsTransparent("Material#isTransparent"),
|
||||
|
||||
new MaterialRewriter.GetEquipmentSlot("Material#getEquipmentSlot")
|
||||
),
|
||||
new RegistryFieldRewriter<>(Structure.class, Registries.STRUCTURE, "Structure", "getStructure"),
|
||||
new RegistryFieldRewriter<>(StructureType.class, Registries.STRUCTURE_TYPE, "StructureType", "getStructureType"),
|
||||
new RegistryFieldRewriter<>(TrimPattern.class, Registries.TRIM_PATTERN, "TrimPattern", null),
|
||||
|
|
|
@ -4,10 +4,10 @@ import com.google.common.util.concurrent.MoreExecutors;
|
|||
import com.mojang.logging.LogUtils;
|
||||
import io.papermc.generator.rewriter.SourceRewriter;
|
||||
import io.papermc.generator.types.SourceGenerator;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import io.papermc.generator.utils.TagCollector;
|
||||
import io.papermc.generator.utils.TagResult;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.core.LayeredRegistryAccess;
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.Set;
|
|||
|
||||
public class SearchReplaceRewriter implements SourceRewriter {
|
||||
|
||||
private static final String INDENT_UNIT = " ";
|
||||
protected static final String INDENT_UNIT = " ";
|
||||
private static final String PAPER_START_FORMAT = "Paper start";
|
||||
private static final String PAPER_END_FORMAT = "Paper end";
|
||||
private static final String GENERATED_COMMENT_FORMAT = "// %s - Generated/%s"; // {0} = PAPER_START_FORMAT|PAPER_END_FORMAT {1} = pattern
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
package io.papermc.generator.rewriter.types;
|
||||
|
||||
import io.papermc.generator.rewriter.SearchMetadata;
|
||||
import io.papermc.generator.rewriter.SearchReplaceRewriter;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import java.util.Iterator;
|
||||
|
||||
public abstract class SwitchCaseRewriter extends SearchReplaceRewriter {
|
||||
|
||||
@MonotonicNonNull
|
||||
private Iterator<String> cases;
|
||||
|
||||
protected SwitchCaseRewriter(final Class<?> rewriteClass, final String pattern, final boolean equalsSize) {
|
||||
super(rewriteClass, pattern, equalsSize);
|
||||
}
|
||||
|
||||
protected abstract Iterable<String> getCases();
|
||||
|
||||
@Override
|
||||
protected void beginSearch() {
|
||||
this.cases = this.getCases().iterator();
|
||||
}
|
||||
|
||||
private void appendCase(StringBuilder builder, SearchMetadata metadata) {
|
||||
builder.append(metadata.indent()).append("case ").append(this.cases.next()).append(':');
|
||||
builder.append('\n');
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void replaceLine(final SearchMetadata metadata, final StringBuilder builder) {
|
||||
appendCase(builder, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void insert(final SearchMetadata metadata, final StringBuilder builder) {
|
||||
while (this.cases.hasNext()) {
|
||||
appendCase(builder, metadata);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package io.papermc.generator.rewriter.types;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import io.papermc.generator.rewriter.SearchMetadata;
|
||||
import io.papermc.generator.rewriter.SearchReplaceRewriter;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public abstract class SwitchRewriter<T> extends SearchReplaceRewriter {
|
||||
|
||||
protected @MonotonicNonNull Return<T> defaultValue;
|
||||
|
||||
protected SwitchRewriter(final Class<?> rewriteClass, final String pattern, final boolean equalsSize) {
|
||||
super(rewriteClass, pattern, equalsSize);
|
||||
}
|
||||
|
||||
protected record Return<T>(T object, String code) {}
|
||||
|
||||
protected Return<T> returnOf(T object, String code) {
|
||||
return new Return<>(object, code);
|
||||
}
|
||||
|
||||
protected abstract Multimap<Return<T>, String> getContent(); // <return:cases>
|
||||
|
||||
@Override
|
||||
protected void insert(final SearchMetadata metadata, final StringBuilder builder) {
|
||||
Multimap<Return<T>, String> content = this.getContent();
|
||||
for (Return<T> key : content.keySet()) {
|
||||
Collection<String> conditions = content.get(key);
|
||||
for (String cond : conditions) {
|
||||
builder.append(metadata.indent()).append("case ").append(cond).append(':');
|
||||
builder.append('\n');
|
||||
}
|
||||
builder.append(metadata.indent()).append(INDENT_UNIT).append("return ").append(key.code()).append(';');
|
||||
builder.append('\n');
|
||||
}
|
||||
|
||||
if (this.defaultValue != null) {
|
||||
builder.append(metadata.indent()).append("default:");
|
||||
builder.append('\n');
|
||||
builder.append(metadata.indent()).append(INDENT_UNIT).append("return ").append(this.defaultValue.code()).append(';');
|
||||
builder.append('\n');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package io.papermc.generator.rewriter.types.simple;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.MultimapBuilder;
|
||||
import io.papermc.generator.rewriter.types.SwitchRewriter;
|
||||
import io.papermc.generator.utils.Formatting;
|
||||
import java.util.Comparator;
|
||||
import java.util.Locale;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
public class MaterialRewriter {
|
||||
|
||||
// blocks
|
||||
|
||||
/* todo test is broken
|
||||
public static class IsTransparent extends SwitchCaseRewriter {
|
||||
|
||||
public IsTransparent(final String pattern) {
|
||||
super(Material.class, pattern, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterable<String> getCases() {
|
||||
return BuiltInRegistries.BLOCK.holders().filter(reference -> reference.value().defaultBlockState().useShapeForLightOcclusion())
|
||||
.map(reference -> reference.key().location().getPath().toUpperCase(Locale.ENGLISH)).sorted(Formatting.ALPHABETIC_KEY_ORDER).toList();
|
||||
}
|
||||
}*/
|
||||
|
||||
// items
|
||||
|
||||
public static class GetEquipmentSlot extends SwitchRewriter<EquipmentSlot> {
|
||||
|
||||
public GetEquipmentSlot(final String pattern) {
|
||||
super(Material.class, pattern, false);
|
||||
this.defaultValue = returnOf(EquipmentSlot.HAND, "%s.%s".formatted(EquipmentSlot.class.getSimpleName(), EquipmentSlot.HAND.name()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Multimap<Return<EquipmentSlot>, String> getContent() {
|
||||
Multimap<Return<EquipmentSlot>, String> map = MultimapBuilder.treeKeys(Comparator.<Return<EquipmentSlot>>comparingInt(key -> key.object().ordinal()).reversed())
|
||||
.treeSetValues(Formatting.ALPHABETIC_KEY_ORDER).build();
|
||||
BuiltInRegistries.ITEM.holders().forEach(reference -> {
|
||||
net.minecraft.world.entity.EquipmentSlot slot = Mob.getEquipmentSlotForItem(new ItemStack(reference.value()));
|
||||
EquipmentSlot apiSlot = EquipmentSlot.values()[slot.ordinal()];
|
||||
if (apiSlot != this.defaultValue.object()) {
|
||||
String formattedSlot = "%s.%s".formatted(EquipmentSlot.class.getSimpleName(), EquipmentSlot.values()[slot.ordinal()].name()); // name doesn't match
|
||||
map.put(returnOf(apiSlot, formattedSlot), reference.key().location().getPath().toUpperCase(Locale.ENGLISH));
|
||||
}
|
||||
});
|
||||
return map;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -84,6 +84,10 @@ public final class Formatting {
|
|||
return String.format("\"%s\"", value);
|
||||
}
|
||||
|
||||
public static String floatStr(float value) {
|
||||
return Float.toString(value) + 'F';
|
||||
}
|
||||
|
||||
public static Comparator<String> ALPHABETIC_KEY_ORDER = alphabeticKeyOrder(path -> path);
|
||||
|
||||
public static <T> Comparator<T> alphabeticKeyOrder(Function<T, String> mapper) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
public net/minecraft/server/WorldLoader loadAndReplaceLayer(Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/core/LayeredRegistryAccess;Lnet/minecraft/server/RegistryLayer;Ljava/util/List;)Lnet/minecraft/core/LayeredRegistryAccess;
|
||||
public net/minecraft/world/level/material/MapColor MATERIAL_COLORS
|
||||
public net/minecraft/world/level/block/FireBlock igniteOdds
|
||||
|
||||
# for auto-marking experimental stuff
|
||||
public net/minecraft/core/RegistrySetBuilder entries
|
||||
|
|
|
@ -216,6 +216,294 @@ index 6c9689baca1763e2ef79495d38618d587e792434..3073fe5929650076f99d2ea04ebd2265
|
|||
|
||||
/**
|
||||
* Returns a {@link GameEvent} by a {@link NamespacedKey}.
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index f9af60356da4668cec8b24e73f5747ab82e35a91..64923077d86a7fcd3d81af23c390fe0a1d8d36f2 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -4942,6 +4942,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
// Paper end
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isBlock">
|
||||
+ // Paper start - Generated/Material#isBlock
|
||||
case ACACIA_BUTTON:
|
||||
case ACACIA_DOOR:
|
||||
case ACACIA_FENCE:
|
||||
@@ -6000,6 +6001,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case YELLOW_WOOL:
|
||||
case ZOMBIE_HEAD:
|
||||
case ZOMBIE_WALL_HEAD:
|
||||
+ // Paper end - Generated/Material#isBlock
|
||||
//</editor-fold>
|
||||
return true;
|
||||
default:
|
||||
@@ -6015,6 +6017,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public boolean isEdible() {
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isEdible">
|
||||
+ // Paper start - Generated/Material#isEdible
|
||||
case APPLE:
|
||||
case BAKED_POTATO:
|
||||
case BEEF:
|
||||
@@ -6055,6 +6058,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case SUSPICIOUS_STEW:
|
||||
case SWEET_BERRIES:
|
||||
case TROPICAL_FISH:
|
||||
+ // Paper end - Generated/Material#isEdible
|
||||
// ----- Legacy Separator -----
|
||||
case LEGACY_BREAD:
|
||||
case LEGACY_CARROT_ITEM:
|
||||
@@ -6191,6 +6195,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public boolean isRecord() {
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isRecord">
|
||||
+ // Paper start - Generated/Material#isRecord
|
||||
case MUSIC_DISC_5:
|
||||
case MUSIC_DISC_11:
|
||||
case MUSIC_DISC_13:
|
||||
@@ -6207,6 +6212,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case MUSIC_DISC_STRAD:
|
||||
case MUSIC_DISC_WAIT:
|
||||
case MUSIC_DISC_WARD:
|
||||
+ // Paper end - Generated/Material#isRecord
|
||||
//</editor-fold>
|
||||
return true;
|
||||
default:
|
||||
@@ -6225,6 +6231,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
}
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isSolid">
|
||||
+ // Paper start - Generated/Material#isSolid
|
||||
case ACACIA_DOOR:
|
||||
case ACACIA_FENCE:
|
||||
case ACACIA_FENCE_GATE:
|
||||
@@ -7058,6 +7065,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case YELLOW_TERRACOTTA:
|
||||
case YELLOW_WALL_BANNER:
|
||||
case YELLOW_WOOL:
|
||||
+ // Paper end - Generated/Material#isSolid
|
||||
// ----- Legacy Separator -----
|
||||
case LEGACY_STONE:
|
||||
case LEGACY_GRASS:
|
||||
@@ -7273,9 +7281,11 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public boolean isAir() {
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isAir">
|
||||
+ // Paper start - Generated/Material#isAir
|
||||
case AIR:
|
||||
case CAVE_AIR:
|
||||
case VOID_AIR:
|
||||
+ // Paper end - Generated/Material#isAir
|
||||
// ----- Legacy Separator -----
|
||||
case LEGACY_AIR:
|
||||
//</editor-fold>
|
||||
@@ -7299,6 +7309,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
}
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isTransparent">
|
||||
+ // Paper start - Generated/Material#isTransparent
|
||||
case ACACIA_BUTTON:
|
||||
case ACACIA_SAPLING:
|
||||
case ACTIVATOR_RAIL:
|
||||
@@ -7426,6 +7437,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case YELLOW_CARPET:
|
||||
case ZOMBIE_HEAD:
|
||||
case ZOMBIE_WALL_HEAD:
|
||||
+ // Paper end - Generated/Material#isTransparent
|
||||
// ----- Legacy Separator -----
|
||||
case LEGACY_AIR:
|
||||
case LEGACY_SAPLING:
|
||||
@@ -7495,6 +7507,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
}
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isFlammable">
|
||||
+ // Paper start - Generated/Material#isFlammable
|
||||
case ACACIA_DOOR:
|
||||
case ACACIA_FENCE:
|
||||
case ACACIA_FENCE_GATE:
|
||||
@@ -7769,6 +7782,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case YELLOW_CARPET:
|
||||
case YELLOW_WALL_BANNER:
|
||||
case YELLOW_WOOL:
|
||||
+ // Paper end - Generated/Material#isFlammable
|
||||
// ----- Legacy Separator -----
|
||||
case LEGACY_WOOD:
|
||||
case LEGACY_LOG:
|
||||
@@ -7843,6 +7857,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
}
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isBurnable">
|
||||
+ // Paper start - Generated/Material#isBurnable
|
||||
case ACACIA_FENCE:
|
||||
case ACACIA_FENCE_GATE:
|
||||
case ACACIA_LEAVES:
|
||||
@@ -8017,6 +8032,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case WITHER_ROSE:
|
||||
case YELLOW_CARPET:
|
||||
case YELLOW_WOOL:
|
||||
+ // Paper end - Generated/Material#isBurnable
|
||||
// ----- Legacy Separator -----
|
||||
case LEGACY_WOOD:
|
||||
case LEGACY_LOG:
|
||||
@@ -8070,6 +8086,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public boolean isFuel() {
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isFuel">
|
||||
+ // Paper start - Generated/Material#isFuel
|
||||
case ACACIA_BOAT:
|
||||
case ACACIA_BUTTON:
|
||||
case ACACIA_CHEST_BOAT:
|
||||
@@ -8318,6 +8335,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case YELLOW_BANNER:
|
||||
case YELLOW_CARPET:
|
||||
case YELLOW_WOOL:
|
||||
+ // Paper end - Generated/Material#isFuel
|
||||
// ----- Legacy Separator -----
|
||||
case LEGACY_LAVA_BUCKET:
|
||||
case LEGACY_COAL_BLOCK:
|
||||
@@ -8413,6 +8431,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
}
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isOccluding">
|
||||
+ // Paper start - Generated/Material#isOccluding
|
||||
case ACACIA_LOG:
|
||||
case ACACIA_PLANKS:
|
||||
case ACACIA_WOOD:
|
||||
@@ -8783,6 +8802,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case YELLOW_SHULKER_BOX:
|
||||
case YELLOW_TERRACOTTA:
|
||||
case YELLOW_WOOL:
|
||||
+ // Paper end - Generated/Material#isOccluding
|
||||
// ----- Legacy Separator -----
|
||||
case LEGACY_STONE:
|
||||
case LEGACY_GRASS:
|
||||
@@ -8898,6 +8918,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
}
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="hasGravity">
|
||||
+ // Paper start - Generated/Material#hasGravity
|
||||
case ANVIL:
|
||||
case BLACK_CONCRETE_POWDER:
|
||||
case BLUE_CONCRETE_POWDER:
|
||||
@@ -8921,6 +8942,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case SAND:
|
||||
case WHITE_CONCRETE_POWDER:
|
||||
case YELLOW_CONCRETE_POWDER:
|
||||
+ // Paper end - Generated/Material#hasGravity
|
||||
// ----- Legacy Separator -----
|
||||
case LEGACY_SAND:
|
||||
case LEGACY_GRAVEL:
|
||||
@@ -8941,6 +8963,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public boolean isItem() {
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isItem">
|
||||
+ // Paper start - Generated/Material#isItem
|
||||
case ACACIA_WALL_HANGING_SIGN:
|
||||
case ACACIA_WALL_SIGN:
|
||||
case ATTACHED_MELON_STEM:
|
||||
@@ -9088,6 +9111,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case YELLOW_CANDLE_CAKE:
|
||||
case YELLOW_WALL_BANNER:
|
||||
case ZOMBIE_WALL_HEAD:
|
||||
+ // Paper end - Generated/Material#isItem
|
||||
// ----- Legacy Separator -----
|
||||
case LEGACY_ACACIA_DOOR:
|
||||
case LEGACY_BED_BLOCK:
|
||||
@@ -9171,6 +9195,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public boolean isInteractable() {
|
||||
switch (this) {
|
||||
// <editor-fold defaultstate="collapsed" desc="isInteractable">
|
||||
+ // Paper start - Generated/Material#isInteractable
|
||||
case ACACIA_BUTTON:
|
||||
case ACACIA_DOOR:
|
||||
case ACACIA_FENCE:
|
||||
@@ -9454,6 +9479,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case YELLOW_CANDLE:
|
||||
case YELLOW_CANDLE_CAKE:
|
||||
case YELLOW_SHULKER_BOX:
|
||||
+ // Paper end - Generated/Material#isInteractable
|
||||
// </editor-fold>
|
||||
return true;
|
||||
default:
|
||||
@@ -9474,6 +9500,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
Preconditions.checkArgument(isBlock(), "The Material is not a block!");
|
||||
switch (this) {
|
||||
// <editor-fold defaultstate="collapsed" desc="getBlockHardness">
|
||||
+ // Paper start - Generated/Material#getHardness
|
||||
case BARRIER:
|
||||
case BEDROCK:
|
||||
case CHAIN_COMMAND_BLOCK:
|
||||
@@ -10404,6 +10431,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
return 100.0F;
|
||||
default:
|
||||
return 0F;
|
||||
+ // Paper end - Generated/Material#getHardness
|
||||
// </editor-fold>
|
||||
}
|
||||
}
|
||||
@@ -10422,6 +10450,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
Preconditions.checkArgument(isBlock(), "The Material is not a block!");
|
||||
switch (this) {
|
||||
// <editor-fold defaultstate="collapsed" desc="getBlastResistance">
|
||||
+ // Paper start - Generated/Material#getBlastResistance
|
||||
case BIG_DRIPLEAF:
|
||||
case BIG_DRIPLEAF_STEM:
|
||||
case BLACK_CANDLE:
|
||||
@@ -11352,6 +11381,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
return 3600000.8F;
|
||||
default:
|
||||
return 0;
|
||||
+ // Paper end - Generated/Material#getBlastResistance
|
||||
// </editor-fold>
|
||||
}
|
||||
}
|
||||
@@ -11372,6 +11402,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
Preconditions.checkArgument(isBlock(), "The Material is not a block!");
|
||||
switch (this) {
|
||||
// <editor-fold defaultstate="collapsed" desc="getSlipperiness">
|
||||
+ // Paper start - Generated/Material#getSlipperiness
|
||||
default:
|
||||
return 0.6F;
|
||||
case SLIME_BLOCK:
|
||||
@@ -11382,6 +11413,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
return 0.98F;
|
||||
case BLUE_ICE:
|
||||
return 0.989F;
|
||||
+ // Paper end - Generated/Material#getSlipperiness
|
||||
// </editor-fold>
|
||||
}
|
||||
}
|
||||
@@ -11399,6 +11431,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
Preconditions.checkArgument(isItem(), "The Material is not an item!");
|
||||
switch (this) {
|
||||
// <editor-fold defaultstate="collapsed" desc="getCraftingRemainingItem">
|
||||
+ // Paper start - Generated/Material#getCraftingRemainingItem
|
||||
case WATER_BUCKET:
|
||||
case LAVA_BUCKET:
|
||||
case MILK_BUCKET:
|
||||
@@ -11408,6 +11441,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
return GLASS_BOTTLE;
|
||||
default:
|
||||
return null;
|
||||
+ // Paper end - Generated/Material#getCraftingRemainingItem
|
||||
// </editor-fold>
|
||||
}
|
||||
}
|
||||
@@ -11424,6 +11458,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
Preconditions.checkArgument(isItem(), "The Material is not an item!");
|
||||
switch (this) {
|
||||
// <editor-fold defaultstate="collapsed" desc="getEquipmentSlot">
|
||||
+ // Paper start - Generated/Material#getEquipmentSlot
|
||||
case CARVED_PUMPKIN:
|
||||
case CHAINMAIL_HELMET:
|
||||
case CREEPER_HEAD:
|
||||
@@ -11466,6 +11501,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
return EquipmentSlot.OFF_HAND;
|
||||
default:
|
||||
return EquipmentSlot.HAND;
|
||||
+ // Paper end - Generated/Material#getEquipmentSlot
|
||||
// </editor-fold>
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/MusicInstrument.java b/src/main/java/org/bukkit/MusicInstrument.java
|
||||
index ee5368372e136541eafe1d7ffb395de670fe4843..da849da92617fe123bf768ca2cdde4ac15f74959 100644
|
||||
--- a/src/main/java/org/bukkit/MusicInstrument.java
|
||||
|
|
Loading…
Reference in New Issue