port to MC 1.11

This commit is contained in:
octarine-noise
2016-12-10 21:30:55 +01:00
parent 1a1aa81c0f
commit ceb3e5b116
28 changed files with 77 additions and 74 deletions

View File

@@ -38,7 +38,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
@@ -60,7 +60,7 @@ AbstractEntityFX(world, pos.x.toDouble() + 0.5, pos.y.toDouble(), pos.z.toDouble
if (rand.nextFloat() > 0.95f) rotPositive = !rotPositive
if (particleAge > particleMaxAge - 20) particleAlpha = 0.05f * (particleMaxAge - particleAge)
if (isCollided || wasCollided) {
if (onGround || wasCollided) {
velocity.setTo(0.0, 0.0, 0.0)
if (!wasCollided) {
particleAge = Math.max(particleAge, particleMaxAge - 20)
@@ -117,7 +117,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)

View File

@@ -26,7 +26,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

View File

@@ -6,6 +6,7 @@ import mods.betterfoliage.client.config.Config
import mods.octarinecore.client.render.*
import mods.octarinecore.client.resource.TextureListModelProcessor
import mods.octarinecore.client.resource.get
import mods.octarinecore.client.resource.registerSprite
import mods.octarinecore.common.Int3
import mods.octarinecore.common.Rotation
import mods.octarinecore.common.config.ConfigurableBlockMatcher
@@ -45,10 +46,10 @@ class RenderCactus : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
)
override fun processStitch(state: IBlockState, key: List<String>, atlas: TextureMap): IColumnTextureResolver? {
val topTex = atlas[key[0]]
val bottomTex = atlas[key[1]]
val sideTex = atlas[key[2]]
return if (topTex != null && bottomTex != null && sideTex != null) StaticColumnInfo(topTex, bottomTex, sideTex) else null
val topTex = atlas.registerSprite(key[0])
val bottomTex = atlas.registerSprite(key[1])
val sideTex = atlas.registerSprite(key[2])
return StaticColumnInfo(topTex, bottomTex, sideTex)
}
override fun get(state: IBlockState) = stateToValue[state]

View File

@@ -8,6 +8,7 @@ import mods.betterfoliage.client.texture.StandardGrassSupport
import mods.octarinecore.client.render.BlockContext
import mods.octarinecore.client.resource.TextureListModelProcessor
import mods.octarinecore.client.resource.get
import mods.octarinecore.client.resource.registerSprite
import mods.octarinecore.common.Int3
import mods.octarinecore.common.config.ConfigurableBlockMatcher
import mods.octarinecore.common.config.ModelTextureList
@@ -72,10 +73,10 @@ object StandardLogSupport : TextureListModelProcessor<IColumnTextureResolver>, I
override val modelTextures: List<ModelTextureList> get() = Config.blocks.logModels.list
override fun processStitch(state: IBlockState, key: List<String>, atlas: TextureMap): IColumnTextureResolver? {
val topTex = atlas[key[0]]
val bottomTex = atlas[key[1]]
val sideTex = atlas[key[2]]
return if (topTex != null && bottomTex != null && sideTex != null) StaticColumnInfo(topTex, bottomTex, sideTex) else null
val topTex = atlas.registerSprite(key[0])
val bottomTex = atlas.registerSprite(key[1])
val sideTex = atlas.registerSprite(key[2])
return StaticColumnInfo(topTex, bottomTex, sideTex)
}
override fun get(state: IBlockState) = stateToValue[state]