Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update custom-entities to 1.19.2 #3204

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
a4399f0
Implemented Floodgate's 'packet' plugin message
Tim203 Dec 15, 2021
9c672c9
Packet ids can't be negative
Tim203 Dec 16, 2021
3011d89
Update Geyser to use the latest features of Cumulus 1.1
Tim203 Jan 22, 2022
53de9f4
Deploy the Cumulus changes for Geyser so Floodgate can use them
Tim203 Jan 26, 2022
2573b47
Actually deploy
Tim203 Jan 26, 2022
05e98c3
Fix edge case in health code since 1.18.30
Camotoy May 4, 2022
f38c1fb
Spigot: programmatically add Geyser permissions and fix reloading
Camotoy May 6, 2022
db13b4c
Fix decoding for some UTF-8 characters
Camotoy May 10, 2022
b33cc51
Add custom skull render distance (#2751)
davchoo May 14, 2022
b885e22
Always show the world border at least five blocks away
Camotoy May 15, 2022
8c9d1fe
Allow language file overrides
Camotoy May 15, 2022
c3c8161
Bump gson from 2.8.6 to 2.8.9 in /common (#2982)
dependabot[bot] May 21, 2022
3862531
Prevent max health from being set below 0 (#2980)
davchoo May 21, 2022
5339127
Start work on 1.19
Camotoy May 24, 2022
bbf45b6
Compiles; provide your own mappings for now
Camotoy May 25, 2022
193fa23
Paintings work
Camotoy May 25, 2022
ebf18cf
Switch all Position instances to Vector3i
Camotoy May 25, 2022
1a7b570
Chat messages now show up correctly.
Camotoy May 26, 2022
c5de293
Allow 1.19.0 to join and use new block mappings
davchoo May 25, 2022
66a7efa
Yeet 1.18.30 and old palette stuff
davchoo May 26, 2022
9183897
Implement chest boat
Camotoy May 26, 2022
2c77306
Use new toasts for advancements and simplify advancement form response
davchoo May 26, 2022
59cb0c0
Start implementing frogs. Ribbit.
Camotoy May 26, 2022
4b9055c
Add new PaintingTypes
davchoo May 26, 2022
29c819f
Implement allay, plus some interaction fixes
Camotoy May 26, 2022
d74b0e2
Fix encoding SpawnParticleEffectPacket for 1.18.30+
Camotoy May 26, 2022
83c3097
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feat…
Camotoy May 26, 2022
a70f1bc
Reinforced deepslate can't be moved by pistons
davchoo May 26, 2022
e2ce553
Warden time
Camotoy May 26, 2022
85800eb
Tadpole
Camotoy May 26, 2022
4a9eec4
Implement last death position translation
Camotoy May 26, 2022
41cd7f4
SoundEvent and ParticleEvent are now combined
davchoo May 26, 2022
3898e4f
add Swift Sneak enchantment to known enchantments
Camotoy May 27, 2022
8e3119c
Update README for supported versions
Camotoy May 27, 2022
f079ee4
Fix missing startup debug logs on Standalone
davchoo May 19, 2022
528e8d6
Add effects for sculk shrieker and sculk catalyst. Translate vibratio…
davchoo May 27, 2022
1afc8ee
Map Darkness status effect
Camotoy May 27, 2022
7b9a98a
Add croaking and using tongue poses to frog
davchoo May 27, 2022
87320f0
Fix player head yaw for moveAbsolute teleport
davchoo May 27, 2022
b10ce16
The wild update experiment is no longer necessary
Camotoy May 28, 2022
d4ecd2b
Merge remote-tracking branch 'origin/master' into feature/cumulus-1.1
Tim203 May 28, 2022
84bcadc
Converted the new forms
Tim203 May 28, 2022
cbba0d3
Update biome mappings
Camotoy May 29, 2022
bd1cc26
Use new Cumulus methods
Tim203 May 29, 2022
f79a3ef
Bump Protocol version to fix command suggestions
davchoo May 29, 2022
7a0a679
Remove now-obsolete sign workaround. Yay.
Camotoy May 30, 2022
e43a143
Remove obsolete chunk writing code
Camotoy May 30, 2022
a3cdfc5
Use correct type for entity metadata
Camotoy May 30, 2022
9133008
Translate ClientboundSoundEntityPacket
davchoo May 30, 2022
c83eb7f
Print CPU name in dump if possible
Camotoy May 30, 2022
bf4e1d5
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feat…
Camotoy May 31, 2022
196742a
Set entities silent client-side, and more
Camotoy May 31, 2022
81bb6f1
e
Camotoy May 31, 2022
eb23a46
Fix frog color translation
Camotoy May 31, 2022
365f8cf
Translate Warden sonic boom event
davchoo May 31, 2022
2e3e7c6
Fix sonic boom duration ticking below zero
davchoo May 31, 2022
3ac2c98
Swap pitch and volume for warden heartbeat
Camotoy Jun 2, 2022
56daefb
Update PaperMC repo
Redned235 Jun 5, 2022
bcc68ee
Update to latest MCPL changes
Redned235 Jun 5, 2022
94445a5
Re-added the old sendForm methods
Tim203 Jun 5, 2022
09fb6bf
Fix direct connection and ensure connecting doesn't block
Camotoy Jun 5, 2022
86d0200
Re-added the old sendForm methods
Tim203 Jun 6, 2022
5fe24ac
Merge remote-tracking branch 'origin/feature/1.19-bedrock' into featu…
Tim203 Jun 6, 2022
3582d5c
Changed back the Geyser version and use Cumulus 1.1
Tim203 Jun 6, 2022
d8b63b9
Merge remote-tracking branch 'origin/feature/1.19-bedrock' into featu…
Tim203 Jun 6, 2022
378aa6e
Updated changes for latest Geyser version
Tim203 Jun 6, 2022
a397f55
Add goat horn count
Camotoy Jun 7, 2022
172167f
Prepare for release
Camotoy Jun 7, 2022
c8856d4
Compile too
Camotoy Jun 7, 2022
2595eae
Bump to 2.0.4-SNAPSHOT
Camotoy Jun 7, 2022
5a1e6a6
Fix Geyser booting on Spigot 1.19
Camotoy Jun 7, 2022
78bb69b
Fix LevelEvent reading
Camotoy Jun 7, 2022
4e2f744
Updated to 1.19
ImDaBigBoss Jun 8, 2022
72a9df5
Properly support differently setup chat registries
Camotoy Jun 9, 2022
f1a12d1
Bump mappings and MCProtocolLib
Camotoy Jun 9, 2022
691d674
Use PaperServerListPingEvent when available
Camotoy Jun 10, 2022
162aff4
Better handle chat packets sent before login
Camotoy Jun 10, 2022
795bec9
Fixed plugin.yml for spigot
ImDaBigBoss Jun 11, 2022
db00329
Merge master
ImDaBigBoss Jun 12, 2022
474153f
Merge pull request #3020 from ImDaBigBoss/extensions-1.19
Camotoy Jun 13, 2022
4a9581c
Update Spigot adapters for 1.19
Camotoy Jun 13, 2022
aa097ec
Fix java style queries responding incorrectly (#3051)
rtm516 Jun 14, 2022
ddd2262
Custom chat types at login are valid
Camotoy Jun 15, 2022
4405989
Fix compiling
Camotoy Jun 15, 2022
7739e80
Another locale string to pick up on for outdated servers
Camotoy Jun 15, 2022
ea21e03
Map correct glass sounds
Camotoy Jun 16, 2022
5e1769d
Translate goat horns (#3057)
davchoo Jun 16, 2022
5b67c78
Allow Minecraft locales to be loaded even if offline
Camotoy Jun 16, 2022
71c489b
Add missing villager entity events (#3063)
AJ-Ferguson Jun 17, 2022
fef0401
Fixed armorstand passenger yOffset (#2976)
Xamyrz Jun 18, 2022
18f6836
Set default Warden heartBeatDelay to 40 (#3071)
AJ-Ferguson Jun 18, 2022
08241b8
Spigot: Ensure surprise method/constructor changes won't stop ping pa…
Camotoy Jun 21, 2022
3a5e5fe
Update Paper APIs to 1.19; fix ping passthrough for new Spigot+ build…
JulianVennen Jun 23, 2022
23923d7
Ensure old Paper builds can still use ping passthrough
Camotoy Jun 23, 2022
6032733
Indicate support for Bedrock 1.19.2
Camotoy Jun 24, 2022
9ea2204
Fix some item interactions (#3083)
davchoo Jun 24, 2022
2ea5011
Forward cooldowns for shields and goats
Camotoy Jun 25, 2022
00603c5
Fix creeper primed sound
Camotoy Jun 26, 2022
5d29bda
Fix incorrect patterns in loom and DecoderException in beacons (#3090)
davchoo Jun 26, 2022
f62484b
Update Adventure to fix click event deserialization
Camotoy Jun 29, 2022
b2b544c
Jump to new wiki (#3100)
Jun 30, 2022
13e8b59
Quick fix for NPE in SystemChatTranslator
Camotoy Jun 30, 2022
f2f894b
Fix IronGolem cracked texture and sound (#3103)
AJ-Ferguson Jun 30, 2022
36c49a7
Custom item support for extensions (#2822)
ImDaBigBoss Jul 2, 2022
b5eb276
Use an immutable view in GeyserDefineCommandsEvent
Redned235 Jul 2, 2022
f9fd7cb
Fix Geyser not working in IDE
Redned235 Jul 2, 2022
dc810f1
Fix break time while submerged in water (#3110)
davchoo Jul 3, 2022
ab4800c
Fix login screen not closing (#3122)
Yashar256 Jul 8, 2022
897c4dc
Changes
Camotoy Jul 9, 2022
2ce7ff8
Support the 1.19.0 Java block prediction/ack system
Camotoy Jul 10, 2022
4d0952c
Initial support for 1.19.10 Bedrock
Camotoy Jul 10, 2022
fa72609
A cleaner error on illegal set slot packet
Camotoy Jul 10, 2022
4656383
Bump to 2.0.5-SNAPSHOT
Camotoy Jul 10, 2022
83ba6b5
Extensions have their own command
Camotoy Jul 11, 2022
16bb79e
Support HAProxy in legacy ping passthrough
Camotoy Jul 11, 2022
363d72d
Merge remote-tracking branch 'origin/master' into feature/extensions
Kas-tle Jul 12, 2022
bca6359
1.19.10 fallout
Kas-tle Jul 12, 2022
a12c74c
Build on Java 17
Kas-tle Jul 12, 2022
8b9f41d
Java 17 (Jenkinsfile)
Kas-tle Jul 12, 2022
2dbd39c
Per review by @Camotoy
Kas-tle Jul 12, 2022
d1fbb90
fixed java 16 thanks to @davchoo
Kas-tle Jul 12, 2022
109e1c0
Fix dropping items in 1.19.10
Camotoy Jul 12, 2022
1b5f237
Merge remote-tracking branch 'upstream/master' into feature/extensions
Kas-tle Jul 12, 2022
0335c82
Address @Camotoy's review
Kas-tle Jul 13, 2022
f6f8886
Fix PS4 players crashing on certain dimension switches
Camotoy Jul 14, 2022
46faf02
Merge remote-tracking branch 'upstream/master' into feature/extensions
Kas-tle Jul 14, 2022
240af3c
Merge pull request #3131 from Kas-tle/feature/extensions
Camotoy Jul 14, 2022
fcd5678
This was supposed to be a debug log
Camotoy Jul 16, 2022
192ea1a
Update Geyser-Fabric build propagation (#3145)
Konicai Jul 16, 2022
3de2b33
Armor stand fixes (#3147)
davchoo Jul 18, 2022
4672860
Update items to 1.19.10 (#3151)
sctigercat1 Jul 20, 2022
616c088
Fix custom items with ItemTranslator#getBedrockItemMapping
Camotoy Jul 20, 2022
0efd04d
Initial code for `/geyser connectiontest`
Camotoy Jul 20, 2022
25289a3
Error out gracefully when Velocity is outdated
Camotoy Jul 23, 2022
76bb5d4
Fix persistent FOV when walk speed is ever set to zero
Camotoy Jul 23, 2022
4127300
Fix chunks on Hypixel
Camotoy Jul 24, 2022
a18ac29
Initial 1.19.1 Java support
Camotoy Jul 24, 2022
f4a5ccb
Empty villager trades are valid
Camotoy Jul 24, 2022
40fde6b
Some nitpicks and cleaning up the provider API
Camotoy Jul 26, 2022
45b05d1
Compiles; bump version
Camotoy Jul 27, 2022
c914938
Fix clientbound action serialization
Camotoy Jul 27, 2022
4163de9
Translate allay dancing
Camotoy Jul 28, 2022
8f89647
Merge branch 'feature/1.19.1'
Camotoy Jul 28, 2022
d826949
Indicate support for Bedrock 1.19.11
Camotoy Jul 28, 2022
ab5e5a6
Update wording on `saved-user-logins`
Camotoy Aug 1, 2022
51d9320
Bungee: Check for potentially outdated proxies
Camotoy Aug 1, 2022
6856922
Don't let players change their own gamemode without permission
Camotoy Aug 1, 2022
aee43e6
Merge remote-tracking branch 'upstream/master' into feature/extensions
Konicai Aug 2, 2022
7121051
Merge mistake fixes
Konicai Aug 2, 2022
17f3deb
try to reset languages
Konicai Aug 2, 2022
684b9c2
Merge pull request #3194 from Konicai/ext-1.19.1
Camotoy Aug 3, 2022
67e3bf1
Move extensions folder to Geyser's config folder (#3202)
Konicai Aug 4, 2022
641e4dd
Merge remote-tracking branch 'upstream/feature/extensions' into custo…
Konicai Aug 5, 2022
d04d2e8
add EntityDefinition and EntityIdentifier Builders to provider registry
Konicai Aug 5, 2022
58a5fca
Fix merge issues and update 1.19.1 entities
Konicai Aug 5, 2022
7b2e38d
Remove some unnecessary imports
Konicai Aug 5, 2022
135344b
Undo languages change (oopsie)
Konicai Aug 5, 2022
3c27273
Indicate support for Java 1.19.2
Camotoy Aug 5, 2022
f74713c
Initial support for 1.19.20 Bedrock
Camotoy Aug 7, 2022
ee5e916
Merge remote-tracking branch 'upstream/master' into ext-1.19.20
Konicai Aug 9, 2022
b9646b9
Merge pull request #3213 from Konicai/ext-1.19.20
Camotoy Aug 9, 2022
ef81bde
Update items to 1.19.20 (#3215)
7man7LMYT Aug 9, 2022
eab92da
Fix form responses on 1.19.20
Camotoy Aug 9, 2022
259fed2
Merge remote-tracking branch 'upstream/master' into ext-1.19.20-fixes
Konicai Aug 9, 2022
88727fb
Bump Geyser to version 2.0.7-SNAPSHOT and default Bedrock to 1.19.20
Camotoy Aug 10, 2022
ef8130e
Update README
Camotoy Aug 10, 2022
25a18a2
Fix maps not loading in Bedrock (#3218)
davchoo Aug 10, 2022
ab2b794
Fix sending forms with floodgate for 1.19.20 (#3217)
Konicai Aug 10, 2022
678e285
Bump Cumulus version to 1.1.1
Tim203 Aug 10, 2022
8b57a7c
Use StandardCharsets instead of Charsets
Tim203 Aug 10, 2022
737df21
Merge remote-tracking branch 'upstream/master' into ext-1.19.20-fixes
Konicai Aug 10, 2022
2a2e63e
Explicitly set gson dependency in common
Konicai Aug 10, 2022
50ea5ea
Set baby if armor stand is small for OptionalPack (#3210)
Kas-tle Aug 10, 2022
62f9ef7
Merge pull request #3216 from Konicai/ext-1.19.20-fixes
Camotoy Aug 10, 2022
fd4f683
Merge pull request #1 from TypicalShavonne/master
TypicalShavonne Aug 11, 2022
9412458
Merge pull request #3228 from TypicalShavonne/feature/extensions
Camotoy Aug 11, 2022
b69089d
Merge remote-tracking branch 'upstream/feature/extensions' into custo…
Konicai Aug 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
blank_issues_enabled: false
contact_links:
- name: Common Issues
url: https://github.com/GeyserMC/Geyser/wiki/Common-Issues
url: https://wiki.geysermc.org/geyser/common-issues
about: Check the common issues to see if you are not alone with that issue and see how you can fix them.
- name: Frequently Asked Questions
url: https://github.com/GeyserMC/Geyser/wiki/FAQ
url: https://wiki.geysermc.org/geyser/faq
about: Look at the FAQ page for answers to frequently asked questions.
- name: Get help on the GeyserMC Discord server
url: https://discord.gg/geysermc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
distribution: 'temurin'
java-version: 16
java-version: 17
cache: 'gradle'
- name: submodules-init
uses: snickerbockers/submodules-init@v4
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,6 @@ locales/
/cache/
/packs/
/dump.json
/saved-refresh-tokens.json
/saved-refresh-tokens.json
/custom_mappings/
/languages/
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pipeline {
agent any
tools {
gradle 'Gradle 7'
jdk 'Java 16'
jdk 'Java 17'
}
options {
buildDiscarder(logRotator(artifactNumToKeepStr: '20'))
Expand Down Expand Up @@ -102,7 +102,7 @@ pipeline {
success {
script {
if (env.BRANCH_NAME == 'master') {
build propagate: false, wait: false, job: 'GeyserMC/Geyser-Fabric/java-1.18', parameters: [booleanParam(name: 'SKIP_DISCORD', value: true)]
build propagate: false, wait: false, job: 'GeyserMC/Geyser-Fabric/master', parameters: [booleanParam(name: 'SKIP_DISCORD', value: true)]
build propagate: false, wait: false, job: 'GeyserMC/GeyserConnect/master', parameters: [booleanParam(name: 'SKIP_DISCORD', value: true)]
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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.18.0 - 1.18.31 and Minecraft Java 1.18.2.
### Currently supporting Minecraft Bedrock 1.19.0/1.19.1x/1.19.20 and Minecraft Java 1.19.1/1.19.2.

## Setting Up
Take a look [here](https://wiki.geysermc.org/geyser/setup/) for how to set up Geyser.
Expand Down
2 changes: 1 addition & 1 deletion api/base/src/main/java/org/geysermc/api/GeyserApiBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public interface GeyserApiBase {
* @return the major API version. Bumped whenever a significant breaking change or feature addition is added.
*/
default int majorApiVersion() {
return 0;
return 1;
}

/**
Expand Down
40 changes: 8 additions & 32 deletions api/geyser/src/main/java/org/geysermc/geyser/api/GeyserApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.geysermc.geyser.api.extension.ExtensionManager;
import org.geysermc.geyser.api.network.BedrockListener;
import org.geysermc.geyser.api.network.RemoteServer;
import org.geysermc.geyser.api.provider.ProviderManager;

import java.util.List;
import java.util.UUID;
Expand All @@ -44,24 +43,6 @@
* Represents the API used in Geyser.
*/
public interface GeyserApi extends GeyserApiBase {
/**
* Shuts down the current Geyser instance.
*/
void shutdown();

/**
* Reloads the current Geyser instance.
*/
void reload();

/**
* Gets if this Geyser instance is running in an IDE. This only needs to be used in cases where files
* expected to be in a jarfile are not present.
*
* @return if we are in a production environment
*/
boolean isProductionEnvironment();

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -101,11 +82,15 @@ public interface GeyserApi extends GeyserApiBase {
CommandManager commandManager();

/**
* Gets the {@link ProviderManager}.
* Provides an implementation for the specified API type.
*
* @return the provider manager
* @param apiClass the builder class
* @param <R> the implementation type
* @param <T> the API type
* @return the builder instance
*/
ProviderManager providerManager();
@NonNull
<R extends T, T> R provider(@NonNull Class<T> apiClass, @Nullable Object... args);

/**
* Gets the {@link EventBus} for handling
Expand All @@ -116,7 +101,7 @@ public interface GeyserApi extends GeyserApiBase {
EventBus eventBus();

/**
* Get's the default {@link RemoteServer} configured
* Gets the default {@link RemoteServer} configured
* within the config file that is used by default.
*
* @return the default remote server used within Geyser
Expand All @@ -131,15 +116,6 @@ public interface GeyserApi extends GeyserApiBase {
*/
BedrockListener bedrockListener();

/**
* Gets the maximum number of players that
* can join this Geyser instance.
*
* @return the maximum number of players that
* can join this Geyser instance
*/
int maxPlayers();

/**
* Gets the current {@link GeyserApiBase} instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ public interface Command {
@NonNull
List<String> aliases();

/**
* 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.
*/
boolean isSuggestedOpOnly();

/**
* Gets if this command is executable on console.
*
Expand Down Expand Up @@ -98,7 +105,7 @@ default boolean isBedrockOnly() {
}

static <T extends CommandSource> Command.Builder<T> builder(Class<T> sourceType) {
return GeyserApi.api().providerManager().builderProvider().provideBuilder(Builder.class, sourceType);
return GeyserApi.api().provider(Builder.class, sourceType);
}

interface Builder<T extends CommandSource> {
Expand Down Expand Up @@ -135,6 +142,14 @@ interface Builder<T extends CommandSource> {
*/
Builder<T> aliases(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
*/
Builder<T> suggestedOpOnly(boolean suggestedOpOnly);

/**
* Sets if this command is executable on console.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public interface EntityDefinition {
float offset();

static Builder builder() {
return GeyserApi.api().providerManager().builderProvider().provideBuilder(Builder.class);
return GeyserApi.api().provider(EntityDefinition.Builder.class);
}

interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public interface EntityIdentifier {

@NonNull
static Builder builder() {
return GeyserApi.api().providerManager().builderProvider().provideBuilder(Builder.class);
return GeyserApi.api().provider(EntityIdentifier.Builder.class);
}

interface Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public interface EventBus {
void unregisterAll(@NonNull Extension extension);

/**
* Fires the given {@link Event}.
* Fires the given {@link Event} and returns the result.
*
* @param event the event to fire
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
import java.util.Set;

/**
* Called when the downstream server defines the commands available on the server.
* Called when the Java server defines the commands available on the server.
* <br>
* This event is mapped to the existence of Brigadier on the server.
*/
public class ServerDefineCommandsEvent extends ConnectionEvent implements Cancellable {
private final Set<? extends CommandInfo> commands;
Expand All @@ -45,9 +47,10 @@ public ServerDefineCommandsEvent(@NonNull GeyserConnection connection, @NonNull
}

/**
* A mutable collection of the commands sent over.
* A collection of commands sent from the server. Any element in this collection can be removed, but no element can
* be added.
*
* @return a mutable collection of the commands sent over
* @return a collection of the commands sent over
*/
@NonNull
public Set<? extends CommandInfo> commands() {
Expand All @@ -65,7 +68,6 @@ public void setCancelled(boolean cancelled) {
}

public interface CommandInfo {

/**
* Gets the name of the command.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Copyright (c) 2019-2022 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.event.lifecycle;

import com.google.common.collect.Multimap;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.geysermc.geyser.api.event.Event;
import org.geysermc.geyser.api.item.custom.CustomItemData;
import org.geysermc.geyser.api.item.custom.NonVanillaCustomItemData;

import java.util.*;

/**
* Called on Geyser's startup when looking for custom items. Custom items must be registered through this event.
*
* This event will not be called if the "add non-Bedrock items" setting is disabled in the Geyser config.
*/
public abstract class GeyserDefineCustomItemsEvent implements Event {
private final Multimap<String, CustomItemData> customItems;
private final List<NonVanillaCustomItemData> nonVanillaCustomItems;

public GeyserDefineCustomItemsEvent(Multimap<String, CustomItemData> customItems, List<NonVanillaCustomItemData> nonVanillaCustomItems) {
this.customItems = customItems;
this.nonVanillaCustomItems = nonVanillaCustomItems;
}

/**
* Gets a multimap of all the already registered custom items indexed by the item's extended java item's identifier.
*
* @return a multimap of all the already registered custom items
*/
public Map<String, Collection<CustomItemData>> getExistingCustomItems() {
return Collections.unmodifiableMap(this.customItems.asMap());
}

/**
* Gets the list of the already registered non-vanilla custom items.
*
* @return the list of the already registered non-vanilla custom items
*/
public List<NonVanillaCustomItemData> getExistingNonVanillaCustomItems() {
return Collections.unmodifiableList(this.nonVanillaCustomItems);
}

/**
* Registers a custom item with a base Java item. This is used to register items with custom textures and properties
* based on NBT data.
*
* @param identifier the base (java) item
* @param customItemData the custom item data to register
* @return if the item was registered
*/
public abstract boolean register(@NonNull String identifier, @NonNull CustomItemData customItemData);

/**
* Registers a custom item with no base item. This is used for mods.
*
* @param customItemData the custom item data to register
* @return if the item was registered
*/
public abstract boolean register(@NonNull NonVanillaCustomItemData customItemData);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@
package org.geysermc.geyser.api.event.lifecycle;

import org.checkerframework.checker.nullness.qual.NonNull;
import org.geysermc.geyser.api.command.Command;
import org.geysermc.geyser.api.command.CommandManager;
import org.geysermc.geyser.api.event.Event;

import java.util.Map;
import java.nio.file.Path;
import java.util.List;

/**
* Called when commands are defined within Geyser.
* Called when resource packs are loaded within Geyser.
*
* @param commandManager the command manager
* @param commands a mutable list of the currently
* registered default commands
* @param resourcePacks a mutable list of the currently listed resource packs
*/
public record GeyserDefineCommandsEvent(@NonNull CommandManager commandManager, @NonNull Map<String, Command> commands) implements Event {
public record GeyserLoadResourcePacksEvent(@NonNull List<Path> resourcePacks) implements Event {
}
Loading