Update to Minecraft 1.19.3

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-12-08 03:00:00 +11:00
parent a13136ada2
commit 8b26bb8f3e
305 changed files with 3331 additions and 2864 deletions

View File

@@ -23,7 +23,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import net.minecraft.SharedConstants;
import net.minecraft.advancements.critereon.LootDeserializationContext;
import net.minecraft.core.IRegistry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.nbt.DynamicOpsNBT;
import net.minecraft.nbt.MojangsonParser;
import net.minecraft.nbt.NBTBase;
@@ -36,7 +36,6 @@ import net.minecraft.util.ChatDeserializer;
import net.minecraft.util.datafix.DataConverterRegistry;
import net.minecraft.util.datafix.fixes.DataConverterTypes;
import net.minecraft.world.entity.ai.attributes.AttributeBase;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.IBlockData;
@@ -56,7 +55,6 @@ import org.bukkit.craftbukkit.CraftEquipmentSlot;
import org.bukkit.craftbukkit.attribute.CraftAttributeInstance;
import org.bukkit.craftbukkit.attribute.CraftAttributeMap;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
import org.bukkit.craftbukkit.inventory.CraftCreativeCategory;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.craftbukkit.legacy.CraftLegacy;
import org.bukkit.inventory.CreativeCategory;
@@ -105,16 +103,16 @@ public final class CraftMagicNumbers implements UnsafeValues {
private static final Map<Material, FluidType> MATERIAL_FLUID = new HashMap<>();
static {
for (Block block : IRegistry.BLOCK) {
BLOCK_MATERIAL.put(block, Material.getMaterial(IRegistry.BLOCK.getKey(block).getPath().toUpperCase(Locale.ROOT)));
for (Block block : BuiltInRegistries.BLOCK) {
BLOCK_MATERIAL.put(block, Material.getMaterial(BuiltInRegistries.BLOCK.getKey(block).getPath().toUpperCase(Locale.ROOT)));
}
for (Item item : IRegistry.ITEM) {
ITEM_MATERIAL.put(item, Material.getMaterial(IRegistry.ITEM.getKey(item).getPath().toUpperCase(Locale.ROOT)));
for (Item item : BuiltInRegistries.ITEM) {
ITEM_MATERIAL.put(item, Material.getMaterial(BuiltInRegistries.ITEM.getKey(item).getPath().toUpperCase(Locale.ROOT)));
}
for (FluidType fluid : IRegistry.FLUID) {
FLUID_MATERIAL.put(fluid, Registry.FLUID.get(CraftNamespacedKey.fromMinecraft(IRegistry.FLUID.getKey(fluid))));
for (FluidType fluid : BuiltInRegistries.FLUID) {
FLUID_MATERIAL.put(fluid, Registry.FLUID.get(CraftNamespacedKey.fromMinecraft(BuiltInRegistries.FLUID.getKey(fluid))));
}
for (Material material : Material.values()) {
@@ -123,13 +121,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
}
MinecraftKey key = key(material);
IRegistry.ITEM.getOptional(key).ifPresent((item) -> {
BuiltInRegistries.ITEM.getOptional(key).ifPresent((item) -> {
MATERIAL_ITEM.put(material, item);
});
IRegistry.BLOCK.getOptional(key).ifPresent((block) -> {
BuiltInRegistries.BLOCK.getOptional(key).ifPresent((block) -> {
MATERIAL_BLOCK.put(material, block);
});
IRegistry.FLUID.getOptional(key).ifPresent((fluid) -> {
BuiltInRegistries.FLUID.getOptional(key).ifPresent((fluid) -> {
MATERIAL_FLUID.put(material, fluid);
});
}
@@ -237,7 +235,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
* @return string
*/
public String getMappingsVersion() {
return "69c84c88aeb92ce9fa9525438b93f4fe";
return "1afe2ffe8a9d7fc510442a168b3d4338";
}
@Override
@@ -351,7 +349,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
Multimap<AttributeBase, net.minecraft.world.entity.ai.attributes.AttributeModifier> nmsDefaultAttributes = getItem(material).getDefaultAttributeModifiers(CraftEquipmentSlot.getNMS(slot));
for (Entry<AttributeBase, net.minecraft.world.entity.ai.attributes.AttributeModifier> mapEntry : nmsDefaultAttributes.entries()) {
Attribute attribute = CraftAttributeMap.fromMinecraft(IRegistry.ATTRIBUTE.getKey(mapEntry.getKey()).toString());
Attribute attribute = CraftAttributeMap.fromMinecraft(BuiltInRegistries.ATTRIBUTE.getKey(mapEntry.getKey()).toString());
defaultAttributes.put(attribute, CraftAttributeInstance.convert(mapEntry.getValue(), slot));
}
@@ -360,8 +358,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
@Override
public CreativeCategory getCreativeCategory(Material material) {
CreativeModeTab category = getItem(material).getItemCategory();
return CraftCreativeCategory.fromNMS(category);
return CreativeCategory.BUILDING_BLOCKS; // TODO: Figure out what to do with this
}
/**

View File

@@ -1,7 +1,6 @@
package org.bukkit.craftbukkit.util;
import java.util.List;
import java.util.Random;
import java.util.function.Predicate;
import net.minecraft.core.BlockPosition;
import net.minecraft.core.EnumDirection;
@@ -16,6 +15,7 @@ import net.minecraft.util.RandomSource;
import net.minecraft.world.DifficultyDamageScaler;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.flag.FeatureFlagSet;
import net.minecraft.world.level.GeneratorAccessSeed;
import net.minecraft.world.level.biome.BiomeBase;
import net.minecraft.world.level.biome.BiomeManager;
@@ -124,11 +124,6 @@ public class DummyGeneratorAccess implements GeneratorAccessSeed {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public IRegistryCustom registryAccess() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<Entity> getEntities(Entity entity, AxisAlignedBB aabb, Predicate<? super Entity> prdct) {
throw new UnsupportedOperationException("Not supported yet.");
@@ -184,6 +179,16 @@ public class DummyGeneratorAccess implements GeneratorAccessSeed {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public IRegistryCustom registryAccess() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public FeatureFlagSet enabledFeatures() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public float getShade(EnumDirection ed, boolean bln) {
throw new UnsupportedOperationException("Not supported yet.");