Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-03 14:50:19 +01:00
Merge branch 'master' into feature/sounds
Dieser Commit ist enthalten in:
Commit
c22eb170ec
6
.idea/copyright/Geyser.xml
Normale Datei
6
.idea/copyright/Geyser.xml
Normale Datei
@ -0,0 +1,6 @@
|
|||||||
|
<component name="CopyrightManager">
|
||||||
|
<copyright>
|
||||||
|
<option name="notice" value="Copyright (c) 2019-&#36;today.year 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 " />
|
||||||
|
<option name="myName" value="Geyser" />
|
||||||
|
</copyright>
|
||||||
|
</component>
|
7
.idea/copyright/profiles_settings.xml
Normale Datei
7
.idea/copyright/profiles_settings.xml
Normale Datei
@ -0,0 +1,7 @@
|
|||||||
|
<component name="CopyrightManager">
|
||||||
|
<settings>
|
||||||
|
<module2copyright>
|
||||||
|
<element module="All" copyright="Geyser" />
|
||||||
|
</module2copyright>
|
||||||
|
</settings>
|
||||||
|
</component>
|
@ -43,22 +43,14 @@ import com.nukkitx.math.vector.Vector2f;
|
|||||||
import com.nukkitx.math.vector.Vector2i;
|
import com.nukkitx.math.vector.Vector2i;
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.math.vector.Vector3i;
|
import com.nukkitx.math.vector.Vector3i;
|
||||||
import com.nukkitx.nbt.tag.CompoundTag;
|
|
||||||
import com.nukkitx.protocol.bedrock.BedrockServerSession;
|
import com.nukkitx.protocol.bedrock.BedrockServerSession;
|
||||||
import com.nukkitx.protocol.bedrock.data.ContainerId;
|
import com.nukkitx.protocol.bedrock.data.ContainerId;
|
||||||
import com.nukkitx.protocol.bedrock.data.GamePublishSetting;
|
import com.nukkitx.protocol.bedrock.data.GamePublishSetting;
|
||||||
import com.nukkitx.protocol.bedrock.packet.AvailableEntityIdentifiersPacket;
|
|
||||||
import com.nukkitx.protocol.bedrock.packet.BiomeDefinitionListPacket;
|
|
||||||
import com.nukkitx.protocol.bedrock.packet.PlayStatusPacket;
|
|
||||||
import com.nukkitx.protocol.bedrock.packet.StartGamePacket;
|
|
||||||
import com.nukkitx.protocol.bedrock.packet.TextPacket;
|
|
||||||
import com.nukkitx.protocol.bedrock.data.GameRuleData;
|
import com.nukkitx.protocol.bedrock.data.GameRuleData;
|
||||||
import com.nukkitx.protocol.bedrock.data.PlayerPermission;
|
import com.nukkitx.protocol.bedrock.data.PlayerPermission;
|
||||||
import com.nukkitx.protocol.bedrock.packet.*;
|
import com.nukkitx.protocol.bedrock.packet.*;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
import org.geysermc.common.AuthType;
|
import org.geysermc.common.AuthType;
|
||||||
import org.geysermc.common.window.FormWindow;
|
import org.geysermc.common.window.FormWindow;
|
||||||
import org.geysermc.connector.GeyserConnector;
|
import org.geysermc.connector.GeyserConnector;
|
||||||
@ -176,7 +168,7 @@ public class GeyserSession implements CommandSender {
|
|||||||
upstream.sendPacket(biomeDefinitionListPacket);
|
upstream.sendPacket(biomeDefinitionListPacket);
|
||||||
|
|
||||||
AvailableEntityIdentifiersPacket entityPacket = new AvailableEntityIdentifiersPacket();
|
AvailableEntityIdentifiersPacket entityPacket = new AvailableEntityIdentifiersPacket();
|
||||||
entityPacket.setTag(CompoundTag.EMPTY);
|
entityPacket.setTag(Toolbox.ENTITY_IDENTIFIERS);
|
||||||
upstream.sendPacket(entityPacket);
|
upstream.sendPacket(entityPacket);
|
||||||
|
|
||||||
InventoryContentPacket creativePacket = new InventoryContentPacket();
|
InventoryContentPacket creativePacket = new InventoryContentPacket();
|
||||||
|
@ -58,13 +58,19 @@ public class EntityCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void spawnEntity(Entity entity) {
|
public void spawnEntity(Entity entity) {
|
||||||
cacheEntity(entity);
|
if (cacheEntity(entity)) {
|
||||||
entity.spawnEntity(session);
|
entity.spawnEntity(session);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cacheEntity(Entity entity) {
|
public boolean cacheEntity(Entity entity) {
|
||||||
entityIdTranslations.put(entity.getEntityId(), entity.getGeyserId());
|
// Check to see if the entity exists, otherwise we can end up with duplicated mobs
|
||||||
entities.put(entity.getGeyserId(), entity);
|
if (!entityIdTranslations.containsKey(entity.getEntityId())) {
|
||||||
|
entityIdTranslations.put(entity.getEntityId(), entity.getGeyserId());
|
||||||
|
entities.put(entity.getGeyserId(), entity);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean removeEntity(Entity entity, boolean force) {
|
public boolean removeEntity(Entity entity, boolean force) {
|
||||||
|
@ -54,7 +54,7 @@ public abstract class ItemStackTranslator {
|
|||||||
public ItemStack translateToJava(ItemData itemData, ItemEntry itemEntry) {
|
public ItemStack translateToJava(ItemData itemData, ItemEntry itemEntry) {
|
||||||
if (itemData == null) return null;
|
if (itemData == null) return null;
|
||||||
if (itemData.getTag() == null) {
|
if (itemData.getTag() == null) {
|
||||||
return new ItemStack(itemEntry.getJavaId(), itemData.getCount());
|
return new ItemStack(itemEntry.getJavaId(), itemData.getCount(), new com.github.steveice10.opennbt.tag.builtin.CompoundTag(""));
|
||||||
}
|
}
|
||||||
return new ItemStack(itemEntry.getJavaId(), itemData.getCount(), this.translateToJavaNBT(itemData.getTag()));
|
return new ItemStack(itemEntry.getJavaId(), itemData.getCount(), this.translateToJavaNBT(itemData.getTag()));
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,8 @@ public class Toolbox {
|
|||||||
|
|
||||||
public static final Int2ObjectMap<ItemEntry> ITEM_ENTRIES = new Int2ObjectOpenHashMap<>();
|
public static final Int2ObjectMap<ItemEntry> ITEM_ENTRIES = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
|
public static CompoundTag ENTITY_IDENTIFIERS;
|
||||||
|
|
||||||
public static int BARRIER_INDEX = 0;
|
public static int BARRIER_INDEX = 0;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@ -143,6 +145,7 @@ public class Toolbox {
|
|||||||
// Load the locale data
|
// Load the locale data
|
||||||
LocaleUtils.init();
|
LocaleUtils.init();
|
||||||
|
|
||||||
|
/* Load creative items */
|
||||||
stream = getResource("bedrock/creative_items.json");
|
stream = getResource("bedrock/creative_items.json");
|
||||||
|
|
||||||
JsonNode creativeItemEntries;
|
JsonNode creativeItemEntries;
|
||||||
@ -172,6 +175,16 @@ public class Toolbox {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
CREATIVE_ITEMS = creativeItems.toArray(new ItemData[0]);
|
CREATIVE_ITEMS = creativeItems.toArray(new ItemData[0]);
|
||||||
|
|
||||||
|
|
||||||
|
/* Load entity identifiers */
|
||||||
|
stream = Toolbox.getResource("bedrock/entity_identifiers.dat");
|
||||||
|
|
||||||
|
try (NBTInputStream nbtInputStream = NbtUtils.createNetworkReader(stream)) {
|
||||||
|
ENTITY_IDENTIFIERS = (CompoundTag) nbtInputStream.readTag();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new AssertionError("Unable to get entities from entity identifiers", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Binäre Datei nicht angezeigt.
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren