update to latest recommended Forge

This commit is contained in:
octarine-noise
2018-10-25 11:10:44 +02:00
parent 0997b83367
commit e704a0af94
6 changed files with 14 additions and 14 deletions

View File

@@ -114,8 +114,8 @@ class BlockContext {
/** Get the distance of the block from the camera (player). */
val cameraDistance: Int get() {
val camera = Minecraft.getMinecraft().renderViewEntity ?: return 0
return Math.abs(pos.x - MathHelper.floor_double(camera.posX)) +
Math.abs(pos.y - MathHelper.floor_double(camera.posY)) +
Math.abs(pos.z - MathHelper.floor_double(camera.posZ))
return Math.abs(pos.x - MathHelper.floor(camera.posX)) +
Math.abs(pos.y - MathHelper.floor(camera.posY)) +
Math.abs(pos.z - MathHelper.floor(camera.posZ))
}
}

View File

@@ -90,7 +90,7 @@ class IconSet(val domain: String, val namePattern: String) : IStitchListener {
var num = 0
override fun onStitch(atlas: TextureMap) {
num = 0;
num = 0
(0..15).forEach { idx ->
icons[idx] = null
val locReal = ResourceLocation(domain, "textures/${namePattern.format(idx)}.png")
@@ -103,13 +103,13 @@ class IconSet(val domain: String, val namePattern: String) : IStitchListener {
class ModelSet(val num: Int, val init: Model.(Int)->Unit): IConfigChangeListener {
val models = Array(num) { Model().apply{ init(it) } }
override fun onConfigChange() { (0..num-1).forEach { models[it] = Model().apply{ init(it) } } }
override fun onConfigChange() { (0 until num).forEach { models[it] = Model().apply{ init(it) } } }
operator fun get(idx: Int) = models[idx % num]
}
class VectorSet(val num: Int, val init: (Int)->Double3): IConfigChangeListener {
val models = Array(num) { init(it) }
override fun onConfigChange() { (0..num-1).forEach { models[it] = init(it) } }
override fun onConfigChange() { (0 until num).forEach { models[it] = init(it) } }
operator fun get(idx: Int) = models[idx % num]
}
@@ -117,7 +117,7 @@ class SimplexNoise() : IWorldLoadListener {
var noise = NoiseGeneratorSimplex()
override fun onWorldLoad(world: World) { noise = NoiseGeneratorSimplex(Random(world.worldInfo.seed))
}
operator fun get(x: Int, z: Int) = MathHelper.floor_double((noise.getValue(x.toDouble(), z.toDouble()) + 1.0) * 32.0)
operator fun get(x: Int, z: Int) = MathHelper.floor((noise.getValue(x.toDouble(), z.toDouble()) + 1.0) * 32.0)
operator fun get(pos: Int3) = get(pos.x, pos.z)
operator fun get(pos: BlockPos) = get(pos.x, pos.z)
}