Update to Minecraft 1.20.2

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2023-09-22 02:40:00 +10:00
parent e589401ea7
commit a67391a13e
9 changed files with 56 additions and 12 deletions

View File

@ -5,7 +5,7 @@
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<version>1.20.2-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Bukkit</name>
@ -35,14 +35,14 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
<version>32.1.2-jre</version>
<scope>compile</scope>
</dependency>
<!-- bundled with Minecraft, should be kept in sync -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10</version>
<version>2.10.1</version>
<scope>compile</scope>
</dependency>
<!-- bundled with Minecraft, should be kept in sync -->
@ -55,7 +55,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
<version>2.2</version>
<scope>compile</scope>
</dependency>
<!-- not part of the API proper -->

View File

@ -52,8 +52,11 @@ public abstract class GameEvent implements Keyed {
@Deprecated
public static final GameEvent ENTITY_KILLED = getEvent("entity_die");
public static final GameEvent ENTITY_PLACE = getEvent("entity_place");
public static final GameEvent ENTITY_ROAR = getEvent("entity_roar");
public static final GameEvent ENTITY_SHAKE = getEvent("entity_shake");
public static final GameEvent ENTITY_ACTION = getEvent("entity_action");
@Deprecated
public static final GameEvent ENTITY_ROAR = getEvent("entity_action");
@Deprecated
public static final GameEvent ENTITY_SHAKE = getEvent("entity_action");
public static final GameEvent EQUIP = getEvent("equip");
public static final GameEvent EXPLODE = getEvent("explode");
public static final GameEvent FLAP = getEvent("flap");
@ -77,7 +80,7 @@ public abstract class GameEvent implements Keyed {
public static final GameEvent PROJECTILE_LAND = getEvent("projectile_land");
public static final GameEvent PROJECTILE_SHOOT = getEvent("projectile_shoot");
@Deprecated
public static final GameEvent RAVAGER_ROAR = getEvent("entity_roar");
public static final GameEvent RAVAGER_ROAR = getEvent("entity_action");
@Deprecated
public static final GameEvent RING_BELL = getEvent("block_change");
public static final GameEvent SCULK_SENSOR_TENDRILS_CLICKING = getEvent("sculk_sensor_tendrils_clicking");
@ -91,8 +94,9 @@ public abstract class GameEvent implements Keyed {
public static final GameEvent STEP = getEvent("step");
public static final GameEvent SWIM = getEvent("swim");
public static final GameEvent TELEPORT = getEvent("teleport");
public static final GameEvent UNEQUIP = getEvent("unequip");
@Deprecated
public static final GameEvent WOLF_SHAKING = getEvent("entity_shake");
public static final GameEvent WOLF_SHAKING = getEvent("entity_action");
public static final GameEvent RESONATE_1 = getEvent("resonate_1");
public static final GameEvent RESONATE_2 = getEvent("resonate_2");
public static final GameEvent RESONATE_3 = getEvent("resonate_3");

View File

@ -206,6 +206,10 @@ public final class GameRule<T> {
* Whether vines will spread.
*/
public static final GameRule<Boolean> DO_VINES_SPREAD = new GameRule<>("doVinesSpread", Boolean.class);
/**
* Whether ender pearls will vanish on player death.
*/
public static final GameRule<Boolean> ENDER_PEARLS_VANISH_ON_DEATH = new GameRule<>("enderPearlsVanishOnDeath", Boolean.class);
// Numerical rules
/**

View File

@ -598,6 +598,12 @@ public enum Sound implements Keyed {
BLOCK_SOUL_SOIL_HIT("block.soul_soil.hit"),
BLOCK_SOUL_SOIL_PLACE("block.soul_soil.place"),
BLOCK_SOUL_SOIL_STEP("block.soul_soil.step"),
BLOCK_SPONGE_ABSORB("block.sponge.absorb"),
BLOCK_SPONGE_BREAK("block.sponge.break"),
BLOCK_SPONGE_FALL("block.sponge.fall"),
BLOCK_SPONGE_HIT("block.sponge.hit"),
BLOCK_SPONGE_PLACE("block.sponge.place"),
BLOCK_SPONGE_STEP("block.sponge.step"),
BLOCK_SPORE_BLOSSOM_BREAK("block.spore_blossom.break"),
BLOCK_SPORE_BLOSSOM_FALL("block.spore_blossom.fall"),
BLOCK_SPORE_BLOSSOM_HIT("block.spore_blossom.hit"),
@ -660,6 +666,11 @@ public enum Sound implements Keyed {
BLOCK_WET_GRASS_HIT("block.wet_grass.hit"),
BLOCK_WET_GRASS_PLACE("block.wet_grass.place"),
BLOCK_WET_GRASS_STEP("block.wet_grass.step"),
BLOCK_WET_SPONGE_BREAK("block.wet_sponge.break"),
BLOCK_WET_SPONGE_FALL("block.wet_sponge.fall"),
BLOCK_WET_SPONGE_HIT("block.wet_sponge.hit"),
BLOCK_WET_SPONGE_PLACE("block.wet_sponge.place"),
BLOCK_WET_SPONGE_STEP("block.wet_sponge.step"),
BLOCK_WOODEN_BUTTON_CLICK_OFF("block.wooden_button.click_off"),
BLOCK_WOODEN_BUTTON_CLICK_ON("block.wooden_button.click_on"),
BLOCK_WOODEN_DOOR_CLOSE("block.wooden_door.close"),

View File

@ -260,6 +260,10 @@ public interface Tag<T extends Keyed> extends Keyed {
* Vanilla block tag representing all terracotta.
*/
Tag<Material> TERRACOTTA = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("terracotta"), Material.class);
/**
* Vanilla block tag representing all concrete powder.
*/
Tag<Material> CONCRETE_POWDER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("concrete_powder"), Material.class);
/**
* Vanilla block tag representing all blocks which complete the find tree
* tutorial.
@ -499,6 +503,10 @@ public interface Tag<T extends Keyed> extends Keyed {
* Vanilla block tag representing all blocks that play combination step sounds.
*/
Tag<Material> COMBINATION_STEP_SOUND_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("combination_step_sound_blocks"), Material.class);
/**
* Vanilla block tag representing all blocks that play step sounds with camels on sand.
*/
Tag<Material> CAMEL_SAND_STEP_SOUND_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("camel_sand_step_sound_blocks"), Material.class);
/**
* Vanilla block tag representing all blocks that block vibration signals.
*/
@ -950,6 +958,10 @@ public interface Tag<T extends Keyed> extends Keyed {
* Vanilla tag representing entities which are dismounted when underwater.
*/
Tag<EntityType> ENTITY_TYPES_DISMOUNTS_UNDERWATER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("dismounts_underwater"), EntityType.class);
/**
* Vanilla tag representing entities which are not controlled by their mount.
*/
Tag<EntityType> ENTITY_TYPES_NON_CONTROLLING_RIDER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("non_controlling_rider"), EntityType.class);
/**
* Returns whether or not this tag has an entry for the specified item.

View File

@ -53,6 +53,10 @@ public enum Attribute implements Keyed {
* Luck bonus of an Entity.
*/
GENERIC_LUCK("generic.luck"),
/**
* Maximum absorption of an Entity.
*/
MAX_ABSORPTION("generic.max_absorption"),
/**
* Strength with which a horse will jump.
*/

