Hey,
vielleicht sind ja ein paar Java-Devs unter euch die mir eventuell weiterhelfen können.
Ich Code gerade einen PvP-Client und ich suche jetzt schon seid 3 Stunden nach dem Fehler.
Es kommt immer eine NullPointerException, wenn ich ein Mod einschalten möchte, in diesem
Beispiel die 1.7 Animation.. Eine NullPointerException kommt immer wenn man auf etwas zugreifen
möchte das Null ist. Hab schon alles mögliche versucht, ich weiß einfach nicht weiter..
Gecoded mit Eclipse und dem 1.8 Minecraft-Moder-Pack.
EntityPlayerSP-Klasse:
public void onUpdate() {
if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) {
for (Module m : ModuleManager.activeModule) {
if (m.getState()) {
m.onUpdate();
...
}
}
BlockHit-Klasse:
package de.EinsAchtSieben.Client.Module.Mods;
import de.EinsAchtSieben.Client.Module.Module;
import net.minecraft.item.ItemSword;
public class BlockHit extends Module {
public BlockHit() {
super("BlockHit");
}
boolean toggle = false;
public void onUpdate()
{
if (this.toggle)
{
mc.gameSettings.keyBindUseItem.pressed = false;
this.toggle = false;
}
if (((mc.thePlayer.getHeldItem().getItem() instanceof ItemSword)) && <- Zeile 22. aus der Fehler Meldung.
(mc.thePlayer.isSwingInProgress))
{
mc.gameSettings.keyBindUseItem.pressed = true;
this.toggle = true;
}
}
}
Fehler:
Stacktrace:
at de.EinsAchtSieben.Client.Module.Mods.BlockHit.onUpdate(BlockHit.java:22) <- Zeile des Fehlers.
at net.minecraft.client.entity.EntityPlayerSP.onUpdate(EntityPlayerSP.java:141) <- Zeile des Fehlers.
at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:1885)
at net.minecraft.world.World.updateEntity(World.java:1854)
-- Entity being ticked --
Details:
Entity Type: null (net.minecraft.client.entity.EntityPlayerSP) <- Fehler
Entity ID: 138
Entity Name: Player917
Entity's Exact location: 521,91, 68,00, 259,67
Entity's Block location: 521,00,68,00,259,00 - World: (521,68,259), Chunk: (at 9,4,3 in 32,16; contains blocks 512,0,256 to 527,255,271), Region: (1,0; contains chunks 32,0 to 63,31, blocks 512,0,0 to 1023,255,511)
Entity's Momentum: 0,00, -0,08, 0,00
Entity's Rider: ~~ERROR~~ NullPointerException: null <- Fehler
Entity's Vehicle: ~~ERROR~~ NullPointerException: null <- Fehler
vielleicht sind ja ein paar Java-Devs unter euch die mir eventuell weiterhelfen können.
Ich Code gerade einen PvP-Client und ich suche jetzt schon seid 3 Stunden nach dem Fehler.
Es kommt immer eine NullPointerException, wenn ich ein Mod einschalten möchte, in diesem
Beispiel die 1.7 Animation.. Eine NullPointerException kommt immer wenn man auf etwas zugreifen
möchte das Null ist. Hab schon alles mögliche versucht, ich weiß einfach nicht weiter..
Gecoded mit Eclipse und dem 1.8 Minecraft-Moder-Pack.
EntityPlayerSP-Klasse:
public void onUpdate() {
if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) {
for (Module m : ModuleManager.activeModule) {
if (m.getState()) {
m.onUpdate();
...
}
}
BlockHit-Klasse:
package de.EinsAchtSieben.Client.Module.Mods;
import de.EinsAchtSieben.Client.Module.Module;
import net.minecraft.item.ItemSword;
public class BlockHit extends Module {
public BlockHit() {
super("BlockHit");
}
boolean toggle = false;
public void onUpdate()
{
if (this.toggle)
{
mc.gameSettings.keyBindUseItem.pressed = false;
this.toggle = false;
}
if (((mc.thePlayer.getHeldItem().getItem() instanceof ItemSword)) && <- Zeile 22. aus der Fehler Meldung.
(mc.thePlayer.isSwingInProgress))
{
mc.gameSettings.keyBindUseItem.pressed = true;
this.toggle = true;
}
}
}
Fehler:
Stacktrace:
at de.EinsAchtSieben.Client.Module.Mods.BlockHit.onUpdate(BlockHit.java:22) <- Zeile des Fehlers.
at net.minecraft.client.entity.EntityPlayerSP.onUpdate(EntityPlayerSP.java:141) <- Zeile des Fehlers.
at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:1885)
at net.minecraft.world.World.updateEntity(World.java:1854)
-- Entity being ticked --
Details:
Entity Type: null (net.minecraft.client.entity.EntityPlayerSP) <- Fehler
Entity ID: 138
Entity Name: Player917
Entity's Exact location: 521,91, 68,00, 259,67
Entity's Block location: 521,00,68,00,259,00 - World: (521,68,259), Chunk: (at 9,4,3 in 32,16; contains blocks 512,0,256 to 527,255,271), Region: (1,0; contains chunks 32,0 to 63,31, blocks 512,0,0 to 1023,255,511)
Entity's Momentum: 0,00, -0,08, 0,00
Entity's Rider: ~~ERROR~~ NullPointerException: null <- Fehler
Entity's Vehicle: ~~ERROR~~ NullPointerException: null <- Fehler