mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
Move patches around
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Tue, 20 Apr 2021 01:15:04 +0100
|
||||
Subject: [PATCH] don't throw when loading invalid TEs
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.world.level.block.entity;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
+import net.minecraft.ResourceLocationException;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject {
|
||||
public static BlockEntity loadStatic(BlockState state, CompoundTag tag) {
|
||||
String s = tag.getString("id");
|
||||
|
||||
- return (BlockEntity) Registry.BLOCK_ENTITY_TYPE.getOptional(new ResourceLocation(s)).map((tileentitytypes) -> {
|
||||
+ // Paper
|
||||
+ ResourceLocation minecraftKey = null;
|
||||
+ try {
|
||||
+ minecraftKey = new ResourceLocation(s);
|
||||
+ } catch (ResourceLocationException ex) {}
|
||||
+ // Paper end
|
||||
+ return (BlockEntity) Registry.BLOCK_ENTITY_TYPE.getOptional(minecraftKey).map((tileentitytypes) -> {
|
||||
try {
|
||||
return tileentitytypes.create();
|
||||
} catch (Throwable throwable) {
|
Reference in New Issue
Block a user