Everything posted by Draco18s
-
[Solved]Importing .obj into Minecraft and Handle it as a Placeable Block
*Cough* Client proxy. *Cough*
-
New modder getting started - looking for some guidance
You mean http://www.minecraftforge.net/wiki/ ? The wiki has all kinds of things http://www.minecraftforge.net/forum/index.php/board,120.0.html ? This board has tutorials, though dominated by 1.8 things, but there's still 1.7 stuff in the archives http://www.minecraftforge.net/forum/index.php/board,118.0.html ? This board has everything to do with Forge Gradle, the "replacement" to MCP
-
[Solved]Importing .obj into Minecraft and Handle it as a Placeable Block
This is basic stuff dude. The block and the renderer are separate and distinct classes. To register the renderer, you need to do this (from my own project): TileEntitySpecialRenderer render = new TESRWindvane(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWindvane.class, render); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(OresBase.blockvane), new ItemModelRenderer(render, new TileEntityWindvane()));
-
[SOLVED] [1.7.10] Chunkloading Block
I noticed something: ticket.getModData().setInteger("coreX",xCoord);//set X to X ticket.getModData().setInteger("coreX",yCoord);//set X to Y ticket.getModData().setInteger("coreX",zCoord);//set X to Z Uh?
-
[1.7.10] Getting Block Coordinates
Also, your TileEntity's constructor MUST take NO parameters or things will go weird, fast.
-
[1.7.10] Achievement Trigger Suggestions
Also, cache the result of Item.getItemFromBlock(WinterBlocks.icedStone) so you don't have to do the lookup every time.
-
[1.7.10] Can a Tile Entity have a Techne model?
You need a TileEntitySpecialRenderer class, that class holds a reference to your ModelWhatever class.
-
[1.7.10] Getting Block Coordinates
More like "whatever it is you're trying to do you need a TileEntity." Because seriously, either you're given coordinates or its a method where the coordinates are irrelevant (or its an overloaded function in which case, both).
-
[1.7.10] Getting Block Coordinates
The block class is a singleton and is used as a reference for ALL blocks of that type in the word, regardless of their position. That's why a world, x, y, and z coordinates are passed to most methods. Why do you need these outside of those methods, what are you trying to do?
-
[1.8] anoing bug / features founded at setting item textures
Having not worked with 1.8, I unfortunately can't tell you. I'm basing my information off what I've gleaned from reading the forums and maybe I'm wrong.
-
[1.8] anoing bug / features founded at setting item textures
That's because the metadata is handled INSIDE the json file.
-
Change item damage to represent value
No...you use the ItemStack's damage value or you use the ItemStack's NBT. Those are your options.
-
Change item damage to represent value
This bit: public class ItemToolGas extends Item { private int storedGas = 0; That variable is effectively static because ItemToolGas is only ever instantiated once (its a singleton class). Each copy of it that exists in your in-game inventory is actually an instance of ItemStack which references the shared[/s] singleton.
-
Return true for isItemEqual() with any itemDamage
Actually javac compiles these two to the same thing: int i = 1; i++; int i = 1; ++i; If the value is not used, it does not matter. Ah, cool. The last time I saw the test done for various ways was on AS3 (which does create a temporary variable).
-
Unable to solve a FileNotFound Error
Well, your "models" folder isn't inside "resources" that's why. The path its trying to load is, "src/main/resources/assets/objloader/models/mymodel.obj"
-
Return true for isItemEqual() with any itemDamage
This is pretty much true. You'd have to be calling instanceof like 10,000 times a tick to see a difference. There are other, similar "micro optimizations" you can make as well, for instance using ++i instead of i++ (because of the way values are returned, i++ has to use a little extra stack space and a pop). But for the most part you'd only notice a difference when it's being used tens, if not hundreds, of thousands of times every frame.
-
[1.7.2]Custom Arrow
Or you could use my custom arrow: https://github.com/Draco18s/Artifacts/blob/master/main/java/com/draco18s/artifacts/entity/EntitySpecialArrow.java Which doesn't have any non-Minecraft imports, already deals with the onImpact problem, and is easily modifiable to add potion effects. See line 321.
-
[1.7.10] Transparency in GUI?
Unity has one of the better explanations. Its talking about shader code, but GL11 uses the same parameters. http://docs.unity3d.com/Manual/SL-Blend.html It's still bare-bones, but it does have the four most commonly used blends listed out.
-
[1.8]How to register metadata blocks with different names
You need an ItemBlock class, like so: package com.draco18s.ores.item; import java.util.List; import com.draco18s.ores.OresBase; import com.draco18s.ores.block.BlockOreFlower; import cpw.mods.fml.common.Loader; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockColored; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemDye; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; public class ItemBlockOreFlower extends ItemBlock { private IIcon[] icons; public static final String[] names = new String[] {"poorjoe","horsetail","horsetail","vallozia","flame_lily","flame_lily", "tansy","tansy","hauman","leadplant","primrose"}; private String[] flowerDescript = {"indicator.iron","indicator.gold","indicator.gold","indicator.diamond","indicator.redstone","indicator.redstone", "indicator.tin","indicator.tin","indicator.copper","indicator.lead","indicator.uranium"}; public ItemBlockOreFlower(Block b) { super(b); setHasSubtypes(true); } @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean flag) { if(stack.getItemDamage() < 6 || Loader.isModLoaded("IC2")) { list.add(StatCollector.translateToLocal(flowerDescript[stack.getItemDamage()])); } } @Override @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int p_77617_1_) { return this.field_150939_a.getIcon(2, p_77617_1_); } @Override public int getMetadata(int p_77647_1_) { return p_77647_1_; } @Override public String getUnlocalizedName(ItemStack itemStack) { return "item." + names[itemStack.getItemDamage()]; } }
-
Items disappearing in a custom inventory
HAHAHA! That's a great line.
-
New attributes for custom entities
Note that DataWatchers have a specific number of things that they watch and once they're used up, they're used up. All the vanilla entities are already using about half that limit, plus or minus two (e.g. the dogs have a datawatcher object for their collar color, chickens do not).
-
1.7.10 Emu toolMaterial is error less but i think i codded it wrong Please help
...are you doing GameRegistry stuff inside a class inside your item!? What the hell?
-
[1.7.2]Custom Arrow
Well. Thread.sleep is not going to make the arrow "wait a second" before exploding. It will cause the game to "freeze entirely for a second" then explode.
-
[1.7.10] Bubble particles not spawning
Good question. I was seeing something similar the other day when making a drowning effect for "this isn't water, stop making it act like water" block. I had copied over the bubble particle call figuring I could use it and I wasn't getting bubbles either. I've since removed it (both because it wasn't working and because I did another, better, effect).
-
[1.8]Issue while modding a Slab
Please include BlockTuileSlab.java
IPS spam blocked by CleanTalk.