diff --git a/src/muqsit/libcamera/CameraInstruction.php b/src/muqsit/libcamera/CameraInstruction.php index dcb5933..89bc1a2 100644 --- a/src/muqsit/libcamera/CameraInstruction.php +++ b/src/muqsit/libcamera/CameraInstruction.php @@ -37,7 +37,7 @@ public static function set( ?Vector3 $facing_pos = null ) : self{ $preset_id = libcamera::getPresetRegistry()->network_ids[spl_object_id($preset)]; - $instruction = new CameraSetInstruction($preset_id, $ease, $camera_pos, $rot, $facing_pos, null, null, null); + $instruction = new CameraSetInstruction($preset_id, $ease, $camera_pos, $rot, $facing_pos, null, null, null, false); return new self([[$instruction, null, null, null]]); } diff --git a/src/muqsit/libcamera/libcamera.php b/src/muqsit/libcamera/libcamera.php index 841cfa3..8db4326 100644 --- a/src/muqsit/libcamera/libcamera.php +++ b/src/muqsit/libcamera/libcamera.php @@ -32,11 +32,11 @@ public static function isRegistered(): bool{ public static function register(Plugin $plugin) : void{ !self::$registered || throw new BadMethodCallException("Tried to registered an already existing libcamera instance"); $preset_registry = new CameraPresetRegistry([ - "free" => new CameraPreset("minecraft:free", "", null, null, null, null, null, null, null, null, null, null, null, null, null, null, CameraPreset::AUDIO_LISTENER_TYPE_CAMERA, false, false, null), - "first_person" => new CameraPreset("minecraft:first_person", "", null, null, null, null, null, null, null, null, null, null, null, null, null, null, CameraPreset::AUDIO_LISTENER_TYPE_PLAYER, false, false, null), - "third_person" => new CameraPreset("minecraft:third_person", "", null, null, null, null, null, null, null, null, null, null, null, null, null, null, CameraPreset::AUDIO_LISTENER_TYPE_PLAYER, false, false, null), - "third_person_front" => new CameraPreset("minecraft:third_person_front", "", null, null, null, null, null, null, null, null, null, null, null, null, null, null, CameraPreset::AUDIO_LISTENER_TYPE_PLAYER, false, false, null), - "target" => new CameraPreset("minecraft:target", "minecraft:free", null, null, null, null, null, 0.0, true, new Vector2(0.0, 360.0), new Vector2(0.0, 180.0), true, 50.0, null, null, null, CameraPreset::AUDIO_LISTENER_TYPE_CAMERA, false, false, null) + "free" => new CameraPreset("minecraft:free", "", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, CameraPreset::AUDIO_LISTENER_TYPE_CAMERA, false, null, null), + "first_person" => new CameraPreset("minecraft:first_person", "", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, CameraPreset::AUDIO_LISTENER_TYPE_PLAYER, false, null, null), + "third_person" => new CameraPreset("minecraft:third_person", "", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, CameraPreset::AUDIO_LISTENER_TYPE_PLAYER, false, null, null), + "third_person_front" => new CameraPreset("minecraft:third_person_front", "", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, CameraPreset::AUDIO_LISTENER_TYPE_PLAYER, false, null, null), + "target" => new CameraPreset("minecraft:target", "minecraft:free", null, null, null, null, null, 0.0, true, new Vector2(0.0, 360.0), new Vector2(0.0, 180.0), true, 50.0, null, null, null, null, null, CameraPreset::AUDIO_LISTENER_TYPE_CAMERA, false, null, null) ]); $packet = CameraPresetsPacket::create(array_values($preset_registry->registered)); Server::getInstance()->getPluginManager()->registerEvent(DataPacketReceiveEvent::class, function(DataPacketReceiveEvent $event) use($packet) : void{ @@ -48,9 +48,7 @@ public static function register(Plugin $plugin) : void{ foreach($event->getPackets() as $packet){ if($packet instanceof StartGamePacket){ $experiments = $packet->levelSettings->experiments->getExperiments(); - $experiments["focus_target_camera"] = true; - $experiments["third_person_cameras"] = true; - $experiments["cameras"] = true; + $experiments["experimental_creator_camera"] = true;//It seems to work without it. $packet->levelSettings->experiments = new Experiments($experiments, true); } }