mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 11:24:56 -04:00
Changing to .toString() instead of accessing the "full" value
This commit is contained in:
parent
1fa5bb1d2a
commit
42cbc4d80b
@ -24,7 +24,7 @@ data class Motif(
|
||||
) : RegistryItem() {
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
companion object : ResourceLocationCodec<Motif> {
|
||||
|
@ -24,7 +24,7 @@ data class PluginChannel(
|
||||
) : RegistryItem() {
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
companion object : ResourceLocationCodec<PluginChannel> {
|
||||
|
@ -45,7 +45,7 @@ data class Biome(
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
companion object : ResourceLocationCodec<Biome> {
|
||||
|
@ -72,7 +72,7 @@ open class Block(
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
open fun getPlacementState(connection: PlayConnection, target: BlockTarget): BlockState? = defaultState
|
||||
|
@ -23,7 +23,7 @@ data class Dimension(
|
||||
) : RegistryItem() {
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
companion object : ResourceLocationCodec<Dimension> {
|
||||
|
@ -29,7 +29,7 @@ class PixlyzerStatusEffectType(
|
||||
) : StatusEffectType(), Colored, CategorizedEffect {
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
companion object : ResourceLocationCodec<StatusEffectType> {
|
||||
|
@ -18,7 +18,7 @@ abstract class Enchantment : RegistryItem() {
|
||||
override val injectable: Boolean get() = false
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
|
@ -25,6 +25,6 @@ abstract class AbstractEntityVariant(
|
||||
val texture = data["texture"].toResourceLocation().texture()
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
}
|
||||
|
@ -20,11 +20,11 @@ import de.bixilon.minosoft.data.registries.registries.registry.codec.ResourceLoc
|
||||
|
||||
data class VillagerProfession(
|
||||
override val identifier: ResourceLocation,
|
||||
// ToDo
|
||||
// TODO
|
||||
) : RegistryItem() {
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
companion object : ResourceLocationCodec<VillagerProfession> {
|
||||
|
@ -33,7 +33,7 @@ open class Fluid(override val identifier: ResourceLocation) : RegistryItem() {
|
||||
open var model: FluidModel? = null
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
open fun matches(other: Fluid): Boolean {
|
||||
|
@ -37,7 +37,7 @@ data class Material(
|
||||
) : RegistryItem() {
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
companion object : ResourceLocationCodec<Material> {
|
||||
|
@ -34,7 +34,7 @@ data class ParticleType(
|
||||
) : RegistryItem() {
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
fun default(): ParticleData {
|
||||
|
@ -62,6 +62,6 @@ abstract class RegistryItem : Identified {
|
||||
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ open class Statistic(
|
||||
) : RegistryItem(), Translatable {
|
||||
|
||||
override fun toString(): String {
|
||||
return identifier.full
|
||||
return identifier.toString()
|
||||
}
|
||||
|
||||
companion object : ResourceLocationCodec<Statistic> {
|
||||
|
@ -57,7 +57,7 @@ class SpriteTexture(private val original: AbstractTexture) : AbstractTexture {
|
||||
val bytesPerTexture = size.x * size.y * PNGDecoder.Format.RGBA.numComponents
|
||||
|
||||
for (i in 0 until animationProperties.frameCount) {
|
||||
val splitTexture = MemoryTexture(resourceLocation = ResourceLocation.of(resourceLocation.full + "_animated_$i"), size)
|
||||
val splitTexture = MemoryTexture(resourceLocation = ResourceLocation.of(resourceLocation.toString() + "_animated_$i"), size)
|
||||
|
||||
splitTexture.data!!.let {
|
||||
it.copyFrom(original.data!!, bytesPerTexture * i, 0, bytesPerTexture)
|
||||
|
@ -29,7 +29,7 @@ class VibrationS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
||||
/**
|
||||
* @return Depends on vibration target type, if block: block postion, if entity: entity id
|
||||
*/
|
||||
val targetData: Any = when (targetType.full) {
|
||||
val targetData: Any = when (targetType.toString()) {
|
||||
"minecraft:block" -> buffer.readBlockPosition()
|
||||
"minecraft:entity" -> buffer.readEntityId()
|
||||
else -> error("Unknown target type: $targetType")
|
||||
|
@ -294,7 +294,7 @@ open class OutByteBuffer() {
|
||||
}
|
||||
|
||||
fun writeResourceLocation(resourceLocation: ResourceLocation) {
|
||||
writeString(resourceLocation.full)
|
||||
writeString(resourceLocation.toString())
|
||||
}
|
||||
|
||||
fun writeVec3d(vec3: Vec3) {
|
||||
|
@ -117,14 +117,14 @@ class PlayInByteBuffer : InByteBuffer {
|
||||
fun readParticleData(type: ParticleType): ParticleData {
|
||||
// ToDo: Replace with dynamic particle type calling
|
||||
if (this.versionId < V_17W45A) {
|
||||
return when (type.identifier.full) {
|
||||
return when (type.identifier.toString()) {
|
||||
"minecraft:iconcrack" -> ItemParticleData.read(this, type)
|
||||
"minecraft:blockcrack", "minecraft:blockdust", "minecraft:falling_dust" -> BlockParticleData.read(this, type)
|
||||
else -> ParticleData(type)
|
||||
}
|
||||
}
|
||||
|
||||
return when (type.identifier.full) {
|
||||
return when (type.identifier.toString()) {
|
||||
"minecraft:block", "minecraft:falling_dust" -> BlockParticleData.read(this, type)
|
||||
"minecraft:dust" -> DustParticleData.read(this, type)
|
||||
"minecraft:item" -> ItemParticleData.read(this, type)
|
||||
|
@ -40,7 +40,7 @@ object ResourceLocationSerializer : SimpleModule() {
|
||||
object Serializer : StdSerializer<ResourceLocation>(ResourceLocation::class.java) {
|
||||
|
||||
override fun serialize(value: ResourceLocation?, generator: JsonGenerator, provider: SerializerProvider?) {
|
||||
generator.writeString(value?.full)
|
||||
generator.writeString(value?.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user