View File

@ -34,7 +34,9 @@ public interface DataPack extends Keyed {
* This is related to the server version to work.
*
* @return the pack version
* @deprecated packs can support multiple versions
*/
@Deprecated
public int getPackFormat();
/**

View File

@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableMap;
import java.util.Map;
import java.util.NoSuchElementException;
import org.bukkit.Color;
import org.bukkit.NamespacedKey;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.configuration.serialization.SerializableAs;
import org.bukkit.entity.LivingEntity;
@ -108,8 +109,14 @@ public class PotionEffect implements ConfigurationSerializable {
@NotNull
private static PotionEffectType getEffectType(@NotNull Map<?, ?> map) {
int type = getInt(map, TYPE);
PotionEffectType effect = PotionEffectType.getById(type);
PotionEffectType effect;
if (map.get(TYPE) instanceof String) {
String type = (String) map.get(TYPE);
effect = PotionEffectType.getByKey(NamespacedKey.fromString(type));
} else {
int type = getInt(map, TYPE);
effect = PotionEffectType.getById(type);
}
if (effect != null) {
return effect;
}
@ -136,7 +143,7 @@ public class PotionEffect implements ConfigurationSerializable {
@NotNull
public Map<String, Object> serialize() {
return ImmutableMap.<String, Object>builder()
.put(TYPE, type.getId())
.put(TYPE, type.getKey().toString())
.put(DURATION, duration)
.put(AMPLIFIER, amplifier)
.put(AMBIENT, ambient)

View File

@ -27,7 +27,7 @@ public class PotionEffectTypeWrapper extends PotionEffectType {
*/
@NotNull
public PotionEffectType getType() {
return PotionEffectType.getById(getId());
return PotionEffectType.getByKey(getKey());
}
@Override