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

Dobrze zrobiłem?

package net.minecraft.src;
import java.util.Random;
public class mod_reddiamond extends BaseMod
{
    public static Block Reddiamondore = new BlockReddiamondore(133, 0).setBlockName("Reddiamondore").setHardness(10F).setResistance(50F);
public String getVersion()
{
	 return "0.9";
}
public void load(){}
public mod_reddiamondore()
{
						    BlockCristal.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod_rd/blockrd.png")
						    ModLoader.addName(Blockreddiamondore, "RedDiamond");
						    ModLoader.registerBlock(BlockReddiamondore);
    ModLoader.addSmelting(133, new ItemStack(260, 1));
}
public void generateSurface(World world, Random random, int i, int j)
    {
		    for (int k = 0; k < 3; k++)
		    {
				    int x = i + random.nextInt(24);
				    int y = 10 + random.nextInt(20);
				    int z = j + random.nextInt(24);
				    (new WorldGenMinable(Blockreddiamondore.blockID, 4)).generate(world, random, x, y, z);
		    }
    }
}

Twoja reklama tutaj - Pisz na pw xD

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

Czy do np. kilofa muszę zrobić kilka plików? Jak sam napisałeś

pliku rodzaju narzędzia danego typu dziedziczący po klasie typu narzędzia(nie każda klasa rodzaju narzędzia dziedziczy po klasie typu narzędzia) pliku typu narzędzia dziedziczącego po klasie zwykłego przedmiotu pliku z typem wyliczeniowym wytrzymałości, szybkości itd. danego typu narzędzia

... Ok...

 

Oto kod pliku z typem wyliczeniowym który nazwij EnumTYPToolMaterial, gdzie TYP zastąp typem narzędzia:

Czyli mam zrobić nowy plik i nazwać go np. EnumObsidianToolMaterial? I w tym :

public enum EnumTYPToolMaterial

mam napisać zamiast TYP to np. Obsidian?

 

 

package net.minecraft.src; public class ItemTYPTool extends Item { private Block blocksEffectiveAgainst[]; protected float efficiencyOnProperMaterial; private int damageVsEntity; protected EnumTYPToolMaterial toolMaterial; protected ItemTYPTool(int i, int j, EnumTYPToolMaterial enumTYPtoolmaterial, Block ablock[]) { super(i); efficiencyOnProperMaterial = 4F; toolMaterial = enumTYPtoolmaterial; blocksEffectiveAgainst = ablock; maxStackSize = 1; setMaxDamage(enumTYPtoolmaterial.getMaxUses()); efficiencyOnProperMaterial = enumTYPtoolmaterial.getEfficiencyOnProperMaterial(); damageVsEntity = j + enumTYPtoolmaterial.getDamageVsEntity(); } /** * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if * sword */ public float getStrVsBlock(ItemStack itemstack, Block block) { for (int i = 0; i < blocksEffectiveAgainst.length; i++) { if (blocksEffectiveAgainst == block) { return efficiencyOnProperMaterial; } } return 1.0F; } /** * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise * the damage on the stack. */ public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) { itemstack.damageItem(2, entityliving1); return true; } public boolean onBlockDestroyed(ItemStack itemstack, int i, int j, int k, int l, EntityLiving entityliving) { itemstack.damageItem(1, entityliving); return true; } /** * Returns the damage against a given entity. */ public int getDamageVsEntity(Entity entity) { return damageVsEntity; } /** * Returns True is the item is renderer in full 3D when hold. */ public boolean isFull3D() { return true; } /** * Return the enchantability factor of the item, most of the time is based on material. */ public int getItemEnchantability() { return toolMaterial.getEnchantability(); } } To już osobny plik?

 

Opublikowano

mam Problem z Kilofem zrobiłem dwa pliki ItemSzPickaxe EnumszToolMaterial

 

EnumszToolMaterial:


package net.minecraft.src;

public enum EnumszToolMaterial
{

       private final int harvestLevel;
       private final int maxUses;
       private final float efficiencyOnProperMaterial;
       private final int damageVsEntity;
       private final int enchantability;

