Skip to content

Commit

Permalink
fix: console thrown player null
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlimiter committed Jan 28, 2024
1 parent f772d4e commit d2d2134
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 9 deletions.
3 changes: 3 additions & 0 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ processResources {

tasks.withType(JavaCompile).configureEach {
options.setEncoding("UTF-8")
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of("${jdk_version}")
}
}

jar {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ org.gradle.daemon=false
mod_id=atomsweep
mod_name=AtomSweep-forge
mod_license=GPL V3
mod_version=0.2.1
mod_version=0.2.2
mod_group_id=committee.nova.atom
mod_authors=cnlimiter
mod_description=Example mod description.\nNewline characters can be used and will be replaced properly.
# Dependency Properties
minecraft_version=1.20.1
toml_version=0.1.3
toml_version=0.1.4
lombok_version=1.18.24
lickperms_version=5.4
4 changes: 3 additions & 1 deletion src/main/java/nova/committee/atom/sweep/Static.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ public static Boolean cmdPermission(CommandSourceStack source, String permission
return source.hasPermission(2);
else
return true;
else if (!source.isPlayer())
return source.hasPermission(2);
else
try {
return Static.hasPermission(source.getPlayerOrException(), permission);
} catch (CommandSyntaxException e) {
throw new RuntimeException(e);
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.tomlj.TomlTable;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
Expand All @@ -21,10 +22,10 @@ public class ItemsConfig extends AutoLoadTomlConfig {
private boolean itemWhiteMode = true;
@TableField(rightComment = "黑名单模式")
private boolean itemBlackMode = true;
@TableField(rightComment = "白名单")
@TableField(rightComment = "白名单(优先级高于黑名单)")
private List<String> itemEntitiesWhitelist = Arrays.asList("minecraft:diamond", "minecraft:emerald");
@TableField(rightComment = "黑名单")
private List<String> itemEntitiesBlacklist = List.of();
private List<String> itemEntitiesBlacklist = Collections.emptyList();

public ItemsConfig() {
super(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.tomlj.TomlTable;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
Expand All @@ -28,11 +29,12 @@ public class MobsConfig extends AutoLoadTomlConfig {
@TableField(rightComment = "黑名单模式")
private boolean mobBlackMode = true;
@TableField(rightComment = "生物白名单")
private List<String> mobEntitiesWhitelist = Arrays.asList("minecraft:cat", "minecraft:mule", "minecraft:wolf", "minecraft:horse",
"minecraft:donkey", "minecraft:wither", "minecraft:guardian", "minecraft:villager", "minecraft:iron_golem", "minecraft:snow_golem",
private List<String> mobEntitiesWhitelist = Arrays.asList(
"minecraft:chicken", "minecraft:cat", "minecraft:mule", "minecraft:wolf", "minecraft:horse", "minecraft:donkey",
"minecraft:wither", "minecraft:guardian", "minecraft:villager", "minecraft:iron_golem", "minecraft:snow_golem",
"minecraft:vindicator", "minecraft:ender_dragon", "minecraft:elder_guardian");
@TableField(rightComment = "生物黑名单")
private List<String> mobEntitiesBlacklist = List.of();
private List<String> mobEntitiesBlacklist = Collections.emptyList();

public boolean isAnimalEntitiesCleanupEnable() {
return isAnimalEntitiesCleanupEnable;
Expand Down
1 change: 1 addition & 0 deletions versions/1.16.5/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ loom.platform=forge
minecraft_dependency=1.16.x
minecraft_version_range=[1.16,1.17)
pack_format_number=6
jdk_version=8

1 change: 1 addition & 0 deletions versions/1.18.2/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ loom.platform=forge
minecraft_dependency=1.18.x
minecraft_version_range=[1.18,1.19)
pack_format_number=8
jdk_version=17

1 change: 1 addition & 0 deletions versions/1.19.2/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ loom.platform=forge
minecraft_dependency=1.19.2
minecraft_version_range=[1.19.2,1.19.3)
pack_format_number=9
jdk_version=17
2 changes: 1 addition & 1 deletion versions/1.19.3/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ loom.platform=forge
minecraft_dependency=1.19.3
minecraft_version_range=[1.19.3,1.19.4)
pack_format_number=9

jdk_version=17
1 change: 1 addition & 0 deletions versions/1.19.4/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ loom.platform=forge
minecraft_dependency=1.19.4
minecraft_version_range=[1.19.4,1.20)
pack_format_number=9
jdk_version=17
1 change: 1 addition & 0 deletions versions/1.20.1/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ loom.platform=forge
minecraft_dependency=1.20.x
minecraft_version_range=[1.20,1.21)
pack_format_number=12
jdk_version=17

0 comments on commit d2d2134

Please sign in to comment.