-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
356 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
plugins { | ||
id("java") | ||
id("io.papermc.paperweight.userdev") | ||
} | ||
|
||
dependencies { | ||
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT") | ||
compileOnly(project(":api")) | ||
} | ||
|
||
tasks { | ||
assemble { | ||
dependsOn(reobfJar) | ||
} | ||
compileJava { | ||
options.encoding = "UTF-8" | ||
} | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
} |
25 changes: 25 additions & 0 deletions
25
nms/v1_21_R1/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R4/PlayerNMS.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package fr.euphyllia.skyllia.utils.nms.v1_20_R4; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class PlayerNMS extends fr.euphyllia.skyllia.api.utils.nms.PlayerNMS { | ||
|
||
public void setOwnWorldBorder(JavaPlugin main, Player player, @NotNull Location centerBorder, double borderSize, int warningBlocks, int warningTime) { | ||
player.getScheduler().execute(main, () -> { | ||
final net.minecraft.world.level.border.WorldBorder worldBorderPlayer = new net.minecraft.world.level.border.WorldBorder(); | ||
worldBorderPlayer.world = ((org.bukkit.craftbukkit.CraftWorld) centerBorder.getWorld()).getHandle(); | ||
worldBorderPlayer.setCenter(centerBorder.getBlockX(), centerBorder.getBlockZ()); | ||
worldBorderPlayer.setSize(borderSize); | ||
worldBorderPlayer.setWarningBlocks(warningBlocks); | ||
worldBorderPlayer.setWarningTime(warningTime); | ||
final net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket updateWorldBorderPacket = new net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket(worldBorderPlayer); | ||
org.bukkit.craftbukkit.entity.CraftPlayer craftPlayer = ((org.bukkit.craftbukkit.entity.CraftPlayer) player); | ||
craftPlayer.getHandle().connection.send(updateWorldBorderPacket); | ||
}, null, 0L); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.