Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/plateau2minecraft/anvil/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def from_numeric_id(cls, block_id: int, data: int = 0):
data
Numeric data, used to represent variants of the block
"""
# See https://minecraft.gamepedia.com/Java_Edition_data_value/Pre-flattening
# and https://minecraft.gamepedia.com/Java_Edition_data_value for current values
# See https://minecraft.wiki/w/Java_Edition_data_value/Pre-flattening
# and https://minecraft.wiki/w/Java_Edition_data_value for current values
key = f"{block_id}:{data}"
if key not in LEGACY_ID_MAP:
raise KeyError(f"Block {key} not found")
Expand Down
10 changes: 5 additions & 5 deletions src/plateau2minecraft/anvil/chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
_VERSION_20w17a = 2529

# This version changes how biomes are stored to allow for biomes at different heights
# https://minecraft.fandom.com/wiki/Java_Edition_19w36a
# https://minecraft.wiki/w/Java_Edition_19w36a
_VERSION_19w36a = 2203

# This is the version where "The Flattening" (https://minecraft.gamepedia.com/Java_Edition_1.13/Flattening) happened
# This is the version where "The Flattening" (https://minecraft.wiki/w/Java_Edition_1.13/Flattening) happened
# where blocks went from numeric ids to namespaced ids (namespace:block_id)
_VERSION_17w47a = 1451

Expand Down Expand Up @@ -113,7 +113,7 @@ def __init__(self, nbt_data: nbt.NBTFile, x=None, z=None, version=None):
self.version = nbt_data["DataVersion"].value
except KeyError:
# Version is pre-1.9 snapshot 15w32a, so world does not have a Data Version.
# See https://minecraft.fandom.com/wiki/Data_version
# See https://minecraft.wiki/w/Data_version
self.version = None

if self.version > _VERSION_1_17_1:
Expand Down Expand Up @@ -469,7 +469,7 @@ def get_biome(self, x: int, y: int, z: int) -> Biome:
# Each biome index refers to a column stored Z then X.
index = z * 16 + x
else:
# https://minecraft.fandom.com/wiki/Java_Edition_19w36a
# https://minecraft.wiki/w/Java_Edition_19w36a
# Get index on the biome list with the order YZX
# Each biome index refers to a 4x4 areas here so we do integer division by 4
index = (y // 4) * 4 * 4 + (z // 4) * 4 + (x // 4)
Expand Down Expand Up @@ -516,7 +516,7 @@ def get_block_from_data(
y %= 16

if self.version is None or self.version < _VERSION_17w47a:
# Explained in depth here https://minecraft.gamepedia.com/index.php?title=Chunk_format&oldid=1153403#Block_format
# Explained in depth here https://minecraft.wiki/w/index.php?title=Chunk_format&oldid=1153403#Block_format

if section is None or "Blocks" not in section:
if force_new:
Expand Down
10 changes: 5 additions & 5 deletions src/plateau2minecraft/anvil/ro_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
_VERSION_20w17a = 2529

# This version changes how biomes are stored to allow for biomes at different heights
# https://minecraft.fandom.com/wiki/Java_Edition_19w36a
# https://minecraft.wiki/w/Java_Edition_19w36a
_VERSION_19w36a = 2203

# This is the version where "The Flattening" (https://minecraft.gamepedia.com/Java_Edition_1.13/Flattening) happened
# This is the version where "The Flattening" (https://minecraft.wiki/w/Java_Edition_1.13/Flattening) happened
# where blocks went from numeric ids to namespaced ids (namespace:block_id)
_VERSION_17w47a = 1451

Expand Down Expand Up @@ -97,7 +97,7 @@ def __init__(self, nbt_data: nbt.NBTFile):
self.version = nbt_data["DataVersion"].value
except KeyError:
# Version is pre-1.9 snapshot 15w32a, so world does not have a Data Version.
# See https://minecraft.fandom.com/wiki/Data_version
# See https://minecraft.wiki/w/Data_version
self.version = None

if self.version > _VERSION_1_17_1:
Expand Down Expand Up @@ -231,7 +231,7 @@ def get_biome(self, x: int, y: int, z: int) -> Biome:
# Each biome index refers to a column stored Z then X.
index = z * 16 + x
else:
# https://minecraft.fandom.com/wiki/Java_Edition_19w36a
# https://minecraft.wiki/w/Java_Edition_19w36a
# Get index on the biome list with the order YZX
# Each biome index refers to a 4x4 areas here so we do integer division by 4
index = (y // 4) * 4 * 4 + (z // 4) * 4 + (x // 4)
Expand Down Expand Up @@ -283,7 +283,7 @@ def get_block(
y %= 16

if self.version is None or self.version < _VERSION_17w47a:
# Explained in depth here https://minecraft.gamepedia.com/index.php?title=Chunk_format&oldid=1153403#Block_format
# Explained in depth here https://minecraft.wiki/w/index.php?title=Chunk_format&oldid=1153403#Block_format

if section is None or "Blocks" not in section:
if force_new:
Expand Down
4 changes: 2 additions & 2 deletions src/plateau2minecraft/anvil/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
_VERSION_20w17a = 2529

# This version changes how biomes are stored to allow for biomes at different heights
# https://minecraft.fandom.com/wiki/Java_Edition_19w36a
# https://minecraft.wiki/w/Java_Edition_19w36a
_VERSION_19w36a = 2203

# This is the version where "The Flattening" (https://minecraft.gamepedia.com/Java_Edition_1.13/Flattening) happened
# This is the version where "The Flattening" (https://minecraft.wiki/w/Java_Edition_1.13/Flattening) happened
# where blocks went from numeric ids to namespaced ids (namespace:block_id)
_VERSION_17w47a = 1451

Expand Down