From f56663456df254c40cca8cbff50849dd7ef6dab1 Mon Sep 17 00:00:00 2001 From: YHDiamond <47502993+YHDiamond@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:20:27 -0500 Subject: [PATCH 1/5] Update CONTRIBUTING.md (#1787) * Update CONTRIBUTING.md * Update CONTRIBUTING.md Ok that works to but i meant for that to mean 'put all your annotation stuff here' obviously it wont compile, but this works too Co-authored-by: theminecoder Co-authored-by: YHDiamond <47502993+yehudahrrs@users.noreply.github.com> Co-authored-by: theminecoder --- CONTRIBUTING.md | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c7a5a3d28..527471bae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,29 +11,36 @@ Thank for for considering a contribution! Generally, Geyser welcomes PRs from ev We have some general style guides that should be applied throughout the code: ```java +public class LongClassName { + private static final int AIR_ITEM = 0; // Static item names should be capitalized -private static final AIR_ITEM = 0; // Static item names should be capitalized + public Int2IntMap items = new Int2IntOpenHashMap(); // Use the interface as the class type but initialize with the implementation. -public Int2IntMap items = new Int2IntOpenHashMap(); // Use the interface as the class type but initialize with the implementation. + public int nameWithMultipleWords = 0; -public int nameWithMultipleWords = 0; + /** + * Javadoc comment to explain what a function does. + */ + @RandomAnnotation(stuff = true, moreStuff = "might exist") + public void applyStuff() { + Variable variable = new Variable(); + Variable otherVariable = new Variable(); -/** -* Javadoc comment to explain what a function does. -*/ -public void applyStuff() { - if (condition) { - // Do stuff. - } else if (anotherCondition) { - // Do something else. - } - - switch (value) { - case 0: - break; - case 1: - break: - } + if (condition) { + // Do stuff. + } else if (anotherCondition) { + // Do something else. + } + + switch (value) { + case 0: + stuff(); + break; + case 1: + differentStuff(); + break; + } + } } ``` From ce6055460eb786bc90072daa2a2070f7a8402736 Mon Sep 17 00:00:00 2001 From: 7man7LMYT <67489949+7man7LMYT@users.noreply.github.com> Date: Wed, 27 Jan 2021 16:21:47 -0800 Subject: [PATCH 2/5] Bedrock doesn't support custom armor stand poses (#1873) Added the line that states that custom armor stand poses aren't possible in bedrock. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 68f98c018..343fca94a 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ The following things can't be fixed because of Bedrock limitations. They might b - Custom heads in inventories - Clickable links in chat - Glowing effect +- Custom armor stand poses ## Compiling 1. Clone the repo to your computer From aec08e7d3cc085e10678b2dff50635246cf1b256 Mon Sep 17 00:00:00 2001 From: YHDiamond <47502993+YHDiamond@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:23:27 -0500 Subject: [PATCH 3/5] Add images to statistics menu (#1719) Co-authored-by: YHDiamond <47502993+yehudahrrs@users.noreply.github.com> --- .../connector/utils/StatisticsUtils.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/utils/StatisticsUtils.java b/connector/src/main/java/org/geysermc/connector/utils/StatisticsUtils.java index 7d2a75fc8..08521284b 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/StatisticsUtils.java +++ b/connector/src/main/java/org/geysermc/connector/utils/StatisticsUtils.java @@ -30,6 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType; import com.github.steveice10.mc.protocol.data.game.statistic.*; import org.geysermc.common.window.SimpleFormWindow; import org.geysermc.common.window.button.FormButton; +import org.geysermc.common.window.button.FormImage; import org.geysermc.common.window.response.SimpleFormResponse; import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.translators.item.ItemRegistry; @@ -54,17 +55,17 @@ public class StatisticsUtils { SimpleFormWindow window = new SimpleFormWindow(LocaleUtils.getLocaleString("gui.stats", language), ""); - window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.generalButton", language))); + window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.generalButton", language), new FormImage(FormImage.FormImageType.PATH, "textures/ui/World"))); - window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.mined", language))); - window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.broken", language))); - window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.crafted", language))); - window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.used", language))); - window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.picked_up", language))); - window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.dropped", language))); + window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.mined", language), new FormImage(FormImage.FormImageType.PATH, "textures/items/iron_pickaxe"))); + window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.broken", language), new FormImage(FormImage.FormImageType.PATH, "textures/items/record_11"))); + window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.crafted", language), new FormImage(FormImage.FormImageType.PATH, "textures/blocks/crafting_table_side"))); + window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.used", language), new FormImage(FormImage.FormImageType.PATH, "textures/ui/Wrenches1"))); + window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.picked_up", language), new FormImage(FormImage.FormImageType.PATH, "textures/blocks/chest_front"))); + window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.itemsButton", language) + " - " + LocaleUtils.getLocaleString("stat_type.minecraft.dropped", language), new FormImage(FormImage.FormImageType.PATH, "textures/ui/trash_default"))); - window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.mobsButton", language) + " - " + LanguageUtils.getPlayerLocaleString("geyser.statistics.killed", language))); - window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.mobsButton", language) + " - " + LanguageUtils.getPlayerLocaleString("geyser.statistics.killed_by", language))); + window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.mobsButton", language) + " - " + LanguageUtils.getPlayerLocaleString("geyser.statistics.killed", language), new FormImage(FormImage.FormImageType.PATH, "textures/items/diamond_sword"))); + window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("stat.mobsButton", language) + " - " + LanguageUtils.getPlayerLocaleString("geyser.statistics.killed_by", language), new FormImage(FormImage.FormImageType.PATH, "textures/ui/wither_heart_flash"))); return window; } @@ -189,7 +190,7 @@ public class StatisticsUtils { } SimpleFormWindow window = new SimpleFormWindow(title, content.toString()); - window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("gui.back", language))); + window.getButtons().add(new FormButton(LocaleUtils.getLocaleString("gui.back", language), new FormImage(FormImage.FormImageType.PATH, "textures/gui/newgui/undo"))); session.sendForm(window, STATISTICS_LIST_FORM_ID); } From 462e9b8b0d110dd80cadf0cd0124bc3ebcf054f4 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Thu, 28 Jan 2021 16:08:20 +0000 Subject: [PATCH 4/5] Fix beehive direction being flipped (#1880) * Fix beehive direction being flipped * Update submodule --- connector/src/main/resources/mappings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connector/src/main/resources/mappings b/connector/src/main/resources/mappings index dd0347bd5..c4f07d672 160000 --- a/connector/src/main/resources/mappings +++ b/connector/src/main/resources/mappings @@ -1 +1 @@ -Subproject commit dd0347bd51e00e42ea58faaf68b562526c4d2817 +Subproject commit c4f07d67244b2746d0a8b2d94cd10cb2833d4018 From 498f7653d3ed4334733b48bee203defd33b6b2b1 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Thu, 28 Jan 2021 16:33:26 +0000 Subject: [PATCH 5/5] Fix NPE when link entity not found and use non-deprecated constructor (#1706) * Fix NPE when link entity not found and use non-deprecated constructor * Extract method call to variable * Update PlayerEntity.java * Fix indentation --- .../org/geysermc/connector/entity/player/PlayerEntity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/connector/src/main/java/org/geysermc/connector/entity/player/PlayerEntity.java b/connector/src/main/java/org/geysermc/connector/entity/player/PlayerEntity.java index fc7b867bb..5cef3252a 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/player/PlayerEntity.java +++ b/connector/src/main/java/org/geysermc/connector/entity/player/PlayerEntity.java @@ -103,7 +103,10 @@ public class PlayerEntity extends LivingEntity { long linkedEntityId = session.getEntityCache().getCachedPlayerEntityLink(entityId); if (linkedEntityId != -1) { - addPlayerPacket.getEntityLinks().add(new EntityLinkData(session.getEntityCache().getEntityByJavaId(linkedEntityId).getGeyserId(), geyserId, EntityLinkData.Type.RIDER, false)); + Entity linkedEntity = session.getEntityCache().getEntityByJavaId(linkedEntityId); + if (linkedEntity != null) { + addPlayerPacket.getEntityLinks().add(new EntityLinkData(linkedEntity.getGeyserId(), geyserId, EntityLinkData.Type.RIDER, false, false)); + } } valid = true;