mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-19 14:59:27 +00:00
Joining on 1.21.11 works! Drops 1.21.90 and 1.21.100
This commit is contained in:
@@ -115,15 +115,19 @@ import org.geysermc.geyser.entity.type.living.animal.TurtleEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.farm.ChickenEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.farm.CowEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.farm.PigEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.farm.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.entity.type.living.animal.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.entity.type.living.animal.horse.AbstractHorseEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.horse.CamelEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.horse.CamelHuskEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.horse.ChestedHorseEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.horse.HorseEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.horse.LlamaEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.horse.SkeletonHorseEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.horse.TraderLlamaEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.horse.ZombieHorseEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.nautilus.AbstractNautilusEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.nautilus.NautilusEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.nautilus.ZombieNautilusEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.tameable.CatEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.tameable.ParrotEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.tameable.TameableEntity;
|
||||
@@ -196,6 +200,7 @@ public final class EntityDefinitions {
|
||||
public static final EntityDefinition<BreezeEntity> BREEZE;
|
||||
public static final EntityDefinition<AbstractWindChargeEntity> BREEZE_WIND_CHARGE;
|
||||
public static final EntityDefinition<CamelEntity> CAMEL;
|
||||
public static final EntityDefinition<CamelHuskEntity> CAMEL_HUSK;
|
||||
public static final EntityDefinition<CatEntity> CAT;
|
||||
public static final EntityDefinition<SpiderEntity> CAVE_SPIDER;
|
||||
public static final EntityDefinition<BoatEntity> CHERRY_BOAT;
|
||||
@@ -262,6 +267,7 @@ public final class EntityDefinitions {
|
||||
public static final EntityDefinition<MinecartEntity> MINECART;
|
||||
public static final EntityDefinition<MooshroomEntity> MOOSHROOM;
|
||||
public static final EntityDefinition<ChestedHorseEntity> MULE;
|
||||
public static final EntityDefinition<NautilusEntity> NAUTILUS;
|
||||
public static final EntityDefinition<BoatEntity> OAK_BOAT;
|
||||
public static final EntityDefinition<ChestBoatEntity> OAK_CHEST_BOAT;
|
||||
public static final EntityDefinition<OcelotEntity> OCELOT;
|
||||
@@ -269,6 +275,7 @@ public final class EntityDefinitions {
|
||||
public static final EntityDefinition<BoatEntity> PALE_OAK_BOAT;
|
||||
public static final EntityDefinition<ChestBoatEntity> PALE_OAK_CHEST_BOAT;
|
||||
public static final EntityDefinition<PandaEntity> PANDA;
|
||||
public static final EntityDefinition<AbstractSkeletonEntity> PARCHED;
|
||||
public static final EntityDefinition<ParrotEntity> PARROT;
|
||||
public static final EntityDefinition<PhantomEntity> PHANTOM;
|
||||
public static final EntityDefinition<PigEntity> PIG;
|
||||
@@ -324,6 +331,7 @@ public final class EntityDefinitions {
|
||||
public static final EntityDefinition<ZoglinEntity> ZOGLIN;
|
||||
public static final EntityDefinition<ZombieEntity> ZOMBIE;
|
||||
public static final EntityDefinition<ZombieHorseEntity> ZOMBIE_HORSE;
|
||||
public static final EntityDefinition<ZombieNautilusEntity> ZOMBIE_NAUTILUS;
|
||||
public static final EntityDefinition<ZombieVillagerEntity> ZOMBIE_VILLAGER;
|
||||
public static final EntityDefinition<ZombifiedPiglinEntity> ZOMBIFIED_PIGLIN;
|
||||
|
||||
@@ -829,6 +837,11 @@ public final class EntityDefinitions {
|
||||
.height(1.8f).width(0.6f)
|
||||
.offset(1.62f)
|
||||
.build();
|
||||
PARCHED = EntityDefinition.inherited(AbstractSkeletonEntity::new, mobEntityBase)
|
||||
.type(EntityType.PARCHED)
|
||||
.height(1.8f).width(0.6f)
|
||||
.offset(1.62f)
|
||||
.build();
|
||||
VEX = EntityDefinition.inherited(VexEntity::new, mobEntityBase)
|
||||
.type(EntityType.VEX)
|
||||
.height(0.8f).width(0.4f)
|
||||
@@ -1173,6 +1186,9 @@ public final class EntityDefinitions {
|
||||
.addTranslator(MetadataTypes.BOOLEAN, CamelEntity::setDashing)
|
||||
.addTranslator(MetadataTypes.LONG, CamelEntity::setLastPoseTick)
|
||||
.build();
|
||||
CAMEL_HUSK = EntityDefinition.inherited(CamelHuskEntity::new, CAMEL)
|
||||
.type(EntityType.CAMEL_HUSK)
|
||||
.build();
|
||||
HORSE = EntityDefinition.inherited(HorseEntity::new, abstractHorseEntityBase)
|
||||
.type(EntityType.HORSE)
|
||||
.height(1.6f).width(1.3965f)
|
||||
@@ -1209,6 +1225,18 @@ public final class EntityDefinitions {
|
||||
.build();
|
||||
}
|
||||
|
||||
// Nautilus
|
||||
{
|
||||
EntityDefinition<AbstractNautilusEntity> abstractNautilusBase = EntityDefinition.<AbstractNautilusEntity>inherited(null, ageableEntityBase) // No factory, is abstract
|
||||
.build();
|
||||
|
||||
NAUTILUS = EntityDefinition.inherited(NautilusEntity::new, abstractNautilusBase)
|
||||
.build();
|
||||
|
||||
ZOMBIE_NAUTILUS = EntityDefinition.inherited(ZombieNautilusEntity::new, abstractNautilusBase)
|
||||
.build();
|
||||
}
|
||||
|
||||
EntityDefinition<TameableEntity> tameableEntityBase = EntityDefinition.<TameableEntity>inherited(null, ageableEntityBase) // No factory, is abstract
|
||||
.addTranslator(MetadataTypes.BYTE, TameableEntity::setTameableFlags)
|
||||
.addTranslator(MetadataTypes.OPTIONAL_LIVING_ENTITY_REFERENCE, TameableEntity::setOwner)
|
||||
|
||||
@@ -29,7 +29,7 @@ import lombok.Getter;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import org.cloudburstmc.math.vector.Vector3f;
|
||||
import org.geysermc.geyser.entity.EntityDefinition;
|
||||
import org.geysermc.geyser.entity.type.living.animal.farm.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.entity.type.living.animal.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.inventory.GeyserItemStack;
|
||||
import org.geysermc.geyser.item.Items;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
|
||||
@@ -23,13 +23,11 @@
|
||||
* @link https://github.com/GeyserMC/Geyser
|
||||
*/
|
||||
|
||||
package org.geysermc.geyser.entity.type.living.animal.farm;
|
||||
package org.geysermc.geyser.entity.type.living.animal;
|
||||
|
||||
import org.cloudburstmc.math.vector.Vector3f;
|
||||
import org.geysermc.geyser.entity.EntityDefinition;
|
||||
import org.geysermc.geyser.entity.properties.type.EnumProperty;
|
||||
import org.geysermc.geyser.entity.type.living.animal.AnimalEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.VariantHolder;
|
||||
import org.geysermc.geyser.impl.IdentifierImpl;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.session.cache.RegistryCache;
|
||||
@@ -28,6 +28,7 @@ package org.geysermc.geyser.entity.type.living.animal.farm;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.cloudburstmc.math.vector.Vector3f;
|
||||
import org.geysermc.geyser.entity.EntityDefinition;
|
||||
import org.geysermc.geyser.entity.type.living.animal.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.item.type.Item;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.session.cache.registry.JavaRegistries;
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.cloudburstmc.math.vector.Vector3f;
|
||||
import org.cloudburstmc.protocol.bedrock.data.SoundEvent;
|
||||
import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag;
|
||||
import org.geysermc.geyser.entity.EntityDefinition;
|
||||
import org.geysermc.geyser.entity.type.living.animal.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.inventory.GeyserItemStack;
|
||||
import org.geysermc.geyser.item.Items;
|
||||
import org.geysermc.geyser.item.type.Item;
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.cloudburstmc.math.vector.Vector3f;
|
||||
import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag;
|
||||
import org.geysermc.geyser.entity.EntityDefinition;
|
||||
import org.geysermc.geyser.entity.type.Tickable;
|
||||
import org.geysermc.geyser.entity.type.living.animal.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.entity.type.player.PlayerEntity;
|
||||
import org.geysermc.geyser.entity.vehicle.BoostableVehicleComponent;
|
||||
import org.geysermc.geyser.entity.vehicle.ClientVehicle;
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2025 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.entity.type.living.animal.horse;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.cloudburstmc.math.vector.Vector3f;
|
||||
import org.geysermc.geyser.entity.EntityDefinition;
|
||||
import org.geysermc.geyser.item.type.Item;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.session.cache.tags.ItemTag;
|
||||
import org.geysermc.geyser.session.cache.tags.Tag;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class CamelHuskEntity extends CamelEntity {
|
||||
public CamelHuskEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
|
||||
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @Nullable Tag<Item> getFoodTag() {
|
||||
return ItemTag.CAMEL_HUSK_FOOD;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Copyright (c) 2025 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.entity.type.living.animal.nautilus;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.cloudburstmc.math.TrigMath;
|
||||
import org.cloudburstmc.math.vector.Vector2f;
|
||||
import org.cloudburstmc.math.vector.Vector3f;
|
||||
import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag;
|
||||
import org.geysermc.geyser.entity.EntityDefinition;
|
||||
import org.geysermc.geyser.entity.type.living.animal.AnimalEntity;
|
||||
import org.geysermc.geyser.entity.vehicle.ClientVehicle;
|
||||
import org.geysermc.geyser.entity.vehicle.NautilusVehicleComponent;
|
||||
import org.geysermc.geyser.entity.vehicle.VehicleComponent;
|
||||
import org.geysermc.geyser.inventory.GeyserItemStack;
|
||||
import org.geysermc.geyser.item.Items;
|
||||
import org.geysermc.geyser.item.enchantment.EnchantmentComponent;
|
||||
import org.geysermc.geyser.item.type.Item;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.session.cache.tags.ItemTag;
|
||||
import org.geysermc.geyser.session.cache.tags.Tag;
|
||||
import org.geysermc.geyser.util.InteractiveTag;
|
||||
import org.geysermc.geyser.util.ItemUtils;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.entity.EquipmentSlot;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameMode;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentTypes;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.item.component.HolderSet;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public abstract class AbstractNautilusEntity extends AnimalEntity implements ClientVehicle {
|
||||
private HolderSet repairableItems = null;
|
||||
private boolean isCurseOfBinding = false;
|
||||
private final NautilusVehicleComponent vehicleComponent;
|
||||
|
||||
public AbstractNautilusEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw, float defSpeed) {
|
||||
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
|
||||
this.vehicleComponent = new NautilusVehicleComponent(this, 0.0f, defSpeed);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @Nullable Tag<Item> getFoodTag() {
|
||||
return ItemTag.NAUTILUS_FOOD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBody(GeyserItemStack stack) {
|
||||
super.setBody(stack);
|
||||
isCurseOfBinding = ItemUtils.hasEffect(session, stack, EnchantmentComponent.PREVENT_ARMOR_CHANGE);
|
||||
repairableItems = stack.getComponent(DataComponentTypes.REPAIRABLE);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected InteractiveTag testMobInteraction(@NonNull Hand hand, @NonNull GeyserItemStack itemInHand) {
|
||||
if (getFlag(EntityFlag.ANGRY)) {
|
||||
return InteractiveTag.NONE;
|
||||
}
|
||||
|
||||
if (getFlag(EntityFlag.TAMED)) {
|
||||
if (itemInHand.asItem().javaIdentifier().endsWith("_nautilus_armor") && !getItemInSlot(EquipmentSlot.BODY).isEmpty() && !getFlag(EntityFlag.BABY)) {
|
||||
return InteractiveTag.EQUIP_WOLF_ARMOR; // TODO
|
||||
}
|
||||
if (itemInHand.is(Items.SHEARS) && !getItemInSlot(EquipmentSlot.BODY).isEmpty()
|
||||
&& (!isCurseOfBinding || session.getGameMode().equals(GameMode.CREATIVE))) {
|
||||
return InteractiveTag.REMOVE_WOLF_ARMOR; // TODO
|
||||
}
|
||||
if (itemInHand.is(session, repairableItems) &&
|
||||
!getItemInSlot(EquipmentSlot.BODY).isEmpty() && getItemInSlot(EquipmentSlot.BODY).isDamaged()) {
|
||||
return InteractiveTag.REPAIR_WOLF_ARMOR; // TODO
|
||||
}
|
||||
} else if (getFlag(EntityFlag.BABY) || getFlag(EntityFlag.TAMED)) {
|
||||
if (itemInHand.is(session, ItemTag.NAUTILUS_FOOD)) {
|
||||
// Can feed either baby nautilus, or tamed nautilus
|
||||
return InteractiveTag.FEED;
|
||||
}
|
||||
} else {
|
||||
if (itemInHand.is(session, ItemTag.NAUTILUS_TAMING_ITEMS)) {
|
||||
// Nautilus taming food and untamed - can tame
|
||||
return InteractiveTag.TAME;
|
||||
}
|
||||
}
|
||||
return super.testMobInteraction(hand, itemInHand);
|
||||
}
|
||||
|
||||
public void setBoost(IntEntityMetadata entityMetadata) {
|
||||
vehicleComponent.startBoost(entityMetadata.getPrimitiveValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public VehicleComponent<?> getVehicleComponent() {
|
||||
return vehicleComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3f getRiddenInput(Vector2f input) {
|
||||
float x = input.getX();
|
||||
float y = 0.0f;
|
||||
float z = 0.0f;
|
||||
|
||||
if (input.getY() != 0.0f) {
|
||||
float pitch = session.getPlayerEntity().getPitch();
|
||||
z = TrigMath.cos(pitch * TrigMath.DEG_TO_RAD);
|
||||
y = -TrigMath.sin(pitch * TrigMath.DEG_TO_RAD);
|
||||
if (input.getY() < 0.0f) {
|
||||
z *= -0.5f;
|
||||
y *= -0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
if (session.getInputCache().wasJumping()) {
|
||||
y += 0.5f;
|
||||
}
|
||||
|
||||
return Vector3f.from(x, y, z).mul(3.9f * vehicleComponent.getMoveSpeed());
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getVehicleSpeed() {
|
||||
return 0.0f; // Unused
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClientControlled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canClimb() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -23,20 +23,16 @@
|
||||
* @link https://github.com/GeyserMC/Geyser
|
||||
*/
|
||||
|
||||
package org.geysermc.geyser.registry.populator.conversion;
|
||||
package org.geysermc.geyser.entity.type.living.animal.nautilus;
|
||||
|
||||
import org.cloudburstmc.nbt.NbtMap;
|
||||
import org.cloudburstmc.math.vector.Vector3f;
|
||||
import org.geysermc.geyser.entity.EntityDefinition;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
|
||||
public class Conversion827_819 {
|
||||
import java.util.UUID;
|
||||
|
||||
public static NbtMap remapBlock(NbtMap nbtMap) {
|
||||
nbtMap = Conversion844_827.remapBlock(nbtMap);
|
||||
|
||||
final String name = nbtMap.getString("name");
|
||||
if (name.endsWith("copper_chest")) {
|
||||
return ConversionHelper.withName(nbtMap, "chest");
|
||||
}
|
||||
|
||||
return nbtMap;
|
||||
public class NautilusEntity extends AbstractNautilusEntity {
|
||||
public NautilusEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
|
||||
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw, 1.0f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2025 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.entity.type.living.animal.nautilus;
|
||||
|
||||
import org.cloudburstmc.math.vector.Vector3f;
|
||||
import org.geysermc.geyser.entity.EntityDefinition;
|
||||
import org.geysermc.geyser.entity.type.living.animal.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.entity.type.living.animal.VariantHolder;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.session.cache.registry.JavaRegistries;
|
||||
import org.geysermc.geyser.session.cache.registry.JavaRegistryKey;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class ZombieNautilusEntity extends AbstractNautilusEntity implements VariantHolder<TemperatureVariantAnimal.BuiltInVariant> {
|
||||
public ZombieNautilusEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
|
||||
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw, 1.1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBedrockVariant(TemperatureVariantAnimal.BuiltInVariant variant) {
|
||||
TemperatureVariantAnimal.TEMPERATE_VARIANT_PROPERTY.apply(propertyManager, variant);
|
||||
updateBedrockEntityProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JavaRegistryKey<TemperatureVariantAnimal.BuiltInVariant> variantRegistry() {
|
||||
return JavaRegistries.ZOMBIE_NAUTILUS_VARIANT;
|
||||
}
|
||||
}
|
||||
@@ -103,27 +103,4 @@ public class HappyGhastVehicleComponent extends VehicleComponent<HappyGhastEntit
|
||||
travel(ctx, flyingSpeed * 5.0f / 3.0f);
|
||||
vehicle.setMotion(vehicle.getMotion().mul(drag));
|
||||
}
|
||||
|
||||
private Fluid checkForFluid(VehicleContext ctx) {
|
||||
Fluid result = Fluid.EMPTY;
|
||||
|
||||
BoundingBox box = boundingBox.clone();
|
||||
box.expand(-0.001);
|
||||
|
||||
Vector3d min = box.getMin();
|
||||
Vector3d max = box.getMax();
|
||||
|
||||
BlockPositionIterator iter = BlockPositionIterator.fromMinMax(min.getFloorX(), min.getFloorY(), min.getFloorZ(), max.getFloorX(), max.getFloorY(), max.getFloorZ());
|
||||
for (iter.reset(); iter.hasNext(); iter.next()) {
|
||||
BlockState blockState = ctx.getBlock(iter);
|
||||
if (blockState.is(Blocks.WATER)) {
|
||||
return Fluid.WATER; // Water takes priority over lava
|
||||
}
|
||||
if (blockState.is(Blocks.LAVA)) {
|
||||
result = Fluid.LAVA;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2025 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.entity.vehicle;
|
||||
|
||||
import org.geysermc.geyser.entity.type.living.animal.nautilus.AbstractNautilusEntity;
|
||||
import org.geysermc.geyser.level.block.Fluid;
|
||||
import org.geysermc.geyser.util.MathUtils;
|
||||
|
||||
public class NautilusVehicleComponent extends BoostableVehicleComponent<AbstractNautilusEntity> {
|
||||
public NautilusVehicleComponent(AbstractNautilusEntity vehicle, float stepHeight, float defSpeed) {
|
||||
super(vehicle, stepHeight);
|
||||
this.moveSpeed = defSpeed;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateRotation() {
|
||||
float yaw = vehicle.getYaw() + MathUtils.wrapDegrees(getRiddenRotation().getX() - vehicle.getYaw()) * 0.08f;
|
||||
vehicle.setYaw(yaw);
|
||||
vehicle.setHeadYaw(yaw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called every session tick while the player is mounted on the vehicle.
|
||||
*/
|
||||
public void tickVehicle() {
|
||||
if (!vehicle.isClientControlled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
VehicleContext ctx = new VehicleContext();
|
||||
ctx.loadSurroundingBlocks();
|
||||
|
||||
// LivingEntity#travel
|
||||
Fluid fluid = checkForFluid(ctx);
|
||||
float drag = switch (fluid) {
|
||||
case WATER -> 0.9f; // AbstractNautilus#travelInWater
|
||||
case LAVA -> 0.5f; // LivingEntity#travelInLava
|
||||
case EMPTY -> 1f; // TODO No drag it seems? Should probably check the block below, e.g. soul sand
|
||||
};
|
||||
|
||||
travel(ctx, getRiddenSpeed(fluid));
|
||||
vehicle.setMotion(vehicle.getMotion().mul(drag));
|
||||
}
|
||||
|
||||
// AbstractNautilus#getRiddenSpeed
|
||||
private float getRiddenSpeed(Fluid fluid) {
|
||||
return fluid == Fluid.WATER ? 0.0325F * this.getMoveSpeed() :
|
||||
0.02F * this.getMoveSpeed();
|
||||
}
|
||||
}
|
||||
@@ -898,6 +898,29 @@ public class VehicleComponent<T extends LivingEntity & ClientVehicle> {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
protected Fluid checkForFluid(VehicleContext ctx) {
|
||||
Fluid result = Fluid.EMPTY;
|
||||
|
||||
BoundingBox box = boundingBox.clone();
|
||||
box.expand(-0.001);
|
||||
|
||||
Vector3d min = box.getMin();
|
||||
Vector3d max = box.getMax();
|
||||
|
||||
BlockPositionIterator iter = BlockPositionIterator.fromMinMax(min.getFloorX(), min.getFloorY(), min.getFloorZ(), max.getFloorX(), max.getFloorY(), max.getFloorZ());
|
||||
for (iter.reset(); iter.hasNext(); iter.next()) {
|
||||
BlockState blockState = ctx.getBlock(iter);
|
||||
if (blockState.is(Blocks.WATER)) {
|
||||
return Fluid.WATER; // Water takes priority over lava
|
||||
}
|
||||
if (blockState.is(Blocks.LAVA)) {
|
||||
result = Fluid.LAVA;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected class VehicleContext {
|
||||
private Vector3d centerPos;
|
||||
private Vector3d cachePos;
|
||||
|
||||
@@ -70,7 +70,8 @@ public enum BedrockEnchantment {
|
||||
SWIFT_SNEAK,
|
||||
WIND_BURST,
|
||||
DENSITY,
|
||||
BREACH;
|
||||
BREACH,
|
||||
LUNGE;
|
||||
|
||||
private static final BedrockEnchantment[] VALUES = values();
|
||||
|
||||
|
||||
@@ -86,9 +86,6 @@ public final class GameProtocol {
|
||||
|
||||
static {
|
||||
// Strict ordering
|
||||
register(Bedrock_v818.CODEC, "1.21.90", "1.21.91", "1.21.92");
|
||||
register(Bedrock_v819.CODEC, "1.21.93", "1.21.94");
|
||||
register(Bedrock_v827.CODEC, "1.21.100", "1.21.101");
|
||||
register(Bedrock_v844.CODEC, "1.21.111", "1.21.112", "1.21.113", "1.21.114");
|
||||
register(Bedrock_v859.CODEC, "1.21.120", "1.21.121", "1.21.122", "1.21.123");
|
||||
register(Bedrock_v860.CODEC);
|
||||
@@ -184,7 +181,7 @@ public final class GameProtocol {
|
||||
* @return the supported Minecraft: Java Edition version
|
||||
*/
|
||||
public static String getJavaMinecraftVersion() {
|
||||
return "1.21.10";
|
||||
return "1.21.11";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -63,8 +63,6 @@ import org.geysermc.geyser.level.block.type.Block;
|
||||
import org.geysermc.geyser.level.block.type.BlockState;
|
||||
import org.geysermc.geyser.level.block.type.FlowerPotBlock;
|
||||
import org.geysermc.geyser.registry.BlockRegistries;
|
||||
import org.geysermc.geyser.registry.populator.conversion.Conversion827_819;
|
||||
import org.geysermc.geyser.registry.populator.conversion.Conversion844_827;
|
||||
import org.geysermc.geyser.registry.type.BlockMappings;
|
||||
import org.geysermc.geyser.registry.type.GeyserBedrockBlock;
|
||||
import org.geysermc.geyser.util.JsonUtils;
|
||||
@@ -125,9 +123,6 @@ public final class BlockRegistryPopulator {
|
||||
|
||||
private static void registerBedrockBlocks() {
|
||||
var blockMappers = ImmutableMap.<ObjectIntPair<String>, Remapper>builder()
|
||||
.put(ObjectIntPair.of("1_21_90", Bedrock_v818.CODEC.getProtocolVersion()), Conversion827_819::remapBlock)
|
||||
.put(ObjectIntPair.of("1_21_90", Bedrock_v819.CODEC.getProtocolVersion()), Conversion827_819::remapBlock)
|
||||
.put(ObjectIntPair.of("1_21_100", Bedrock_v827.CODEC.getProtocolVersion()), Conversion844_827::remapBlock)
|
||||
.put(ObjectIntPair.of("1_21_110", Bedrock_v844.CODEC.getProtocolVersion()), tag -> tag)
|
||||
// 1.21.110 -> 1.21.12x doesn't change the block palette
|
||||
.put(ObjectIntPair.of("1_21_110", Bedrock_v859.CODEC.getProtocolVersion()), tag -> tag)
|
||||
|
||||
@@ -45,9 +45,6 @@ import org.cloudburstmc.nbt.NbtMap;
|
||||
import org.cloudburstmc.nbt.NbtMapBuilder;
|
||||
import org.cloudburstmc.nbt.NbtType;
|
||||
import org.cloudburstmc.nbt.NbtUtils;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v818.Bedrock_v818;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v819.Bedrock_v819;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v827.Bedrock_v827;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v844.Bedrock_v844;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v859.Bedrock_v859;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v860.Bedrock_v860;
|
||||
@@ -76,7 +73,6 @@ import org.geysermc.geyser.item.type.Item;
|
||||
import org.geysermc.geyser.level.block.property.Properties;
|
||||
import org.geysermc.geyser.registry.BlockRegistries;
|
||||
import org.geysermc.geyser.registry.Registries;
|
||||
import org.geysermc.geyser.registry.populator.conversion.Conversion844_827;
|
||||
import org.geysermc.geyser.registry.type.BlockMappings;
|
||||
import org.geysermc.geyser.registry.type.GeyserBedrockBlock;
|
||||
import org.geysermc.geyser.registry.type.GeyserMappingItem;
|
||||
@@ -125,84 +121,29 @@ public class ItemRegistryPopulator {
|
||||
}
|
||||
|
||||
public static void populate() {
|
||||
Map<Item, Item> eightTwoSevenFallbacks = new HashMap<>();
|
||||
eightTwoSevenFallbacks.put(Items.ACACIA_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.BAMBOO_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.BIRCH_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.CHERRY_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.CRIMSON_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.DARK_OAK_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.JUNGLE_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.MANGROVE_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.OAK_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.PALE_OAK_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.SPRUCE_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.WARPED_SHELF, Items.CHISELED_BOOKSHELF);
|
||||
eightTwoSevenFallbacks.put(Items.COPPER_BARS, Items.IRON_BARS);
|
||||
eightTwoSevenFallbacks.put(Items.EXPOSED_COPPER_BARS, Items.IRON_BARS);
|
||||
eightTwoSevenFallbacks.put(Items.WEATHERED_COPPER_BARS, Items.IRON_BARS);
|
||||
eightTwoSevenFallbacks.put(Items.OXIDIZED_COPPER_BARS, Items.IRON_BARS);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_COPPER_BARS, Items.IRON_BARS);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_EXPOSED_COPPER_BARS, Items.IRON_BARS);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_WEATHERED_COPPER_BARS, Items.IRON_BARS);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_OXIDIZED_COPPER_BARS, Items.IRON_BARS);
|
||||
eightTwoSevenFallbacks.put(Items.COPPER_GOLEM_STATUE, Items.ARMOR_STAND);
|
||||
eightTwoSevenFallbacks.put(Items.EXPOSED_COPPER_GOLEM_STATUE, Items.ARMOR_STAND);
|
||||
eightTwoSevenFallbacks.put(Items.WEATHERED_COPPER_GOLEM_STATUE, Items.ARMOR_STAND);
|
||||
eightTwoSevenFallbacks.put(Items.OXIDIZED_COPPER_GOLEM_STATUE, Items.ARMOR_STAND);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_COPPER_GOLEM_STATUE, Items.ARMOR_STAND);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_EXPOSED_COPPER_GOLEM_STATUE, Items.ARMOR_STAND);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_WEATHERED_COPPER_GOLEM_STATUE, Items.ARMOR_STAND);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_OXIDIZED_COPPER_GOLEM_STATUE, Items.ARMOR_STAND);
|
||||
eightTwoSevenFallbacks.put(Items.COPPER_LANTERN, Items.LANTERN);
|
||||
eightTwoSevenFallbacks.put(Items.EXPOSED_COPPER_LANTERN, Items.LANTERN);
|
||||
eightTwoSevenFallbacks.put(Items.WEATHERED_COPPER_LANTERN, Items.LANTERN);
|
||||
eightTwoSevenFallbacks.put(Items.OXIDIZED_COPPER_LANTERN, Items.LANTERN);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_COPPER_LANTERN, Items.LANTERN);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_EXPOSED_COPPER_LANTERN, Items.LANTERN);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_WEATHERED_COPPER_LANTERN, Items.LANTERN);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_OXIDIZED_COPPER_LANTERN, Items.LANTERN);
|
||||
eightTwoSevenFallbacks.put(Items.EXPOSED_LIGHTNING_ROD, Items.LIGHTNING_ROD);
|
||||
eightTwoSevenFallbacks.put(Items.WEATHERED_LIGHTNING_ROD, Items.LIGHTNING_ROD);
|
||||
eightTwoSevenFallbacks.put(Items.OXIDIZED_LIGHTNING_ROD, Items.LIGHTNING_ROD);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_LIGHTNING_ROD, Items.LIGHTNING_ROD);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_EXPOSED_LIGHTNING_ROD, Items.LIGHTNING_ROD);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_WEATHERED_LIGHTNING_ROD, Items.LIGHTNING_ROD);
|
||||
eightTwoSevenFallbacks.put(Items.WAXED_OXIDIZED_LIGHTNING_ROD, Items.LIGHTNING_ROD);
|
||||
eightTwoSevenFallbacks.put(Items.COPPER_TORCH, Items.TORCH);
|
||||
eightTwoSevenFallbacks.put(Items.COPPER_HORSE_ARMOR, Items.LEATHER_HORSE_ARMOR);
|
||||
|
||||
Map<Item, Item> eightOneNineFallbacks = new HashMap<>(eightTwoSevenFallbacks);
|
||||
eightOneNineFallbacks.put(Items.COPPER_CHEST, Items.CHEST);
|
||||
eightOneNineFallbacks.put(Items.EXPOSED_COPPER_CHEST, Items.CHEST);
|
||||
eightOneNineFallbacks.put(Items.WEATHERED_COPPER_CHEST, Items.CHEST);
|
||||
eightOneNineFallbacks.put(Items.OXIDIZED_COPPER_CHEST, Items.CHEST);
|
||||
eightOneNineFallbacks.put(Items.WAXED_COPPER_CHEST, Items.CHEST);
|
||||
eightOneNineFallbacks.put(Items.WAXED_EXPOSED_COPPER_CHEST, Items.CHEST);
|
||||
eightOneNineFallbacks.put(Items.WAXED_WEATHERED_COPPER_CHEST, Items.CHEST);
|
||||
eightOneNineFallbacks.put(Items.WAXED_OXIDIZED_COPPER_CHEST, Items.CHEST);
|
||||
eightOneNineFallbacks.put(Items.COPPER_HELMET, Items.LEATHER_HELMET);
|
||||
eightOneNineFallbacks.put(Items.COPPER_CHESTPLATE, Items.LEATHER_CHESTPLATE);
|
||||
eightOneNineFallbacks.put(Items.COPPER_LEGGINGS, Items.LEATHER_LEGGINGS);
|
||||
eightOneNineFallbacks.put(Items.COPPER_BOOTS, Items.LEATHER_BOOTS);
|
||||
eightOneNineFallbacks.put(Items.COPPER_NUGGET, Items.IRON_NUGGET);
|
||||
eightOneNineFallbacks.put(Items.COPPER_SWORD, Items.STONE_SWORD);
|
||||
eightOneNineFallbacks.put(Items.COPPER_PICKAXE, Items.STONE_PICKAXE);
|
||||
eightOneNineFallbacks.put(Items.COPPER_SHOVEL, Items.STONE_SHOVEL);
|
||||
eightOneNineFallbacks.put(Items.COPPER_AXE, Items.STONE_AXE);
|
||||
eightOneNineFallbacks.put(Items.COPPER_HOE, Items.STONE_HOE);
|
||||
eightOneNineFallbacks.put(Items.COPPER_GOLEM_SPAWN_EGG, Items.IRON_GOLEM_SPAWN_EGG);
|
||||
|
||||
Map<Item, Item> eightOneEightFallbacks = new HashMap<>(eightOneNineFallbacks);
|
||||
eightOneEightFallbacks.put(Items.MUSIC_DISC_LAVA_CHICKEN, Items.MUSIC_DISC_CHIRP);
|
||||
Map<Item, Item> eightFourFourFallbacks = new HashMap<>();
|
||||
eightFourFourFallbacks.put(Items.WOODEN_SPEAR, Items.WOODEN_SWORD);
|
||||
eightFourFourFallbacks.put(Items.STONE_SPEAR, Items.STONE_SWORD);
|
||||
eightFourFourFallbacks.put(Items.COPPER_SPEAR, Items.COPPER_SWORD);
|
||||
eightFourFourFallbacks.put(Items.IRON_SPEAR, Items.IRON_SWORD);
|
||||
eightFourFourFallbacks.put(Items.GOLDEN_SPEAR, Items.GOLDEN_SWORD);
|
||||
eightFourFourFallbacks.put(Items.DIAMOND_SPEAR, Items.DIAMOND_SWORD);
|
||||
eightFourFourFallbacks.put(Items.NETHERITE_SPEAR, Items.NETHERITE_SWORD);
|
||||
eightFourFourFallbacks.put(Items.COPPER_NAUTILUS_ARMOR, Items.COPPER_HORSE_ARMOR);
|
||||
eightFourFourFallbacks.put(Items.IRON_NAUTILUS_ARMOR, Items.IRON_HORSE_ARMOR);
|
||||
eightFourFourFallbacks.put(Items.GOLDEN_NAUTILUS_ARMOR, Items.GOLDEN_HORSE_ARMOR);
|
||||
eightFourFourFallbacks.put(Items.DIAMOND_NAUTILUS_ARMOR, Items.DIAMOND_HORSE_ARMOR);
|
||||
eightFourFourFallbacks.put(Items.NETHERITE_NAUTILUS_ARMOR, Items.DIAMOND_HORSE_ARMOR); // Any version without nautilus armor won't have netherite horse armor either
|
||||
eightFourFourFallbacks.put(Items.NETHERITE_HORSE_ARMOR, Items.DIAMOND_HORSE_ARMOR);
|
||||
eightFourFourFallbacks.put(Items.NAUTILUS_SPAWN_EGG, Items.PUFFERFISH_SPAWN_EGG);
|
||||
eightFourFourFallbacks.put(Items.ZOMBIE_NAUTILUS_SPAWN_EGG, Items.PUFFERFISH_SPAWN_EGG);
|
||||
eightFourFourFallbacks.put(Items.CAMEL_HUSK_SPAWN_EGG, Items.CAMEL_SPAWN_EGG);
|
||||
eightFourFourFallbacks.put(Items.PARCHED_SPAWN_EGG, Items.SKELETON_SPAWN_EGG);
|
||||
|
||||
List<PaletteVersion> paletteVersions = new ArrayList<>(6);
|
||||
paletteVersions.add(new PaletteVersion("1_21_90", Bedrock_v818.CODEC.getProtocolVersion(), eightOneEightFallbacks, Conversion844_827::remapItem));
|
||||
paletteVersions.add(new PaletteVersion("1_21_93", Bedrock_v819.CODEC.getProtocolVersion(), eightOneNineFallbacks, Conversion844_827::remapItem));
|
||||
paletteVersions.add(new PaletteVersion("1_21_100", Bedrock_v827.CODEC.getProtocolVersion(), eightTwoSevenFallbacks, Conversion844_827::remapItem));
|
||||
paletteVersions.add(new PaletteVersion("1_21_110", Bedrock_v844.CODEC.getProtocolVersion()));
|
||||
paletteVersions.add(new PaletteVersion("1_21_120", Bedrock_v859.CODEC.getProtocolVersion()));
|
||||
paletteVersions.add(new PaletteVersion("1_21_120", Bedrock_v860.CODEC.getProtocolVersion()));
|
||||
paletteVersions.add(new PaletteVersion("1_21_110", Bedrock_v844.CODEC.getProtocolVersion(), eightFourFourFallbacks));
|
||||
paletteVersions.add(new PaletteVersion("1_21_120", Bedrock_v859.CODEC.getProtocolVersion(), eightFourFourFallbacks));
|
||||
paletteVersions.add(new PaletteVersion("1_21_120", Bedrock_v860.CODEC.getProtocolVersion(), eightFourFourFallbacks));
|
||||
paletteVersions.add(new PaletteVersion("1_21_130", Bedrock_v898.CODEC.getProtocolVersion()));
|
||||
|
||||
GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
|
||||
|
||||
@@ -70,10 +70,6 @@ public final class TagRegistryPopulator {
|
||||
};
|
||||
|
||||
List<ObjectIntPair<String>> paletteVersions = List.of(
|
||||
ObjectIntPair.of("1_21_90", Bedrock_v818.CODEC.getProtocolVersion()),
|
||||
// Not a typo, it's the same file
|
||||
ObjectIntPair.of("1_21_90", Bedrock_v819.CODEC.getProtocolVersion()),
|
||||
ObjectIntPair.of("1_21_100", Bedrock_v827.CODEC.getProtocolVersion()),
|
||||
ObjectIntPair.of("1_21_110", Bedrock_v844.CODEC.getProtocolVersion()),
|
||||
ObjectIntPair.of("1_21_120", Bedrock_v859.CODEC.getProtocolVersion())
|
||||
// TODO .130!
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2025 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.registry.populator.conversion;
|
||||
|
||||
import org.cloudburstmc.nbt.NbtMap;
|
||||
import org.cloudburstmc.nbt.NbtMapBuilder;
|
||||
import org.geysermc.geyser.item.Items;
|
||||
import org.geysermc.geyser.item.type.Item;
|
||||
import org.geysermc.geyser.registry.type.GeyserMappingItem;
|
||||
|
||||
public class Conversion844_827 {
|
||||
|
||||
public static NbtMap remapBlock(NbtMap nbtMap) {
|
||||
final String name = nbtMap.getString("name");
|
||||
if (name.equals("minecraft:iron_chain") || name.endsWith("copper_chain")) {
|
||||
return ConversionHelper.withName(nbtMap, "chain");
|
||||
} else if (name.endsWith("lightning_rod")) {
|
||||
NbtMapBuilder statesWithoutPoweredBit = nbtMap.getCompound("states").toBuilder();
|
||||
statesWithoutPoweredBit.remove("powered_bit");
|
||||
return nbtMap.toBuilder()
|
||||
.putString("name", "minecraft:lightning_rod")
|
||||
.putCompound("states", statesWithoutPoweredBit.build())
|
||||
.build();
|
||||
} else if (name.endsWith("_shelf") || name.endsWith("copper_golem_statue")) {
|
||||
return ConversionHelper.withoutStates("unknown");
|
||||
} else if (name.equals("minecraft:copper_torch")) {
|
||||
return ConversionHelper.withName(nbtMap, "torch");
|
||||
} else if (name.endsWith("copper_bars")) {
|
||||
return ConversionHelper.withName(nbtMap, "iron_bars");
|
||||
} else if (name.endsWith("copper_lantern")) {
|
||||
return ConversionHelper.withName(nbtMap, "lantern");
|
||||
}
|
||||
|
||||
return nbtMap;
|
||||
}
|
||||
|
||||
public static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
|
||||
if (item == Items.IRON_CHAIN || item.javaIdentifier().endsWith("copper_chain")) {
|
||||
return mapping.withBedrockIdentifier("minecraft:chain");
|
||||
}
|
||||
return mapping;
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ import org.cloudburstmc.nbt.NbtType;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.entity.type.living.animal.FrogEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.VariantHolder;
|
||||
import org.geysermc.geyser.entity.type.living.animal.farm.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.entity.type.living.animal.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.entity.type.living.animal.tameable.CatEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.tameable.WolfEntity;
|
||||
import org.geysermc.geyser.inventory.item.BannerPattern;
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.cloudburstmc.protocol.bedrock.data.TrimMaterial;
|
||||
import org.cloudburstmc.protocol.bedrock.data.TrimPattern;
|
||||
import org.geysermc.geyser.entity.type.living.animal.FrogEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.farm.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.entity.type.living.animal.TemperatureVariantAnimal;
|
||||
import org.geysermc.geyser.entity.type.living.animal.tameable.CatEntity;
|
||||
import org.geysermc.geyser.entity.type.living.animal.tameable.WolfEntity;
|
||||
import org.geysermc.geyser.inventory.item.BannerPattern;
|
||||
@@ -98,6 +98,7 @@ public class JavaRegistries {
|
||||
public static final JavaRegistryKey<TemperatureVariantAnimal.BuiltInVariant> PIG_VARIANT = create("pig_variant");
|
||||
public static final JavaRegistryKey<TemperatureVariantAnimal.BuiltInVariant> COW_VARIANT = create("cow_variant");
|
||||
public static final JavaRegistryKey<TemperatureVariantAnimal.BuiltInVariant> CHICKEN_VARIANT = create("chicken_variant");
|
||||
public static final JavaRegistryKey<TemperatureVariantAnimal.BuiltInVariant> ZOMBIE_NAUTILUS_VARIANT = create("zombie_nautilus_variant");
|
||||
|
||||
private static <T> JavaRegistryKey<T> create(String key, JavaRegistryKey.RegistryLookup<T> registryLookup) {
|
||||
JavaRegistryKey<T> registry = new JavaRegistryKey<>(MinecraftKey.key(key), registryLookup);
|
||||
|
||||
@@ -47,14 +47,14 @@ import org.geysermc.geyser.translator.inventory.horse.LlamaInventoryTranslator;
|
||||
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
||||
import org.geysermc.geyser.translator.protocol.Translator;
|
||||
import org.geysermc.geyser.util.InventoryUtils;
|
||||
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.inventory.ClientboundHorseScreenOpenPacket;
|
||||
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.inventory.ClientboundMountScreenOpenPacket;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Translator(packet = ClientboundHorseScreenOpenPacket.class)
|
||||
public class JavaHorseScreenOpenTranslator extends PacketTranslator<ClientboundHorseScreenOpenPacket> {
|
||||
@Translator(packet = ClientboundMountScreenOpenPacket.class)
|
||||
public class JavaHorseScreenOpenTranslator extends PacketTranslator<ClientboundMountScreenOpenPacket> {
|
||||
|
||||
private static final NbtMap ARMOR_SLOT;
|
||||
private static final NbtMap CARPET_SLOT;
|
||||
@@ -102,7 +102,7 @@ public class JavaHorseScreenOpenTranslator extends PacketTranslator<ClientboundH
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(GeyserSession session, ClientboundHorseScreenOpenPacket packet) {
|
||||
public void translate(GeyserSession session, ClientboundMountScreenOpenPacket packet) {
|
||||
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
|
||||
if (entity == null) {
|
||||
return;
|
||||
|
||||
Submodule core/src/main/resources/mappings updated: 15398c1588...f110274a7e
@@ -18,7 +18,7 @@ protocol-common = "3.0.0.Beta11-20251209.183710-12"
|
||||
protocol-codec = "3.0.0.Beta11-20251209.183710-13"
|
||||
raknet = "1.0.0.CR3-20251208.214317-23"
|
||||
minecraftauth = "5.0.0"
|
||||
mcprotocollib = "1.21.9-20251029.184056-18"
|
||||
mcprotocollib = "1.21.11-20251210.192611-9"
|
||||
adventure = "4.25.0"
|
||||
adventure-platform = "4.4.1"
|
||||
junit = "5.9.2"
|
||||
@@ -30,20 +30,20 @@ folia = "1.19.4-R0.1-SNAPSHOT"
|
||||
viaversion = "4.9.2"
|
||||
adapters = "1.16-SNAPSHOT"
|
||||
cloud = "2.0.0-rc.2"
|
||||
cloud-minecraft = "2.0.0-beta.13"
|
||||
cloud-minecraft-modded = "2.0.0-beta.13"
|
||||
cloud-minecraft = "2.0.0-beta.14"
|
||||
cloud-minecraft-modded = "2.0.0-beta.14"
|
||||
commodore = "2.2"
|
||||
bungeecord = "1.21-R0.1-20250215.224541-54"
|
||||
bungeecord-api = "1.21-R0.1"
|
||||
velocity = "3.4.0-SNAPSHOT"
|
||||
viaproxy = "3.3.2-SNAPSHOT"
|
||||
fabric-loader = "0.17.2"
|
||||
fabric-api = "0.133.14+1.21.9"
|
||||
fabric-api = "0.139.4+1.21.11"
|
||||
fabric-permissions-api = "0.4.1"
|
||||
neoforge-minecraft = "21.10.0-beta"
|
||||
neoforge-minecraft = "21.11.0-beta"
|
||||
mixin = "0.8.5"
|
||||
mixinextras = "0.3.5"
|
||||
minecraft = "1.21.10"
|
||||
minecraft = "1.21.11"
|
||||
mockito = "5.+"
|
||||
runtask = "2.3.1"
|
||||
runpaperversion = "1.21.10"
|
||||
@@ -53,7 +53,7 @@ runvelocityversion = "3.4.0-SNAPSHOT"
|
||||
indra = "3.1.3"
|
||||
shadow = "8.1.1"
|
||||
architectury-plugin = "3.4-SNAPSHOT"
|
||||
architectury-loom = "1.11-SNAPSHOT"
|
||||
architectury-loom = "1.13-SNAPSHOT"
|
||||
minotaur = "2.8.7"
|
||||
lombok = "8.4"
|
||||
blossom = "2.1.0"
|
||||
|
||||
Reference in New Issue
Block a user