Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
09bd095
Add data from MCUtils for 1.21
me4502 Jun 15, 2024
1771e45
Fix nbt access in proxy
octylFractal Jun 15, 2024
956055c
Lazily compute BlockState#getAsString (#2566)
me4502 Jul 6, 2024
8482aa5
Remove <1.16 //drawsel max size handling (#2572)
me4502 Jul 7, 2024
e44e10f
Cleanup registry init (#2583)
me4502 Jul 25, 2024
48acc7d
Attempt to fix #2125
seijikun Nov 11, 2022
e8faf85
Fix SideEffectSet inconsistencies, improve perf
octylFractal Sep 7, 2024
efeedaa
Add property-based testing for SideEffectSet
octylFractal Sep 7, 2024
36cc32c
Changes /curve /line thickness param from int to double (#2623)
Harvestminer Sep 11, 2024
67cb690
Make task executor lifecycled to platform readiness.
wizjany Feb 17, 2025
23ab70f
Bump lin-bus to support old schematics better
octylFractal Oct 2, 2024
bdf7b68
Data updates for 1.21.2
octylFractal Oct 22, 2024
8fdc98c
[Bukkit] Stop using EnumMap for potential registry types
octylFractal Nov 1, 2024
e8b3b52
Add parent dir to manifest classpath to account for paper-remapped lo…
wizjany Jan 6, 2025
fd06515
Add setBiome override in MaskingExtent.
wizjany Feb 1, 2025
bad5992
Add //mirror as an alias of //flip. (#2714)
wizjany Feb 17, 2025
6580d4d
Remove never-working caching and fix bugs in region code (#2716)
octylFractal Feb 18, 2025
aab0589
Fix negative height cones.
wizjany Mar 2, 2025
bc53008
Fix sending CUI packets to unwilling clients.
wizjany Mar 2, 2025
1048566
Added a brush for biomes (#1491)
me4502 Aug 16, 2020
841d4a0
Add morph brush (#2078)
me4502 Jun 4, 2022
5c093d7
Add a -c flag to the biome brush to set entire column (#2235)
me4502 May 21, 2023
6e0742c
Deprecate MultiStageReorder and ReorderMode (#1999)
me4502 Jun 12, 2022
d04a2a7
Add API to disable history tracking in EditSessions (#2189)
me4502 Sep 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ target
forge-download
out
run
.jqwik-database

/dependency-reduced-pom.xml
*-private.sh
Expand Down
5 changes: 4 additions & 1 deletion buildSrc/src/main/kotlin/CommonJavaConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ fun Project.applyCommonJavaConfiguration(sourcesJar: Boolean, banSlf4j: Boolean
}

tasks.withType<Test>().configureEach {
useJUnitPlatform()
useJUnitPlatform {
includeEngines("junit-jupiter", "jqwik")
}
}

dependencies {
"compileOnly"("com.google.code.findbugs:jsr305:3.0.2")
"testImplementation"("org.junit.jupiter:junit-jupiter-api:5.11.1")
"testImplementation"("org.junit.jupiter:junit-jupiter-params:5.11.1")
"testImplementation"("net.jqwik:jqwik:1.9.0")
"testImplementation"("org.mockito:mockito-core:5.14.0")
"testImplementation"("org.mockito:mockito-junit-jupiter:5.14.0")
"testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:5.11.1")
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/PlatformConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fun Project.applyShadowConfiguration() {

val CLASSPATH = listOf("truezip", "truevfs", "js")
.map { "$it.jar" }
.flatMap { listOf(it, "FastAsyncWorldEdit/$it") }
.flatMap { listOf(it, "FastAsyncWorldEdit/$it", "../$it", "../FastAsyncWorldEdit/$it") }
.joinToString(separator = " ")

sealed class WorldEditKind(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ private BlockEntity getBlockEntity(BlockPos blockPos) {
if (tileEntity == null) {
return null;
}
BlockEntity newEntity = tileEntity.getType().create(blockPos, getBlockState(blockPos));
newEntity.loadWithComponents(
tileEntity.loadWithComponents(
(CompoundTag) adapter.fromNativeLin(this.editSession.getFullBlock(
blockPos.getX(),
blockPos.getY(),
Expand All @@ -113,7 +112,7 @@ private BlockEntity getBlockEntity(BlockPos blockPos) {
this.serverLevel.registryAccess()
);

return newEntity;
return tileEntity;
}

private BlockState getBlockState(BlockPos blockPos) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ private BlockEntity getBlockEntity(BlockPos blockPos) {
if (tileEntity == null) {
return null;
}
BlockEntity newEntity = tileEntity.getType().create(blockPos, getBlockState(blockPos));
newEntity.loadWithComponents(
tileEntity.loadWithComponents(
(CompoundTag) adapter.fromNativeLin(this.editSession.getFullBlock(
blockPos.getX(),
blockPos.getY(),
Expand All @@ -113,7 +112,7 @@ private BlockEntity getBlockEntity(BlockPos blockPos) {
this.serverLevel.registryAccess()
);

return newEntity;
return tileEntity;
}

private BlockState getBlockState(BlockPos blockPos) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ private BlockEntity getBlockEntity(BlockPos blockPos) {
if (tileEntity == null) {
return null;
}
BlockEntity newEntity = tileEntity.getType().create(blockPos, getBlockState(blockPos));
newEntity.loadWithComponents(
tileEntity.loadWithComponents(
(CompoundTag) adapter.fromNativeLin(this.editSession.getFullBlock(
blockPos.getX(),
blockPos.getY(),
Expand All @@ -113,7 +112,7 @@ private BlockEntity getBlockEntity(BlockPos blockPos) {
this.serverLevel.registryAccess()
);

return newEntity;
return tileEntity;
}

private BlockState getBlockState(BlockPos blockPos) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,8 @@ default Entity adapt(org.bukkit.entity.Entity entity) {
*/
default Material adapt(ItemType itemType) {
checkNotNull(itemType);
if (!itemType.id().startsWith("minecraft:")) {
throw new IllegalArgumentException("Bukkit only supports Minecraft items");
}
return Material.getMaterial(itemType.id().substring(10).toUpperCase(Locale.ROOT));
NamespacedKey key = checkNotNull(NamespacedKey.fromString(itemType.id()), "Item type key is invalid");
return Registry.MATERIAL.get(key);
}

/**
Expand All @@ -180,11 +178,8 @@ default Material adapt(ItemType itemType) {
*/
default Material adapt(BlockType blockType) {
checkNotNull(blockType);
if (!blockType.id().startsWith("minecraft:")) {
throw new IllegalArgumentException("Bukkit only supports Minecraft blocks");
}
String id = blockType.id().substring(10).toUpperCase(Locale.ROOT);
return Material.getMaterial(id);
NamespacedKey key = checkNotNull(NamespacedKey.fromString(blockType.id()), "Block type key is invalid");
return Registry.MATERIAL.get(key);
}

default org.bukkit.entity.EntityType adapt(EntityType entityType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;

import static com.google.common.base.Preconditions.checkNotNull;

Expand Down Expand Up @@ -83,6 +83,7 @@ private static IBukkitAdapter getAdapter() {

static {
TO_BLOCK_CONTEXT.setRestricted(false);
TO_BLOCK_CONTEXT.setTryLegacy(false);
}

/**
Expand Down Expand Up @@ -366,6 +367,9 @@ public static GameMode adapt(org.bukkit.GameMode gameMode) {
//FAWE end
}

private static final Map<Biome, BiomeType> biomeBiomeTypeCache = new ConcurrentHashMap<>();
private static final Map<BiomeType, Biome> biomeTypeBiomeCache = new ConcurrentHashMap<>();

/**
* Create a WorldEdit BiomeType from a Bukkit one.
*
Expand Down Expand Up @@ -402,8 +406,8 @@ public static org.bukkit.entity.EntityType adapt(EntityType entityType) {
//FAWE end
}

private static final EnumMap<Material, BlockType> materialBlockTypeCache = new EnumMap<>(Material.class);
private static final EnumMap<Material, ItemType> materialItemTypeCache = new EnumMap<>(Material.class);
private static final Map<Material, BlockType> materialBlockTypeCache = new ConcurrentHashMap<>();
private static final Map<Material, ItemType> materialItemTypeCache = new ConcurrentHashMap<>();

/**
* Converts a Material to a BlockType.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
import com.sk89q.worldedit.world.registry.BundledBlockRegistry;
import com.sk89q.worldedit.world.registry.PassthroughBlockMaterial;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;

import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,10 @@ private void initializeRegistries() {
/*

// Block & Item
for (Material material : Material.values()) {
if (material.isBlock() && !material.isLegacy()) {
BlockType.REGISTRY.register(material.getKey().toString(), new BlockType(material.getKey().toString(), blockState -> {
Registry.MATERIAL.forEach(material -> {
String key = material.getKey().toString();
if (material.isBlock()) {
BlockType.REGISTRY.register(key, new BlockType(key, blockState -> {
// TODO Use something way less hacky than this.
ParserContext context = new ParserContext();
context.setPreferringWildcard(true);
Expand All @@ -331,13 +332,13 @@ private void initializeRegistries() {
}
return defaultState;
} catch (InputParseException e) {
LOGGER.warn("Error loading block state for " + material.getKey(), e);
LOGGER.warn("Error loading block state for " + key, e);
return blockState;
}
}));
}
if (material.isItem() && !material.isLegacy()) {
ItemType.REGISTRY.register(material.getKey().toString(), new ItemType(material.getKey().toString()));
if (material.isItem()) {
ItemType.REGISTRY.register(key, new ItemType(key));
}
}
*/
Expand All @@ -359,10 +360,12 @@ private void setupTags() {
// Tags
try {
for (Tag<Material> blockTag : Bukkit.getTags(Tag.REGISTRY_BLOCKS, Material.class)) {
BlockCategory.REGISTRY.register(blockTag.getKey().toString(), new BlockCategory(blockTag.getKey().toString()));
String key = blockTag.getKey().toString();
BlockCategory.REGISTRY.register(key, new BlockCategory(blockTag.getKey().toString()));
}
for (Tag<Material> itemTag : Bukkit.getTags(Tag.REGISTRY_ITEMS, Material.class)) {
ItemCategory.REGISTRY.register(itemTag.getKey().toString(), new ItemCategory(itemTag.getKey().toString()));
String key = itemTag.getKey().toString();
ItemCategory.REGISTRY.register(key, new ItemCategory(itemTag.getKey().toString()));
}
} catch (NoSuchMethodError ignored) {
LOGGER.warn(
Expand Down
Loading
Loading