Everything posted by MikaXD
-
[1.7.X] Read data from a .schematic file
This mod doesn't really help me with READING .schematic files
-
[1.7.X] Read data from a .schematic file
I want to spawn some new structures in minecraft but some of them are pretty big so I need a lot of code. With MCEdit you can create .schematic files which contains my structure. And here's the question: How can I read the blocks and metadata from a .schematic file? On the internet I didn't find anything useful for the current version. Sorry for my bad english
-
[1.7.10] Custom gui problem
I've just created a new gui which is opened when the player right clicks my custom block. But if the player has an aktive potion effect, it's shown in the gui. I don't want to remove the potion effects when the player opens my gui, but is there a way to hide them?
-
[1.7.10] Command addTabCompletionOptions
Thank you!
-
[1.7.10] Command addTabCompletionOptions
How to use this?
-
[1.7.2] Check if player is operator
I didn't expect it's so difficult to check if a player is op! I also used the ServerConfigurationManager but without success. I think it's very disappointing that Forge doesn't provide any methode to check this. I mean, you can easily check if the player is in creative mode, if the player is flying... But you CAN'T check if the player is op... (on an easy way).
-
[1.7.2] Check if player is operator
How can i check if a player is op?
-
[1.7.2] Change the reach of a player
Thanks to you, TheGreyGhost and Ernio, it's working! :)
-
[1.7.2] Change the reach of a player
How can I do this? Changing the reach of the player so he can attack, build or right click something which is eg 25 blocks away?
-
[1.7.2] Getting entities around player
Can I get a list of entities in a specific radius around the player?
-
[1.7.2] Gui position on screen
Here's my gui class. package XX.XXX.XXX; import java.util.Collection; import java.util.Iterator; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.shader.ShaderGroup; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; import org.lwjgl.opengl.GL11; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class GuiTest extends Gui { private Minecraft mc; public GuiMana(Minecraft mc) { super(); this.mc = mc; } @SubscribeEvent(priority = EventPriority.NORMAL) public void renderGameOverlayEvent(RenderGameOverlayEvent event) { if(event.isCancelable() || event.type != ElementType.EXPERIENCE) { return; } GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_LIGHTING); this.mc.renderEngine.bindTexture(new ResourceLocation("XXX:textures/gui/ingame_gui.png")); /* *Here is the problem; What must be insert to draw the gui over the health bar? * this.drawTexturedModalRect(/*xpos*/, /*ypos*/, 0, 49, 102, 14); } }
-
[1.7.2] Gui position on screen
Doesn't work... Can you give an example?
-
[1.7.2] Gui position on screen
I've just added a gui to the game, which is drawn on the screen (RenderGameOverlayEvent). Now there's the problem: If you resize the game window, the gui is always drawn relative to the upper left corner. But I want to draw it on s specific position (In my case, it should be near the health bar). Is there a possibility to get the current position of the health bar?
-
[1.7.2] world.spawnParticles does not work :(
still does not work
-
Increase player speed
player.capabilities.setPlayerWalkSpeed(2); But be careful, this will increase the speed very strong!
-
[1.7.2] world.spawnParticles does not work :(
I'm trying to spawn particles when the player right clicks with my tool, but they are not spawning In my onItemRightClick methode I put this code: player.worldObj.spawnParticle("smoke", 1, 1, 1, player.posX, player.posY, player.posZ); Do you know, what the problem is?
-
[1.7.2]Question to "addPotionEffect"
I'll try it again.
-
Custom Structure in Custom Biome 1.7.2
I only found a program for an old minecraft version: http://www.minecraftforum.net/topic/1336152-132-updated-metadata-support-simple-schematic-to-java-file-converter/ Just select a .schematic file and then you get the code for java - but be careful: This is NOT the right code. You have to replace all the world.setBlock lines with the new code (You can do this easily in the notepad!). This program also splits the code into different methodes, because java cannot place more than 1600 blocks in one methode! If you don't what a .schematic file is - Google is your friend! PS: You can create a schematic file with MCEdit.
-
[1.7.2]Question to "addPotionEffect"
I only ran "gradlew setupDecompWorkspace eclipse".
-
Custom Structure in Custom Biome 1.7.2
1. Create a new class which implements the IWorldGenerator 2. Create a new variable in your main class for the IWorldGenerator 3. Register your world generator in your main class Here is an example: Your world generator (called Test): package XXX.XXXX.XXXX; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenPlains; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import cpw.mods.fml.common.IWorldGenerator; public class Test implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId) { case -1: generateNether(world, random, chunkX * 16, chunkZ * 16); break; case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); break; case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16); break; } } private void generateEnd(World w, Random r, int i, int j) { } private void generateSurface(World world, Random random, int i2, int k2) { int i = i2 + random.nextInt(15); int k = k2 + random.nextInt(15); int j = world.getHeightValue(i,k)-1; if((random.nextInt(1000000)+1)<=100000){ boolean place = true; if(place){ world.setBlock(i+0, j+0, k+0, Block.getBlockById(44), 3, 2); world.setBlock(i+1, j+0, k+0, Block.getBlockById(44), 3, 2); world.setBlock(i+2, j+0, k+0, Block.getBlockById(44), 3, 2); world.setBlock(i+3, j+0, k+0, Block.getBlockById(44), 3, 2); world.setBlock(i+4, j+0, k+0, Block.getBlockById(44), 3, 2); world.setBlock(i+0, j+0, k+1, Block.getBlockById(44), 3, 2); world.setBlock(i+1, j+0, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+2, j+0, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+3, j+0, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+4, j+0, k+1, Block.getBlockById(44), 3, 2); world.setBlock(i+0, j+0, k+2, Block.getBlockById(44), 3, 2); world.setBlock(i+1, j+0, k+2, Block.getBlockById(4), 0, 2); world.setBlock(i+2, j+0, k+2, Block.getBlockById(9), 0, 2); world.setBlock(i+3, j+0, k+2, Block.getBlockById(4), 0, 2); world.setBlock(i+4, j+0, k+2, Block.getBlockById(44), 3, 2); world.setBlock(i+0, j+0, k+3, Block.getBlockById(44), 3, 2); world.setBlock(i+1, j+0, k+3, Block.getBlockById(4), 0, 2); world.setBlock(i+2, j+0, k+3, Block.getBlockById(4), 0, 2); world.setBlock(i+3, j+0, k+3, Block.getBlockById(4), 0, 2); world.setBlock(i+4, j+0, k+3, Block.getBlockById(44), 3, 2); world.setBlock(i+0, j+0, k+4, Block.getBlockById(44), 3, 2); world.setBlock(i+1, j+0, k+4, Block.getBlockById(44), 3, 2); world.setBlock(i+2, j+0, k+4, Block.getBlockById(44), 3, 2); world.setBlock(i+3, j+0, k+4, Block.getBlockById(44), 3, 2); world.setBlock(i+4, j+0, k+4, Block.getBlockById(44), 3, 2); world.setBlock(i+1, j+1, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+3, j+1, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+1, j+1, k+3, Block.getBlockById(4), 0, 2); world.setBlock(i+3, j+1, k+3, Block.getBlockById(4), 0, 2); world.setBlock(i+1, j+2, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+3, j+2, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+1, j+2, k+3, Block.getBlockById(4), 0, 2); world.setBlock(i+3, j+2, k+3, Block.getBlockById(4), 0, 2); world.setBlock(i+1, j+3, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+3, j+3, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+1, j+3, k+3, Block.getBlockById(4), 0, 2); world.setBlock(i+3, j+3, k+3, Block.getBlockById(4), 0, 2); world.setBlock(i+1, j+4, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+2, j+4, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+3, j+4, k+1, Block.getBlockById(4), 0, 2); world.setBlock(i+1, j+4, k+2, Block.getBlockById(4), 0, 2); world.setBlock(i+2, j+4, k+2, Block.getBlockById(4), 0, 2); world.setBlock(i+3, j+4, k+2, Block.getBlockById(4), 0, 2); world.setBlock(i+1, j+4, k+3, Block.getBlockById(4), 0, 2); world.setBlock(i+2, j+4, k+3, Block.getBlockById(4), 0, 2); world.setBlock(i+3, j+4, k+3, Block.getBlockById(4), 0, 2); }}} private void generateNether(World w, Random rand, int i, int j) { } } and in your main class: public static IWorldGenerator test = new Test(); //and in the init: GameRegistry.registerWorldGenerator(test, 1); If you only want to generate your structure in your biome, you have to check if the current biome is yours: if(world.getWorldChunkManager().getBiomeGenAt(x,y)==YOURBIOME){ place(true); }
-
[1.7.2]Question to "addPotionEffect"
If I COULD open this class, I wouldn't ask, what the parameters mean. When I try to open a specific class by holding the mouse over the methode name, eclipse always says, the attached source could not be found or something like that :'( But thanks for you help!
-
[1.7.2]Question to "addPotionEffect"
I want to give the player a potion effect and I found this code: player.addPotionEffect(new PotionEffect(int par1, int par2, int par3, boolean par4)); What do the 4 arguments mean?
-
[1.7.2] Adding an item slot to the player's inventory?
Everything makes sense to me, except your "hard part". Can you give me some instructions? Or do you know a good example?
-
[1.7.2] Adding an item slot to the player's inventory?
Yes, but I think it's not as easy as I thought at first, because I didn't find anything about that...
-
[1.7.2] Adding an item slot to the player's inventory?
Hi all, how can I add a new item slot to the player's survival inventory?
IPS spam blocked by CleanTalk.