mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Merge remote-tracking branch 'upstream/master' into feature/blocky
This commit is contained in:
commit
7327e275ef
11 changed files with 93 additions and 43 deletions
10
.github/workflows/build.yml
vendored
10
.github/workflows/build.yml
vendored
|
@ -106,12 +106,18 @@ jobs:
|
|||
# Save the private key to a file
|
||||
echo "$DOWNLOADS_PRIVATE_KEY" > id_ecdsa
|
||||
chmod 600 id_ecdsa
|
||||
# Set the project
|
||||
project=geyser
|
||||
# Get the version from gradle.properties
|
||||
version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2)
|
||||
# Create the build folder
|
||||
ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP mkdir -p "~/uploads/$project/$GITHUB_RUN_NUMBER/"
|
||||
# Copy over artifacts
|
||||
scp -B -o StrictHostKeyChecking=no -i id_ecdsa bootstrap/**/build/libs/Geyser-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/files/
|
||||
rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" bootstrap/**/build/libs/Geyser-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$project/$GITHUB_RUN_NUMBER/
|
||||
# Run the build script
|
||||
ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP ./handleBuild.sh geyser $version $GITHUB_RUN_NUMBER $GITHUB_SHA
|
||||
# Push the metadata
|
||||
echo "{\"project\": \"$project\", \"version\": \"$version\", \"id\": $GITHUB_RUN_NUMBER, \"commit\": \"$GITHUB_SHA\"}" > metadata.json
|
||||
rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" metadata.json $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$project/$GITHUB_RUN_NUMBER/
|
||||
|
||||
- name: Notify Discord
|
||||
if: ${{ (success() || failure()) && github.repository == 'GeyserMC/Geyser' }}
|
||||
|
|
31
.github/workflows/publish.yml
vendored
Normal file
31
.github/workflows/publish.yml
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
name: Publish
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths-ignore:
|
||||
- '.github/ISSUE_TEMPLATE/*.yml'
|
||||
- '.github/actions/pullrequest.yml'
|
||||
- '.idea/copyright/*.xml'
|
||||
- '.gitignore'
|
||||
- 'CONTRIBUTING.md'
|
||||
- 'LICENSE'
|
||||
- 'Jenkinsfile '
|
||||
- 'README.md'
|
||||
- 'licenseheader.txt'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Publish to Modrinth
|
||||
env:
|
||||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|
||||
run: ./gradlew fabric:modrinth
|
|
@ -1,9 +1,6 @@
|
|||
<img src="https://geysermc.org/img/geyser-1760-860.png" alt="Geyser" width="600"/>
|
||||
|
||||
[![forthebadge made-with-java](https://forthebadge.com/images/badges/made-with-java.svg)](https://java.com/)
|
||||
|
||||
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
|
||||
[![Build Status](https://ci.opencollab.dev/job/Geyser/job/master/badge/icon)](https://ci.opencollab.dev/job/GeyserMC/job/Geyser/job/master/)
|
||||
[![Discord](https://img.shields.io/discord/613163671870242838.svg?color=%237289da&label=discord)](https://discord.gg/geysermc)
|
||||
[![Crowdin](https://badges.crowdin.net/geyser/localized.svg)](https://translate.geysermc.org/)
|
||||
|
||||
|
@ -17,7 +14,7 @@ The ultimate goal of this project is to allow Minecraft: Bedrock Edition users t
|
|||
|
||||
Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have joined us here!
|
||||
|
||||
### Currently supporting Minecraft Bedrock 1.19.30 - 1.19.70 and Minecraft Java 1.19.4.
|
||||
### Currently supporting Minecraft Bedrock 1.19.30 - 1.19.71 and Minecraft Java 1.19.4.
|
||||
|
||||
## Setting Up
|
||||
Take a look [here](https://wiki.geysermc.org/geyser/setup/) for how to set up Geyser.
|
||||
|
@ -27,7 +24,7 @@ Take a look [here](https://wiki.geysermc.org/geyser/setup/) for how to set up Ge
|
|||
## Links:
|
||||
- Website: https://geysermc.org
|
||||
- Docs: https://wiki.geysermc.org/geyser/
|
||||
- Download: https://ci.geysermc.org
|
||||
- Download: https://geysermc.org/download
|
||||
- Discord: https://discord.gg/geysermc
|
||||
- Donate: https://opencollective.com/geysermc
|
||||
- Test Server: `test.geysermc.org` port `25565` for Java and `19132` for Bedrock
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
plugins {
|
||||
id("fabric-loom") version "1.0-SNAPSHOT"
|
||||
id("com.modrinth.minotaur") version "2.+"
|
||||
}
|
||||
|
||||
java {
|
||||
|
@ -74,4 +75,22 @@ tasks {
|
|||
archiveClassifier.set("")
|
||||
archiveVersion.set("")
|
||||
}
|
||||
}
|
||||
|
||||
modrinth {
|
||||
projectId.set("wKkoqHrH")
|
||||
versionNumber.set(project.version as String + "-" + System.getenv("GITHUB_RUN_NUMBER"))
|
||||
versionType.set("beta")
|
||||
changelog.set("A changelog can be found at https://github.com/GeyserMC/Geyser/commits")
|
||||
|
||||
syncBodyFrom.set(rootProject.file("README.md").readText())
|
||||
|
||||
uploadFile.set(tasks.getByPath("remapJar"))
|
||||
gameVersions.addAll("1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4")
|
||||
|
||||
loaders.add("fabric")
|
||||
|
||||
dependencies {
|
||||
required.project("fabric-api")
|
||||
}
|
||||
}
|
|
@ -68,7 +68,6 @@ public final class BlockStateValues {
|
|||
|
||||
public static final int JAVA_AIR_ID = 0;
|
||||
|
||||
public static int JAVA_BELL_ID;
|
||||
public static int JAVA_COBWEB_ID;
|
||||
public static int JAVA_FURNACE_ID;
|
||||
public static int JAVA_FURNACE_LIT_ID;
|
||||
|
|
|
@ -49,7 +49,7 @@ public final class GameProtocol {
|
|||
*/
|
||||
public static final BedrockPacketCodec DEFAULT_BEDROCK_CODEC = Bedrock_v567patch.BEDROCK_V567PATCH.toBuilder()
|
||||
.protocolVersion(575)
|
||||
.minecraftVersion("1.19.70")
|
||||
.minecraftVersion("1.19.71")
|
||||
.build();
|
||||
/**
|
||||
* A list of all supported Bedrock versions that can join Geyser
|
||||
|
@ -77,7 +77,9 @@ public final class GameProtocol {
|
|||
.protocolVersion(568)
|
||||
.minecraftVersion("1.19.62")
|
||||
.build());
|
||||
SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC);
|
||||
SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC.toBuilder()
|
||||
.minecraftVersion("1.19.70/1.19.71")
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -294,7 +294,6 @@ public final class BlockRegistryPopulator {
|
|||
Deque<String> cleanIdentifiers = new ArrayDeque<>();
|
||||
|
||||
int javaRuntimeId = -1;
|
||||
int bellBlockId = -1;
|
||||
int cobwebBlockId = -1;
|
||||
int furnaceRuntimeId = -1;
|
||||
int furnaceLitRuntimeId = -1;
|
||||
|
@ -371,10 +370,7 @@ public final class BlockRegistryPopulator {
|
|||
// It's possible to only have this store differences in names, but the key set of all Java names is used in sending command suggestions
|
||||
BlockRegistries.JAVA_TO_BEDROCK_IDENTIFIERS.register(cleanJavaIdentifier.intern(), bedrockIdentifier.intern());
|
||||
|
||||
if (javaId.startsWith("minecraft:bell[")) {
|
||||
bellBlockId = uniqueJavaId;
|
||||
|
||||
} else if (javaId.contains("cobweb")) {
|
||||
if (javaId.contains("cobweb")) {
|
||||
cobwebBlockId = uniqueJavaId;
|
||||
|
||||
} else if (javaId.startsWith("minecraft:furnace[facing=north")) {
|
||||
|
@ -395,10 +391,6 @@ public final class BlockRegistryPopulator {
|
|||
slimeBlockRuntimeId = javaRuntimeId;
|
||||
}
|
||||
}
|
||||
if (bellBlockId == -1) {
|
||||
throw new AssertionError("Unable to find bell in palette");
|
||||
}
|
||||
BlockStateValues.JAVA_BELL_ID = bellBlockId;
|
||||
|
||||
if (cobwebBlockId == -1) {
|
||||
throw new AssertionError("Unable to find cobwebs in palette");
|
||||
|
|
|
@ -79,21 +79,23 @@ public class BedrockInteractTranslator extends PacketTranslator<InteractPacket>
|
|||
session.sendDownstreamPacket(sneakPacket);
|
||||
|
||||
Entity currentVehicle = session.getPlayerEntity().getVehicle();
|
||||
session.setMountVehicleScheduledFuture(session.scheduleInEventLoop(() -> {
|
||||
if (session.getPlayerEntity().getVehicle() == null) {
|
||||
return;
|
||||
}
|
||||
if (currentVehicle != null) {
|
||||
session.setMountVehicleScheduledFuture(session.scheduleInEventLoop(() -> {
|
||||
if (session.getPlayerEntity().getVehicle() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
long vehicleBedrockId = currentVehicle.getGeyserId();
|
||||
if (session.getPlayerEntity().getVehicle().getGeyserId() == vehicleBedrockId) {
|
||||
// The Bedrock client, as of 1.19.51, dismounts on its end. The server may not agree with this.
|
||||
// If the server doesn't agree with our dismount (sends a packet saying we dismounted),
|
||||
// then remount the player.
|
||||
SetEntityLinkPacket linkPacket = new SetEntityLinkPacket();
|
||||
linkPacket.setEntityLink(new EntityLinkData(vehicleBedrockId, session.getPlayerEntity().getGeyserId(), EntityLinkData.Type.PASSENGER, true, false));
|
||||
session.sendUpstreamPacket(linkPacket);
|
||||
}
|
||||
}, 1, TimeUnit.SECONDS));
|
||||
long vehicleBedrockId = currentVehicle.getGeyserId();
|
||||
if (session.getPlayerEntity().getVehicle().getGeyserId() == vehicleBedrockId) {
|
||||
// The Bedrock client, as of 1.19.51, dismounts on its end. The server may not agree with this.
|
||||
// If the server doesn't agree with our dismount (sends a packet saying we dismounted),
|
||||
// then remount the player.
|
||||
SetEntityLinkPacket linkPacket = new SetEntityLinkPacket();
|
||||
linkPacket.setEntityLink(new EntityLinkData(vehicleBedrockId, session.getPlayerEntity().getGeyserId(), EntityLinkData.Type.PASSENGER, true, false));
|
||||
session.sendUpstreamPacket(linkPacket);
|
||||
}
|
||||
}, 1, TimeUnit.SECONDS));
|
||||
}
|
||||
break;
|
||||
case MOUSEOVER:
|
||||
// Handle the buttons for mobile - "Mount", etc; and the suggestions for console - "ZL: Mount", etc
|
||||
|
|
|
@ -199,9 +199,10 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
|
|||
*/
|
||||
private static CommandParamData[][] getParams(GeyserSession session, CommandNode commandNode, CommandNode[] allNodes) {
|
||||
// Check if the command is an alias and redirect it
|
||||
if (commandNode.getRedirectIndex() != -1) {
|
||||
GeyserImpl.getInstance().getLogger().debug("Redirecting command " + commandNode.getName() + " to " + allNodes[commandNode.getRedirectIndex()].getName());
|
||||
commandNode = allNodes[commandNode.getRedirectIndex()];
|
||||
if (commandNode.getRedirectIndex().isPresent()) {
|
||||
int redirectIndex = commandNode.getRedirectIndex().getAsInt();
|
||||
GeyserImpl.getInstance().getLogger().debug("Redirecting command " + commandNode.getName() + " to " + allNodes[redirectIndex].getName());
|
||||
commandNode = allNodes[redirectIndex];
|
||||
}
|
||||
|
||||
if (commandNode.getChildIndices().length >= 1) {
|
||||
|
|
|
@ -103,7 +103,7 @@ public class JavaBlockEventTranslator extends PacketTranslator<ClientboundBlockE
|
|||
} else if (packet.getValue() instanceof EndGatewayValue) {
|
||||
blockEventPacket.setEventType(1);
|
||||
session.sendUpstreamPacket(blockEventPacket);
|
||||
} else if (packet.getValue() instanceof GenericBlockValue bellValue && packet.getBlockId() == BlockStateValues.JAVA_BELL_ID) {
|
||||
} else if (packet.getValue() instanceof BellValue bellValue) {
|
||||
// Bells - needed to show ring from other players
|
||||
BlockEntityDataPacket blockEntityPacket = new BlockEntityDataPacket();
|
||||
blockEntityPacket.setBlockPosition(position);
|
||||
|
@ -113,11 +113,12 @@ public class JavaBlockEventTranslator extends PacketTranslator<ClientboundBlockE
|
|||
builder.putInt("y", position.getY());
|
||||
builder.putInt("z", position.getZ());
|
||||
builder.putString("id", "Bell");
|
||||
int bedrockRingDirection = switch (bellValue.getValue()) {
|
||||
case 3 -> 0; // north
|
||||
case 4 -> 1; // east
|
||||
case 5 -> 3;// west
|
||||
default -> bellValue.getValue(); // south (2) is identical
|
||||
int bedrockRingDirection = switch (bellValue.getDirection()) {
|
||||
case SOUTH -> 0;
|
||||
case WEST -> 1;
|
||||
case NORTH -> 2;
|
||||
case EAST -> 3;
|
||||
default -> throw new IllegalStateException("Unexpected BellValue Direction: " + bellValue.getDirection());
|
||||
};
|
||||
builder.putInt("Direction", bedrockRingDirection);
|
||||
builder.putByte("Ringing", (byte) 1);
|
||||
|
|
|
@ -11,7 +11,7 @@ websocket = "1.5.1"
|
|||
protocol = "2.9.17-20230217.002312-1"
|
||||
raknet = "1.6.28-20220125.214016-6"
|
||||
mcauthlib = "d9d773e"
|
||||
mcprotocollib = "1.19.4-20230317.173631-4"
|
||||
mcprotocollib = "1.19.4-20230319.175814-6"
|
||||
adventure = "4.12.0-20220629.025215-9"
|
||||
adventure-platform = "4.1.2"
|
||||
junit = "5.9.2"
|
||||
|
|
Loading…
Reference in a new issue