-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements selection tool, area displays, and /plot create
- Loading branch information
Showing
34 changed files
with
976 additions
and
67 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
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
16 changes: 16 additions & 0 deletions
16
Core/src/main/java/br/com/gamemods/minecity/api/MathUtil.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,16 @@ | ||
package br.com.gamemods.minecity.api; | ||
|
||
public class MathUtil | ||
{ | ||
private MathUtil() {} | ||
|
||
public static <C extends Comparable<C>, T extends C> T min(T a, T b) | ||
{ | ||
return (a.compareTo(b) <= 0)? a : b; | ||
} | ||
|
||
public static <C extends Comparable<C>, T extends C> T max(T a, T b) | ||
{ | ||
return (a.compareTo(b) >= 0)? a : b; | ||
} | ||
} |
13 changes: 10 additions & 3 deletions
13
Core/src/main/java/br/com/gamemods/minecity/api/command/CommandEvent.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 |
---|---|---|
@@ -1,24 +1,31 @@ | ||
package br.com.gamemods.minecity.api.command; | ||
|
||
import br.com.gamemods.minecity.api.Sync; | ||
import br.com.gamemods.minecity.api.world.BlockPos; | ||
import br.com.gamemods.minecity.MineCity; | ||
import br.com.gamemods.minecity.api.world.EntityPos; | ||
import br.com.gamemods.minecity.structure.ClaimedChunk; | ||
import br.com.gamemods.minecity.structure.Inconsistency; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public class CommandEvent | ||
{ | ||
public final MineCity mineCity; | ||
public final CommandSender sender; | ||
public final EntityPos position; | ||
public final List<String> path; | ||
public final List<String> args; | ||
|
||
public CommandEvent(CommandSender sender, List<String> path, List<String> args) | ||
{ | ||
this.mineCity = sender.getServer().getMineCity(); | ||
this.sender = sender; | ||
this.path = path; | ||
this.args = args; | ||
position = sender.getPosition(); | ||
} | ||
|
||
public ClaimedChunk getChunk() | ||
{ | ||
return mineCity.getChunk(position.getChunk()).orElseGet(()-> Inconsistency.claim(position.getChunk())); | ||
} | ||
} |
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
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.