1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

Remove outdated code for .50/.60, fix bug with reloading geyser on standalone

This commit is contained in:
onebeastchris
2025-06-23 21:14:43 +02:00
parent 7900a911ed
commit d3683b970a
7 changed files with 11 additions and 41 deletions

View File

@@ -236,6 +236,9 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
// Event must be fired after CommandRegistry has subscribed its listener.
// Also, the subscription for the Permissions class is created when Geyser is initialized.
cloud.fireRegisterPermissionsEvent();
} else {
// This isn't ideal - but geyserLogger#start won't ever finish, leading to a reloading deadlock
geyser.setReloading(false);
}
if (gui != null) {

View File

@@ -185,7 +185,8 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
/**
* Determines if we're currently reloading. Replaces per-bootstrap reload checks
*/
private volatile boolean isReloading;
@Setter
private boolean isReloading;
/**
* Determines if Geyser is currently enabled. This is used to determine if {@link #disable()} should be called during {@link #shutdown()}.

View File

@@ -87,10 +87,8 @@ public class BoatEntity extends Entity implements Leashable, Tickable {
@Override
protected void initializeMetadata() {
super.initializeMetadata();
if (GameProtocol.is1_21_70orHigher(session)) {
// Without this flag you cant stand on boats
setFlag(EntityFlag.COLLIDABLE, true);
}
// Without this flag you cant stand on boats
setFlag(EntityFlag.COLLIDABLE, true);
}
@Override

View File

@@ -89,14 +89,6 @@ public final class GameProtocol {
/* Bedrock convenience methods to gatekeep features and easily remove the check on version removal */
public static boolean isPreCreativeInventoryRewrite(int protocolVersion) {
return protocolVersion < 776;
}
public static boolean is1_21_70orHigher(GeyserSession session) {
return session.protocolVersion() >= Bedrock_v786.CODEC.getProtocolVersion();
}
public static boolean isTheOneVersionWithBrokenForms(GeyserSession session) {
return session.protocolVersion() == Bedrock_v786.CODEC.getProtocolVersion();
}

View File

@@ -70,7 +70,6 @@ import org.geysermc.geyser.item.Items;
import org.geysermc.geyser.item.type.BlockItem;
import org.geysermc.geyser.item.type.Item;
import org.geysermc.geyser.level.block.property.Properties;
import org.geysermc.geyser.network.GameProtocol;
import org.geysermc.geyser.registry.BlockRegistries;
import org.geysermc.geyser.registry.Registries;
import org.geysermc.geyser.registry.type.BlockMappings;
@@ -185,9 +184,6 @@ public class ItemRegistryPopulator {
// Used for custom items
int nextFreeBedrockId = 0;
// TODO yeet
List<ItemDefinition> componentItemData = new ObjectArrayList<>();
Int2ObjectMap<ItemDefinition> registry = new Int2ObjectOpenHashMap<>();
Map<String, ItemDefinition> definitions = new Object2ObjectLinkedOpenHashMap<>();
@@ -252,13 +248,7 @@ public class ItemRegistryPopulator {
}
});
List<CreativeItemGroup> creativeItemGroups;
if (GameProtocol.isPreCreativeInventoryRewrite(palette.protocolVersion)) {
creativeItemGroups = new ArrayList<>();
} else {
creativeItemGroups = CreativeItemRegistryPopulator.readCreativeItemGroups(palette, creativeItems);
}
List<CreativeItemGroup> creativeItemGroups = CreativeItemRegistryPopulator.readCreativeItemGroups(palette, creativeItems);
BlockMappings blockMappings = BlockRegistries.BLOCKS.forVersion(palette.protocolVersion());
Set<Item> javaOnlyItems = new ObjectOpenHashSet<>();
@@ -511,9 +501,6 @@ public class ItemRegistryPopulator {
.build(), creativeNetId.get(), customItem.creativeCategory().getAsInt());
creativeItems.add(creativeItemData);
}
// ComponentItemData - used to register some custom properties
componentItemData.add(customMapping.itemDefinition());
customItemOptions.add(Pair.of(customItem.customItemOptions(), customMapping.itemDefinition()));
registry.put(customMapping.integerId(), customMapping.itemDefinition());
@@ -578,7 +565,6 @@ public class ItemRegistryPopulator {
ItemDefinition definition = new SimpleItemDefinition("geysermc:furnace_minecart", furnaceMinecartId, ItemVersion.DATA_DRIVEN, true, registerFurnaceMinecart(furnaceMinecartId));
definitions.put("geysermc:furnace_minecart", definition);
registry.put(definition.getRuntimeId(), definition);
componentItemData.add(definition);
mappings.set(Items.FURNACE_MINECART.javaId(), ItemMapping.builder()
.javaItem(Items.FURNACE_MINECART)
@@ -609,7 +595,6 @@ public class ItemRegistryPopulator {
int customItemId = nextFreeBedrockId++;
NonVanillaItemRegistration registration = CustomItemRegistryPopulator.registerCustomItem(customItem, customItemId, palette.protocolVersion);
componentItemData.add(registration.mapping().getBedrockDefinition());
ItemMapping mapping = registration.mapping();
Item javaItem = registration.javaItem();
while (javaItem.javaId() >= mappings.size()) {
@@ -672,7 +657,6 @@ public class ItemRegistryPopulator {
.creativeItems(creativeItems)
.creativeItemGroups(creativeItemGroups)
.itemDefinitions(registry)
.componentItemData(componentItemData)
.storedItems(new StoredItemMappings(javaItemToMapping))
.javaOnlyItems(javaOnlyItems)
.buckets(buckets)

View File

@@ -71,8 +71,6 @@ public class ItemMappings implements DefinitionRegistry<ItemDefinition> {
List<ItemDefinition> buckets;
List<ItemDefinition> boats;
List<ItemDefinition> componentItemData; // TODO get rid of?
Int2ObjectMap<String> customIdMappings;
Object2ObjectMap<CustomBlockData, ItemDefinition> customBlockItemDefinitions;

View File

@@ -810,15 +810,9 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
sentSpawnPacket = true;
syncEntityProperties();
if (GameProtocol.isPreCreativeInventoryRewrite(this.protocolVersion())) {
ItemComponentPacket componentPacket = new ItemComponentPacket();
componentPacket.getItems().addAll(itemMappings.getComponentItemData());
upstream.sendPacket(componentPacket);
} else {
ItemComponentPacket componentPacket = new ItemComponentPacket();
componentPacket.getItems().addAll(itemMappings.getItemDefinitions().values());
upstream.sendPacket(componentPacket);
}
ItemComponentPacket componentPacket = new ItemComponentPacket();
componentPacket.getItems().addAll(itemMappings.getItemDefinitions().values());
upstream.sendPacket(componentPacket);
ChunkUtils.sendEmptyChunks(this, playerEntity.getPosition().toInt(), 0, false);