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
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,22 @@ private boolean checkIfKnownChunk(FabricWorld fw, ChunkPos pos) {
return false;
}

/**
* Get the name of a property's value within a block state, as it is serialized into
* the chunk NBT.
*
* Property#name(T) resolves to the serialized name for enum properties, which is what
* the chunk palette stores. Calling toString() on the value instead yields the Java
* enum constant name. That matches only by coincidence -- as it does for vanilla,
* whose constants are uppercased serialized names -- so modded enums whose constant
* names differ (e.g. a constant N_E serialized as "ne") fail to resolve at chunk load
* and silently render as air.
*/
private static <T extends Comparable<T>> String getPropertyValueName(BlockState bs,
net.minecraft.state.property.Property<T> p) {
return p.name(bs.get(p));
}

/**
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
*/
Expand Down Expand Up @@ -206,7 +222,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + getPropertyValueName(bs, p);
}
int lightAtten = bs.isFullOpaque(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 15 : (bs.isTranslucent(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 0 : 1);
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,22 @@ private boolean checkIfKnownChunk(FabricWorld fw, ChunkPos pos) {
return false;
}

/**
* Get the name of a property's value within a block state, as it is serialized into
* the chunk NBT.
*
* Property#name(T) resolves to the serialized name for enum properties, which is what
* the chunk palette stores. Calling toString() on the value instead yields the Java
* enum constant name. That matches only by coincidence -- as it does for vanilla,
* whose constants are uppercased serialized names -- so modded enums whose constant
* names differ (e.g. a constant N_E serialized as "ne") fail to resolve at chunk load
* and silently render as air.
*/
private static <T extends Comparable<T>> String getPropertyValueName(BlockState bs,
net.minecraft.state.property.Property<T> p) {
return p.name(bs.get(p));
}

/**
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
*/
Expand Down Expand Up @@ -206,7 +222,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + getPropertyValueName(bs, p);
}
int lightAtten = bs.isFullOpaque(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 15 : (bs.isTranslucent(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 0 : 1);
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,22 @@ private boolean checkIfKnownChunk(FabricWorld fw, ChunkPos pos) {
return false;
}

/**
* Get the name of a property's value within a block state, as it is serialized into
* the chunk NBT.
*
* Property#name(T) resolves to the serialized name for enum properties, which is what
* the chunk palette stores. Calling toString() on the value instead yields the Java
* enum constant name. That matches only by coincidence -- as it does for vanilla,
* whose constants are uppercased serialized names -- so modded enums whose constant
* names differ (e.g. a constant N_E serialized as "ne") fail to resolve at chunk load
* and silently render as air.
*/
private static <T extends Comparable<T>> String getPropertyValueName(BlockState bs,
net.minecraft.state.property.Property<T> p) {
return p.name(bs.get(p));
}

/**
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
*/
Expand Down Expand Up @@ -204,7 +220,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + getPropertyValueName(bs, p);
}
int lightAtten = bs.isOpaqueFullCube(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 15 : (bs.isTranslucent(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 0 : 1);
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,22 @@ private boolean checkIfKnownChunk(FabricWorld fw, ChunkPos pos) {
return false;
}

/**
* Get the name of a property's value within a block state, as it is serialized into
* the chunk NBT.
*
* Property#name(T) resolves to the serialized name for enum properties, which is what
* the chunk palette stores. Calling toString() on the value instead yields the Java
* enum constant name. That matches only by coincidence -- as it does for vanilla,
* whose constants are uppercased serialized names -- so modded enums whose constant
* names differ (e.g. a constant N_E serialized as "ne") fail to resolve at chunk load
* and silently render as air.
*/
private static <T extends Comparable<T>> String getPropertyValueName(BlockState bs,
net.minecraft.state.property.Property<T> p) {
return p.name(bs.get(p));
}

/**
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
*/
Expand Down Expand Up @@ -205,7 +221,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + getPropertyValueName(bs, p);
}
int lightAtten = bs.isOpaqueFullCube(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 15 : (bs.isTranslucent(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 0 : 1);
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,22 @@ public static class BlockUpdateRec {

public static DynmapBlockState[] stateByID;

/**
* Get the name of a property's value within a block state, as it is serialized into
* the chunk NBT.
*
* Property#name(T) resolves to the serialized name for enum properties, which is what
* the chunk palette stores. Calling toString() on the value instead yields the Java
* enum constant name. That matches only by coincidence -- as it does for vanilla,
* whose constants are uppercased serialized names -- so modded enums whose constant
* names differ (e.g. a constant N_E serialized as "ne") fail to resolve at chunk load
* and silently render as air.
*/
private static <T extends Comparable<T>> String getPropertyValueName(BlockState bs,
net.minecraft.state.property.Property<T> p) {
return p.name(bs.get(p));
}

/**
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
*/
Expand Down Expand Up @@ -166,7 +182,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + getPropertyValueName(bs, p);
}
int lightAtten = bs.isOpaqueFullCube(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 15 : (bs.isTranslucent(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 0 : 1);
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,22 @@ public static class BlockUpdateRec {

public static DynmapBlockState[] stateByID;

/**
* Get the name of a property's value within a block state, as it is serialized into
* the chunk NBT.
*
* Property#name(T) resolves to the serialized name for enum properties, which is what
* the chunk palette stores. Calling toString() on the value instead yields the Java
* enum constant name. That matches only by coincidence -- as it does for vanilla,
* whose constants are uppercased serialized names -- so modded enums whose constant
* names differ (e.g. a constant N_E serialized as "ne") fail to resolve at chunk load
* and silently render as air.
*/
private static <T extends Comparable<T>> String getPropertyValueName(BlockState bs,
net.minecraft.state.property.Property<T> p) {
return p.name(bs.get(p));
}

/**
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
*/
Expand Down Expand Up @@ -161,7 +177,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + getPropertyValueName(bs, p);
}
int lightAtten = bs.isOpaqueFullCube(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 15 : (bs.isTransparent(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 0 : 1);
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@ public static class BlockUpdateRec {

public static DynmapBlockState[] stateByID;

/**
* Get the name of a property's value within a block state, as it is serialized into
* the chunk NBT.
*
* Property#name(T) resolves to the serialized name for enum properties, which is what
* the chunk palette stores. Calling toString() on the value instead yields the Java
* enum constant name. That matches only by coincidence -- as it does for vanilla,
* whose constants are uppercased serialized names -- so modded enums whose constant
* names differ (e.g. a constant N_E serialized as "ne") fail to resolve at chunk load
* and silently render as air.
*/
private static <T extends Comparable<T>> String getPropertyValueName(BlockState bs,
net.minecraft.state.property.Property<T> p) {
return p.name(bs.get(p));
}

/**
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
*/
Expand Down Expand Up @@ -161,7 +177,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + getPropertyValueName(bs, p);
}
int lightAtten = bs.isOpaqueFullCube(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 15 : (bs.isTransparent(EmptyBlockView.INSTANCE, BlockPos.ORIGIN) ? 0 : 1);
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@ public static class BlockUpdateRec {

public static DynmapBlockState[] stateByID;

/**
* Get the name of a property's value within a block state, as it is serialized into
* the chunk NBT.
*
* Property#name(T) resolves to the serialized name for enum properties, which is what
* the chunk palette stores. Calling toString() on the value instead yields the Java
* enum constant name. That matches only by coincidence -- as it does for vanilla,
* whose constants are uppercased serialized names -- so modded enums whose constant
* names differ (e.g. a constant N_E serialized as "ne") fail to resolve at chunk load
* and silently render as air.
*/
private static <T extends Comparable<T>> String getPropertyValueName(BlockState bs,
net.minecraft.state.property.Property<T> p) {
return p.name(bs.get(p));
}

/**
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
*/
Expand Down Expand Up @@ -161,7 +177,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + getPropertyValueName(bs, p);
}
int lightAtten = bs.isOpaqueFullCube() ? 15 : (bs.isTransparent() ? 0 : 1);
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@ public static class BlockUpdateRec {

public static DynmapBlockState[] stateByID;

/**
* Get the name of a property's value within a block state, as it is serialized into
* the chunk NBT.
*
* Property#name(T) resolves to the serialized name for enum properties, which is what
* the chunk palette stores. Calling toString() on the value instead yields the Java
* enum constant name. That matches only by coincidence -- as it does for vanilla,
* whose constants are uppercased serialized names -- so modded enums whose constant
* names differ (e.g. a constant N_E serialized as "ne") fail to resolve at chunk load
* and silently render as air.
*/
private static <T extends Comparable<T>> String getPropertyValueName(BlockState bs,
net.minecraft.state.property.Property<T> p) {
return p.name(bs.get(p));
}

/**
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
*/
Expand Down Expand Up @@ -161,7 +177,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + getPropertyValueName(bs, p);
}
int lightAtten = bs.isOpaqueFullCube() ? 15 : (bs.isTransparent() ? 0 : 1);
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@ public static class BlockUpdateRec {

public static DynmapBlockState[] stateByID;

/**
* Get the name of a property's value within a block state, as it is serialized into
* the chunk NBT.
*
* Property#name(T) resolves to the serialized name for enum properties, which is what
* the chunk palette stores. Calling toString() on the value instead yields the Java
* enum constant name. That matches only by coincidence -- as it does for vanilla,
* whose constants are uppercased serialized names -- so modded enums whose constant
* names differ (e.g. a constant N_E serialized as "ne") fail to resolve at chunk load
* and silently render as air.
*/
private static <T extends Comparable<T>> String getPropertyValueName(BlockState bs,
net.minecraft.state.property.Property<T> p) {
return p.name(bs.get(p));
}

/**
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
*/
Expand Down Expand Up @@ -161,7 +177,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + getPropertyValueName(bs, p);
}
int lightAtten = bs.isOpaqueFullCube() ? 15 : (bs.isTransparent() ? 0 : 1);
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public void initializeBlockStates() {
statename += ",";
}
try {
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + p.getName(bs.get(p));
} catch (IllegalFormatConversionException e){
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + p.getName(bs.get(p));
}
int lightAtten = bs.isOpaqueCube(EmptyBlockReader.INSTANCE, BlockPos.ZERO) ? 15 : (bs.propagatesSkylightDown(EmptyBlockReader.INSTANCE, BlockPos.ZERO) ? 0 : 1);
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,23 @@ private static Registry<Biome> getBiomeReg() {
}

/**
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
* Get the name of a property's value within a block state, as it is serialized into
* the chunk NBT.
*
* Property#getName(T) resolves to the serialized name for enum properties, which is what
* the chunk palette stores. Calling toString() on the value instead yields the Java
* enum constant name. That matches only by coincidence -- as it does for vanilla,
* whose constants are uppercased serialized names -- so modded enums whose constant
* names differ (e.g. a constant N_E serialized as "ne") fail to resolve at chunk load
* and silently render as air.
*/
private static <T extends Comparable<T>> String getPropertyValueName(BlockState bs,
net.minecraft.state.Property<T> p) {
return p.getName(bs.get(p));
}

/**
*
* Initialize block states (org.dynmap.blockstate.DynmapBlockState)
*/
public void initializeBlockStates() {
stateByID = new DynmapBlockState[512*32]; // Simple map - scale as needed
Expand Down Expand Up @@ -269,7 +282,7 @@ public void initializeBlockStates() {
if (statename.length() > 0) {
statename += ",";
}
statename += p.getName() + "=" + bs.get(p).toString();
statename += p.getName() + "=" + getPropertyValueName(bs, p);
}
int lightAtten = 15;
try { // Workaround for mods with broken block state logic...
Expand Down
Loading