Everything posted by Draco18s
-
Registering/Using ITickHandler
Can't update very far, the mod I'm writing needs to work with another mod, which is not compatible past 644 (and I'm on 639).
-
[Unsolved]Weird code behaviour...?
isRemote returns true on the CLIENT Hence:
-
Registering/Using ITickHandler
Why do you extend Gui? Scratch that, You need this: RenderGameOverlayEvent.Pre or RenderGameOverlayEvent.Post not the RenderWorldLastEvent *Cough*
-
Block collision bounds are "static" (Java term)
Look at BlockSnow (the natural snow block), see if you can glean some information from it.
-
Registering/Using ITickHandler
None of their code is relevant. A large percentage of it has to do with Questology's...properties and variables. Another good portion is drawing some text that I don't need Of the remainder, it's what I have, plus some GUIscalar code, which shouldn't matter (except that it won't size my GUI object properly unless implemented).
-
Registering/Using ITickHandler
package draco18s.decay.client; import org.lwjgl.opengl.GL11; import draco18s.decay.PositiveDamage; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiIngame; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.client.event.RenderWorldLastEvent; public class OverhealGUIHandler extends Gui { private final Minecraft mc = Minecraft.getMinecraft(); @ForgeSubscribe public void drawOverlay(RenderWorldLastEvent event) { System.out.println("Rendering"); //this prints mc.renderEngine.bindTexture("/mods/DecayingWorld/textures/gui/overheal.png"); drawTexturedModalRect(244, 382, 0, 0, 162, 16); } }
-
energy framework-esque thing won't work and i can't figure out why it won't work
Seriously, look at the source code for my phase stone. It updates its neighbors just fine.
-
Registering/Using ITickHandler
That part worked fine, the function is being called, but NOTHING IS DRAWN.
-
Container: Function to check if Item is a specified Item
package draco18s.economy.inventory; import draco18s.economy.EconBankAccounts; import draco18s.economy.entities.EntityShop; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class MySlot extends Slot { public int sellprice = 0; public MySlot(IInventory par1iInventory, int par2, int par3, int par4) { super(par1iInventory, par2, par3, par4); } public boolean canTakeStack(EntityPlayer shopper) { return true; } public boolean isItemValid(ItemStack par1ItemStack) { return false; //returning false prevents the player from putting items into the slot } }
-
energy framework-esque thing won't work and i can't figure out why it won't work
That's not true. world.setBlockMetadataWithNotify(...); takes an integer flag as its last parameter. Pass a 3.
-
Registering/Using ITickHandler
Ok, I've got Questology's code, but I can't get anything to draw. The only thing I can figure is that it's because net.minecraftforge.client.event.RenderGameOverlayEvent doesn't exist any more. The function is being called, but nothing is getting drawn. :<
-
How to use NBT
I've been blindly poking at WorldSaveData, which I think creates nbts, but I'm honestly not sure. *Checks the save of the one mod that's using that* Well I'll be. That's the one, alright!
-
Registering/Using ITickHandler
Alright, I can't figure this out. I'm trying to add a new HUD item and I have a class that implements ITickHandler and I've registered it with the TickRegistry, but its methods are never called! I have this in my main mod class TickRegistry.registerTickHandler(new MyGUI(), Side.CLIENT); And this is my GUI class
-
How to use NBT
Yes, but I'm not sure how.
-
How to use NBT
Generally you tell the NTB to save/load the same datatype as the object you wish to save. eg, to save an int nbt.setInteger("myInt", myInt); to get it back myInt = nbt.getInteger("myInt");
-
energy framework-esque thing won't work and i can't figure out why it won't work
The redstone wire code is good code to look at. You can also take a peek at my sourcecode here.
-
energy framework-esque thing won't work and i can't figure out why it won't work
if(the ID passed == this.blockID) { look at all six neighbors if one of them has metadata I don't have make my metadata the same }
-
How to use NBT
If you're using a TileEntity, there's a read/write NBTCompound function. Just use that. It's pretty strait forward, actually.
-
Texture and lang issues
You're welcome. I just find it absurd that every texture-not-loading issue comes down to people not-reading the documentation, tutorials, and prior threads related to their issue. I have single-handedly solved this issue successfully for over 14 different people in the last two weeks. That's about one a day.
-
Custom furnace and armor texture problem
Jesus christ. Use a freaking string. Don't try to reference the @Mod annotation. He said use what's IN the annotation.
-
Texture and lang issues
Ok, here's your issue. You are storing your textures in src/minecraft/resource/textures/items But the icon register looks for it in src/minecraft/mods/textures/items Read the error. "TextureManager.createTexture called for file mods/nopales/textures/items/nopales.png, but that file does not exist. " As for the creative tab name: no shit. Your unlocalized name is itemGroup.Nopales, and it hasn't been localized (likely because minecraft can't find your localization file). As to that issue, I have no idea
-
Change placed block according to neighbouring blocks
And that variable is equal to..?
-
Texture and lang issues
We need the code that calls those files.
-
[Unsolved] Setting bounding boxes for block and handheld icon [1.5.2]
Look up blocks like the fence. As for the icon, I know it's handled by the render ID. Which means if you're using a custom renderer, there's probably a function you need in there. There's also setBlockBoundsForItemRender, which is used for blocks which have their bounds set by metadata so that when its in the inventory, it uses a fixed value (rather than the last metadata used in the world)
-
Tron Light Trail/Wall Collision boxes
He's trying to avoid creating a million entities.
IPS spam blocked by CleanTalk.