This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Xtansia's profile picture

Error when trying to test peripheral

Started by Xtansia, 27 March 2012 - 12:06 AM
Xtansia #1
Posted 27 March 2012 - 02:06 AM
Ok so I've coded a peripheral,
I recompile and reobfuscate,
I then put my code in to my mods folder to test,
And then I get this error when trying to place the peripheral next to a computer:
Spoiler===Simple Minecraft Error Test===

Starting Minecraft…

27 achievements
177 recipes
LWJGL Version: 2.4.2
ModLoader 1.2.3 Initializing…
Mod Initialized: mod_ModLoaderMp 1.2.3v3
Mod Initialized: mod_MinecraftForge 1.4.0.46
Mod Initialized: mod_CCPeriph_CmdLoader V1.0.0 for MC1.2.3
ComputerCraft: turtleBlockID 209
CONFLICT @ -47
ModLoaderMP 1.0.0 Initialized
Mod Initialized: mod_CCTurtle 1.31
Loading ComputerCraft: To change block IDs, modify config/mod_ComputerCraft.cfg
ComputerCraft: computerBlockID 207
ComputerCraft: diskDriveBlockID 208
ComputerCraft: diskItemID 4000
CONFLICT @ -49
CONFLICT @ -48
Mod Initialized: mod_ComputerCraft 1.31
Mod Loaded: mod_ModLoaderMp 1.2.3v3
Mod Loaded: mod_MinecraftForge 1.4.0.46
MinecraftForge v1.4.0.46 Initialized
Mar 27, 2012 1:59:34 PM forge.ForgeHooks <clinit>
INFO: MinecraftForge v1.4.0.46 Initialized

Mod Loaded: mod_CCPeriph_CmdLoader V1.0.0 for MC1.2.3
ComputerCraft: Searching for RedPowerLib…
ComputerCraft: RedPowerLib not found.
Mod Loaded: mod_CCTurtle 1.31
Mod Loaded: mod_ComputerCraft 1.31
Done.
Loading: net.java.games.input.DirectAndRawInputEnvironmentPlugin

Starting up SoundSystem…
Initializing LWJGL OpenAL
(The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.or
g)
OpenAL initialized.

java.lang.NullPointerException
at dan200.computer.shared.Computer$PeripheralWrapper.<init>(Computer.jav
a:76)
at dan200.computer.shared.Computer.setPeripheral(Computer.java:929)
at dan200.computer.shared.NetworkedComputerHelper.setPeripheral(Networke
dComputerHelper.java:300)
at dan200.computer.shared.TileEntityComputer.setPeripheral(TileEntityCom
puter.java:172)
at dan200.computer.shared.BlockComputerBase.refreshInput(BlockComputerBa
se.java:166)
at dan200.computer.shared.NetworkedComputerHelper.update(NetworkedComput
erHelper.java:76)
at dan200.computer.shared.TileEntityComputer.n_(TileEntityComputer.java:
71)
at wz.n(World.java:2030)
at net.minecraft.client.Minecraft.k(Minecraft.java:1878)
at net.minecraft.client.Minecraft.x(Minecraft.java:842)
at net.minecraft.client.Minecraft.run(Minecraft.java:747)
at java.lang.Thread.run(Unknown Source)
Stopping!

SoundSystem shutting down…
Author: Paul Lamb, www.paulscode.com


Finished session


Right click, Select all,
Press Enter (This will copy the output to your clipboard).
Then paste the result on http://www.pastebin.com

===========#Risucraft===========

Press any key to continue . . .


I don't have a clue as to what is happening.
yoskaz01 #2
Posted 27 March 2012 - 05:26 AM
did you implement all of the IPeripheral methods?
Xtansia #3
Posted 27 March 2012 - 06:39 AM
Yep,
I've managed to fix it now, but for some reason further back in my code was causing getMethods() to return null,
Which in my own opinion shouldn't cause minecraft to crash it should just mark it as having no methods like,
if(periph.getMethods() == null){
methods = new String[]{};
}else{
methods = periph.getMethods();
}

Now I have another error I need to figure out.
But it is a simple one.
rockymc #4
Posted 29 March 2012 - 05:21 PM
Are you using 1.31 for 1.2.3?
Xtansia #5
Posted 29 March 2012 - 07:53 PM
Are you using 1.31 for 1.2.3?

Yes I was,
But I've fixed my problems now.