Dieser Commit ist enthalten in:
Ursprung
75dcb3dbea
Commit
f323c043b2
@ -17,14 +17,14 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.bausystem.features.xray;
|
package de.steamwar.bausystem.shared;
|
||||||
|
|
||||||
import net.minecraft.server.v1_15_R1.EntityPlayer;
|
import net.minecraft.server.v1_15_R1.EntityPlayer;
|
||||||
import net.minecraft.server.v1_15_R1.PacketPlayInFlying;
|
import net.minecraft.server.v1_15_R1.PacketPlayInFlying;
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class XrayWrapper15 implements XrayWrapper {
|
public class PlayerMovementWrapper15 implements PlayerMovementWrapper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPosition(Player player, Object object) {
|
public void setPosition(Player player, Object object) {
|
@ -17,14 +17,14 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.bausystem.features.xray;
|
package de.steamwar.bausystem.shared;
|
||||||
|
|
||||||
import net.minecraft.network.protocol.game.PacketPlayInFlying;
|
import net.minecraft.network.protocol.game.PacketPlayInFlying;
|
||||||
import net.minecraft.server.level.EntityPlayer;
|
import net.minecraft.server.level.EntityPlayer;
|
||||||
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class XrayWrapper18 implements XrayWrapper {
|
public class PlayerMovementWrapper18 implements PlayerMovementWrapper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPosition(Player player, Object object) {
|
public void setPosition(Player player, Object object) {
|
@ -17,14 +17,14 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.bausystem.features.xray;
|
package de.steamwar.bausystem.shared;
|
||||||
|
|
||||||
import net.minecraft.network.protocol.game.PacketPlayInFlying;
|
import net.minecraft.network.protocol.game.PacketPlayInFlying;
|
||||||
import net.minecraft.server.level.EntityPlayer;
|
import net.minecraft.server.level.EntityPlayer;
|
||||||
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class XrayWrapper19 implements XrayWrapper {
|
public class PlayerMovementWrapper19 implements PlayerMovementWrapper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPosition(Player player, Object object) {
|
public void setPosition(Player player, Object object) {
|
@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.tpslimit;
|
|||||||
|
|
||||||
import com.comphenix.tinyprotocol.Reflection;
|
import com.comphenix.tinyprotocol.Reflection;
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.features.xray.XrayWrapper;
|
import de.steamwar.bausystem.shared.PlayerMovementWrapper;
|
||||||
import de.steamwar.bausystem.utils.NMSWrapper;
|
import de.steamwar.bausystem.utils.NMSWrapper;
|
||||||
import de.steamwar.bausystem.utils.ProtocolAPI;
|
import de.steamwar.bausystem.utils.ProtocolAPI;
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
@ -99,7 +99,7 @@ public class TPSLimitUtils {
|
|||||||
BiFunction<Player, Object, Object> positionSetter = (player, o) -> {
|
BiFunction<Player, Object, Object> positionSetter = (player, o) -> {
|
||||||
if (currentTPSLimit < 20) {
|
if (currentTPSLimit < 20) {
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
||||||
XrayWrapper.impl.setPosition(player, o);
|
PlayerMovementWrapper.impl.setPosition(player, o);
|
||||||
}, 1L);
|
}, 1L);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ import de.steamwar.bausystem.linkage.LinkageType;
|
|||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.linkage.LinkedInstance;
|
import de.steamwar.bausystem.linkage.LinkedInstance;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
|
import de.steamwar.bausystem.shared.PlayerMovementWrapper;
|
||||||
import de.steamwar.bausystem.utils.ProtocolAPI;
|
import de.steamwar.bausystem.utils.ProtocolAPI;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.core.CraftbukkitWrapper;
|
import de.steamwar.core.CraftbukkitWrapper;
|
||||||
@ -115,7 +116,7 @@ public class XrayCommand extends SWCommand implements Listener {
|
|||||||
Region region = Region.getRegion(player.getLocation());
|
Region region = Region.getRegion(player.getLocation());
|
||||||
if (hidden.containsKey(region) && hidden.get(region).contains(player)) {
|
if (hidden.containsKey(region) && hidden.get(region).contains(player)) {
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
||||||
XrayWrapper.impl.setPosition(player, o);
|
PlayerMovementWrapper.impl.setPosition(player, o);
|
||||||
}, 1L);
|
}, 1L);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,14 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.bausystem.features.xray;
|
package de.steamwar.bausystem.shared;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.core.VersionDependent;
|
import de.steamwar.core.VersionDependent;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public interface XrayWrapper {
|
public interface PlayerMovementWrapper {
|
||||||
XrayWrapper impl = VersionDependent.getVersionImpl(BauSystem.getInstance());
|
PlayerMovementWrapper impl = VersionDependent.getVersionImpl(BauSystem.getInstance());
|
||||||
|
|
||||||
void setPosition(Player player, Object object);
|
void setPosition(Player player, Object object);
|
||||||
}
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren