-
Notifications
You must be signed in to change notification settings - Fork 1
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
22 changed files
with
477 additions
and
12 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
|
||
# build cache | ||
build/ | ||
target/ | ||
.gradle/ | ||
.idea/ | ||
|
||
|
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,42 @@ | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
.idea/jarRepositories.xml | ||
.idea/compiler.xml | ||
.idea/libraries/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
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,8 @@ | ||
repositories { | ||
mavenCentral() | ||
maven("https://papermc.io/repo/repository/maven-public/") // Paper | ||
} | ||
|
||
dependencies { | ||
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT") // Paper | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,42 @@ | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
.idea/jarRepositories.xml | ||
.idea/compiler.xml | ||
.idea/libraries/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
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,13 @@ | ||
repositories { | ||
mavenCentral() | ||
maven("https://papermc.io/repo/repository/maven-public/") // Paper | ||
maven("https://jitpack.io/") // SaberFactions | ||
maven("https://repo.codemc.org/repository/maven-public/") // NBTAPI | ||
} | ||
|
||
@Suppress | ||
dependencies { | ||
implementation(project(":common")) | ||
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT") // Paper | ||
compileOnly("com.github.SaberLLC:Saber-Factions:4.1.2-STABLE") // SaberFactions | ||
} |
45 changes: 45 additions & 0 deletions
45
conflict-packages/src/main/java/net/momirealms/antigrieflib/comp/SaberFactionsComp.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,45 @@ | ||
package net.momirealms.antigrieflib.comp; | ||
|
||
import com.massivecraft.factions.Board; | ||
import com.massivecraft.factions.FLocation; | ||
import com.massivecraft.factions.FPlayers; | ||
import com.massivecraft.factions.zcore.fperms.Access; | ||
import com.massivecraft.factions.zcore.fperms.PermissableAction; | ||
import net.momirealms.antigrieflib.AbstractComp; | ||
import org.bukkit.Location; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
import java.util.Optional; | ||
|
||
public class SaberFactionsComp extends AbstractComp { | ||
|
||
public SaberFactionsComp(JavaPlugin plugin) { | ||
super(plugin, "SaberFactions"); | ||
} | ||
|
||
@Override | ||
public void init() { | ||
} | ||
|
||
@Override | ||
public boolean canPlace(Player player, Location location) { | ||
return Optional.ofNullable(Board.getInstance().getFactionAt(FLocation.wrap(location))) | ||
.map(faction -> faction.getAccess(FPlayers.getInstance().getByPlayer(player), PermissableAction.BUILD) == Access.ALLOW) | ||
.orElse(true); | ||
} | ||
|
||
@Override | ||
public boolean canBreak(Player player, Location location) { | ||
return Optional.ofNullable(Board.getInstance().getFactionAt(FLocation.wrap(location))) | ||
.map(faction -> faction.getAccess(FPlayers.getInstance().getByPlayer(player), PermissableAction.DESTROY) == Access.ALLOW) | ||
.orElse(true); | ||
} | ||
|
||
@Override | ||
public boolean canInteract(Player player, Location location) { | ||
return Optional.ofNullable(Board.getInstance().getFactionAt(FLocation.wrap(location))) | ||
.map(faction -> faction.getAccess(FPlayers.getInstance().getByPlayer(player), PermissableAction.CONTAINER) == Access.ALLOW) | ||
.orElse(true); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
projectVersion = 0.1 | ||
projectVersion = 0.5 | ||
projectGroup=net.momirealms | ||
|
||
#systemProp.socks.proxyHost=127.0.0.1 | ||
|
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
Oops, something went wrong.