Another server only error

Started by LueLusten on Sat, 11/19/2016 - 17:45

Topic category: Help with MCreator's application

Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Another server only error
Sat, 11/19/2016 - 17:45

I getting a little pissed off now every time I try make a block for a server I run I keep running in to walls NO where do these options say Client only and if they are they they should be
only thing I have added via code is a check so it will only run one of the commands 

 

The error log talks about EntityPlayerSP but I can't seem to find this anywhere.

ERROR Log:

---- Minecraft Crash Report ----
// Why is it breaking :(

Time: 19/11/16 17:37
Description: Exception in server tick loop

net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityPlayerSP
    at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:186)
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:576)
    at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:97)
    at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:328)
    at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:124)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:496)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityPlayerSP
    at mod.mcreator.mcreator_drBlockHead.<clinit>(mcreator_drBlockHead.java:70)
    at mod.mcreator.TestEnvironmentMod.<init>(TestEnvironmentMod.java:69)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at net.minecraftforge.fml.common.ILanguageAdapter$JavaAdapter.getNewInstance(ILanguageAdapter.java:193)
    at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:571)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:239)
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:217)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:142)
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:545)
    ... 5 more
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityPlayerSP
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 36 more
Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@47289387 from coremod FMLCorePlugin
    at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:253)
    at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279)
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176)
    ... 38 more
Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/entity/EntityPlayerSP for invalid side SERVER
    at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:56)
    at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:249)
    ... 40 more

A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
    Minecraft Version: 1.10.2
    Operating System: Windows 8.1 (amd64) version 6.3
    Java Version: 1.8.0_101, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 997931152 bytes (951 MB) / 1162346496 bytes (1108 MB) up to 7632060416 bytes (7278 MB)
    JVM Flags: 0 total; 
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.32 Powered by Forge 12.18.2.2099 4 mods loaded, 4 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UC    mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
    UC    FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.2.2099.jar) 
    UC    Forge{12.18.2.2099} [Minecraft Forge] (forgeSrc-1.10.2-12.18.2.2099.jar) 
    UE    TestEnvironmentMod{1.0} [TestEnvironmentMod] (modid-1.0.jar) 
    Loaded coremods (and transformers): 
    Profiler Position: N/A (disabled)
    Is Modded: Definitely; Server brand changed to 'fml,forge'
    Type: Dedicated Server (map_server.txt)

 

Block Source:

package mod.mcreator;

import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.FMLCommonHandler;

import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumActionResult;
import net.minecraft.server.MinecraftServer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.init.Items;
import net.minecraft.init.Blocks;
import net.minecraft.entity.player.*;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.Entity;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.Minecraft;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.SoundType;
import net.minecraft.block.BlockFalling;

import java.util.Random;

public class mcreator_drBlockHead {

    public mcreator_drBlockHead() {
    }

    public static BlockDrBlockHead block;

    public static Object instance;

    public int addFuel(ItemStack fuel) {
        return 0;
    }

    public void serverLoad(FMLServerStartingEvent event) {
    }

    public void preInit(FMLPreInitializationEvent event) {
    }

    public void registerRenderers() {
    }

