Skip to content

Commit 4b430ad

Browse files
committed
v1.0.0
1 parent a7cb86b commit 4b430ad

File tree

16 files changed

+294
-709
lines changed

16 files changed

+294
-709
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16+
- name: Set up JDK 16
17+
uses: actions/setup-java@v2
18+
with:
19+
distribution: 'adopt'
20+
java-version: '16'
21+
- name: Build and analyze
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
24+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
25+
run: mvn verify

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target/
2+
*.class
3+
/.classpath
4+
/.DS_Store

LICENSE

Lines changed: 246 additions & 674 deletions
Large diffs are not rendered by default.

starlin_l2/pom.xml renamed to pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<artifactId>starlin_l2</artifactId>
66
<groupId>com.github.katorly</groupId>
7-
<version>1.0-SNAPSHOT</version>
7+
<version>1.0.0</version>
88

99
<!-- Repositories -->
1010
<repositories>
@@ -41,7 +41,7 @@
4141
<artifactId>maven-antrun-plugin</artifactId>
4242
<configuration>
4343
<tasks>
44-
<copy file="target/starlin_l2-1.0-SNAPSHOT.jar" todir="/Users/Aditya/Desktop/spigot/plugins"/>
44+
<copy file="target/starlin_l2-1.0-SNAPSHOT.jar" todir="/workspace"/>
4545
</tasks>
4646
</configuration>
4747
<executions>

starlin_l2/src/main/java/com/github/katorly/starlin_l2/EventListener.java renamed to src/main/java/com/github/katorly/starlin_l2/EventListener.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@
1313
import org.bukkit.event.player.PlayerJoinEvent;
1414

1515
public class EventListener implements Listener {
16-
@EventHandler
17-
public void onCropTrample(PlayerInteractEvent e) {
18-
if (e.getAction() == Action.PHYSICAL && e.getClickedBlock().getType() == Material.FARMLAND) {
19-
e.setCancelled(true);
20-
}
21-
}
22-
23-
@EventHandler
16+
@EventHandler //Prevent players from stucking in the Nether Portal when logging in.
2417
public void onPlayerJoin(PlayerJoinEvent e) {
2518
Player p = e.getPlayer();
2619
Location l = p.getLocation();
@@ -36,8 +29,16 @@ public void onPlayerJoin(PlayerJoinEvent e) {
3629
|| (l_xl.getBlock().getType() == Material.NETHER_PORTAL) || (l_xr.getBlock().getType() == Material.NETHER_PORTAL)
3730
|| (l_up.getBlock().getType() == Material.NETHER_PORTAL) || (l_down.getBlock().getType() == Material.NETHER_PORTAL)
3831
|| (l_zl.getBlock().getType() == Material.NETHER_PORTAL) || (l_zr.getBlock().getType() == Material.NETHER_PORTAL)) {
39-
p.chat("/spawn");
40-
MessageSender.sendMessage(p, "&b&l星林宇宙 &r&8>> &7检测到您在下界门处登录, 为防止您无法正常登录, 已将您传送到主城!");
32+
Location spawn = w.getSpawnLocation();
33+
p.teleport(spawn);
34+
MessageSender.sendMessage(p, "&b&l星林宇宙 &r&8>> &7检测到您在下界门处登录, 为防止您无法正常登录, 已将您传送到出生点!");
35+
}
36+
}
37+
38+
@EventHandler //Prevent crops from being trampled.
39+
public void onCropTrample(PlayerInteractEvent e) {
40+
if (e.getAction() == Action.PHYSICAL && e.getClickedBlock().getType() == Material.FARMLAND) {
41+
e.setCancelled(true);
4142
}
4243
}
43-
}
44+
}

starlin_l2/src/main/java/com/github/katorly/starlin_l2/backup/MessageSender.java renamed to src/main/java/com/github/katorly/starlin_l2/backup/MessageSender.java

File renamed without changes.

starlin_l2/src/main/java/com/github/katorly/starlin_l2/starlin_l2.java renamed to src/main/java/com/github/katorly/starlin_l2/starlin_l2.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ public starlin_l2() {
1414
@Override
1515
public void onEnable() {
1616
getServer().getPluginManager().registerEvents(new EventListener(),this);
17-
Bukkit.getLogger().fine("Starlin_L2 enabled! Made for StarlinWorld server only.");
18-
Bukkit.getLogger().info("Author: Katorly");
17+
Bukkit.getLogger().info("[Starlin_L2] Author: Katorly");
18+
Bukkit.getLogger().info("[Starlin_L2] Starlin_L2 enabled! Made for StarlinWorld server only.");
1919
}
2020

2121
@Override
2222
public void onDisable() {
2323
HandlerList.unregisterAll(this);
24-
Bukkit.getLogger().fine("Starlin_L2 disabled!");
24+
Bukkit.getLogger().info("[Starlin_L2] Starlin_L2 disabled!");
2525
}
2626
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: starlin_l2
2-
version: "1.0-SNAPSHOT"
2+
version: "1.0.0"
33
author: Katorly
44
main: com.github.katorly.starlin_l2.starlin_l2
5-
api-version: "1.18"
5+
api-version: 1.18
66
description: A Spigot plugin made for StarlinWorld.

starlin_l2/src/main/resources/plugin.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)