-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
689bdbf
commit bd653f7
Showing
4 changed files
with
28 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,29 @@ | ||
package miyucomics.hexical.entities | ||
|
||
import net.minecraft.entity.Entity | ||
import net.minecraft.entity.EntityDimensions | ||
import net.minecraft.entity.EntityPose | ||
import net.minecraft.entity.EntityType | ||
import net.minecraft.nbt.NbtCompound | ||
import net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket | ||
import net.minecraft.util.math.Direction | ||
import net.minecraft.world.World | ||
|
||
class SpikeEntity(entityType: EntityType<SpikeEntity?>?, world: World?) : Entity(entityType, world) { | ||
private var direction: Direction = Direction.UP | ||
companion object { | ||
} | ||
override fun getEyeHeight(pose: EntityPose, dimensions: EntityDimensions) = 0.5f | ||
|
||
fun setDirection() { | ||
if (this.direction.axis.isHorizontal) { | ||
fun setDirection(direction: Direction) { | ||
if (direction.axis.isHorizontal) { | ||
this.pitch = 0.0f | ||
this.yaw = (this.direction.horizontal * 90).toFloat() | ||
this.yaw = (direction.horizontal * 90).toFloat() | ||
} else { | ||
this.pitch = (-90 * this.direction.direction.offset()).toFloat() | ||
this.pitch = (-90 * direction.direction.offset()).toFloat() | ||
this.yaw = 0.0f | ||
} | ||
} | ||
|
||
override fun initDataTracker() { | ||
} | ||
|
||
override fun readCustomDataFromNbt(nbt: NbtCompound) { | ||
} | ||
|
||
override fun writeCustomDataToNbt(nbt: NbtCompound) { | ||
} | ||
|
||
override fun initDataTracker() {} | ||
override fun readCustomDataFromNbt(nbt: NbtCompound) {} | ||
override fun writeCustomDataToNbt(nbt: NbtCompound) {} | ||
override fun createSpawnPacket() = EntitySpawnS2CPacket(this) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters