1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2026-01-04 15:31:36 +00:00

Merge remote-tracking branch 'upstream/master' into feature/configurate

# Conflicts:
#	bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyLogger.java
#	build-logic/src/main/kotlin/geyser.base-conventions.gradle.kts
#	core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java
#	core/src/main/java/org/geysermc/geyser/pack/GeyserResourcePackManifest.java
#	core/src/main/java/org/geysermc/geyser/registry/loader/SoundRegistryLoader.java
#	core/src/main/java/org/geysermc/geyser/util/WebUtils.java
#	gradle/libs.versions.toml
This commit is contained in:
onebeastchris
2025-04-26 01:08:15 +02:00
292 changed files with 33826 additions and 18032 deletions

View File

@@ -25,6 +25,6 @@
"depends": {
"fabricloader": ">=0.16.7",
"fabric-api": "*",
"minecraft": ">=1.21.4"
"minecraft": ">=1.21.5"
}
}

View File

@@ -16,12 +16,12 @@ config = "geyser_neoforge.mixins.json"
[[dependencies.geyser_neoforge]]
modId="neoforge"
type="required"
versionRange="[21.0.0-beta,)"
versionRange="[21.5.0-beta,)"
ordering="NONE"
side="BOTH"
[[dependencies.geyser_neoforge]]
modId="minecraft"
type="required"
versionRange="[1.21,)"
versionRange="[1.21.5,)"
ordering="NONE"
side="BOTH"
side="BOTH"

View File

@@ -84,6 +84,13 @@ public class GeyserModLogger implements GeyserLogger {
}
}
@Override
public void debug(String message, Object... arguments) {
if (debug) {
logger.info(String.format(message, arguments));
}
}
@Override
public void setDebug(boolean debug) {
this.debug = debug;

View File

@@ -25,15 +25,13 @@
package org.geysermc.geyser.platform.mod.mixin.server;
import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.core.BlockPos;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import org.cloudburstmc.math.vector.Vector3f;
import org.cloudburstmc.protocol.bedrock.data.SoundEvent;
@@ -44,13 +42,13 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(BlockItem.class)
public class BlockPlaceMixin {
@Inject(method = "place", locals = LocalCapture.CAPTURE_FAILSOFT, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;playSound(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/core/BlockPos;Lnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundSource;FF)V"))
private void geyser$hijackPlaySound(BlockPlaceContext blockPlaceContext, CallbackInfoReturnable<InteractionResult> cir, BlockPlaceContext blockPlaceContext2, BlockState blockState, BlockPos blockPos, Level level, Player player, ItemStack itemStack, BlockState blockState2, SoundType soundType) {
@Inject(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;playSound(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/core/BlockPos;Lnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundSource;FF)V"))
private void geyser$hijackPlaySound(BlockPlaceContext blockPlaceContext, CallbackInfoReturnable<InteractionResult> callbackInfoReturnable,
@Local BlockPos pos, @Local Player player, @Local(ordinal = 1) BlockState placedState) {
if (player == null) {
return;
}
@@ -61,16 +59,16 @@ public class BlockPlaceMixin {
}
Vector3f position = Vector3f.from(
blockPos.getX(),
blockPos.getY(),
blockPos.getZ()
pos.getX(),
pos.getY(),
pos.getZ()
);
LevelSoundEventPacket placeBlockSoundPacket = new LevelSoundEventPacket();
placeBlockSoundPacket.setSound(SoundEvent.PLACE);
placeBlockSoundPacket.setPosition(position);
placeBlockSoundPacket.setBabySound(false);
placeBlockSoundPacket.setExtraData(session.getBlockMappings().getBedrockBlockId(Block.BLOCK_STATE_REGISTRY.getId(blockState2)));
placeBlockSoundPacket.setExtraData(session.getBlockMappings().getBedrockBlockId(Block.BLOCK_STATE_REGISTRY.getId(placedState)));
placeBlockSoundPacket.setIdentifier(":");
session.sendUpstreamPacket(placeBlockSoundPacket);
session.setLastBlockPlacePosition(null);