Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/GeyserMC/Geyser into AGGR…
Browse files Browse the repository at this point in the history
…ESSIVEfixrenderdistance
  • Loading branch information
Camotoy committed Oct 13, 2024
2 parents 523d688 + d64c0b3 commit 130aec3
Show file tree
Hide file tree
Showing 297 changed files with 39,182 additions and 4,228 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ locales/
/packs/
/dump.json
/saved-refresh-tokens.json
/saved-auth-chains.json
/custom_mappings/
/languages/
/custom-skulls.yml
/custom-skulls.yml
/permissions.yml
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ 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.20.80 - 1.21.2 and Minecraft Java 1.21
## Supported Versions
Geyser is currently supporting Minecraft Bedrock 1.20.80 - 1.21.30 and Minecraft Java 1.21/1.21.1. For more information, please see [here](https://geysermc.org/wiki/geyser/supported-versions/).

## Setting Up
Take a look [here](https://wiki.geysermc.org/geyser/setup/) for how to set up Geyser.

[![YouTube Video](https://img.youtube.com/vi/U7dZZ8w7Gi4/0.jpg)](https://www.youtube.com/watch?v=U7dZZ8w7Gi4)
Take a look [here](https://geysermc.org/wiki/geyser/setup/) for how to set up Geyser.

## Links:
- Website: https://geysermc.org
- Docs: https://wiki.geysermc.org/geyser/
- Docs: https://geysermc.org/wiki/geyser/
- Download: https://geysermc.org/download
- Discord: https://discord.gg/geysermc
- Donate: https://opencollective.com/geysermc
Expand All @@ -34,20 +33,20 @@ Take a look [here](https://wiki.geysermc.org/geyser/setup/) for how to set up Ge
- Some Entity Flags

## What can't be fixed
There are a few things Geyser is unable to support due to various differences between Minecraft Bedrock and Java. For a list of these limitations, see the [Current Limitations](https://wiki.geysermc.org/geyser/current-limitations/) page.
There are a few things Geyser is unable to support due to various differences between Minecraft Bedrock and Java. For a list of these limitations, see the [Current Limitations](https://geysermc.org/wiki/geyser/current-limitations/) page.

## Compiling
1. Clone the repo to your computer
2. Navigate to the Geyser root directory and run `git submodule update --init --recursive`. This command downloads all the needed submodules for Geyser and is a crucial step in this process.
3. Run `gradlew build` and locate to `bootstrap/build` folder.

## Contributing
Any contributions are appreciated. Please feel free to reach out to us on [Discord](http://discord.geysermc.org/) if
Any contributions are appreciated. Please feel free to reach out to us on [Discord](https://discord.gg/geysermc) if
you're interested in helping out with Geyser.

## Libraries Used:
- [Adventure Text Library](https://github.com/KyoriPowered/adventure)
- [NukkitX Bedrock Protocol Library](https://github.com/NukkitX/Protocol)
- [Steveice10's Java Protocol Library](https://github.com/Steveice10/MCProtocolLib)
- [CloudburstMC Bedrock Protocol Library](https://github.com/CloudburstMC/Protocol)
- [GeyserMC's Java Protocol Library](https://github.com/GeyserMC/MCProtocolLib)
- [TerminalConsoleAppender](https://github.com/Minecrell/TerminalConsoleAppender)
- [Simple Logging Facade for Java (slf4j)](https://github.com/qos-ch/slf4j)
3 changes: 3 additions & 0 deletions ap/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id("geyser.base-conventions")
}
18 changes: 17 additions & 1 deletion api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
plugins {
// Allow blossom to mark sources root of templates
idea
id("geyser.publish-conventions")
alias(libs.plugins.blossom)
}

dependencies {
api(libs.base.api)
api(libs.math)
}
}

version = property("version")!!
val apiVersion = (version as String).removeSuffix("-SNAPSHOT")

sourceSets {
main {
blossom {
javaSources {
property("version", apiVersion)
}
}
}
}
53 changes: 53 additions & 0 deletions api/src/main/java-templates/org/geysermc/geyser/api/BuildData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2024 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/

package org.geysermc.geyser.api;

import org.geysermc.api.util.ApiVersion;

/**
* Not a public API. For internal use only. May change without notice.
* This class is processed before compilation to insert build properties.
*/
class BuildData {
static final String VERSION = "{{ version }}";
static final ApiVersion API_VERSION;

static {
String[] parts = VERSION.split("\\.");
if (parts.length != 3) {
throw new RuntimeException("Invalid api version: " + VERSION);
}

try {
int human = Integer.parseInt(parts[0]);
int major = Integer.parseInt(parts[1]);
int minor = Integer.parseInt(parts[2]);
API_VERSION = new ApiVersion(human, major, minor);
} catch (Exception e) {
throw new RuntimeException("Invalid api version: " + VERSION, e);
}
}
}
11 changes: 11 additions & 0 deletions api/src/main/java/org/geysermc/geyser/api/GeyserApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.api.Geyser;
import org.geysermc.api.GeyserApiBase;
import org.geysermc.api.util.ApiVersion;
import org.geysermc.geyser.api.command.CommandSource;
import org.geysermc.geyser.api.connection.GeyserConnection;
import org.geysermc.geyser.api.event.EventBus;
Expand Down Expand Up @@ -169,4 +170,14 @@ public interface GeyserApi extends GeyserApiBase {
static GeyserApi api() {
return Geyser.api(GeyserApi.class);
}

/**
* Returns the {@link ApiVersion} representing the current Geyser api version.
* See the <a href="https://github.com/geysermc/api/blob/master/geyser-versioning.md">Geyser version outline</a>)
*
* @return the current geyser api version
*/
default ApiVersion geyserApiVersion() {
return BuildData.API_VERSION;
}
}
115 changes: 77 additions & 38 deletions api/src/main/java/org/geysermc/geyser/api/command/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
import org.checkerframework.checker.nullness.qual.NonNull;
import org.geysermc.geyser.api.GeyserApi;
import org.geysermc.geyser.api.connection.GeyserConnection;
import org.geysermc.geyser.api.event.lifecycle.GeyserRegisterPermissionsEvent;
import org.geysermc.geyser.api.extension.Extension;
import org.geysermc.geyser.api.util.TriState;

import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -58,15 +60,15 @@ public interface Command {
* Gets the permission node associated with
* this command.
*
* @return the permission node for this command
* @return the permission node for this command if defined, otherwise an empty string
*/
@NonNull
String permission();

/**
* Gets the aliases for this command.
* Gets the aliases for this command, as an unmodifiable list
*
* @return the aliases for this command
* @return the aliases for this command as an unmodifiable list
*/
@NonNull
List<String> aliases();
Expand All @@ -75,35 +77,39 @@ public interface Command {
* Gets if this command is designed to be used only by server operators.
*
* @return if this command is designated to be used only by server operators.
* @deprecated this method is not guaranteed to provide meaningful or expected results.
*/
boolean isSuggestedOpOnly();
@Deprecated(forRemoval = true)
default boolean isSuggestedOpOnly() {
return false;
}

/**
* Gets if this command is executable on console.
*
* @return if this command is executable on console
* @return true if this command is executable on console
* @deprecated use {@link #isPlayerOnly()} instead (inverted)
*/
boolean isExecutableOnConsole();
@Deprecated(forRemoval = true)
default boolean isExecutableOnConsole() {
return !isPlayerOnly();
}

/**
* Gets the subcommands associated with this
* command. Mainly used within the Geyser Standalone
* GUI to know what subcommands are supported.
*
* @return the subcommands associated with this command
* @return true if this command can only be used by players
*/
@NonNull
default List<String> subCommands() {
return Collections.emptyList();
}
boolean isPlayerOnly();

/**
* Used to send a deny message to Java players if this command can only be used by Bedrock players.
*
* @return true if this command can only be used by Bedrock players.
* @return true if this command can only be used by Bedrock players
*/
default boolean isBedrockOnly() {
return false;
boolean isBedrockOnly();

/**
* @deprecated this method will always return an empty immutable list
*/
@Deprecated(forRemoval = true)
@NonNull
default List<String> subCommands() {
return Collections.emptyList();
}

/**
Expand All @@ -128,86 +134,119 @@ interface Builder<T extends CommandSource> {
* is an instance of this source.
*
* @param sourceType the source type
* @return the builder
* @return this builder
*/
Builder<T> source(@NonNull Class<? extends T> sourceType);

/**
* Sets the command name.
*
* @param name the command name
* @return the builder
* @return this builder
*/
Builder<T> name(@NonNull String name);

/**
* Sets the command description.
*
* @param description the command description
* @return the builder
* @return this builder
*/
Builder<T> description(@NonNull String description);

/**
* Sets the permission node.
* Sets the permission node required to run this command. <br>
* It will not be registered with any permission registries, such as an underlying server,
* or a permissions Extension (unlike {@link #permission(String, TriState)}).
*
* @param permission the permission node
* @return the builder
* @return this builder
*/
Builder<T> permission(@NonNull String permission);

/**
* Sets the permission node and its default value. The usage of the default value is platform dependant
* and may or may not be used. For example, it may be registered to an underlying server.
* <p>
* Extensions may instead listen for {@link GeyserRegisterPermissionsEvent} to register permissions,
* especially if the same permission is required by multiple commands. Also see this event for TriState meanings.
*
* @param permission the permission node
* @param defaultValue the node's default value
* @return this builder
* @deprecated this method is experimental and may be removed in the future
*/
@Deprecated
Builder<T> permission(@NonNull String permission, @NonNull TriState defaultValue);

/**
* Sets the aliases.
*
* @param aliases the aliases
* @return the builder
* @return this builder
*/
Builder<T> aliases(@NonNull List<String> aliases);

/**
* Sets if this command is designed to be used only by server operators.
*
* @param suggestedOpOnly if this command is designed to be used only by server operators
* @return the builder
* @return this builder
* @deprecated this method is not guaranteed to produce meaningful or expected results
*/
@Deprecated(forRemoval = true)
Builder<T> suggestedOpOnly(boolean suggestedOpOnly);

/**
* Sets if this command is executable on console.
*
* @param executableOnConsole if this command is executable on console
* @return the builder
* @return this builder
* @deprecated use {@link #isPlayerOnly()} instead (inverted)
*/
@Deprecated(forRemoval = true)
Builder<T> executableOnConsole(boolean executableOnConsole);

/**
* Sets the subcommands.
* Sets if this command can only be executed by players.
*
* @param subCommands the subcommands
* @return the builder
* @param playerOnly if this command is player only
* @return this builder
*/
Builder<T> subCommands(@NonNull List<String> subCommands);
Builder<T> playerOnly(boolean playerOnly);

/**
* Sets if this command is bedrock only.
* Sets if this command can only be executed by bedrock players.
*
* @param bedrockOnly if this command is bedrock only
* @return the builder
* @return this builder
*/
Builder<T> bedrockOnly(boolean bedrockOnly);

/**
* Sets the subcommands.
*
* @param subCommands the subcommands
* @return this builder
* @deprecated this method has no effect
*/
@Deprecated(forRemoval = true)
default Builder<T> subCommands(@NonNull List<String> subCommands) {
return this;
}

/**
* Sets the {@link CommandExecutor} for this command.
*
* @param executor the command executor
* @return the builder
* @return this builder
*/
Builder<T> executor(@NonNull CommandExecutor<T> executor);

/**
* Builds the command.
*
* @return the command
* @return a new command from this builder
*/
@NonNull
Command build();
Expand Down
Loading

0 comments on commit 130aec3

Please sign in to comment.