/*
 * This file is part of Sponge, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered <https://www.spongepowered.org>
 * Copyright (c) contributors
 *
 * 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.
 */
package org.spongepowered.common.event.tracking.phase.packet.inventory;

import net.minecraft.server.level.ServerPlayer;
import org.spongepowered.common.event.tracking.phase.packet.BasicPacketContext;
import org.spongepowered.common.event.tracking.phase.packet.BasicPacketState;

public final class CreativeInventoryPacketState extends BasicPacketState {

    @Override
    public void unwind(BasicPacketContext context) {
        final ServerPlayer player = context.getPacketPlayer();
//        context.getCapturedItemsSupplier()
//            .acceptAndClearIfNotEmpty(items -> {
//                try (CauseStackManager.StackFrame frame = PhaseTracker.getCauseStackManager().pushCauseFrame()) {
//                    frame.pushCause(player);
//                    SpongeCommonEventFactory.callDropItemDrop(player, items, context);
//                }
//            });
    }
}

@@ -1362,16 +1362,239 @@
 Player;%0A
+import net.minecraft.world.entity.Entity;%0A%0Aimport org.spongepowered.api.event.cause.entity.SpawnType;%0Aimport org.spongepowered.api.event.cause.entity.SpawnTypes;%0Aimport org.spongepowered.common.event.tracking.TrackingUtil;%0A
 import o
@@ -1665,16 +1665,16 @@
 ontext;%0A
-
 import o
@@ -1744,16 +1744,53 @@
 State;%0A%0A
+import java.util.function.Supplier;%0A%0A
 public f
@@ -1894,16 +1894,22 @@
  unwind(
+final 
 BasicPac
@@ -1942,447 +1942,247 @@
     
-final ServerPlayer player = context.getPacketPlayer(
+TrackingUtil.processBlockCaptures(context
 );%0A
-//
     
+%7D%0A%0A
     
-context.getCapturedItemsSupplier()%0A//            .acceptAndClearIfNotEmpty(items -%3E %7B%0A//                try (CauseStackManager.StackFrame frame = PhaseTracker.getCauseStackManager().pushCauseFrame()) %7B%0A//                    frame.pushCause(player);%0A//                    SpongeCommonEventFactory.callDropItemDrop(player, items, context);%0A//                %7D%0A//            %7D)
+@Override%0A    public Supplier%3CSpawnType%3E getSpawnTypeForTransaction(%0A        final BasicPacketContext context, final Entity entityToSpawn%0A    ) %7B%0A        return SpawnTypes.DROPPED_ITEM
 ;%0A  

Add frame modifier for creative packets