       private EnumszToolMaterial(String s1, int j, int k, int l, float f, int i1, int j1)
       {
               harvestLevel = k;
               maxUses = l;
               efficiencyOnProperMaterial = f;
               damageVsEntity = i1;
               enchantability = j1;
       }

       public int getMaxUses()
       {
               return maxUses;
       }

       public float getEfficiencyOnProperMaterial()
       {
               return efficiencyOnProperMaterial;
       }

       public int getDamageVsEntity()
       {
               return damageVsEntity;
       }

       public int getHarvestLevel()
       {
               return harvestLevel;
       }

       public int getEnchantability()
       {
               return enchantability;
       }
}

 

ItemSzPickaxe:


package net.minecraft.src;

public class ItemSzPickaxe extends Item
{
       private static Block blocksEffectiveAgainst[];

       protected ItemSzPickaxe(int i, EnumTYPToolMaterial enumTYPtoolmaterial)
       {
               super(i, 2, enumsztoolmaterial, blocksEffectiveAgainst);
       }

       /**
        * Returns if the item (tool) can harvest results from the block type.
        */
       public boolean canHarvestBlock(Block block)
       {
if (block == Block.obsidian)
               {
                       return toolMaterial.getHarvestLevel() == 3;
               }

               if (block == Block.blockDiamond || block == Block.oreDiamond)
               {
                       return toolMaterial.getHarvestLevel() >= 2;
               }

               if (block == Block.blockGold || block == Block.oreGold)
               {
                       return toolMaterial.getHarvestLevel() >= 2;
               }

               if (block == Block.blockSteel || block == Block.oreIron)
               {
                       return toolMaterial.getHarvestLevel() >= 1;
               }

               if (block == Block.blockLapis || block == Block.oreLapis)
               {
                       return toolMaterial.getHarvestLevel() >= 1;
               }

               if (block == Block.oreRedstone || block == Block.oreRedstoneGlowing)
               {
                       return toolMaterial.getHarvestLevel() >= 2;
               }

               if (block.blockMaterial == Material.rock)
               {
                       return true;
               }
               else
               {
                       return block.blockMaterial == Material.iron;
               }
       }

       /**
        * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
        * sword
        */
       public float getStrVsBlock(ItemStack itemstack, Block block)
       {
               if (block != null && (block.blockMaterial == Material.iron || block.blockMaterial == Material.rock))
               {
                       return efficiencyOnProperMaterial;
               }
               else
               {
                       return super.getStrVsBlock(itemstack, block);
               }
       }

       static
       {
               blocksEffectiveAgainst = (new Block[]
                               {
                                       Block.cobblestone, Block.stairDouble, Block.stairSingle, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold,
                                       Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail,
                                       Block.railDetector, Block.railPowered
                               });
       }
}

 

zobaczcie czy mam wszystko dobrze

Opublikowano

 

 

mam Problem z Kilofem zrobiłem dwa pliki ItemSzPickaxe EnumszToolMaterial

 

EnumszToolMaterial:


package net.minecraft.src;

public enum EnumszToolMaterial
{

	private final int harvestLevel;
	private final int maxUses;
	private final float efficiencyOnProperMaterial;
	private final int damageVsEntity;
	private final int enchantability;

	private EnumszToolMaterial(String s1, int j, int k, int l, float f, int i1, int j1)
	{
			harvestLevel = k;
			maxUses = l;
			efficiencyOnProperMaterial = f;
			damageVsEntity = i1;
			enchantability = j1;
	}

	public int getMaxUses()
	{
			return maxUses;
	}

	public float getEfficiencyOnProperMaterial()
	{
			return efficiencyOnProperMaterial;
	}

	public int getDamageVsEntity()
	{
			return damageVsEntity;
	}

	public int getHarvestLevel()
	{
			return harvestLevel;
	}

	public int getEnchantability()
	{
			return enchantability;
	}
}

 

ItemSzPickaxe:


package net.minecraft.src;

public class ItemSzPickaxe extends Item
{
	private static Block blocksEffectiveAgainst[];

