upgrade to recent Forge and MCP mappings

This commit is contained in:
octarine-noise
2016-05-16 12:17:54 +02:00
parent 69db3d6608
commit b5af0fe1c5
18 changed files with 29 additions and 29 deletions

View File

@@ -32,8 +32,8 @@ dependencies {
}
minecraft {
version = '1.9-12.16.0.1853-1.9'
mappings = 'snapshot_20160406'
version = '1.9-12.16.1.1894'
mappings = 'snapshot_20160509'
runDir = 'run'
}

View File

@@ -49,7 +49,7 @@ fun getUseNeighborBrightnessOverride(original: Boolean, state: IBlockState): Boo
fun onRandomDisplayTick(world: World, state: IBlockState, pos: BlockPos) {
if (Config.enabled &&
Config.risingSoul.enabled &&
state.block == Blocks.soul_sand &&
state.block == Blocks.SOUL_SAND &&
world.isAirBlock(pos + up1) &&
Math.random() < Config.risingSoul.chance) {
EntityRisingSoulFX(world, pos).addIfValid()

View File

@@ -34,7 +34,7 @@ class BlockMatcher(val domain: String, val path: String) : ConfigPropertyBase()
whiteList.forEach { if (it.isAssignableFrom(blockClass)) return true }
return false
}
fun matchesID(block: Block) = blockIDs.contains(Block.blockRegistry.getIDForObject(block))
fun matchesID(block: Block) = blockIDs.contains(Block.REGISTRY.getIDForObject(block))
fun matchesID(blockId: Int) = blockIDs.contains(blockId)
override fun attach(target: Configuration, langPrefix: String, categoryName: String, propertyName: String) {
@@ -59,8 +59,8 @@ class BlockMatcher(val domain: String, val path: String) : ConfigPropertyBase()
fun updateIDs() {
blockIDs.clear()
Block.blockRegistry.forEach {
if (matchesClass(it as Block)) blockIDs.add(Block.blockRegistry.getIDForObject(it))
Block.REGISTRY.forEach {
if (matchesClass(it as Block)) blockIDs.add(Block.REGISTRY.getIDForObject(it))
}
}

View File

@@ -13,9 +13,9 @@ import net.minecraftforge.fml.relauncher.SideOnly
private fun featureEnable() = boolean(true).lang("enabled")
private fun distanceLimit() = int(min=1, max=1000, default=1000).lang("distance")
fun biomeList(defaults: (BiomeGenBase) -> Boolean) = intList {
BiomeGenBase.biomeRegistry
BiomeGenBase.REGISTRY
.filter { it != null && defaults(it) }
.map { BiomeGenBase.biomeRegistry.getIDForObject(it) }
.map { BiomeGenBase.REGISTRY.getIDForObject(it) }
.toTypedArray()
}.apply { guiClass = BiomeListConfigEntry::class.java }

View File

@@ -13,7 +13,7 @@ class BiomeListConfigEntry(
configElement: IConfigElement)
: IdListConfigEntry<BiomeGenBase>(owningScreen, owningEntryList, configElement) {
override val baseSet: List<BiomeGenBase> get() = BiomeGenBase.biomeRegistry.filterNotNull()
override val BiomeGenBase.itemId: Int get() = BiomeGenBase.biomeRegistry.getIDForObject(this)
override val baseSet: List<BiomeGenBase> get() = BiomeGenBase.REGISTRY.filterNotNull()
override val BiomeGenBase.itemId: Int get() = BiomeGenBase.REGISTRY.getIDForObject(this)
override val BiomeGenBase.itemName: String get() = this.biomeName
}

View File

@@ -20,11 +20,11 @@ import org.apache.logging.log4j.Level.INFO
object ShadersModIntegration {
@JvmStatic var isPresent = false
@JvmStatic val tallGrassEntityData = entityDataFor(Blocks.tallgrass.defaultState.withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS))
@JvmStatic val leavesEntityData = entityDataFor(Blocks.leaves.defaultState)
@JvmStatic val tallGrassEntityData = entityDataFor(Blocks.TALLGRASS.defaultState.withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS))
@JvmStatic val leavesEntityData = entityDataFor(Blocks.LEAVES.defaultState)
fun entityDataFor(blockState: IBlockState) =
(Block.blockRegistry.getIDForObject(blockState.block).toLong() and 65535) or
(Block.REGISTRY.getIDForObject(blockState.block).toLong() and 65535) or
((blockState.renderType.ordinal.toLong() and 65535) shl 16) or
(blockState.block.getMetaFromState(blockState).toLong() shl 32)

View File

@@ -38,7 +38,7 @@ AbstractEntityFX(world, pos.x.toDouble() + 0.5, pos.y.toDouble(), pos.z.toDouble
init {
particleMaxAge = MathHelper.floor_double(random(0.6, 1.0) * Config.fallingLeaves.lifetime * 20.0)
ySpeed = -Config.fallingLeaves.speed
motionY = -Config.fallingLeaves.speed
particleScale = Config.fallingLeaves.size.toFloat() * 0.1f
val state = world.getBlockState(pos)

View File

@@ -23,7 +23,7 @@ AbstractEntityFX(world, pos.x.toDouble() + 0.5, pos.y.toDouble() + 1.0, pos.z.to
val initialPhase = rand.nextInt(64)
init {
ySpeed = 0.1
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)

View File

@@ -27,8 +27,8 @@ class RenderAlgae : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
override fun isEligible(ctx: BlockContext) =
Config.enabled && Config.algae.enabled &&
ctx.cameraDistance < Config.algae.distance &&
ctx.blockState(up2).material == Material.water &&
ctx.blockState(up1).material == Material.water &&
ctx.blockState(up2).material == Material.WATER &&
ctx.blockState(up1).material == Material.WATER &&
Config.blocks.dirt.matchesID(ctx.block) &&
ctx.biomeId in Config.algae.biomes &&
noise[ctx.pos] < Config.algae.population

View File

@@ -45,8 +45,8 @@ class RenderCoral : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
override fun isEligible(ctx: BlockContext) =
Config.enabled && Config.coral.enabled &&
ctx.cameraDistance < Config.coral.distance &&
(ctx.blockState(up2).material == Material.water || Config.coral.shallowWater) &&
ctx.blockState(up1).material == Material.water &&
(ctx.blockState(up2).material == Material.WATER || Config.coral.shallowWater) &&
ctx.blockState(up1).material == Material.WATER &&
Config.blocks.sand.matchesID(ctx.block) &&
ctx.biomeId in Config.coral.biomes &&
noise[ctx.pos] < Config.coral.population

View File

@@ -45,7 +45,7 @@ class RenderLeaves : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
override fun render(ctx: BlockContext, dispatcher: BlockRendererDispatcher, renderer: VertexBuffer, layer: BlockRenderLayer): Boolean {
val isSnowed = ctx.blockState(up1).material.let {
it == Material.snow || it == Material.craftedSnow
it == Material.SNOW || it == Material.CRAFTED_SNOW
}
renderWorldBlockBase(ctx, dispatcher, renderer, null)
val leafInfo = LeafRegistry[ctx, DOWN] ?: return false

View File

@@ -26,7 +26,7 @@ class RenderMycelium : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
override fun isEligible(ctx: BlockContext): Boolean {
if (!Config.enabled || !Config.shortGrass.myceliumEnabled) return false
return ctx.block == Blocks.mycelium &&
return ctx.block == Blocks.MYCELIUM &&
ctx.cameraDistance < Config.shortGrass.distance
}

View File

@@ -32,7 +32,7 @@ class RenderNetherrack : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID)
override fun isEligible(ctx: BlockContext): Boolean {
if (!Config.enabled || !Config.netherrack.enabled) return false
return ctx.block == Blocks.netherrack &&
return ctx.block == Blocks.NETHERRACK &&
ctx.cameraDistance < Config.netherrack.distance
}

View File

@@ -44,8 +44,8 @@ class RenderReeds : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
override fun isEligible(ctx: BlockContext) =
Config.enabled && Config.reed.enabled &&
ctx.cameraDistance < Config.reed.distance &&
ctx.blockState(up2).material == Material.air &&
ctx.blockState(up1).material == Material.water &&
ctx.blockState(up2).material == Material.AIR &&
ctx.blockState(up1).material == Material.WATER &&
Config.blocks.dirt.matchesID(ctx.block) &&
ctx.biomeId in Config.reed.biomes &&
noise[ctx.pos] < Config.reed.population

View File

@@ -24,7 +24,7 @@ val denseLeavesRot = arrayOf(Rotation.identity, Rotation.rot90[EAST.ordinal], Ro
val whitewash: RenderVertex.(ShadingContext, Int, Quad, Int, Vertex)->Unit = { ctx, qi, q, vi, v -> setGrey(1.4f) }
val greywash: RenderVertex.(ShadingContext, Int, Quad, Int, Vertex)->Unit = { ctx, qi, q, vi, v -> setGrey(1.0f) }
val IBlockState.isSnow: Boolean get() = material.let { it == Material.snow || it == Material.craftedSnow }
val IBlockState.isSnow: Boolean get() = material.let { it == Material.SNOW || it == Material.CRAFTED_SNOW }
fun Quad.toCross(rotAxis: EnumFacing, trans: (Quad)->Quad) =
(0..3).map { rotIdx ->

View File

@@ -25,10 +25,10 @@ abstract class AbstractEntityFX(world: World, x: Double, y: Double, z: Double) :
super.onUpdate()
currentPos.setTo(posX, posY, posZ)
prevPos.setTo(prevPosX, prevPosY, prevPosZ)
velocity.setTo(xSpeed, ySpeed, zSpeed)
velocity.setTo(motionX, motionY, motionZ)
update()
posX = currentPos.x; posY = currentPos.y; posZ = currentPos.z;
xSpeed = velocity.x; ySpeed = velocity.y; zSpeed = velocity.z;
motionX = velocity.x; motionY = velocity.y; motionZ = velocity.z;
}
/** Render the particle. */

View File

@@ -33,7 +33,7 @@ abstract class ModelDataInspector {
@Suppress("UNCHECKED_CAST")
@SubscribeEvent
fun handleLoadModelData(event: LoadModelDataEvent) {
val stateMappings = Block.blockRegistry.flatMap { block ->
val stateMappings = Block.REGISTRY.flatMap { block ->
((event.loader.blockModelShapes.blockStateMapper.blockStateMap[block] as? IStateMapper ?: DefaultStateMapper())
.putStateModelLocations(block as Block) as Map<IBlockState, ModelResourceLocation>).entries
}

View File

@@ -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.func_151605_a(x.toDouble(), z.toDouble()) + 1.0) * 32.0)
operator fun get(x: Int, z: Int) = MathHelper.floor_double((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)
}