Skip to content

Commit

Permalink
allow non-solid blocks in cuboid.spawnable_blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 1, 2020
1 parent ff44cb9 commit 69fc9d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Expand Up @@ -75,7 +75,8 @@ public String getName() {
@Override
public boolean applyDetermination(ScriptPath path, ObjectTag determinationObj) {
String determination = determinationObj.toString();
if (determination.startsWith("icon:")) {
String determineLow = CoreUtilities.toLowerCase(determination);
if (determineLow.startsWith("icon:")) {
String iconFile = determination.substring("icon:".length());
CachedServerIcon icon = iconCache.get(iconFile);
if (icon != null) {
Expand All @@ -99,7 +100,7 @@ public boolean applyDetermination(ScriptPath path, ObjectTag determinationObj) {
}
return true;
}
if (determination.length() > 0 && !determination.equalsIgnoreCase("none")) {
if (determination.length() > 0 && !determineLow.equalsIgnoreCase("none")) {
List<String> values = CoreUtilities.split(determination, '|', 2);
if (ArgumentHelper.matchesInteger(values.get(0))) {
event.setMaxPlayers(Integer.parseInt(values.get(0)));
Expand Down
Expand Up @@ -624,8 +624,8 @@ public ListTag getSpawnableBlocks(List<MaterialTag> mats, Attribute attribute) {
loc = new LocationTag(loc_1.clone().add(x, y, z));
if (!loc.getBlockTypeForTag(attribute).isSolid()
&& !(new LocationTag(loc.clone().add(0, 1, 0)).getBlockTypeForTag(attribute)).isSolid()
&& new LocationTag(loc.clone().add(0, -1, 0)).getBlockTypeForTag(attribute).isSolid()
&& matchesMaterialList(loc.clone().add(0, -1, 0), mats, attribute)) {
&& (new LocationTag(loc.clone().add(0, -1, 0)).getBlockTypeForTag(attribute).isSolid()
|| (mats != null && matchesMaterialList(loc.clone().add(0, -1, 0), mats, attribute)))) {
// Get the center of the block, so the entity won't suffocate
// inside the edges for a couple of seconds
loc.add(0.5, 0, 0.5);
Expand Down

0 comments on commit 69fc9d3

Please sign in to comment.