	protected ItemSzPickaxe(int i, EnumTYPToolMaterial enumTYPtoolmaterial)
	{
			super(i, 2, enumsztoolmaterial, blocksEffectiveAgainst);
	}

	/**
	 * Returns if the item (tool) can harvest results from the block type.
	 */
	public boolean canHarvestBlock(Block block)
	{
if (block == Block.obsidian)
			{
					return toolMaterial.getHarvestLevel() == 3;
			}

			if (block == Block.blockDiamond || block == Block.oreDiamond)
			{
					return toolMaterial.getHarvestLevel() >= 2;
			}

			if (block == Block.blockGold || block == Block.oreGold)
			{
					return toolMaterial.getHarvestLevel() >= 2;
			}

			if (block == Block.blockSteel || block == Block.oreIron)
			{
					return toolMaterial.getHarvestLevel() >= 1;
			}

			if (block == Block.blockLapis || block == Block.oreLapis)
			{
					return toolMaterial.getHarvestLevel() >= 1;
			}

			if (block == Block.oreRedstone || block == Block.oreRedstoneGlowing)
			{
					return toolMaterial.getHarvestLevel() >= 2;
			}

			if (block.blockMaterial == Material.rock)
			{
					return true;
			}
			else
			{
					return block.blockMaterial == Material.iron;
			}
	}

	/**
	 * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
	 * sword
	 */
	public float getStrVsBlock(ItemStack itemstack, Block block)
	{
			if (block != null && (block.blockMaterial == Material.iron || block.blockMaterial == Material.rock))
			{
					return efficiencyOnProperMaterial;
			}
			else
			{
					return super.getStrVsBlock(itemstack, block);
			}
	}

	static
	{
			blocksEffectiveAgainst = (new Block[]
							{
									Block.cobblestone, Block.stairDouble, Block.stairSingle, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold,
									Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail,
									Block.railDetector, Block.railPowered
							});
	}
}

 

zobaczcie czy mam wszystko dobrze

 

 

Brakuje ci pliku mod_NAZWA MODA.java

 

 

Opublikowano

@Shad<.< tak.

@Minecraft Maniak źle, w pliku EnumszToolMaterial nie ma tej linijki TyP[...] .

 

PS. Jutro rano będą moby.

Opublikowano

mam problem

[u]PICKAXE[/u]( 3,  5F, 6F, 2, 14);

Te PICKAXE mi się podkreśla

 

W Pliku ItemSzPickaxe:

 


package net.minecraft.src;

public class ItemSzPickaxe extends Item
{
private static Block blocksEffectiveAgainst[];

protected ItemSzPickaxe(int i, EnumszToolMaterial  enumsztoolmaterial)
{
super(i, 2, enumsztoolmaterial, blocksEffectiveAgainst); <----- tu wszystko
}

/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block block)
{
if (block == Block.obsidian)
{
return toolMaterial.getHarvestLevel() == 3;<----- tu toolMaterial
}

if (block == Block.blockDiamond || block == Block.oreDiamond)
{
return toolMaterial.getHarvestLevel() >= 2;<----- tu toolMaterial
}

if (block == Block.blockGold || block == Block.oreGold)
{
return toolMaterial.getHarvestLevel() >= 2;<----- tu toolMaterial
}

if (block == Block.blockSteel || block == Block.oreIron)
{
return toolMaterial.getHarvestLevel() >= 1;<-----tu toolMaterial
}

if (block == Block.blockLapis || block == Block.oreLapis)
{
return toolMaterial.getHarvestLevel() >= 1;<-----tu toolMaterial
}

if (block == Block.oreRedstone || block == Block.oreRedstoneGlowing)
{
return toolMaterial.getHarvestLevel() >= 2;<----- tu toolMaterial
}

if (block.blockMaterial == Material.rock)
{
return true;
}
else
{
return block.blockMaterial == Material.iron;
}
}

/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack itemstack, Block block)
{
if (block != null && (block.blockMaterial == Material.iron || block.blockMaterial == Material.rock))
{
return efficiencyOnProperMaterial;<----- Ta linkia cała
}
else
{
return super.getStrVsBlock(itemstack, block);
}
}

