3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-08 17:20:20 +01:00

Fix flower pot updating

Dieser Commit ist enthalten in:
Camotoy 2021-07-13 21:47:13 -04:00
Ursprung a1706365b9
Commit ac9da9a5a0
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

@ -30,17 +30,16 @@ import com.nukkitx.math.vector.Vector3i;
import com.nukkitx.nbt.NbtMap; import com.nukkitx.nbt.NbtMap;
import com.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket; import com.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket;
import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.session.GeyserSession;
import org.geysermc.connector.network.translators.world.block.entity.BedrockOnlyBlockEntity; import org.geysermc.connector.network.translators.world.block.entity.BedrockOnlyBlockEntity;
import org.geysermc.connector.network.translators.world.block.entity.BlockEntityTranslator; import org.geysermc.connector.network.translators.world.block.entity.BlockEntityTranslator;
import org.geysermc.connector.network.translators.world.block.entity.FlowerPotBlockEntityTranslator;
import org.geysermc.connector.registry.Registries; import org.geysermc.connector.registry.Registries;
import javax.annotation.Nonnull;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.annotation.Nonnull;
public class BlockEntityUtils { public class BlockEntityUtils {
/** /**
* A list of all block entities that require the Java block state in order to fill out their block entity information. * A list of all block entities that require the Java block state in order to fill out their block entity information.
@ -65,15 +64,9 @@ public class BlockEntityUtils {
private static final BlockEntityTranslator EMPTY_TRANSLATOR = Registries.BLOCK_ENTITIES.get("Empty"); private static final BlockEntityTranslator EMPTY_TRANSLATOR = Registries.BLOCK_ENTITIES.get("Empty");
static { static {
for (BlockEntityTranslator translator : Registries.BLOCK_ENTITIES.get().values()) { // Seeing as there are only two - and, hopefully, will only ever be two - we can hardcode this
if (!(translator instanceof BedrockOnlyBlockEntity)) { BEDROCK_ONLY_BLOCK_ENTITIES.add((BedrockOnlyBlockEntity) Registries.BLOCK_ENTITIES.get().get("Chest"));
continue; BEDROCK_ONLY_BLOCK_ENTITIES.add(new FlowerPotBlockEntityTranslator());
}
GeyserConnector.getInstance().getLogger().debug("Found Bedrock-only block entity: " + translator.getClass().getCanonicalName());
BedrockOnlyBlockEntity bedrockOnlyBlockEntity = (BedrockOnlyBlockEntity) translator;
BEDROCK_ONLY_BLOCK_ENTITIES.add(bedrockOnlyBlockEntity);
}
} }
public static String getBedrockBlockEntityId(String id) { public static String getBedrockBlockEntityId(String id) {