Skip to content

Commit

Permalink
idk what happened :(
Browse files Browse the repository at this point in the history
I lost some stuff.
  • Loading branch information
nicegamer7 committed May 3, 2020
1 parent 7203a82 commit 7ca6587
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 61 deletions.
49 changes: 6 additions & 43 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,60 +13,29 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>me.lucko:commodore</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>me.lucko.commodore</pattern>
<shadedPattern>xyz.ng7.rSpawn.commodore</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/public/</url>
</repository>
<repository>
<id>Multiverse Snapshots</id>
<url>http://repo.onarandombox.com/content/repositories/multiverse-snapshots/</url>
</repository>
<repository>
<id>minecraft-libraries</id>
<name>Minecraft Libraries</name>
<url>https://libraries.minecraft.net</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
Expand All @@ -79,12 +48,6 @@
<artifactId>Multiverse-Inventories</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>me.lucko</groupId>
<artifactId>commodore</artifactId>
<version>1.7</version>
<scope>compile</scope>
</dependency>
</dependencies>

<properties>
Expand Down
5 changes: 1 addition & 4 deletions rSpawn.iml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.bukkit:bukkit:1.15.2-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" name="Maven: net.md-5:bungeecord-chat:1.15-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.25" level="project" />
<orderEntry type="library" name="Maven: com.onarandombox.multiversecore:Multiverse-Core:4.1.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.onarandombox.multiverseinventories:Multiverse-Inventories:4.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: me.lucko:commodore:1.7" level="project" />
<orderEntry type="library" name="Maven: com.mojang:brigadier:1.0.17" level="project" />
</component>
</module>
8 changes: 4 additions & 4 deletions src/main/java/xyz/ng7/rSpawn/Listeners/OnJoin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import com.onarandombox.multiverseinventories.MultiverseInventories;
import com.onarandombox.multiverseinventories.WorldGroup;
import com.onarandombox.multiverseinventories.share.Sharables;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChangedWorldEvent;
import xyz.ng7.rSpawn.MultiverseInventories.SpawnPointSharable;
import xyz.ng7.rSpawn.rSpawn;
import xyz.ng7.rSpawn.Utils.SpawnLocation;

Expand All @@ -28,14 +28,14 @@ public void onJoin(PlayerChangedWorldEvent e) {
Player p = e.getPlayer();
List<WorldGroup> lwg = this.i.getGroupManager().getGroupsForWorld(p.getWorld().getName());

for (WorldGroup fg: lwg) if (fg.isSharing(Sharables.SPAWN_LOCATION)) {
for (WorldGroup fg: lwg) if (fg.isSharing(SpawnPointSharable.SPAWN_POINT)) {
g = fg.getName();
break;
}

if (g != null && Sharables.getPlayerSpawnLocation(p) == null) {
if (g != null && SpawnPointSharable.getPlayerSpawnPoint(p) == null) {
Location sp = new SpawnLocation(this.c, p.getWorld()).gen();
Sharables.setPlayerSpawnLocation(p, sp);
SpawnPointSharable.setPlayerSpawnPoint(p, sp);
p.teleport(sp);
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/xyz/ng7/rSpawn/Listeners/OnRespawn.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import com.onarandombox.multiverseinventories.MultiverseInventories;
import com.onarandombox.multiverseinventories.WorldGroup;
import com.onarandombox.multiverseinventories.share.Sharables;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerRespawnEvent;
import xyz.ng7.rSpawn.MultiverseInventories.SpawnPointSharable;
import xyz.ng7.rSpawn.rSpawn;
import xyz.ng7.rSpawn.Utils.SpawnLocation;

Expand All @@ -28,25 +28,25 @@ public void onRespawn(PlayerRespawnEvent e) {
Player p = e.getPlayer();
List<WorldGroup> lwg = this.i.getGroupManager().getGroupsForWorld(p.getWorld().getName());

for (WorldGroup fg: lwg) if (fg.isSharing(Sharables.SPAWN_LOCATION)) {
for (WorldGroup fg: lwg) if (fg.isSharing(SpawnPointSharable.SPAWN_POINT)) {
g = fg.getName();
break;
}

if (g != null) {
if (e.isBedSpawn()) return;

Location sp = Sharables.getPlayerSpawnLocation(p);
Location sp = SpawnPointSharable.getPlayerSpawnPoint(p);
if (sp != null) {
if (sp.getY() != sp.getWorld().getHighestBlockYAt(sp)) {
sp.setY(sp.getWorld().getHighestBlockYAt(sp));
Sharables.setPlayerSpawnLocation(p, sp);
SpawnPointSharable.setPlayerSpawnPoint(p, sp);
}

e.setRespawnLocation(sp);
} else {
Sharables.setPlayerSpawnLocation(p, new SpawnLocation(this.c, p.getWorld()).gen());
e.setRespawnLocation(Sharables.getPlayerSpawnLocation(p));
SpawnPointSharable.setPlayerSpawnPoint(p, new SpawnLocation(this.c, p.getWorld()).gen());
e.setRespawnLocation(SpawnPointSharable.getPlayerSpawnPoint(p));
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/xyz/ng7/rSpawn/rSpawn.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import org.bukkit.plugin.java.JavaPlugin;
import xyz.ng7.rSpawn.Listeners.OnJoin;
import xyz.ng7.rSpawn.Listeners.OnRespawn;
import xyz.ng7.rSpawn.MultiverseInventories.SpawnPointSharable;
import xyz.ng7.rSpawn.Utils.ConfigFile;

public class rSpawn extends JavaPlugin {
private FileConfiguration config;
private SpawnPointSharable sharable;
private MultiverseInventories inventories;

public rSpawn() {
Expand All @@ -18,7 +20,7 @@ public rSpawn() {
if (inventories == null) {
getLogger().severe("Multiverse Inventories not found. Disabling plugin.");
getServer().getPluginManager().disablePlugin(this);
}
} else sharable = new SpawnPointSharable(this);
}

private void checkConfigVersion() {
Expand Down Expand Up @@ -49,4 +51,4 @@ public FileConfiguration getConfigFile() {
public MultiverseInventories getInventories() {
return inventories;
}
}
}
28 changes: 26 additions & 2 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
name: rSpawn
version: 1.2.0
api-version: 1.15
author: nicegamer7
main: xyz.ng7.rSpawn.rSpawn
depend:
- Multiverse-Inventories
description: Gives each player their own spawn point.
depend: [Multiverse-Inventories]
commands:
rspawn:
description: The rSpawn command.
usage: /<command> [get|set]
permissions:
rspawn.get.self:
description: Permission to get spawn point for player.
rspawn.get.other:
description: Permission to get spawn point for other players.
rspawn.get:
description: Permission to get spawn point for all players.
children: [rspawn.get.self, rspawn.get.other]
rspawn.set.self:
description: Permission to set spawn point for player.
rspawn.set.other:
description: Permission to set spawn point for other players.
rspawn.set:
description: Permission to set spawn point for all players.
children: [rspawn.set.self, rspawn.set.other]
rspawn.*:
description: Permission to use all rSpawn commands
children: [rspawn.get, rspawn.set]

0 comments on commit 7ca6587

Please sign in to comment.