Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 08:30:12 +01:00
Merge branch 'master' of https://github.com/GeyserMC/Geyser into server-inventory
Dieser Commit ist enthalten in:
Commit
3b847d93b3
@ -11,8 +11,8 @@ 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:
|
We have some general style guides that should be applied throughout the code:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
|
public class LongClassName {
|
||||||
private static final AIR_ITEM = 0; // Static item names should be capitalized
|
private static final int 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.
|
||||||
|
|
||||||
@ -21,7 +21,11 @@ public int nameWithMultipleWords = 0;
|
|||||||
/**
|
/**
|
||||||
* Javadoc comment to explain what a function does.
|
* Javadoc comment to explain what a function does.
|
||||||
*/
|
*/
|
||||||
|
@RandomAnnotation(stuff = true, moreStuff = "might exist")
|
||||||
public void applyStuff() {
|
public void applyStuff() {
|
||||||
|
Variable variable = new Variable();
|
||||||
|
Variable otherVariable = new Variable();
|
||||||
|
|
||||||
if (condition) {
|
if (condition) {
|
||||||
// Do stuff.
|
// Do stuff.
|
||||||
} else if (anotherCondition) {
|
} else if (anotherCondition) {
|
||||||
@ -30,9 +34,12 @@ public void applyStuff() {
|
|||||||
|
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case 0:
|
case 0:
|
||||||
|
stuff();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
break:
|
differentStuff();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -55,6 +55,7 @@ The following things can't be fixed because of Bedrock limitations. They might b
|
|||||||
- Custom heads in inventories
|
- Custom heads in inventories
|
||||||
- Clickable links in chat
|
- Clickable links in chat
|
||||||
- Glowing effect
|
- Glowing effect
|
||||||
|
- Custom armor stand poses
|
||||||
|
|
||||||
## Compiling
|
## Compiling
|
||||||
1. Clone the repo to your computer
|
1. Clone the repo to your computer
|
||||||
|
@ -103,7 +103,10 @@ public class PlayerEntity extends LivingEntity {
|
|||||||
|
|
||||||
long linkedEntityId = session.getEntityCache().getCachedPlayerEntityLink(entityId);
|
long linkedEntityId = session.getEntityCache().getCachedPlayerEntityLink(entityId);
|
||||||
if (linkedEntityId != -1) {
|
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;
|
valid = true;
|
||||||
|
@ -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 com.github.steveice10.mc.protocol.data.game.statistic.*;
|
||||||
import org.geysermc.common.window.SimpleFormWindow;
|
import org.geysermc.common.window.SimpleFormWindow;
|
||||||
import org.geysermc.common.window.button.FormButton;
|
import org.geysermc.common.window.button.FormButton;
|
||||||
|
import org.geysermc.common.window.button.FormImage;
|
||||||
import org.geysermc.common.window.response.SimpleFormResponse;
|
import org.geysermc.common.window.response.SimpleFormResponse;
|
||||||
import org.geysermc.connector.network.session.GeyserSession;
|
import org.geysermc.connector.network.session.GeyserSession;
|
||||||
import org.geysermc.connector.network.translators.item.ItemRegistry;
|
import org.geysermc.connector.network.translators.item.ItemRegistry;
|
||||||
@ -54,17 +55,17 @@ public class StatisticsUtils {
|
|||||||
|
|
||||||
SimpleFormWindow window = new SimpleFormWindow(LocaleUtils.getLocaleString("gui.stats", language), "");
|
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.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)));
|
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)));
|
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)));
|
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)));
|
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)));
|
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", 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)));
|
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;
|
return window;
|
||||||
}
|
}
|
||||||
@ -189,7 +190,7 @@ public class StatisticsUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SimpleFormWindow window = new SimpleFormWindow(title, content.toString());
|
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);
|
session.sendForm(window, STATISTICS_LIST_FORM_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren