Changing to .toString() instead of accessing the "full" value

This commit is contained in:
MrGeoTech 2023-01-03 17:48:52 -06:00
parent 1fa5bb1d2a
commit 42cbc4d80b
No known key found for this signature in database
GPG Key ID: 015B8BF2BAD3DEEA
19 changed files with 21 additions and 21 deletions

View File

@ -24,7 +24,7 @@ data class Motif(
) : RegistryItem() {
override fun toString(): String {
return identifier.full
return identifier.toString()
}
companion object : ResourceLocationCodec<Motif> {

View File

@ -24,7 +24,7 @@ data class PluginChannel(
) : RegistryItem() {
override fun toString(): String {
return identifier.full
return identifier.toString()
}
companion object : ResourceLocationCodec<PluginChannel> {

View File

@ -45,7 +45,7 @@ data class Biome(
}
override fun toString(): String {
return identifier.full
return identifier.toString()
}
companion object : ResourceLocationCodec<Biome> {

View File

@ -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

View File

@ -23,7 +23,7 @@ data class Dimension(
) : RegistryItem() {
override fun toString(): String {
return identifier.full
return identifier.toString()
}
companion object : ResourceLocationCodec<Dimension> {

View File

@ -29,7 +29,7 @@ class PixlyzerStatusEffectType(
) : StatusEffectType(), Colored, CategorizedEffect {
override fun toString(): String {
return identifier.full
return identifier.toString()
}
companion object : ResourceLocationCodec<StatusEffectType> {

View File

@ -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 {

View File

@ -25,6 +25,6 @@ abstract class AbstractEntityVariant(
val texture = data["texture"].toResourceLocation().texture()
override fun toString(): String {
return identifier.full
return identifier.toString()
}
}

View File

@ -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> {

View File

@ -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 {

View File

@ -37,7 +37,7 @@ data class Material(
) : RegistryItem() {
override fun toString(): String {
return identifier.full
return identifier.toString()
}
companion object : ResourceLocationCodec<Material> {

View File

@ -34,7 +34,7 @@ data class ParticleType(
) : RegistryItem() {
override fun toString(): String {
return identifier.full
return identifier.toString()
}
fun default(): ParticleData {

View File

@ -62,6 +62,6 @@ abstract class RegistryItem : Identified {
override fun toString(): String {
return identifier.full
return identifier.toString()
}
}

View File

@ -27,7 +27,7 @@ open class Statistic(
) : RegistryItem(), Translatable {
override fun toString(): String {
return identifier.full
return identifier.toString()
}
companion object : ResourceLocationCodec<Statistic> {

View File

@ -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)

View File

@ -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")

View File

@ -294,7 +294,7 @@ open class OutByteBuffer() {
}
fun writeResourceLocation(resourceLocation: ResourceLocation) {
writeString(resourceLocation.full)
writeString(resourceLocation.toString())
}
fun writeVec3d(vec3: Vec3) {

View File

@ -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)

View File

@ -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())
}
}
}