    public void load(FMLInitializationEvent event) {
        if (event.getSide() == Side.CLIENT) {
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                    .register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("TestEnvironmentMod:DrBlockHead", "inventory"));
        }
    }

    static {

        block = (BlockDrBlockHead) (new BlockDrBlockHead().setHardness(2.0F).setResistance(5.0F).setLightLevel(0.0F)
                .setUnlocalizedName("DrBlockHead").setLightOpacity(0).setCreativeTab(mcreator_fandom.tab));
        block.setHarvestLevel("axe", 3);
    }

    public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
    }

    public void generateNether(World world, Random random, int chunkX, int chunkZ) {
    }

    static class BlockDrBlockHead extends BlockFalling {

        int a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0, a6 = 0;

        boolean red = false;

        protected BlockDrBlockHead() {
            super(Material.WOOD);

            GameRegistry.registerBlock(this, "DrBlockHead");
            setSoundType(SoundType.WOOD);

        }

        @Override
        public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
            int i = pos.getX();
            int j = pos.getY();
            int k = pos.getZ();
            EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
            world.scheduleUpdate(new BlockPos(i, j, k), this, this.tickRate(world));

        }

        @Override
        public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
            return red ? 15 : 0;
        }

        @Override
        public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
            return red ? 15 : 0;
        }

        @Override
        public void onBlockDestroyedByPlayer(World world, BlockPos pos, IBlockState state) {
            EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
            int i = pos.getX();
            int j = pos.getY();
            int k = pos.getZ();
            if (true) {
                world.createExplosion((Entity) null, i, j, k, 1F, true);
            }

        }

        @Override
        public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta,
                EntityLivingBase placer) {
            IBlockState retVal = super.onBlockPlaced(world, pos, facing, hitX, hitY, hitZ, meta, placer);
            EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
            int i = pos.getX();
            int j = pos.getY();
            int k = pos.getZ();
            if (true) {
                if (entity instanceof EntityPlayer)
                    ((EntityPlayer) entity).addStat(mcreator_goldenBlocklings.achievement, 1);
            }

            return retVal;
        }

        @Override
        public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entity, EnumHand hand, ItemStack heldItem,
            EnumFacing side, float hitX, float hitY, float hitZ) {
            int i = pos.getX();
            int j = pos.getY();
            int k = pos.getZ();

               boolean hasTriggered = false;
           
               if ((Math.random() * 100) <= 25) {
                    if (!world.isRemote) {
                         EntityItem var14 = new EntityItem(world, (double) (i), (double) (j + 2), (double) (k), new ItemStack(Items.REEDS, 8, 0));
                         var14.setPickupDelay(4);
                         world.spawnEntityInWorld(var14);
                         hasTriggered = true;
                    }
               }

               if ((Math.random() * 100) <= 5 && !hasTriggered) {
                    if (!world.isRemote) {
                         EntityItem var14 = new EntityItem(world, (double) (i), (double) (j + 2), (double) (k), new ItemStack(Items.IRON_INGOT, 1, 0));
                         var14.setPickupDelay(4);
                         world.spawnEntityInWorld(var14);
                         hasTriggered = true;
                    }
               }

               if ((Math.random() * 100) <= 10 && !hasTriggered) {
                    if (!world.isRemote) {
                         EntityItem var14 = new EntityItem(world, (double) (i), (double) (j + 2), (double) (k), new ItemStack(Items.ROTTEN_FLESH, 6, 0));
                         var14.setPickupDelay(4);
                         world.spawnEntityInWorld(var14);
                         hasTriggered = true;
                    }
               }
            if ((Math.random() * 100) <= 1 && !hasTriggered) {
                    if (entity instanceof EntityPlayerMP) {
                         MinecraftServer minecraftserver = FMLCommonHandler.instance().getMinecraftServerInstance();
                         if (minecraftserver != null)
                              minecraftserver.getCommandManager().executeCommand((EntityPlayerMP) entity, "tellraw @p [\"\",{\"text\":\"[\"},{\"text\":\"Doctor_Blockhead\",\"color\":\"gold\"},{\"text\":\"]:\",\"color\":\"none\"},{\"selector\":\"@p\",\"color\":\"none\"},{\"text\":\" your out of here!\",\"color\":\"none\"}]");
                              if (entity instanceof EntityPlayer)
                                   ((EntityPlayer) entity).setPositionAndUpdate(-200, -200, -200);
                    }
                    hasTriggered = true;
            }
              if(!hasTriggered){               
                    if (entity instanceof EntityPlayerMP) {
                         MinecraftServer minecraftserver = FMLCommonHandler.instance().getMinecraftServerInstance();
                         if ((Math.random() * 100) <= 50) {
                              if (minecraftserver != null)
                                   minecraftserver.getCommandManager().executeCommand((EntityPlayerMP) entity, "tellraw @p [\"\",{\"text\":\"[\"},{\"text\":\"Doctor_Blockhead\",\"color\":\"gold\"},{\"text\":\"]:\",\"color\":\"none\"},{\"selector\":\"@p\",\"color\":\"none\"},{\"text\":\" TRIGGERED\",\"color\":\"none\"}]");
                         }else{
                              if (minecraftserver != null)
                                   minecraftserver.getCommandManager().executeCommand((EntityPlayerMP) entity, "tellraw @p [\"\",{\"text\":\"[\"},{\"text\":\"Doctor_Blockhead\",\"color\":\"gold\"},{\"text\":\"]:\",\"color\":\"none\"},{\"selector\":\"@p\",\"color\":\"none\"},{\"text\":\", Jeff says no, sorry dude!\",\"color\":\"none\"}]");                              
                         }
                    }
                    hasTriggered = true;
              }
            return true;
        }

        @SideOnly(Side.CLIENT)
        @Override
        public BlockRenderLayer getBlockLayer() {
            return BlockRenderLayer.SOLID;
        }

        @Override
        public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
            return new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
        }

        @Override
        public int tickRate(World world) {
            return 10;
        }

        @Override
        public int quantityDropped(Random par1Random) {
            return 0;
        }

    }
}