Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
92b7a6ddbc
Commit
04249488d9
@ -69,6 +69,8 @@ public class NMSWrapper15 implements NMSWrapper.INMSWrapper {
|
|||||||
index = index - 8 + 36;
|
index = index - 8 + 36;
|
||||||
}
|
}
|
||||||
player.getInventory().setItem(index, CraftItemStack.asBukkitCopy(packetPlayInSetCreativeSlot.getItemStack()));
|
player.getInventory().setItem(index, CraftItemStack.asBukkitCopy(packetPlayInSetCreativeSlot.getItemStack()));
|
||||||
|
if (index < 9) player.getInventory().setHeldItemSlot(index);
|
||||||
|
player.updateInventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -74,6 +74,8 @@ public class NMSWrapper18 implements NMSWrapper.INMSWrapper {
|
|||||||
index = index - 8 + 36;
|
index = index - 8 + 36;
|
||||||
}
|
}
|
||||||
player.getInventory().setItem(index, CraftItemStack.asBukkitCopy(packetPlayInSetCreativeSlot.c()));
|
player.getInventory().setItem(index, CraftItemStack.asBukkitCopy(packetPlayInSetCreativeSlot.c()));
|
||||||
|
if (index < 9) player.getInventory().setHeldItemSlot(index);
|
||||||
|
player.updateInventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -74,6 +74,8 @@ public class NMSWrapper19 implements NMSWrapper.INMSWrapper {
|
|||||||
index = index - 8 + 36;
|
index = index - 8 + 36;
|
||||||
}
|
}
|
||||||
player.getInventory().setItem(index, CraftItemStack.asBukkitCopy(packetPlayInSetCreativeSlot.c()));
|
player.getInventory().setItem(index, CraftItemStack.asBukkitCopy(packetPlayInSetCreativeSlot.c()));
|
||||||
|
if (index < 9) player.getInventory().setHeldItemSlot(index);
|
||||||
|
player.updateInventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -32,6 +32,7 @@ import de.steamwar.bausystem.utils.ProtocolWrapper;
|
|||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.core.Core;
|
import de.steamwar.core.Core;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -154,8 +155,10 @@ public class NoClipCommand extends SWCommand implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NOCLIPS.contains(event.getPlayer())) {
|
if (NOCLIPS.contains(event.getPlayer())) {
|
||||||
event.getPlayer().setSpectatorTarget(null);
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
||||||
|
event.getPlayer().setSpectatorTarget(null);
|
||||||
|
}, 1L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren