Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Zaawansowane Tworzenie Modów


karol202

Rekomendowane odpowiedzi

Opublikowano

BlockNAZWAROŚLINY.java:

 

package net.minecraft.src;

import java.util.Random;

public class BlockMarycha extends Block
{
   protected BlockMarycha(int par1, int par2)
   {
       super(par1, Material.plants);
       func_71849_a(CreativeTabs.field_78030_;
       blockIndexInTexture = par2;
       float f = 0.375F;
       setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f);
       setTickRandomly(true);
   }

   /**
    * Ticks the block if it's been scheduled
    */
   public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
   {
       if (par1World.isAirBlock(par2, par3 + 1, par4))
       {
           int i;

           for (i = 1; par1World.getBlockId(par2, par3 - i, par4) == blockID; i++) { }

           if (i < 3)
           {
               int j = par1World.getBlockMetadata(par2, par3, par4);

               if (j == 15)
               {
                   par1World.setBlockWithNotify(par2, par3 + 1, par4, blockID);
                   par1World.setBlockMetadataWithNotify(par2, par3, par4, 0);
               }
               else
               {
                   par1World.setBlockMetadataWithNotify(par2, par3, par4, j + 1);
               }
           }
       }
   }

   /**
    * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
    */
   public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
   {
       int i = par1World.getBlockId(par2, par3 - 1, par4);

       if (i == blockID)
       {
           return true;
       }

       if (i != Block.grass.blockID && i != Block.dirt.blockID && i != Block.sand.blockID)
       {
           return false;
       }

       if (par1World.getBlockMaterial(par2 - 1, par3 - 1, par4) == Material.water)
       {
           return true;
       }

       if (par1World.getBlockMaterial(par2 + 1, par3 - 1, par4) == Material.water)
       {
           return true;
       }

       if (par1World.getBlockMaterial(par2, par3 - 1, par4 - 1) == Material.water)
       {
           return true;
       }

       return par1World.getBlockMaterial(par2, par3 - 1, par4 + 1) == Material.water;
   }

   /**
    * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
    * their own) Args: x, y, z, neighbor blockID
    */
   public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
   {
       checkBlockCoordValid(par1World, par2, par3, par4);
   }

   /**
    * Checks if current block pos is valid, if not, breaks the block as dropable item. Used for reed and cactus.
    */
   protected final void checkBlockCoordValid(World par1World, int par2, int par3, int par4)
   {
       if (!canBlockStay(par1World, par2, par3, par4))
       {
           dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
           par1World.setBlockWithNotify(par2, par3, par4, 0);
       }
   }

   /**
    * Can this block stay at this position.  Similar to canPlaceBlockAt except gets checked often with plants.
    */
   public boolean canBlockStay(World par1World, int par2, int par3, int par4)
   {
       return canPlaceBlockAt(par1World, par2, par3, par4);
   }

   /**
    * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
    * cleared to be reused)
    */
   public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int i)
   {
       return null;
   }

   /**
    * Returns the ID of the items to drop on destruction.
    */
   public int idDropped(int par1, Random par2Random, int par3)
   {
       return mod_10Mod.marihuana.iconIndex;
   }

   /**
    * Is this block (a) opaque and ( a full 1m cube?  This determines whether or not to render the shared face of two
    * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
    */
   public boolean isOpaqueCube()
   {
       return false;
   }

   /**
    * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
    */
   public boolean renderAsNormalBlock()
   {
       return false;
   }

   /**
    * The type of render function that is called for this block
    */
   public int getRenderType()
   {
       return 1;
   }
   public int quantityDropped(Random par1Random)
   {
       return 4 + par1Random.nextInt(6);
   }
   public int func_71922_a(World par1World, int par2, int par3, int par4)
   {
       return mod_10Mod.marycha.blockID;
   }
}

 

Ta Roślina będzie narazie rosła tak jak trzcina ale później dam wam kod na nasionka

  • Odpowiedzi 1,2 tys.
  • Dodano
  • Ostatniej odpowiedzi
Opublikowano

Mam problem. Dodałem własny typ narzędzi i mam kilka błędów.

Pierwszy błąd: Z mojej rudy motyka nie ora pola.

Drugi błąd: Kod miecza z mojej własnej rudy nie działa, podkreśla mi te treści

 

super(i);
		 toolMaterial = --> enumTYPtoolmaterial <-- ;
		 maxStackSize = 1;
		 setMaxDamage( --> enumTYPtoolmaterial    <--- .getMaxUses());
		 weaponDamage = 4 + --> enumTYPtoolmaterial <-- .getDamageVsEntity();

 

Oczywiście zamiast TYP jest wpisana nazwa mojej rudy z której robi się te narzędzia. Co do kilofu, siekiery oraz łopaty to działają bez zarzutów.

Opublikowano

Nie wiem co jest źle w ItemTestArmor jest podkreslona linika

super(par1, par2EnumArmorMaterial, par3, par4);

wie ktoś może o co chodzi?

Opublikowano

Wszystko zrobiłem tam jak w poradniku o mob a wyskakuje mi


  Minecraft has crashed!	 
  ----------------------	 
Minecraft has stopped running because it encountered a problem; Unexpected error
This error has been saved to C:\Users\domowy\AppData\Roaming\.minecraft\crash-reports\crash-2012-09-16_16.38.47-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.

