Jump to content

Yagoki

Members
  • Posts

    290
  • Joined

  • Last visited

Everything posted by Yagoki

  1. Thanks, that's been bugging be for ages. think I'd just looked at it for too long to notice as I said. Did initially think of just packing like you say but it wound up being important that they remain in order and without gaps (various rng operations etc...)
  2. This problem is more of a mathsy one that a forge one but it's been bugging me for so long now that I think I am incapable of noticing the solution Let's say I have an integer set of coordinates, each ranging from 0 to some independent finite limit (which may be different for each. This can be thought of as an N dimensional grid with coordinates (i, j, k, ...) and lengths (I, J, K, ...) . In this case each coordinate that can be occupied/intersect of the grid can be counted with an ordinal assigned by o=i+j*I+k*I*J+... . this is useful wen trying to assign a metadata value or some such. The problem I'm having is figuring out a way of reversing this operation to get the original (i,j,k,...) given the ordinal and (I,J,K,...)
  3. Found the issue. was down to a NPE that i wasn't noticing as it wasn't killing the system, kept assuming the stack-trace was part of the authentication exception which always happens when first launched (caused by ). this was causing the readFromNBT to fail every time from the server. fixed it by amending this statement with a check for hasWorldObj in the setter for power if (this.hasWorldObj && !this.getWorld.isRemote) this.getWorld.scheduleUpdate(this.getPos, this.getBlockType, 1) it's always the simple things that seem to catch me out the most...
  4. can confirm. even tried extending TileEntity explicitly in the Obelisk TE class to be sure but no change.
  5. the tile are not getting saved. The client side tile is created at world load and I can force the tile to be loaded on the server by calling world.getTileEntity on the server side from an item use or some such still no idea what is causing this. receiving no errors stating that the tile entity is missing a mapping so it's not an issue with the registering from what I can tell. The methods createTileEntity and hasTileEntity are not called from the server following world load until world.getTileEntity is called. seems to be true for all my tile entities, but somehow never noticed it before. Possible forge problem?
  6. update has been pushed. break-point triggered on both ends if the tile is placed, but only on client if through world load
  7. thanks for the advice on proper practices, was just going by what I could see in vanilla implementations. Still doesn't fix the issue though...
  8. Tile entity is registered in the ModBlocks object. this is not the issue. I can see assignment happening to the the variable power on the client side but no such luck on the server Before world restart [21:41:50] [21:44:33] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:44:33] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: tile for 0 [21:44:33] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:44:33] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=1] [21:44:33] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=2] [21:44:33] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:44:33] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: tile for 0 [21:44:33] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:44:33] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=1] [21:44:33] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=2] [21:44:33] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:44:33] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=1] [21:44:33] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=2] [21:44:33] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:44:33] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=1] [21:44:33] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=2] [21:44:33] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:44:33] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=1] [21:44:33] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=2] [21:44:33] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 0 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 4 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 8 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 4 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 8 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 12 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 12 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 16 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 16 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 20 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 20 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 24 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 24 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 28 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 28 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 32 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 32 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 36 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 36 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 40 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 40 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 44 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 44 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 48 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 48 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 52 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 52 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 56 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 56 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 60 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 60 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 64 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 64 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 68 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 68 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 72 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 72 [21:44:43] [server thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 76 [21:44:43] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 76 [21:42:02] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:42:02] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=1] [21:42:02] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=2] [21:42:02] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:42:02] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:42:02] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: tile for 0 [21:42:02] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:42:02] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=0] [21:42:02] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=1] [21:42:02] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: mtech:blockObelisk[tier=2] [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 4 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 8 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 12 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 16 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 20 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 24 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 28 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 32 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 36 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 40 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 44 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 48 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 52 [21:42:09] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 56 [21:42:10] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 60 [21:42:10] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 64 [21:42:10] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 68 [21:42:10] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 72 [21:42:10] [Client thread/INFO] [sTDOUT]: [scala.Console$:println:148]: 76 you can see that when the world restarts there are no longer updates getting posted from the server thread as for my use of scala, it's nicer to code in (in my opinion) and has a lot of useful tools, a better interface system (see traits), implicit functions, among other things. mostly just a personal preference
  9. I have created a new tile entity which is supposed to detect entities dying around it. This functionality works fine when the tile has just been created, however when the world gets re-loaded the tile does not get created on the server stopping it from working. My assumption is that it is down to my attempted use of block states to define which have tile entities. If anyone has suggestions for fixing this it would be much appreciated Github: TileEntity package com.yagoki.mtech.block.tileentity import net.minecraft.entity.boss.{EntityDragon, EntityWither} import net.minecraft.entity.{EntityCreature, EntityLivingBase} import net.minecraft.entity.monster.EntityMob import net.minecraft.entity.passive.{EntityTameable, EntityVillager} import net.minecraft.entity.player.EntityPlayer import net.minecraft.nbt.NBTTagCompound import net.minecraft.util.ITickable import net.minecraft.util.math.AxisAlignedBB import scala.collection.JavaConversions._ import com.yagoki.mtech.util.MathUtil._ /** * Created by Ben on 06/04/2016. */ class TileEntityObelisk extends SimpleTileEntity with ITickable { private var _power: Int = 0 def power = _power def power_=(v: Int) = { _power = v // TODO: remove debug println(power) if (!this.getWorld.isRemote) this.getWorld.scheduleUpdate(this.getPos, this.getBlockType, 1) } override def update(): Unit = { val ents: List[EntityLivingBase] = this.getWorld.getEntitiesWithinAABB(classOf[EntityLivingBase], new AxisAlignedBB(this.getPos-(4, 2, 4), this.getPos+(4, 2, 4)).addCoord(.5, .5, .5)).toList ents foreach { e => if (!e.isEntityAlive) power += lifeValForEntity(e) } } def lifeValForEntity(e: EntityLivingBase): Int = e match { case _: EntityPlayer => 0 case _: EntityDragon => 160 case _: EntityWither => 80 case _: EntityTameable => 16 case _: EntityVillager => 8 case _: EntityMob => 2 case _: EntityCreature => 4 case _ => 1 } override def writeToNBT(compound: NBTTagCompound): Unit = { super.writeToNBT(compound) compound.setInteger("power", power) } override def readFromNBT(compound: NBTTagCompound): Unit = { super.readFromNBT(compound) power = compound.getInteger("power") } } Github: Block package com.yagoki.mtech.block import com.yagoki.mtech.block.ModBlocks.SimpleTile import net.minecraft.block.Block import net.minecraft.block.state.{BlockStateContainer, IBlockState} import net.minecraft.init.Blocks import net.minecraft.tileentity.TileEntity import net.minecraft.util.math.{AxisAlignedBB, BlockPos} import net.minecraft.world.{IBlockAccess, World} /** * Created by Ben on 07/04/2016. */ trait BlockObelisk extends SimpleTile { override def isOpaqueCube(state: IBlockState): Boolean = false override def isFullCube(state: IBlockState): Boolean = false def bbFromState(state: IBlockState): AxisAlignedBB = getMetaFromState(state) match { case 0 => new AxisAlignedBB(1/16D, 0, 1/16D, 15/16D, 1, 15/16D) case 1 => new AxisAlignedBB(2/16D, 0, 2/16D, 14/16D, 1, 14/16D) case 2 => new AxisAlignedBB(3/16D, 0, 3/16D, 13/16D, 1, 13/16D) } override def getBoundingBox(state: IBlockState, source: IBlockAccess, pos: BlockPos): AxisAlignedBB = bbFromState(state) override def getMetaFromState(state: IBlockState): Int = state.getValue(ModBlocks.TIER) override def getStateFromMeta(meta: Int): IBlockState = this.getDefaultState.withProperty[integer, Integer](ModBlocks.TIER, meta) override def createBlockState(): BlockStateContainer = new BlockStateContainer(this, ModBlocks.TIER) override def onNeighborBlockChange(world: World, pos: BlockPos, state: IBlockState, neighborBlock: Block): Unit = { val zeroPoint: Int = -state.getValue(ModBlocks.TIER) val obeliskBlocks = (zeroPoint to (zeroPoint+2)).map(i => world.getBlockState(pos.add(0, i, 0))) if (!obeliskBlocks.forall(s => s.getBlock == Blocks.sandstone || s.getBlock == ModBlocks("blockObelisk").get)) world.setBlockState(pos, Blocks.sandstone.getDefaultState) } override def createTileEntity(world: World, state: IBlockState): TileEntity = this.createNewTileEntity(world, getMetaFromState(state)) override def createNewTileEntity(world: World, i: Int): TileEntity = i match { case 0 => super.createNewTileEntity(world, i) } } all other files are on my github so look as you need
  10. Awesome. tried this last night and it didn't as the block was getting replaced, and therefore so was the tile entity. changed the code so that rather than doing it from the state it reads the value from the tile entity and updates the neighbors. I have to keep an array of the previous values though to try and smooth it out a bit, otherwise it flickers on and off quite a bit var powerLevel: Int = 0 var prevEnts: Map[EntityLivingBase, Vec3d] = Map() var postMax: List[Double] = new Array(10).toList override def update(): Unit = { if (!this.getWorld.isRemote) { val entList: List[EntityLivingBase] = getWorld.getEntitiesWithinAABB(classOf[EntityLivingBase], new AxisAlignedBB(this.getPos.getX-4, this.getPos.getY-4, this.getPos.getZ-4,this.getPos.getX+4, this.getPos.getY+4, this.getPos.getZ+4)).toList val posList: Map[EntityLivingBase, Vec3d] = entList.map(e => (e, new Vec3d(e.posX, e.posY, e.posZ))).toMap val speedList: List[Double] = posList.map(kvp => (kvp._2-prevEnts.getOrElse(kvp._1, kvp._2)).lengthVector()).toList.sortWith((d0, d1) => d0 > d1) val max: Double = speedList.headOption.getOrElse(0) postMax = postMax.tail :+ max var mean: Double = 0 postMax foreach(d => mean += d/postMax.length) println(mean) powerLevel = (mean * 30).toInt println(powerLevel) prevEnts = posList this.getWorld.notifyNeighborsOfStateChange(this.getPos, this.getBlockType) } }
  11. previous turned out not to work... was a little premature there. back to square 0, any ideas? [Edit] can also rule out moveForward and moveStrafing [/Edit]
  12. found a work around, substituted each motion with e.posZ - e.lastTickPosZ . had forgotten the last tick position was saved to that
  13. OK, so there is a motionX/Z when the player jumps while sprinting... I'm guessing that the payer motion when walking on the ground or jumping normally is just dictated by a setPos from the key bindings (maybe?) any ideas for a work around?
  14. OK, So I'm trying to set the properties of a tile entity by the speed of the fastest entity near to it. I have the following method setup, (code is in Scala but I can translate if required) override def update(): Unit = { if (!this.getWorld.isRemote) { val ents = this.getWorld.getEntitiesWithinAABB(classOf[EntityLivingBase], new AxisAlignedBB(getPos.getX-3, getPos.getY-3, getPos.getZ-3, getPos.getX+3, getPos.getY+3, getPos.getZ+3)) val speeds: List[Double] = ents.map(e => { val vx = e.motionX val vy = e.motionY val vz = e.motionZ println(List(vx, vy, vz)) vx**2 + vy**2 + vz**2 }).sortWith((d0, d1) => d0 > d1).toList val speed: Double = speeds.headOption.getOrElse[Double](0) ** .5 powerLevel = Math.min(speed * 15, 15).toInt println(powerLevel) var state = BlockMotionSensor.getDefaultState state = state.withProperty[integer, Integer](ModBlocks.meta, powerLevel) this.getWorld.setBlockState(this.getPos, state) } } for my entity player (only tested so far on single player) velocities are printed as List(0.0, -0.07544406518948656, 0.0) , with y increasing if I jump, but x and z never change. Testing on pigs (we do not fear animal testing here) showed that pigs do have velocity in all three directions using the above code. Any suggestions on what I'm missing? or is this a bug in the latest forge (1.9-12.16.0.1816)
  15. Thanks would've taken me ages to notice that change
  16. So having re-done my modding setup and updated to the latest version of Intellij I can't seem to get minecraft running. running either of MinecraftClient of MinecraftServer configurations results in the following error (with GradleStart replaced by GradleStartServer in MinecraftServer): "C:\Program Files\Java\jdk1.8.0_31\bin\java" -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_31\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_31\jre\lib\rt.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.1\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain GradleStart Exception in thread "main" java.lang.ClassNotFoundException: GradleStart at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:260) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122) Process finished with exit code 1 as far as I can tell all the relevant files exist in my libraries all steps involved with setting up forge have been tried,having run setupDecompWorkspace and genIntellijRuns, also having tried --refresh-dependencies the problem seems to be present for me with previous versions of the forge install (through old versions of minecraft), suggesting that this isn't a direct result of forge but more likely a problem with my intellij setup. If anyone has any ideas on how to fix this it would be greatly appreciated
  17. OK, updated to Java 8 from Java 7 (JDK 1.8.0_05 was previously JDK 1.7.something) and it seems to have worked, guessing it fixed a path or something Thanks for pointing out the setupDecompWorkspace command, that wasn't obvious and i don't think it was mentioned in the thing Lex did to show how to use the gradle setup Thanks
  18. Didn't know that was a thing, but just tried that and got an error It says to check that I have the JDK installed (which I know I do. been programming with java for a few years now so lack of JDK is not the issue), i'll go check that that's all up to date then report back.
  19. No, the class files exist, just in the same way that they exist for the LWJGL files. I can use them, but I can't jump to lines of the code. Mostly just that the Source attachment is missing for only the minecraft files, it exists for the forge files. Re-running the setup was one of the first things I tried as I still don't trust gradle
  20. I'm going to assume that given I can't find anything else, only the files for the forge src exist and there are none for the minecarft src
  21. Hmmm... don't see anything saying "referenced libraries" nor can I find any file labelled forgeSrc in my eclipse environment. Getting really tempted to stick with 1.6 but I know I should probably update before I get left too far behind. [EDIT] OK, found it. Was confused for a bit, mostly because I was expecting to find them all in the folder I created for the dev environment, never thought to check if gradle created a new place to keep the things. If anyone else is looking they will be in a folder similar to the location of the .jar you want the src for. then to apply in eclipse: right click on the project-->properties-->Java Build Path-->Libraries-->click on the library you wish to add src to-->click "source attachment"-->Edit-->External Location (you then need to establish if it's an arhivee.g. .jar/.zip/.rar/... or a file system) click the required on then navigate to the file
  22. So just got round to updating my mod to 1.7 and was met by a wave of 300+ errors (fairly typical), however some of them (including this one) I can't figure out. I'm sure some will become more obvious as I get more used to the 1.7 environment but I can't see an obvious replacement for this, also not aided by the fact that there no longer appears to be an equivalent method for what was NetworkRegistry.instance().registerConnectionHandler(new MTechNetworkHandler()); The class which I can't figure out how to replace Anybody got any ideas? the rest of my working 1.6 code is all in this repository Thanks in advance ~Yagoki P.S. am I the only one finding it frustrating that we can't poke around in the src with the gradlew updates like we could with mcp?
  23. that's what I was sayinh, when you hold the block the meta is 0, therefore it will never reach the front icon, and will only render top bottom and sides. By changing the code to: public Icon getIcon(int side, int meta) { if(side == 0) return iconBottom; else if(side == 1) return iconTop; else if(side == meta || (meta == 0 && side == 2/*this may need a different value, possible values are 2,3,4,5*/)) return iconFront; else return iconSide; } you check to see if the meta is 0, which implies to the game that it is in your hand. If that is true, then it will render the front icon on one of the sides, rather than omitting it.
  24. that'll be your metadata, i guess. if you use the metadata to determine the side of the face in the following way (or similarly) then it will not render the face public Icon getIcon(int side, int meta) { if(side == 0) return iconBottom; else if(side == 1) return iconTop; else if(side == meta) return iconFront; else return iconSide; } in your hand the meta will most likely be 0, so all textures will be the side, top or bottom. you can ether change if(side==meta) to if(side==meta ^ (meta==0 && side==3/*this may be different, possibly 2,3,4,5*/)) alternatively you can change the metadata dropped to the number you would have used above
  25. well here's my main class if you want to have a look through it and see if you can tell what's different: https://github.com/Yagoki/MTech/blob/master/MTech/mtech/common/MTech.java
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.