Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-17 08:30:04 +01:00
Ursprung
7281fa360f
Commit
219cd153f9
@ -2788,7 +2788,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
|||||||
if (setBlock(mutable, air)) {
|
if (setBlock(mutable, air)) {
|
||||||
if (y > getMinY()) {
|
if (y > getMinY()) {
|
||||||
BlockState block = getBlock(mutable2);
|
BlockState block = getBlock(mutable2);
|
||||||
if (block.getStates().containsKey(snowy)) {
|
if (block.getBlockType().hasPropertyOfType(snowy.getKey(), snowy.getClass())) {
|
||||||
if (setBlock(mutable2, block.with(snowy, false))) {
|
if (setBlock(mutable2, block.with(snowy, false))) {
|
||||||
affected++;
|
affected++;
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,10 @@ import com.sk89q.worldedit.registry.state.BooleanProperty;
|
|||||||
import com.sk89q.worldedit.registry.state.EnumProperty;
|
import com.sk89q.worldedit.registry.state.EnumProperty;
|
||||||
import com.sk89q.worldedit.registry.state.Property;
|
import com.sk89q.worldedit.registry.state.Property;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class SnowSimulator implements LayerFunction {
|
public class SnowSimulator implements LayerFunction {
|
||||||
|
|
||||||
@ -120,20 +120,19 @@ public class SnowSimulator implements LayerFunction {
|
|||||||
abovePosition) > 10) {
|
abovePosition) > 10) {
|
||||||
return false;
|
return false;
|
||||||
} else if (!block.getBlockType().getMaterial().isFullCube()) {
|
} else if (!block.getBlockType().getMaterial().isFullCube()) {
|
||||||
Map<Property<?>, Object> states = block.getStates();
|
BlockType type = block.getBlockType();
|
||||||
if (states.containsKey(slab) && block.getState(slab).equalsIgnoreCase("bottom")) {
|
if (type.hasPropertyOfType(slab.getKey(), slab.getClass()) && block.getState(slab).equalsIgnoreCase("bottom")) {
|
||||||
return false;
|
return false;
|
||||||
} else if (states.containsKey(trapdoorOpen) && states.containsKey(trapdoor) && (block.getState(trapdoorOpen)
|
} else if ((type.hasPropertyOfType(trapdoorOpen.getKey(), trapdoorOpen.getClass()) && block.getState(trapdoorOpen)) ||
|
||||||
|| block.getState(trapdoor).equalsIgnoreCase("bottom"))) {
|
(type.hasPropertyOfType(trapdoor.getKey(), trapdoor.getClass()) && block.getState(trapdoor).equalsIgnoreCase("bottom"))) {
|
||||||
return false;
|
return false;
|
||||||
} else if (states.containsKey(stair) && block.getState(stair).equalsIgnoreCase("bottom")) {
|
} else if (type.hasPropertyOfType(stair.getKey(), stair.getClass()) && block.getState(stair).equalsIgnoreCase("bottom")) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//FAWE end
|
//FAWE end
|
||||||
} else if (!block.getBlockType().id().toLowerCase(Locale.ROOT).contains("ice") && block
|
} else if (!block.getBlockType().id().toLowerCase(Locale.ROOT).contains("ice") && block.getBlockType()
|
||||||
.getBlockType()
|
|
||||||
.getMaterial()
|
.getMaterial()
|
||||||
.isTranslucent()) {
|
.isTranslucent()) {
|
||||||
return false;
|
return false;
|
||||||
@ -144,14 +143,14 @@ public class SnowSimulator implements LayerFunction {
|
|||||||
// We've hit the highest layer (If it doesn't contain current + 2 it means it's 1 away from full)
|
// We've hit the highest layer (If it doesn't contain current + 2 it means it's 1 away from full)
|
||||||
if (!snowLayersProperty.getValues().contains(currentHeight + 2)) {
|
if (!snowLayersProperty.getValues().contains(currentHeight + 2)) {
|
||||||
if (this.extent.setBlock(abovePosition, snowBlock)) {
|
if (this.extent.setBlock(abovePosition, snowBlock)) {
|
||||||
if (block.getStates().containsKey(snowy)) {
|
if (block.getBlockType().hasPropertyOfType(snowy.getKey(), snowy.getClass())) {
|
||||||
this.extent.setBlock(position, block.with(snowy, true));
|
this.extent.setBlock(position, block.with(snowy, true));
|
||||||
}
|
}
|
||||||
this.affected++;
|
this.affected++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.extent.setBlock(abovePosition, above.with(snowLayersProperty, currentHeight + 1))) {
|
if (this.extent.setBlock(abovePosition, above.with(snowLayersProperty, currentHeight + 1))) {
|
||||||
if (block.getStates().containsKey(snowy)) {
|
if (block.getBlockType().hasPropertyOfType(snowy.getKey(), snowy.getClass())) {
|
||||||
this.extent.setBlock(position, block.with(snowy, true));
|
this.extent.setBlock(position, block.with(snowy, true));
|
||||||
}
|
}
|
||||||
this.affected++;
|
this.affected++;
|
||||||
@ -160,7 +159,7 @@ public class SnowSimulator implements LayerFunction {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.extent.setBlock(abovePosition, snow)) {
|
if (this.extent.setBlock(abovePosition, snow)) {
|
||||||
if (block.getStates().containsKey(snowy)) {
|
if (block.getBlockType().hasPropertyOfType(snowy.getKey(), snowy.getClass())) {
|
||||||
this.extent.setBlock(position, block.with(snowy, true));
|
this.extent.setBlock(position, block.with(snowy, true));
|
||||||
}
|
}
|
||||||
this.affected++;
|
this.affected++;
|
||||||
|
@ -254,7 +254,8 @@ public class BlockType implements Keyed, Pattern {
|
|||||||
* @param propertyType the expected type of the property
|
* @param propertyType the expected type of the property
|
||||||
* @since TODO
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public boolean hasPropertyOfType(PropertyKey key, Class<?> propertyType) {
|
@SuppressWarnings("rawtypes")
|
||||||
|
public boolean hasPropertyOfType(PropertyKey key, Class<? extends Property> propertyType) {
|
||||||
int ordinal = key.getId();
|
int ordinal = key.getId();
|
||||||
Property<?> property;
|
Property<?> property;
|
||||||
return this.settings.propertiesMapArr.length > ordinal
|
return this.settings.propertiesMapArr.length > ordinal
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren