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() {
|
) : RegistryItem() {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object : ResourceLocationCodec<Motif> {
|
companion object : ResourceLocationCodec<Motif> {
|
||||||
|
@ -24,7 +24,7 @@ data class PluginChannel(
|
|||||||
) : RegistryItem() {
|
) : RegistryItem() {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object : ResourceLocationCodec<PluginChannel> {
|
companion object : ResourceLocationCodec<PluginChannel> {
|
||||||
|
@ -45,7 +45,7 @@ data class Biome(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object : ResourceLocationCodec<Biome> {
|
companion object : ResourceLocationCodec<Biome> {
|
||||||
|
@ -72,7 +72,7 @@ open class Block(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun getPlacementState(connection: PlayConnection, target: BlockTarget): BlockState? = defaultState
|
open fun getPlacementState(connection: PlayConnection, target: BlockTarget): BlockState? = defaultState
|
||||||
|
@ -23,7 +23,7 @@ data class Dimension(
|
|||||||
) : RegistryItem() {
|
) : RegistryItem() {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object : ResourceLocationCodec<Dimension> {
|
companion object : ResourceLocationCodec<Dimension> {
|
||||||
|
@ -29,7 +29,7 @@ class PixlyzerStatusEffectType(
|
|||||||
) : StatusEffectType(), Colored, CategorizedEffect {
|
) : StatusEffectType(), Colored, CategorizedEffect {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object : ResourceLocationCodec<StatusEffectType> {
|
companion object : ResourceLocationCodec<StatusEffectType> {
|
||||||
|
@ -18,7 +18,7 @@ abstract class Enchantment : RegistryItem() {
|
|||||||
override val injectable: Boolean get() = false
|
override val injectable: Boolean get() = false
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int {
|
override fun hashCode(): Int {
|
||||||
|
@ -25,6 +25,6 @@ abstract class AbstractEntityVariant(
|
|||||||
val texture = data["texture"].toResourceLocation().texture()
|
val texture = data["texture"].toResourceLocation().texture()
|
||||||
|
|
||||||
override fun toString(): String {
|
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(
|
data class VillagerProfession(
|
||||||
override val identifier: ResourceLocation,
|
override val identifier: ResourceLocation,
|
||||||
// ToDo
|
// TODO
|
||||||
) : RegistryItem() {
|
) : RegistryItem() {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object : ResourceLocationCodec<VillagerProfession> {
|
companion object : ResourceLocationCodec<VillagerProfession> {
|
||||||
|
@ -33,7 +33,7 @@ open class Fluid(override val identifier: ResourceLocation) : RegistryItem() {
|
|||||||
open var model: FluidModel? = null
|
open var model: FluidModel? = null
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun matches(other: Fluid): Boolean {
|
open fun matches(other: Fluid): Boolean {
|
||||||
|
@ -37,7 +37,7 @@ data class Material(
|
|||||||
) : RegistryItem() {
|
) : RegistryItem() {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object : ResourceLocationCodec<Material> {
|
companion object : ResourceLocationCodec<Material> {
|
||||||
|
@ -34,7 +34,7 @@ data class ParticleType(
|
|||||||
) : RegistryItem() {
|
) : RegistryItem() {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun default(): ParticleData {
|
fun default(): ParticleData {
|
||||||
|
@ -62,6 +62,6 @@ abstract class RegistryItem : Identified {
|
|||||||
|
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ open class Statistic(
|
|||||||
) : RegistryItem(), Translatable {
|
) : RegistryItem(), Translatable {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return identifier.full
|
return identifier.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object : ResourceLocationCodec<Statistic> {
|
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
|
val bytesPerTexture = size.x * size.y * PNGDecoder.Format.RGBA.numComponents
|
||||||
|
|
||||||
for (i in 0 until animationProperties.frameCount) {
|
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 {
|
splitTexture.data!!.let {
|
||||||
it.copyFrom(original.data!!, bytesPerTexture * i, 0, bytesPerTexture)
|
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
|
* @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:block" -> buffer.readBlockPosition()
|
||||||
"minecraft:entity" -> buffer.readEntityId()
|
"minecraft:entity" -> buffer.readEntityId()
|
||||||
else -> error("Unknown target type: $targetType")
|
else -> error("Unknown target type: $targetType")
|
||||||
|
@ -294,7 +294,7 @@ open class OutByteBuffer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun writeResourceLocation(resourceLocation: ResourceLocation) {
|
fun writeResourceLocation(resourceLocation: ResourceLocation) {
|
||||||
writeString(resourceLocation.full)
|
writeString(resourceLocation.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun writeVec3d(vec3: Vec3) {
|
fun writeVec3d(vec3: Vec3) {
|
||||||
|
@ -117,14 +117,14 @@ class PlayInByteBuffer : InByteBuffer {
|
|||||||
fun readParticleData(type: ParticleType): ParticleData {
|
fun readParticleData(type: ParticleType): ParticleData {
|
||||||
// ToDo: Replace with dynamic particle type calling
|
// ToDo: Replace with dynamic particle type calling
|
||||||
if (this.versionId < V_17W45A) {
|
if (this.versionId < V_17W45A) {
|
||||||
return when (type.identifier.full) {
|
return when (type.identifier.toString()) {
|
||||||
"minecraft:iconcrack" -> ItemParticleData.read(this, type)
|
"minecraft:iconcrack" -> ItemParticleData.read(this, type)
|
||||||
"minecraft:blockcrack", "minecraft:blockdust", "minecraft:falling_dust" -> BlockParticleData.read(this, type)
|
"minecraft:blockcrack", "minecraft:blockdust", "minecraft:falling_dust" -> BlockParticleData.read(this, type)
|
||||||
else -> ParticleData(type)
|
else -> ParticleData(type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return when (type.identifier.full) {
|
return when (type.identifier.toString()) {
|
||||||
"minecraft:block", "minecraft:falling_dust" -> BlockParticleData.read(this, type)
|
"minecraft:block", "minecraft:falling_dust" -> BlockParticleData.read(this, type)
|
||||||
"minecraft:dust" -> DustParticleData.read(this, type)
|
"minecraft:dust" -> DustParticleData.read(this, type)
|
||||||
"minecraft:item" -> ItemParticleData.read(this, type)
|
"minecraft:item" -> ItemParticleData.read(this, type)
|
||||||
|
@ -40,7 +40,7 @@ object ResourceLocationSerializer : SimpleModule() {
|
|||||||
object Serializer : StdSerializer<ResourceLocation>(ResourceLocation::class.java) {
|
object Serializer : StdSerializer<ResourceLocation>(ResourceLocation::class.java) {
|
||||||
|
|
||||||
override fun serialize(value: ResourceLocation?, generator: JsonGenerator, provider: SerializerProvider?) {
|
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