mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 10:55:01 -04:00
abstract with ResourceLocationAble
This commit is contained in:
parent
8e0400b08e
commit
ff7dfe9cb0
@ -13,11 +13,9 @@
|
||||
|
||||
package de.bixilon.minosoft.data.entities.block
|
||||
|
||||
import de.bixilon.minosoft.data.mappings.ResourceLocation
|
||||
import de.bixilon.minosoft.data.mappings.CompanionResourceLocation
|
||||
import de.bixilon.minosoft.protocol.network.connection.PlayConnection
|
||||
|
||||
interface BlockEntityFactory<T : BlockEntity> {
|
||||
val RESOURCE_LOCATION: ResourceLocation
|
||||
|
||||
interface BlockEntityFactory<T : BlockEntity> : CompanionResourceLocation {
|
||||
fun build(connection: PlayConnection): T
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Minosoft
|
||||
* Copyright (C) 2021 Moritz Zwerger
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||
*/
|
||||
|
||||
package de.bixilon.minosoft.data.mappings
|
||||
|
||||
interface CompanionResourceLocation : ResourceLocationAble {
|
||||
val RESOURCE_LOCATION: ResourceLocation
|
||||
|
||||
override val resourceLocation: ResourceLocation
|
||||
get() = RESOURCE_LOCATION
|
||||
}
|
@ -11,10 +11,8 @@
|
||||
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||
*/
|
||||
|
||||
package de.bixilon.minosoft.util
|
||||
|
||||
import de.bixilon.minosoft.data.mappings.ResourceLocation
|
||||
package de.bixilon.minosoft.data.mappings
|
||||
|
||||
interface ResourceLocationAble {
|
||||
val RESOURCE_LOCATION: ResourceLocation
|
||||
val resourceLocation: ResourceLocation
|
||||
}
|
@ -16,12 +16,12 @@ package de.bixilon.minosoft.data.mappings.entities
|
||||
import de.bixilon.minosoft.data.entities.EntityRotation
|
||||
import de.bixilon.minosoft.data.entities.entities.Entity
|
||||
import de.bixilon.minosoft.data.entities.meta.EntityMetaData
|
||||
import de.bixilon.minosoft.data.mappings.CompanionResourceLocation
|
||||
import de.bixilon.minosoft.data.mappings.ResourceLocation
|
||||
import de.bixilon.minosoft.protocol.network.connection.PlayConnection
|
||||
import de.bixilon.minosoft.util.ResourceLocationAble
|
||||
import glm_.vec3.Vec3
|
||||
|
||||
interface EntityFactory<T : Entity> : ResourceLocationAble {
|
||||
interface EntityFactory<T : Entity> : CompanionResourceLocation {
|
||||
|
||||
/**
|
||||
* Tweaks the entity resource location. Used for pre flattening versions.
|
||||
|
@ -13,11 +13,9 @@
|
||||
|
||||
package de.bixilon.minosoft.data.mappings.other.game.event.handlers
|
||||
|
||||
import de.bixilon.minosoft.data.mappings.ResourceLocation
|
||||
import de.bixilon.minosoft.data.mappings.CompanionResourceLocation
|
||||
import de.bixilon.minosoft.protocol.network.connection.PlayConnection
|
||||
|
||||
interface GameEventHandler {
|
||||
val RESOURCE_LOCATION: ResourceLocation
|
||||
|
||||
interface GameEventHandler : CompanionResourceLocation {
|
||||
fun handle(data: Float, connection: PlayConnection)
|
||||
}
|
||||
|
@ -13,11 +13,10 @@
|
||||
|
||||
package de.bixilon.minosoft.data.mappings.registry
|
||||
|
||||
import de.bixilon.minosoft.data.mappings.ResourceLocation
|
||||
import de.bixilon.minosoft.data.mappings.ResourceLocationAble
|
||||
import de.bixilon.minosoft.data.mappings.versions.VersionMapping
|
||||
|
||||
interface RegistryItem {
|
||||
val resourceLocation: ResourceLocation
|
||||
interface RegistryItem : ResourceLocationAble {
|
||||
|
||||
fun postInit(versionMapping: VersionMapping) {}
|
||||
}
|
||||
|
@ -13,10 +13,10 @@
|
||||
|
||||
package de.bixilon.minosoft.gui.rendering
|
||||
|
||||
import de.bixilon.minosoft.data.mappings.CompanionResourceLocation
|
||||
import de.bixilon.minosoft.protocol.network.connection.PlayConnection
|
||||
import de.bixilon.minosoft.util.ResourceLocationAble
|
||||
|
||||
interface RenderBuilder : ResourceLocationAble {
|
||||
interface RenderBuilder : CompanionResourceLocation {
|
||||
|
||||
fun build(connection: PlayConnection, renderWindow: RenderWindow): Renderer
|
||||
}
|
||||
|
@ -13,11 +13,10 @@
|
||||
|
||||
package de.bixilon.minosoft.gui.rendering.hud
|
||||
|
||||
import de.bixilon.minosoft.data.mappings.ResourceLocation
|
||||
import de.bixilon.minosoft.data.mappings.CompanionResourceLocation
|
||||
import de.bixilon.minosoft.gui.rendering.hud.nodes.HUDElement
|
||||
|
||||
interface HUDRenderBuilder<T : HUDElement> {
|
||||
val RESOURCE_LOCATION: ResourceLocation
|
||||
interface HUDRenderBuilder<T : HUDElement> : CompanionResourceLocation {
|
||||
val DEFAULT_PROPERTIES: HUDElementProperties
|
||||
|
||||
fun build(hudRenderer: HUDRenderer): T
|
||||
|
Loading…
x
Reference in New Issue
Block a user