static
{
blocksEffectiveAgainst = (new Block[]
{
Block.cobblestone, Block.stairDouble, Block.stairSingle, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold,
Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail,
Block.railDetector, Block.railPowered
});
}
}

 

Mam Pytanie Jak Zrobić Crafting tego Narzędzia bo zrobiłem przedmiot i chcem żeby z niego się tworzyło

 

 

Ps.Dziś chyba zrobisz Moby nie? Ja już zrobiłem texturke edytowałem texturke creepera i zrobiłem filoetowego creepera o nazwie Creeper HigStar

Opublikowano

@up crafting tak jak z normalnym przedmiotem tylko że nazwę narzędzia.

 

Zmiany w tutorialu:

  • Dodano 6.Moby :)
  • Poprawiono 1.Przygotowania(teraz mody robi się w Eclipse)
  • Zaktualizowano listę tego co zrobię

Opublikowano

e zrobisz taką lekcje jak zrobić rosline np : drzewo jakieś

 

@edit: Mam Problem z Mobem:

kod:

public void addRenderer(Map map)<--- tu pisze że Syntax error on token ")", ; expected 
                   ^
                   |-----tu pisze void is an invalid type for the variable addRenderer
       {
                                       map.put(EntityCHG.class, new RenderBiped(new ModelBiped(), 0.5F));
       }

Opublikowano

Witam mam problem z dekompilacją Minecrafta. Jeżeli wrzucę czystą grę to wszystko jest ok ale jak wrzucę modloadera to mam błąd. Próbowałem jeszcze raz ściągnąć MCP ale to nic nie dało. Mam Jave 1.7 i JDK najnowsze.

O to dekompilacja:


== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
!! Updates available. Please run updatemcp to get them. !!
> Creating Retroguard config files
!! Modified jar detected. Unpredictable results !!
== Decompiling client using JAD ==
> Creating SRGs
> Applying Retroguard
> Applying MCInjector
> Unpacking jar
> Copying classes
> Applying jadretro
> Decompiling
> Copying sources
> Applying JAD fixes
> Applying patches
'runtime\bin\applydiff.exe -p1 -u -i ..\..\temp\temp.patch -d src\minecraft' fai
led : 1

== ERRORS FOUND ==
When decompiling with ModLoader a single hunk failure in RenderBlocks is expecte
d and is not a problem

1 out of 1 hunk FAILED -- saving rejects to file 'net\minecraft\src\RenderBlocks
.#'
==================

> Cleaning comments
- Done in 43.21 seconds
== Reformating client ==
> Cleaning sources
> Replacing OpenGL constants
> Reformating sources
- Done in 9.16 seconds
== Updating client ==
> Adding javadoc
> Renaming sources
- Done in 6.46 seconds
!! Missing server jar file. Aborting !!
== Recompiling client ==
> Cleaning bin
> Recompiling
- Done in 12.47 seconds
> Generating client md5s
Aby kontynuować, naciśnij dowolny klawisz . . .

Proszę o pomoc.

Opublikowano

Ok, napisałem moda, dałem reobscufate.bat. Wszystko pięknie, brak errorów. Wchodzę w reobf -> minecraft i tam jest pusto. Nie wiem dlaczego o.O

Pomożesz?

LOL xD

Opublikowano

@up pierw musisz recompile

 

Mam Problem z modelem co muszę zamienić aby był model creepera bo to jak on chodzi to widać jak by miał nogi a ja chcem żeby to chodziło tak jak creeper

 

@edit Kiedy wyjdzie następna Lekcja

Opublikowano

Świetny tutorial, miałem okazję kilka razy korzystać.

Polecam wszystkim nowym w temacie :) !

hn5r.png


“Let's face it: the world is twisted. And rotten.” ― Natsuo Kirino


Opublikowano

Witajcie, mam problem z narzendziem:

[b]super(i, 2, enumdiamondtoolmaterial, blocksEffectiveAgainst); ta cała linka tu pisze-The constructor ItemTool(int, int, EnumdiamondToolMaterial, Block[]) is undefined ItemSzPickaxe[/b]

Cały Kod ItemSzPickaxe

