Update to Minecraft 1.19.3
By: md_5 <git@md-5.net>
This commit is contained in:
parent
a13136ada2
commit
8b26bb8f3e
305 changed files with 3331 additions and 2864 deletions
|
@ -11,7 +11,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.StreamSupport;
|
||||
import net.minecraft.core.IRegistry;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.resources.MinecraftKey;
|
||||
import net.minecraft.world.item.Item;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
|
@ -31,13 +31,13 @@ public class MaterialTest extends AbstractTestingBase {
|
|||
materials.put(CraftMagicNumbers.key(material), material);
|
||||
}
|
||||
|
||||
Iterator<Item> items = IRegistry.ITEM.iterator();
|
||||
Iterator<Item> items = BuiltInRegistries.ITEM.iterator();
|
||||
|
||||
while (items.hasNext()) {
|
||||
Item item = items.next();
|
||||
if (item == null) continue;
|
||||
|
||||
MinecraftKey id = IRegistry.ITEM.getKey(item);
|
||||
MinecraftKey id = BuiltInRegistries.ITEM.getKey(item);
|
||||
String name = item.getDescriptionId();
|
||||
|
||||
Material material = materials.remove(id);
|
||||
|
@ -53,13 +53,13 @@ public class MaterialTest extends AbstractTestingBase {
|
|||
public void verifyMaterialOrder() {
|
||||
List<Material> expectedOrder = new ArrayList<>(Material.values().length);
|
||||
|
||||
// Start with items in the same order as IRegistry.ITEM
|
||||
StreamSupport.stream(IRegistry.ITEM.spliterator(), false)
|
||||
// Start with items in the same order as BuiltInRegistries.ITEM
|
||||
StreamSupport.stream(BuiltInRegistries.ITEM.spliterator(), false)
|
||||
.map(CraftMagicNumbers::getMaterial)
|
||||
.forEach(expectedOrder::add);
|
||||
|
||||
// Then non-item blocks in the same order as IRegistry.BLOCK
|
||||
StreamSupport.stream(IRegistry.BLOCK.spliterator(), false)
|
||||
// Then non-item blocks in the same order as BuiltInRegistries.BLOCK
|
||||
StreamSupport.stream(BuiltInRegistries.BLOCK.spliterator(), false)
|
||||
.map(CraftMagicNumbers::getMaterial)
|
||||
.filter(block -> !block.isItem())
|
||||
.forEach(expectedOrder::add);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue