
Naiten
Members-
Posts
325 -
Joined
-
Last visited
Everything posted by Naiten
-
This comes when i try to get tl.px...
-
Oh, now it finally works. Have i said i love you? Now i'm having problems with making the physics of my wagen... And making my blocks to brake...
-
I don't have items.png file, i have many different ones...
-
But i still don't understand how to use them...
-
Yay! Instead all that shit that i still don't understand, i just had to put RenderingRegistry.registerEntityRenderingHandler(net.railowar.src.EntityLocoChe.class, new RenderLocoChe()); into my load method. No public void addRenderer or proxies are needed. Also, calling super method in write/readtonbt crashed the game, but it saves my locomotives without it.
-
No i don't. I will destroy main block, it will update nearby blocks, they will check if main block exists, destroy themselves, update nearby and so on. But i'm getting error on world.destroyBlock((int)tle.px, par3, par4, true); line...
-
What proxy in minecraft actually is? How do i use it?.. I was out of modding for a while and in past times all was gut and without any proxies...
-
Uh. I mean, i don't understand the point i should make loop for...
-
Oh, i had to add an entityInit(){} method, even if it's empty. Now i have to make it render my model...
-
Okay. addRender goes to the main mod class.
-
Where exactly? As i remember, nbttagcompaund doesn't save arrays...
-
Okay, here's my code package net.railowar.src; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; public class EntityLocoChe extends Entity { public EntityLocoChe(World par1World) { super(par1World); } public EntityLocoChe(World world, double d, double d1, double d2) { this(world); setPosition(d, d1, d2); setSize(1.0F, 1.0F); } protected void entityInit(){} public AxisAlignedBB getCollisionBox(Entity entity) { return entity.boundingBox; } public AxisAlignedBB getBoundingBox() { return boundingBox; } public boolean canBeCollidedWith() { return true; } public boolean canBePushed() { return true; } public void writeEntityToNBT(NBTTagCompound nbttagcompound) { } public void readEntityFromNBT(NBTTagCompound nbttagcompound) { } protected int getDropItemId() { return 0; } } EntityRegistry.registerModEntity(EntityLocoChe.class, "Cherepanov", cpw.mods.fml.common.registry.EntityRegistry.findGlobalUniqueEntityId(), this, 64, 1, true); public void addRenderer(Map map) { map.put(net.railowar.src.EntityLocoChe.class, new RenderLocoChe()); } package net.railowar.src; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemChe extends Item { public ItemChe(int par1) { super(par1); this.maxStackSize = 1; this.setCreativeTab(CreativeTabs.tabTransport); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3) { if (!par3.capabilities.isCreativeMode) { --par1ItemStack.stackSize; } par2World.playSoundAtEntity(par3, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityLocoChe(par2World, par3.posX, par3.posY, par3.posZ)); } return par1ItemStack; } } And it doesn't spawn... What's wrong with that?
-
Okay, now it doesn't crash, but it doesn't work as i want either. The thing is — i'm placing a couple of blocks at once and i want them to be broken once too, so i... public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack par6ItemStack) { int[][] bl = {{0,1,240},{0,2,224},{0,3,208},{0,4,192},{0,5,176},{0,6,160}, {-1,1,241},{-1,2,225},{-1,3,209},{-1,4,193},{-1,5,177},{-1,6,161},{-1,7,145},{-1,8,129}, {-2,2,226},{-2,3,210},{-2,4,194},{-2,5,178},{-2,6,162},{-2,7,146},{-2,8,130},{-2,9,114}, {-3,6,163},{-3,7,147},{-3,8,131},{-3,9,115},{-3,10,99},{-3,11,83}, {-4,8,132},{-4,9,116},{-4,10,100},{-4,11,84},{-4,12,68}, {-5,9,117},{-5,10,101},{-5,11,85},{-5,12,69},{-5,13,53}}; int dir = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3; world.setBlockMetadataWithNotify(i, j, k, dir, 0); for (int l = 0; l < bl.length; l++){ int[] c = rotxybydir(bl[l][0], bl[l][1], dir); world.setBlock(i + c[0], j, k + c[1], RoW.Rails.blockID, dir, 0); TileEntityBlockZRail tl = (TileEntityBlockZRail) world.getBlockTileEntity(i + c[0], j, k + c[1]); tl.mid = bl[l][2]; tl.px = i; tl.pz = j; tl.py = k; }; } It places them rather well, but i want to brake them all too...
-
Don't you say! And i so idiot, that i accidentaly put it there with no point!
-
I have declared proper variables in my tile entity public int px = 0; public int py = 0; public int pz = 0; And minecraft returns nullpointerexception on world.destroy public void onBlockDestroyedByPlayer(World world, int par2, int par3, int par4, int par5) { TileEntityBlockZRail tle = (TileEntityBlockZRail)world.getBlockTileEntity(par2, par3, par4); world.destroyBlock((int)tle.px, par3, par4, true); } What's wrong with that?
-
Hello. I definitely need one, can you help with that?
-
You can check my code out, if you want. Basemod. http://pastebin.com/QbCrDCLf Block. http://pastebin.com/DaBKhrTj TileEntity. http://pastebin.com/TJX69p1S Renderer. http://pastebin.com/Gcrct5NT
-
Thanks, but i have already done that with mcmod.info file.
-
Thanks, but i have already done that with mcmod.info file.
-
How do I make my block have a custom render> (EG Chest, signs ect)
Naiten replied to Cyani's topic in Modder Support
That is not the point! Always use Forge methods! Why? ModLoader is client-only. What if you have loads of ModLoader stuff and want to use your mod on a server or make it compatible with it? You simply have to use the Forge methods, because ModLoader is simply not there, since it's client-only. Okay, i see your point. But there's no registerTileEntity method in GameRegistry. -
How do I make my block have a custom render> (EG Chest, signs ect)
Naiten replied to Cyani's topic in Modder Support
That is not the point! Always use Forge methods! Why? ModLoader is client-only. What if you have loads of ModLoader stuff and want to use your mod on a server or make it compatible with it? You simply have to use the Forge methods, because ModLoader is simply not there, since it's client-only. Okay, i see your point. But there's no registerTileEntity method in GameRegistry. -
Well, how do i make an info andn icon to be displayed in "mods" menu in game?
-
Well, how do i make an info andn icon to be displayed in "mods" menu in game?