protected ItemSzPickaxe(int i, EnumdiamondToolMaterial enumdiamondtoolmaterial)
{
	super(i, 2, enumdiamondtoolmaterial, blocksEffectiveAgainst);= 2;
	}

	if (block == Block.blockGold || block == Block.oreGold)
	{
		return toolMaterial.getHarvestLevel() >= 2;
	}

	if (block == Block.blockSteel || block == Block.oreIron)
	{
		return toolMaterial.getHarvestLevel() >= 1;
	}

	if (block == Block.blockLapis || block == Block.oreLapis)
	{
		return toolMaterial.getHarvestLevel() >= 1;
	}

	if (block == Block.oreRedstone || block == Block.oreRedstoneGlowing)
	{
		return toolMaterial.getHarvestLevel() >= 2;
	}

	if (block.blockMaterial == Material.rock)
	{
		return true;
	}
	else
	{
		return block.blockMaterial == Material.iron;
	}
}

/**
 * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
 * sword
 */
public float getStrVsBlock(ItemStack itemstack, Block block)
{
	if (block != null && (block.blockMaterial == Material.iron || block.blockMaterial == Material.rock))
	{
		return efficiencyOnProperMaterial;
	}
	else
	{
		return super.getStrVsBlock(itemstack, block);
	}
}

static
{
	blocksEffectiveAgainst = (new Block[]
			{
				Block.cobblestone, Block.stairDouble, Block.stairSingle, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold,
				Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail,
				Block.railDetector, Block.railPowered
			});
}
}

 

i jeszcze jeden error w pliku EnumdiamondToolMaterial

tu pisze The constructor EnumdiamondToolMaterial(int, int, float, int, int) is undefined EnumdiamondToolMaterial-->PICKAXE( 3,  5, 8F, 4, 14)

cały Plik

package net.minecraft.src;

public enum EnumdiamondToolMaterial
{
PICKAXE( 3,  5, 8F, 4, 14)

private final int harvestLevel;
private final int maxUses;
private final float efficiencyOnProperMaterial;
private final int damageVsEntity;
private final int enchantability;

private EnumdiamondToolMaterial(String s1, int j, int k, int l, float f, int i1, int j1)
{
	harvestLevel = k;
	maxUses = l;
	efficiencyOnProperMaterial = f;
	damageVsEntity = i1;
	enchantability = j1;
}

public int getMaxUses()
{
	return maxUses;
}

public float getEfficiencyOnProperMaterial()
{
	return efficiencyOnProperMaterial;
}

public int getDamageVsEntity()
{
	return damageVsEntity;
}

public int getHarvestLevel()
{
	return harvestLevel;
}

public int getEnchantability()
{
	return enchantability;
}
}

 

 

Mam Pytanie co Wkleić do mod_Sz?

Opublikowano

@up lepiej zrób od początku bo strasznie dużo błędów. Wcześniej napisałem że będę pisał typ na np. diamentowy , a rodzaj na np. kilof a nie na odwrót.

Opublikowano

Witam. Mam małe pytanie a mianowicie czy ten kod jest napisany prawidłowo. Dokładnie chodzi mi o recepturę przetapiania.

 

package net.minecraft.src;
import java.util.Random;
public class mod_Ame extends BaseMod
{
	public static Block TV = new BlockTV(250, 0).setBlockName("TV").setHardness(5F).setResistance(5F).setLightValue(1F);

public String getVersion()
{
	 return "1.2.5";
}

public void load(){}

public mod_Ame()
{
							TV.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/AmeliniumMod/tv.png");
							ModLoader.addName(TV, "Ruda Amelinium");
							ModLoader.registerBlock(TV);
}
public void generateSurface(World world, Random random, int i, int j)
	{
			for (int k = 0; k < 3; k++)
			{
					int x = i + random.nextInt(16);
					int y = 10 + random.nextInt(50);
					int z = j + random.nextInt(16);
					(new WorldGenMinable(TV.blockID, 5)).generate(world, random, x, y, z);
			}
	}
{	
							ModLoader.addSmelting(250, new ItemStack(pilot, 1));
}

}

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...