diff --git a/gradle.properties b/gradle.properties index 12688c5..25361f7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ jarName = BetterFoliage-MC1.10.2 version = 2.2.0 mc_version = 1.10.2 -forge_version = 12.18.2.2121 -mcp_mappings = snapshot_20160905 +forge_version = 12.18.3.2185 +mcp_mappings = stable_29 -kotlin_version = 1.1.1 \ No newline at end of file +kotlin_version = 1.2.0 \ No newline at end of file diff --git a/src/main/kotlin/mods/betterfoliage/client/Client.kt b/src/main/kotlin/mods/betterfoliage/client/Client.kt index 61e95af..c6b8461 100644 --- a/src/main/kotlin/mods/betterfoliage/client/Client.kt +++ b/src/main/kotlin/mods/betterfoliage/client/Client.kt @@ -95,7 +95,7 @@ object Client { val blockName = Block.REGISTRY.getNameForObject(state.block).toString() val blockLoc = "${location.x},${location.y},${location.z}" - Minecraft.getMinecraft().thePlayer.addChatMessage(TextComponentTranslation( + Minecraft.getMinecraft().ingameGUI.chatGUI.printChatMessage(TextComponentTranslation( "betterfoliage.rendererror", textComponent(blockName, TextFormatting.GOLD), textComponent(blockLoc, TextFormatting.GOLD) diff --git a/src/main/kotlin/mods/betterfoliage/client/render/EntityFallingLeavesFX.kt b/src/main/kotlin/mods/betterfoliage/client/render/EntityFallingLeavesFX.kt index 089568c..03013fb 100644 --- a/src/main/kotlin/mods/betterfoliage/client/render/EntityFallingLeavesFX.kt +++ b/src/main/kotlin/mods/betterfoliage/client/render/EntityFallingLeavesFX.kt @@ -40,7 +40,7 @@ AbstractEntityFX(world, pos.x.toDouble() + 0.5, pos.y.toDouble(), pos.z.toDouble var wasCollided = false init { - particleMaxAge = MathHelper.floor_double(random(0.6, 1.0) * Config.fallingLeaves.lifetime * 20.0) + particleMaxAge = MathHelper.floor(random(0.6, 1.0) * Config.fallingLeaves.lifetime * 20.0) motionY = -Config.fallingLeaves.speed particleScale = Config.fallingLeaves.size.toFloat() * 0.1f @@ -119,7 +119,7 @@ object LeafWindTracker { @SubscribeEvent fun handleWorldTick(event: TickEvent.ClientTickEvent) { - if (event.phase == TickEvent.Phase.START) Minecraft.getMinecraft().theWorld?.let { world -> + if (event.phase == TickEvent.Phase.START) Minecraft.getMinecraft().world?.let { world -> // change target wind speed if (world.worldInfo.worldTime >= nextChange) changeWind(world) diff --git a/src/main/kotlin/mods/betterfoliage/client/render/EntityRisingSoulFX.kt b/src/main/kotlin/mods/betterfoliage/client/render/EntityRisingSoulFX.kt index fe4fcaa..e23f39f 100644 --- a/src/main/kotlin/mods/betterfoliage/client/render/EntityRisingSoulFX.kt +++ b/src/main/kotlin/mods/betterfoliage/client/render/EntityRisingSoulFX.kt @@ -27,7 +27,7 @@ AbstractEntityFX(world, pos.x.toDouble() + 0.5, pos.y.toDouble() + 1.0, pos.z.to motionY = 0.1 particleGravity = 0.0f particleTexture = RisingSoulTextures.headIcons[rand.nextInt(256)] - particleMaxAge = MathHelper.floor_double((0.6 + 0.4 * rand.nextDouble()) * Config.risingSoul.lifetime * 20.0) + particleMaxAge = MathHelper.floor((0.6 + 0.4 * rand.nextDouble()) * Config.risingSoul.lifetime * 20.0) } override val isValid: Boolean get() = true diff --git a/src/main/kotlin/mods/octarinecore/client/render/AbstractBlockRenderingHandler.kt b/src/main/kotlin/mods/octarinecore/client/render/AbstractBlockRenderingHandler.kt index cded593..9c58d3a 100644 --- a/src/main/kotlin/mods/octarinecore/client/render/AbstractBlockRenderingHandler.kt +++ b/src/main/kotlin/mods/octarinecore/client/render/AbstractBlockRenderingHandler.kt @@ -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)) } } \ No newline at end of file diff --git a/src/main/kotlin/mods/octarinecore/client/resource/ResourceHandler.kt b/src/main/kotlin/mods/octarinecore/client/resource/ResourceHandler.kt index 550c3d1..c6aa189 100644 --- a/src/main/kotlin/mods/octarinecore/client/resource/ResourceHandler.kt +++ b/src/main/kotlin/mods/octarinecore/client/resource/ResourceHandler.kt @@ -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) } \ No newline at end of file