--- BEGIN ERROR REPORT 579bce3d --------
Generated 16.09.12 16:38
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (x86) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) Client VM (mixed mode, sharing), Oracle Corporation
- Memory: 137390808 bytes (131 MB) / 238972928 bytes (227 MB) up to 259522560 bytes (247 MB)
- JVM Flags: 0 total;
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_Test v1.0
- LWJGL: 2.4.2
- OpenGL: ATI Mobility Radeon HD 5470 GL version 3.2.9262 Compatibility Profile Context, ATI Technologies Inc.
- Is Modded: Very likely
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
- World MpServer Entities: 2 total; [EntityClientPlayerMP['Player799'/273, l='MpServer', x=198,50, y=70,24, z=265,50], EntitySheep['Sheep'/85, l='MpServer', x=223,50, y=67,00, z=284,50]]
- World MpServer Players: 1 total; [EntityClientPlayerMP['Player799'/273, l='MpServer', x=198,50, y=70,24, z=265,50]]
- World MpServer Chunk Stats: MultiplayerChunkCache: 5
- Forced Entities: 2 total; [EntitySheep['Sheep'/85, l='MpServer', x=223,50, y=67,00, z=284,50], EntityClientPlayerMP['Player799'/273, l='MpServer', x=198,50, y=70,24, z=265,50]]
- Retry Entities: 0 total; []
java.lang.NullPointerException
at net.minecraft.src.NetClientHandler.handleMobSpawn(NetClientHandler.java:743)
at net.minecraft.src.Packet24MobSpawn.processPacket(Packet24MobSpawn.java:137)
at net.minecraft.src.MemoryConnection.processReadPackets(MemoryConnection.java:70)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1780)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:821)
at net.minecraft.client.Minecraft.run(Minecraft.java:751)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT b3349dff ----------

 

a w eclipse

 

27 achievements
195 recipes
Client asked for parameter: server
Setting user: Player799, -
LWJGL Version: 2.4.2
ModLoader 1.3.2 Initializing...
Mod Initialized: mod_Test v1.0
Mod Loaded: mod_Test v1.0
Done.
Starting up SoundSystem...
Initializing LWJGL OpenAL
   (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
OpenAL initialized.
wrz 16, 2012 4:38:33 PM net.minecraft.src.IntegratedServer startServer
INFO: Starting integrated minecraft server version 1.3.2
wrz 16, 2012 4:38:33 PM net.minecraft.src.IntegratedServer startServer
INFO: Generating keypair
wrz 16, 2012 4:38:34 PM net.minecraft.server.MinecraftServer initialWorldChunkLoad
INFO: Preparing start region for level 0
wrz 16, 2012 4:38:35 PM net.minecraft.server.MinecraftServer outputPercentRemaining
INFO: Preparing spawn area: 44%
wrz 16, 2012 4:38:36 PM net.minecraft.server.MinecraftServer outputPercentRemaining
INFO: Preparing spawn area: 89%
wrz 16, 2012 4:38:36 PM net.minecraft.src.ServerConfigurationManager initializeConnectionToPlayer
INFO: Player799[/127.0.0.1:0] logged in with entity id 273 at (198.5, 68.62000000476837, 265.5)
Skipping Entity with id -72
java.lang.NullPointerException
at net.minecraft.src.NetClientHandler.handleMobSpawn(NetClientHandler.java:743)
at net.minecraft.src.Packet24MobSpawn.processPacket(Packet24MobSpawn.java:137)
at net.minecraft.src.MemoryConnection.processReadPackets(MemoryConnection.java:70)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1780)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:821)
at net.minecraft.client.Minecraft.run(Minecraft.java:751)
at java.lang.Thread.run(Unknown Source)
wrz 16, 2012 4:38:37 PM net.minecraft.server.MinecraftServer stopServer
INFO: Stopping server
wrz 16, 2012 4:38:37 PM net.minecraft.server.MinecraftServer stopServer
INFO: Saving players
wrz 16, 2012 4:38:37 PM net.minecraft.server.MinecraftServer stopServer
INFO: Saving worlds
wrz 16, 2012 4:38:37 PM net.minecraft.server.MinecraftServer saveAllDimensions
INFO: Saving chunks for level 'New World'/Overworld
wrz 16, 2012 4:38:41 PM net.minecraft.server.MinecraftServer saveAllDimensions
INFO: Saving chunks for level 'New World'/Nether
wrz 16, 2012 4:38:41 PM net.minecraft.server.MinecraftServer saveAllDimensions
INFO: Saving chunks for level 'New World'/The End
Stopping!

 

Tak samo jak robiłem wczesnej zbroje to mi błąd wyskakiwał, ale na szczęście zrobiłem zbroje z innego poradnika.

Opublikowano

Karol sprawdź czy nie ma błędu przy biomie podczas dodawania linijki

ModLoader.addBiome(BG);

ponieważ eclipse pokazuje błąd i Minecraft się nie włącza.

Opublikowano

Jak zmienić zawartosć bonusowej skrzynki i dodać nowe przedmioty do kupienia u osadnikow ?

 

Najlepiej pogrzeb w plikach samego minecrafta. Ja ostatnio sobie zmienilem zawartość skrzyń w lochach.

 

Halo!

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...