Jump to content

DonKresenko

Members
  • Posts

    63
  • Joined

  • Last visited

Posts posted by DonKresenko

  1. Alright I almost got it. The problem now is this

    image

     

    code:

    public IBlockState getStateFromMeta(int meta)
        {
        	int lvl = meta>>2;
        	int face = meta & 0b11;
        	
        	EnumFacing enumfacing = EnumFacing.getHorizontal(face);
        	
        	if (enumfacing.getAxis() == EnumFacing.Axis.Y)
            {
                enumfacing = EnumFacing.NORTH;
            }
        	
            return this.getDefaultState().withProperty(LEVEL, Integer.valueOf(lvl)).withProperty(FACING, enumfacing);
            
        }

     

  2. Ok.

    public IBlockState getStateFromMeta(int meta)
        {
        	int lvl = meta>>2;
        	int face = meta & 0b11;
            
        	EnumFacing enumfacing = EnumFacing.getFront(face);
    
            if (enumfacing.getAxis() == EnumFacing.Axis.Y)
            {
                enumfacing = EnumFacing.NORTH;
            }
            
            return this.getDefaultState().withProperty(LEVEL, Integer.valueOf(lvl)).withProperty(FACING, enumfacing);
            
        }

    This works for NORTH and SOUTH but not for the EAST and WEST

    This is my problem now

     

    (note that directional block is working, this is after reloading the world)

     

  3. I now decreased my property LEVEL to 2 bits (0-3)

     

    I tried this code but it seems not to be working

    public int getMetaFromState(IBlockState state)
        {
        	int lvl = ((Integer)state.getValue(LEVEL)).intValue();
        	lvl <<= 2;
        	int i = ((EnumFacing)state.getValue(FACING)).getHorizontalIndex();
        	// System.out.println(lvl+" | "+i+" = "+(lvl |= i));
        	lvl |= i;
        	
        	return lvl;
        }

    What am I doing wrong?

  4. 7 minutes ago, diesieben07 said:

    You can store up to 4 bits of data in metadata.

    If you want to store more than one property, you need to encode the data into one 4 bit number. One example:

     

    Two properties: Facing (0-3) and Active (true or false).Facing needs two bits (values 0b00, 0b01, 0b10 and 0b11), Active needs one bit (values 0b0 and 0b1). Now you need to shift one over so that they do not collide (pseudocode follows):

    
    activeBit = active ? 0b1 : 0b0;
    activeShifted = activeBit << 2; // activeShifted is now 0b100 or 0b000
    facingBits = facing; // 0b00 - 0b11
    combined = activeShifted | facingBits // e.g. 0b101 for facing 0b01 and active 0b1

     

    The reverse then has to be done when reading from metadata and is left as an exercise to the reader.

    Thank you for the information.

     

    I have LEVEL property (0,6) that takes 3 bits and FACING (n, s, e, w) which takes 2 bits.

    So I cannot do this cause I need 5 bits?

     

  5. 42 minutes ago, IceMetalPunk said:

    A tile entity is the most flexible way. However, if you're only storing 4 or fewer types of liquid, you can simply use block states. Create a block state property that's an enum of the types of liquids you want to store (lava, water, etc.). Give them each a unique index starting at 4 and counting up. Then, assuming you're still using the same LEVEL property from the vanilla cauldron (an integer from 0 to 3), you can calculate the metadata as level | type.getIndex() and you can get the type back from the metadata by doing simply metadata & 12 to get the index of the type (again, they should start at 4). And of course, you can get the level back from the metadata by doing metadata & 3.

    If you're storing more than 4 types of liquid, or going beyond the vanilla 3-level system, you'll need that tile entity.

    Alright. Thank you :)

  6. 21 minutes ago, diesieben07 said:

    Before putting a liquid into the cauldron, check if it's empty. Can't tell you more, because you have not posted any code.

    The thing is that you did not understood what I asked.

     

    I want to be able to place more than one liquid in the cauldron but I don't want to "mix" them. In other words, only one liquid can be in the cauldron at the time

     

    Here is the onBlockActivated method in my block

    Spoiler
    
    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
        {
            ItemStack itemstack = playerIn.getHeldItem(hand);
    
            if (itemstack.isEmpty())
            {
                return true;
            }
            else
            {
                int i = ((Integer)state.getValue(LEVEL)).intValue();
                Item item = itemstack.getItem();
    
                if (item == Items.LAVA_BUCKET)
                {
                    if (i < 6 && !worldIn.isRemote)
                    {
                        if (!playerIn.capabilities.isCreativeMode)
                        {
                            playerIn.setHeldItem(hand, new ItemStack(Items.BUCKET));
                        }
    
                        playerIn.addStat(StatList.CAULDRON_FILLED);
                        this.setLevel(worldIn, pos, state, i + 1);
                        worldIn.playSound((EntityPlayer)null, pos, SoundEvents.ITEM_BUCKET_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F);
                    }
    
                    return true;
                }
                else if (item == Items.BUCKET)
                {
                	if (i > 0 && !worldIn.isRemote)
                    {
                        if (!playerIn.capabilities.isCreativeMode)
                        {
                            itemstack.shrink(1);
    
                            if (itemstack.isEmpty())
                            {
                                playerIn.setHeldItem(hand, new ItemStack(Items.LAVA_BUCKET));
                            }
                            else if (!playerIn.inventory.addItemStackToInventory(new ItemStack(Items.LAVA_BUCKET)))
                            {
                                playerIn.dropItem(new ItemStack(Items.LAVA_BUCKET), false);
                            }
                        }
    
                        playerIn.addStat(StatList.CAULDRON_USED);
                        this.setLevel(worldIn, pos, state, i - 1);
                        worldIn.playSound((EntityPlayer)null, pos, SoundEvents.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
                    }
    
                    return true;
                }
                else
                {
                	return false;
                }
            }
        }

     

     

    With this code, I can add lava in my cauldron and take it out from the cauldron. Now I want to add the ability to store water, but not if there is lava already in the cauldron.

     

    Thank you for the reply

  7. I am creating a custom cauldron. It functions almost the same way as vanilla cauldron except it can store multiple liquids.

    My problem is that I don't know how to detect which liquid I am storing and preventing the player to "mix" liquids in same cauldron (in other words, only one type of liquid can be in cauldron).

     

    Any ideas how to do that?

  8. Thanks, it works now. One more question, i see that pick up delay int (EntityItem.delayBeforeCanPickup ) is now private, is there any substitute?

     

    new code

     

     

    @Override
    public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
        	if(!world.isRemote) {
    		EntityItem entityitem = new EntityItem(world, pos.getX(), pos.getY()+1, pos.getZ(), new ItemStack(Items.apple, 1));
            //entityitem.delayBeforeCanPickup = 5;
            world.spawnEntityInWorld(entityitem);
    	}
        	return super.onBlockPlaced(world, pos, facing, hitX, hitY, hitZ, meta, placer);
    }
    

     

  9. Help me solve this problem.

    When I place my block, i want an item to spawn. I tryed this method but it isn't working.

     

    @Override
    public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
        	if(!worldIn.isRemote) {
    		float f = 0.7F;
            double d = worldIn.rand.nextFloat() * f + (1.0F - f) * 0.5D;
            double d1 = worldIn.rand.nextFloat() * f + (1.0F - f) * 0.2D + 0.6D;
            double d2 = worldIn.rand.nextFloat() * f + (1.0F - f) * 0.5D;
            EntityItem entityitem = new EntityItem(worldIn, hitX + d, hitY + d1, hitZ + d2, new ItemStack(Items.apple, 1));
            //entityitem.delayBeforeCanPickup = 5;
            worldIn.spawnEntityInWorld(entityitem);
    	}
        	return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer);
    }

     

     

    anyone knows solution? Thanks

     

  10. Got the recipe working, but it crashes when i use the trade

     

    source

    package com.nuclearbanana.anticraft.entity;
    
    import com.nuclearbanana.anticraft.AntiCraft;
    
    import net.minecraft.entity.passive.EntityVillager;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.init.Items;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.Tuple;
    import net.minecraft.village.MerchantRecipe;
    import net.minecraft.village.MerchantRecipeList;
    import net.minecraft.world.World;
    
    public class EntityWizard extends EntityVillager {
    
    //private MerchantRecipeList buyingList;
    
    public EntityWizard(World w) {
    	super(w);
    }
    
    @Override
    public MerchantRecipeList getRecipes(EntityPlayer player) {
    	MerchantRecipeList merchantrecipelist = new MerchantRecipeList();
    	 merchantrecipelist.add(new MerchantRecipe(new ItemStack(Items.ghast_tear, 8, 0), new ItemStack(AntiCraft.Triphophyllite), new ItemStack(AntiCraft.Kukstibite, 16)));
    	return merchantrecipelist;
        }
    
    @Override
    public void setRecipes(MerchantRecipeList recipeList) {
    	recipeList.add(new MerchantRecipe(new ItemStack(Items.ghast_tear, 8, 0), new ItemStack(AntiCraft.Triphophyllite), new ItemStack(AntiCraft.Kukstibite, 16)));
    }
    
    public void addDefaultEquipmentAndRecipies(int i) {
    	MerchantRecipeList merchantrecipelist;
            merchantrecipelist = new MerchantRecipeList();
            
            merchantrecipelist.add(new MerchantRecipe(new ItemStack(Items.ghast_tear, 8, 0), new ItemStack(AntiCraft.Triphophyllite), new ItemStack(AntiCraft.Kukstibite, 16)));
            
    }
    
    }
    

     

    Crash report \/

     

     

    [16:02:02] [main/INFO] [GradleStart]: Extra: []

    [16:02:02] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Srbislav/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker]

    [16:02:02] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

    [16:02:02] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker

    [16:02:02] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

    [16:02:02] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker

    [16:02:02] [main/INFO] [FML]: Forge Mod Loader version 7.10.85.1230 for Minecraft 1.7.10 loading

    [16:02:02] [main/INFO] [FML]: Java is Java HotSpot Client VM, version 1.8.0_25, running on Windows 8.1:x86:6.3, installed at C:\Program Files\Java\jre1.8.0_25

    [16:02:02] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

    [16:02:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

    [16:02:02] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin

    [16:02:02] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

    [16:02:02] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

    [16:02:02] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker

    [16:02:02] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

    [16:02:02] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

    [16:02:02] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

    [16:02:03] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

    [16:02:08] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

    [16:02:08] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

    [16:02:08] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker

    [16:02:09] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker

    [16:02:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker

    [16:02:09] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

    [16:02:11] [main/INFO]: Setting user: Player209

    [16:02:15] [Client thread/INFO]: LWJGL Version: 2.9.1

    [16:02:17] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

    [16:02:17] [Client thread/INFO] [FML]: MinecraftForge v10.13.2.1230 Initialized

    [16:02:17] [Client thread/INFO] [FML]: Replaced 182 ore recipies

    [16:02:17] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

    [16:02:18] [Client thread/INFO] [FML]: Searching C:\Users\Srbislav\Desktop\Mihajlo\AntiCraft\eclipse\mods for mods

    [16:02:26] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

    [16:02:26] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, anticraft] at CLIENT

    [16:02:26] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, anticraft] at SERVER

    [16:02:27] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:§4AntiCraft

    [16:02:28] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

    [16:02:28] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations

    [16:02:28] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

    [16:02:28] [Client thread/INFO] [FML]: Applying holder lookups

    [16:02:28] [Client thread/INFO] [FML]: Holder lookups applied

    [16:02:29] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

    [16:02:29] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem...

    [16:02:29] [Thread-6/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL

    [16:02:29] [Thread-6/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

    [16:02:30] [Thread-6/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.

    [16:02:30] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

    [16:02:30] [sound Library Loader/INFO]: Sound engine started

    [16:02:37] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas

    [16:02:38] [Client thread/INFO]: Created: 256x256 textures/items-atlas

    [16:02:38] [Client thread/INFO] [sTDOUT]: [com.nuclearbanana.anticraft.AntiCraft:postInit:172]: AntiCraft loaded!

    [16:02:38] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods

    [16:02:38] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:§4AntiCraft

    [16:02:40] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas

    [16:02:41] [Client thread/INFO]: Created: 256x256 textures/items-atlas

    [16:02:41] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

    [16:02:41] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down...

    [16:02:41] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]:    Author: Paul Lamb, www.paulscode.com

    [16:02:41] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

    [16:02:41] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

    [16:02:41] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem...

    [16:02:42] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL

    [16:02:42] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

    [16:02:42] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.

    [16:02:42] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

    [16:02:42] [sound Library Loader/INFO]: Sound engine started

    [16:03:00] [server thread/INFO]: Starting integrated minecraft server version 1.7.10

    [16:03:00] [server thread/INFO]: Generating keypair

    [16:03:01] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

    [16:03:01] [server thread/INFO] [FML]: Applying holder lookups

    [16:03:01] [server thread/INFO] [FML]: Holder lookups applied

    [16:03:01] [server thread/INFO] [FML]: Loading dimension 0 (AntiCraft Test) (net.minecraft.server.integrated.IntegratedServer@18abf25)

    [16:03:02] [server thread/INFO] [FML]: Loading dimension 1 (AntiCraft Test) (net.minecraft.server.integrated.IntegratedServer@18abf25)

    [16:03:02] [server thread/INFO] [FML]: Loading dimension -1 (AntiCraft Test) (net.minecraft.server.integrated.IntegratedServer@18abf25)

    [16:03:02] [server thread/INFO]: Preparing start region for level 0

    [16:03:03] [server thread/INFO]: Preparing spawn area: 16%

    [16:03:04] [server thread/INFO]: Preparing spawn area: 49%

    [16:03:05] [server thread/INFO]: Preparing spawn area: 88%

    [16:03:06] [server thread/INFO]: Changing view distance to 6, from 10

    [16:03:07] [Netty Client IO #0/INFO] [FML]: Server protocol version 1

    [16:03:07] [Netty IO #1/INFO] [FML]: Client protocol version 1

    [16:03:07] [Netty IO #1/INFO] [FML]: Client attempting to join with 4 mods : [email protected],[email protected],[email protected],[email protected]

    [16:03:07] [Netty IO #1/INFO] [FML]: Attempting connection with missing mods [] at CLIENT

    [16:03:07] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [] at SERVER

    [16:03:07] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established

    [16:03:07] [server thread/INFO] [FML]: [server thread] Server side modded connection established

    [16:03:07] [server thread/INFO]: Player209[local:E:dc4007fd] logged in with entity id 163 at (-226.13511905513528, 52.0, -653.364649710334)

    [16:03:07] [server thread/INFO]: Player209 joined the game

    [16:03:16] [server thread/INFO]: Saving and pausing game...

    [16:03:16] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/Overworld

    [16:03:16] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/Nether

    [16:03:16] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/The End

    [16:03:30] [server thread/INFO]: Player209 has just earned the achievement [Taking Inventory]

    [16:03:30] [Client thread/INFO]: [CHAT] Player209 has just earned the achievement [Taking Inventory]

    [16:03:38] [server thread/ERROR]: Encountered an unexpected exception

    net.minecraft.util.ReportedException: Ticking memory connection

    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[NetworkSystem.class:?]

    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) ~[MinecraftServer.class:?]

    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) ~[MinecraftServer.class:?]

    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[integratedServer.class:?]

    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]

    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]

    Caused by: java.lang.NullPointerException

    at net.minecraft.entity.passive.EntityVillager.useRecipe(EntityVillager.java:395) ~[EntityVillager.class:?]

    at net.minecraft.inventory.SlotMerchantResult.onPickupFromSlot(SlotMerchantResult.java:80) ~[slotMerchantResult.class:?]

    at net.minecraft.inventory.Container.slotClick(Container.java:347) ~[Container.class:?]

    at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955) ~[NetHandlerPlayServer.class:?]

    at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41) ~[C0EPacketClickWindow.class:?]

    at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113) ~[C0EPacketClickWindow.class:?]

    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) ~[NetworkManager.class:?]

    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?]

    ... 5 more

    [16:03:38] [server thread/ERROR]: This crash report has been saved to: C:\Users\Srbislav\Desktop\Mihajlo\AntiCraft\eclipse\.\crash-reports\crash-2015-01-29_16.03.38-server.txt

    [16:03:38] [server thread/INFO]: Stopping server

    [16:03:38] [server thread/INFO]: Saving players

    [16:03:38] [server thread/INFO]: Saving worlds

    [16:03:38] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/Overworld

    [16:03:38] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: ---- Minecraft Crash Report ----

    // Oh - I know what I did wrong!

     

    Time: 1/29/15 4:03 PM

    Description: Ticking memory connection

     

    java.lang.NullPointerException: Ticking memory connection

    at net.minecraft.entity.passive.EntityVillager.useRecipe(EntityVillager.java:395)

    at net.minecraft.inventory.SlotMerchantResult.onPickupFromSlot(SlotMerchantResult.java:80)

    at net.minecraft.inventory.Container.slotClick(Container.java:347)

    at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955)

    at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41)

    at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113)

    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)

    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)

    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)

    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)

    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)

    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)

    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)

     

     

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

    ---------------------------------------------------------------------------------------

     

    -- Head --

    Stacktrace:

    at net.minecraft.entity.passive.EntityVillager.useRecipe(EntityVillager.java:395)

    at net.minecraft.inventory.SlotMerchantResult.onPickupFromSlot(SlotMerchantResult.java:80)

    at net.minecraft.inventory.Container.slotClick(Container.java:347)

    at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955)

    at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41)

    at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113)

    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)

     

    -- Ticking connection --

    Details:

    Connection: net.minecraft.network.NetworkManager@4148f7

    Stacktrace:

    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)

    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)

    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)

    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)

    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)

    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)

     

    -- System Details --

    Details:

    Minecraft Version: 1.7.10

    Operating System: Windows 8.1 (x86) version 6.3

    Java Version: 1.8.0_25, Oracle Corporation

    Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

    Memory: 951427104 bytes (907 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)

    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

    FML: MCP v9.05 FML v7.10.85.1230 Minecraft Forge 10.13.2.1230 4 mods loaded, 4 mods active

    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    FML{7.10.85.1230} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1230.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    Forge{10.13.2.1230} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1230.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    anticraft{1.0} [§4AntiCraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    Profiler Position: N/A (disabled)

    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

    Player Count: 1 / 8; [EntityPlayerMP['Player209'/163, l='AntiCraft Test', x=-225.94, y=52.00, z=-653.29]]

    Type: Integrated Server (map_client.txt)

    Is Modded: Definitely; Client brand changed to 'fml,forge'

    [16:03:38] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:393]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2015-01-29_16.03.38-server.txt

    [16:03:38] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.

    [16:03:39] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/Nether

    [16:03:39] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/The End

    [16:03:39] [server thread/INFO] [FML]: Unloading dimension 0

    [16:03:39] [server thread/INFO] [FML]: Unloading dimension -1

    [16:03:39] [server thread/INFO] [FML]: Unloading dimension 1

    [16:03:39] [server thread/INFO] [FML]: Applying holder lookups

    [16:03:39] [server thread/INFO] [FML]: Holder lookups applied

    [16:03:39] [server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.

    [16:03:39] [Client thread/INFO] [FML]: Server terminated.

    AL lib: (EE) alc_cleanup: 1 device not closed

    Java HotSpot Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

     

     

  11. First of all, I'M NOT MAKING A NEW VILLAGER TYPE (that one is easy), I'm making a new MOB that can trade with the player and has only 1 trade. The mob has a custom model and custom render (that part is done), but I can't get the trade to work. The GUI shows up when i right-click on a mob, but there's a blank trade (see photo). Anyone know how to fix it? Would help :)

     

    Problem photo

    Y0fTgG2.png

     

    Entity code

    package com.blabla.test;
    
    import net.minecraft.entity.passive.EntityVillager;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.init.Items;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.Tuple;
    import net.minecraft.village.MerchantRecipe;
    import net.minecraft.village.MerchantRecipeList;
    import net.minecraft.world.World;
    
    public class EntityWizard extends EntityVillager {
    
    private MerchantRecipeList buyingList;
    
    public EntityWizard(World w) {
    	super(w);
    }
    
    @Override
    public MerchantRecipeList getRecipes(EntityPlayer player) {
    	if (this.buyingList == null)
            {
                this.addDefaultEquipmentAndRecipies(1);
            }
    
            return this.buyingList;
        }
    
    @Override
    public void setRecipes(MerchantRecipeList recipeList) {
    	recipeList.add(new MerchantRecipe(new ItemStack(Items.ghast_tear, 8, 0), null, new ItemStack(Items.arrow, 16)));
    }
    
    public void addDefaultEquipmentAndRecipies(int i) {
    	MerchantRecipeList merchantrecipelist;
            merchantrecipelist = new MerchantRecipeList();
            
            merchantrecipelist.add(new MerchantRecipe(new ItemStack(Items.ghast_tear, 8, 0), null, new ItemStack(Items.arrow, 16)));
            
    }
    
    }
    

×
×
  • Create New...

Important Information

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