-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
7+ hours from the time of this post. And when I had it open last night, there wasn't much in it.
-
Good. It just isn't always apparent that any given poster has. Especially when the opening post is as short and as confusingly written* as it is. That said, I have no idea how to do what you're trying to do. I simply looked at the decompiled source code for a mod that does and tried to figure out how it worked (but as its not deobfuscated, references to vanilla classes is shaky at best). All I can tell is that he extended that base class. :\ *My guess is that English is not your native language.
-
0-15
-
I think you mean ‼Fun‼.
-
Yeah, its not simple. And I'm away from my implementation at the moment.
-
Meaning I'd have to store a list of valid dimension IDs. Grumble grumble. Rather than being able to look at empirical world properties. Hell biome.
-
Yes. The mob should be able to change dimensions if forced (via teleportation effects, such as nether portals) but should not spawn there.
-
You forgot the diagonals. # ## Will have a different connected texture on the lower left block than the same block with this configuration: ## ##
-
I think that using the biomeList (the list of all the biomes that are available, including modded ones), you could check to see what ID's are used, and then (somehow as there is no method that I can find that returns the name of the biome) get the name of the biome. Then, using that getName() method or whatever you are using to get it, print out the ID of the biome, and the name of the corresponding ID. After obtaining that information, you could then read through and find the biomes you needed.... Something like that. Less of an issue than restriction dimension.
-
Start by looking at net.minecraft.command.CommandBase
-
net.minecraft.world.WorldSavedData It basically only needs two functions: @Override public void readFromNBT(NBTTagCompound nbttagcompound) { } @Override public void writeToNBT(NBTTagCompound nbttagcompound) { }
-
You also need something like 47 individual texture files, based on what I've seen from a "connected textures for texture pack creators" thing.
-
Its for specifying the construction of a specific village building. If you don't have one, then you don't need it. Otherwise you're going to need several classes. Mind, I haven't done this myself, I'm simply looking at the decompiled source for another mod. But this should get you started: public class VillageCreationHandler implements VillagerRegistry.IVillageCreationHandler
-
You need to implement the.... IWorldSaveData interface, if I remember correctly. I can't pull up the one project I used it in at the moment, so I can't be more helpful than that.
-
public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) { this.glow(par1World, par2, par3, par4); super.onEntityWalking(par1World, par2, par3, par4, par5Entity); } *Cough*
-
Not easily. Essentially you need to figure out how to specify a different icon based on surrounding blocks. The existing class functions don't allow for that.
-
VillagerRegistry.instance().registerVillagerType(villagerID, "/mods/MyMod/textures/villager/myvillager.png"); //adding the villager VillagerRegistry.instance().registerVillageTradeHandler(villagerID, this.villager); //adding his trades VillagerRegistry.instance().registerVillageCreationHandler(new VillageCreationHandler()); //villager house (e.g. Mystcraft's archivist always get his house, TC3's villager gets his tower, etc.)
-
Using a tile entity? Ew, that's an awful way to do it. //EventHandler.java @ForgeSubscribe public void EntityUpdate(LivingEvent event){ if (entity instanceof EntityPlayer && entity.getHealth < 5) { //DO Your stuff } } //base mod.java MinecraftForge.EVENT_BUS.register(new EventHandler());
-
The ID +/- 256 "trick" is a result of original vanilla's code, that block IDs were 0-255, and items were 0-255 (internally shifted by 256). That translated into Forge supplying a getBlockID function separate from a getItemID function (the latter auto-incrementing the ID by 256). And now we're stuck with it.
-
In your base mod EntityRegistry.registerModEntity(PipeXPOrb.class, "PipeXPOrb", 1, this, 350, 5, false);
-
I tried but I cannot find such command. public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { } Do you, or do you not, have a World as one of your parameters?
-
[1.5.2] adding custom ingamegui with item right click
Draco18s replied to happyPenguin's topic in Modder Support
Short answer: Yes Long answer: You need at least three classes to do it. The item or block itself Packet Handler implements IPacketHandler Gui Renderer implements ITickHandler These two lines in your base Init function: overlayGui = new MyGUIrenderer(); TickRegistry.registerTickHandler(overlayGui, Side.CLIENT); And this will get you drawing something like the pumpkin head. Actually, 95% of this is the pumpkin head. u = 32; float minU = (float)u/512; //my texture was 512x512 float minV = 0; float maxU = (float)(u+32)/512; float maxV = 0.0625F; ScaledResolution scaledresolution = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); int k = scaledresolution.getScaledWidth(); int l = scaledresolution.getScaledHeight(); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(false); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_ALPHA_TEST); this.mc.renderEngine.bindTexture("/mods/MyMod/textures/gui/gui.png"); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0.0D, (double)l, -90.0D, minU, maxV); tessellator.addVertexWithUV((double)k, (double)l, -90.0D, maxU, maxV); tessellator.addVertexWithUV((double)k, 0.0D, -90.0D, maxU, minV); tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, minU, minV); tessellator.draw(); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -
world.createExplosion(x,y,z, radius) You will almost certainly have access to the world at the point in your block that you're trying to get this to happen.
-
Couldn't this be achieved by checking if the player is in the dimension needed? (or do you need the dimension ID still?) If this is possible, then you could spawn it in a dimension specific biome. (I assume that the dimension biomes do not spawn in the overworld, and only in the dimension?) The problem arises when trying to determine what dimension number that is. Followed by what object is doing the checking assuming I knew? The mob itself? And your assumption is wrong. Mystcraft says "what biomes would you like?" and gives you a list. All vanilla biomes are valid (and so are all mod biomes). I can, in fact, make a world that checkerboards between Sky and Hell. I believe that cannot be achieved with vanilla code... Other than calling addSpawn for all biomes...which means I need an event listener to listen for mod biomes...
-
I'm working with the Mystcraft API. Part of that API is a world generator interface, it's effectively the same as a vanilla IWorldGenerator, but Mystcraft controls when it is used (and there are often multiple per dimension). Each one of these files is the implementation of a single effect. An effect can range from "add these blocks to the world" to "cause potion effects on mobs at random." I want to spawn custom mobs as part of one of these effects. Mystcraft does not currently do any kind of mob spawn control. So I am currently doing AABB checks over a wide area (easily 65x65x128) every 80 or so ticks, and counting how many mobs of a given type are found, and if below a certain threshold, spawn more. I would much rather hand control over to Minecraft's spawning system, but I have no way of knowing when to invalidate the spawning rules. I only know when the player is in the dimension them dimension is loaded. I do not have access to the load or unload events (at least, not in any more detail than the Forge events) nor do I have access to the list of effects a given dimension has (specifically: XCompWiz doesn't want symbols to be aware of each other: observable properties are fine ("what is the average terrain height?" "what is the sea level?") but not the specific symbols used to get there ("Flat terrain" "nether terrain" etc.). So a number of things can be inferred from looking at these aggregate properties, but outside of the IWorldGenerator class, I have no way of knowing if an active dimension has the property I desire (nor does the spawn registry limit dimensions! Imagine multiplayer where I could enable/disable the spawning based on the property I don't have access to: one player goes to the valid dimension and the player in the overworld sees my mobs spawn at night! This is not desirable!). So, I need to spawn my mobs... 1) Any time, day or night 2) Specific, but unknown, dimension ID or IDs 3) No biome restrictions