code cleanup
This commit is contained in:
parent
6d0d7aa3af
commit
3ab23aa69a
3 changed files with 6 additions and 6 deletions
|
@ -141,8 +141,9 @@ public class Region {
|
||||||
areas.clear();
|
areas.clear();
|
||||||
|
|
||||||
File regions_folder = new File(SaveLocation.getSaveFolder(),"regions");
|
File regions_folder = new File(SaveLocation.getSaveFolder(),"regions");
|
||||||
if (!regions_folder.exists())
|
if (!regions_folder.exists()) {
|
||||||
regions_folder.mkdirs();
|
boolean ignored = regions_folder.mkdirs();
|
||||||
|
}
|
||||||
ArrayList<File> regions = directory_utils.list_files_in_dir_recursive(regions_folder,((dir, name) -> name.endsWith(".json")));
|
ArrayList<File> regions = directory_utils.list_files_in_dir_recursive(regions_folder,((dir, name) -> name.endsWith(".json")));
|
||||||
if (prop.log_level>-1)
|
if (prop.log_level>-1)
|
||||||
System.out.println("[REGIONS] Trying to load %s areas.".replace("%s", String.valueOf(regions.size())));
|
System.out.println("[REGIONS] Trying to load %s areas.".replace("%s", String.valueOf(regions.size())));
|
||||||
|
@ -250,7 +251,7 @@ public class Region {
|
||||||
|
|
||||||
File perms_folder = new File(get_path_string(SaveLocation.getSaveFolder().getPath(),"region_perms", area.name));
|
File perms_folder = new File(get_path_string(SaveLocation.getSaveFolder().getPath(),"region_perms", area.name));
|
||||||
if (!perms_folder.exists()) {
|
if (!perms_folder.exists()) {
|
||||||
perms_folder.mkdirs();
|
boolean ignored = perms_folder.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -21,7 +21,7 @@ import static net.pietru.cookie_utils.api.Region.*;
|
||||||
public class PlayerEntityMixin extends EntityMixin{
|
public class PlayerEntityMixin extends EntityMixin{
|
||||||
|
|
||||||
@Inject(method = "onAttackInteraction", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "onAttackInteraction", at = @At("HEAD"), cancellable = true)
|
||||||
private void event_player_attack(CallbackInfo ci, @Local Entity sourceEntity){
|
private void event_player_attack(CallbackInfo ci, @Local(argsOnly = true) Entity sourceEntity){
|
||||||
if (sourceEntity instanceof PlayerEntity){
|
if (sourceEntity instanceof PlayerEntity){
|
||||||
Account account = ((PlayerEntity) sourceEntity).getPlayer().getAccount();
|
Account account = ((PlayerEntity) sourceEntity).getPlayer().getAccount();
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ public class PlayerEntityMixin extends EntityMixin{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "hit", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "hit", at = @At("HEAD"), cancellable = true)
|
||||||
private void event_player_hit(CallbackInfo ci, @Local IDamageSource damageSource, @Local float amount){
|
private void event_player_hit(CallbackInfo ci, @Local(argsOnly = true) IDamageSource damageSource, @Local(argsOnly = true) float amount){
|
||||||
if (damageSource instanceof Entity) {
|
if (damageSource instanceof Entity) {
|
||||||
if (damageSource instanceof PlayerEntity) {
|
if (damageSource instanceof PlayerEntity) {
|
||||||
Account account = ((PlayerEntity) damageSource).getPlayer().getAccount();
|
Account account = ((PlayerEntity) damageSource).getPlayer().getAccount();
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package net.pietru.cookie_utils.permissions;
|
package net.pietru.cookie_utils.permissions;
|
||||||
|
|
||||||
import com.badlogic.gdx.utils.JsonValue;
|
import com.badlogic.gdx.utils.JsonValue;
|
||||||
import finalforeach.cosmicreach.settings.ServerSettings;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
Loading…
Reference in a new issue