-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ported to 1.21.2 #58
base: 1.22
Are you sure you want to change the base?
Ported to 1.21.2 #58
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,9 @@ authors=Sisby folk | |
contributors=Ampflower, falkreon, jaskarth, Garden System | ||
license=LGPL-3.0-or-later | ||
# Mod Version | ||
baseVersion=0.6.25 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unneccesary |
||
baseVersion=0.6.26 | ||
# Branch Metadata | ||
branch=1.21 | ||
tagBranch=1.20 | ||
compatibleVersions=1.21, 1.21.1 | ||
branch=1.21.2 | ||
tagBranch=1.21.2 | ||
compatibleVersions=1.21.2 | ||
compatibleLoaders=fabric, quilt, neoforge |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,7 @@ | |
import folk.sisby.surveyor.terrain.RegionSummary; | ||
import folk.sisby.surveyor.util.ChunkUtil; | ||
import folk.sisby.surveyor.util.MapUtil; | ||
import net.minecraft.nbt.NbtCompound; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ignoring editorconfig here, you need to fix your IDE setup. |
||
import net.minecraft.nbt.NbtElement; | ||
import net.minecraft.nbt.NbtIo; | ||
import net.minecraft.nbt.NbtList; | ||
import net.minecraft.nbt.NbtSizeTracker; | ||
import net.minecraft.nbt.NbtString; | ||
import net.minecraft.nbt.*; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.RegistryKey; | ||
import net.minecraft.registry.RegistryKeys; | ||
|
@@ -34,12 +29,7 @@ | |
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
import java.util.*; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
public class WorldStructureSummary { | ||
|
@@ -164,8 +154,8 @@ public Multimap<RegistryKey<Structure>, ChunkPos> keySet(SurveyorExploration exp | |
public void put(ServerWorld world, StructureStart start) { | ||
if (Surveyor.CONFIG.structures == SystemMode.FROZEN) return; | ||
ChunkPos rPos = regionPosOf(start.getPos()); | ||
RegistryKey<Structure> key = world.getRegistryManager().get(RegistryKeys.STRUCTURE).getKey(start.getStructure()).orElseThrow(); | ||
Optional<RegistryKey<StructureType<?>>> type = world.getRegistryManager().get(RegistryKeys.STRUCTURE_TYPE).getKey(start.getStructure().getType()); | ||
RegistryKey<Structure> key = world.getRegistryManager().getOrThrow(RegistryKeys.STRUCTURE).getKey(start.getStructure()).orElseThrow(); | ||
Optional<RegistryKey<StructureType<?>>> type = world.getRegistryManager().getOrThrow(RegistryKeys.STRUCTURE_TYPE).getKey(start.getStructure().getType()); | ||
if (!start.hasChildren()) { | ||
Surveyor.LOGGER.error("Cowardly refusing to save structure {} as it has no pieces! Report this to the structure mod author!", key.getValue()); | ||
return; | ||
|
@@ -175,7 +165,7 @@ public void put(ServerWorld world, StructureStart start) { | |
return; | ||
} | ||
regions.computeIfAbsent(rPos, k -> new RegionStructureSummary()).put(world, start); | ||
List<TagKey<Structure>> tags = world.getRegistryManager().get(RegistryKeys.STRUCTURE).getEntry(start.getStructure()).streamTags().toList(); | ||
List<TagKey<Structure>> tags = world.getRegistryManager().getOrThrow(RegistryKeys.STRUCTURE).getEntry(start.getStructure()).streamTags().toList(); | ||
structureTypes.put(key, type.orElseThrow()); | ||
structureTags.putAll(key, tags); | ||
dirty(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,7 +127,7 @@ public void writeBuf(PacketByteBuf buf) { | |
UInts.writeBuf(glint, buf); | ||
} | ||
|
||
public void fillEmptyFloors(int depthOffset, int minDepth, int maxDepth, LayerSummary.Raw outLayer) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unneccessary and confusing |
||
public void fillEmptyFloors(int depthOffset, int minDepth, int maxDepth, Raw outLayer) { | ||
int i = 0; | ||
for (int j = 0; j < 256; j++) { | ||
if (found.get(j)) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unneccesary