Jump to content

FBalazs

Members
  • Posts

    22
  • Joined

  • Last visited

Everything posted by FBalazs

  1. I will watch it when i get home, currently i'm working from mobile internet and it's expensive O_O By the way, i managed to fix the spawning issue. I passed the reference of the inventory itemstack to the entity, instead of copying it. So when i set count in the inventory to zero, it caused the entity to set it's count to zero as well. I hope i can fix the lightning issue after watching the video.
  2. Hi, I'm developing a custom tileentity with a guiless inventory. You can put items on it's top side and get them out of there. I have two problems here. The first and more important problem is that i can't get the world to spawn the item when the player interacts with the block. I call world.spawnEntity on the server side with an EntityItem filled with the ItemStack. On client, the item pops up and disappears instantly, without me getting the item in the player inventory. The corresponding code looks like this: My second problem is that the items rendered on the block look totally dark, no lightning at all. I tried it with and without the lightning related lines, but i noticed no change. The rendering code is like this: Screenshot of the rendering result: The GitHub project can be found here. Thank you for your help in advance!
  3. Print the coordinates only if the generate method returns with "true". It means blocks have been placed. ... if((new WorldGenMinable(indestructibleTools.nether_carbyneore.blockID, 20, Block.netherrack.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord)) { System.out.println("Nether ore created at: "+Xcoord+" "+Ycoord+" "+Zcoord); } ...
  4. Hi I'm developing the Elysium mod. It started a while ago and now i'm recoding it. Basically it's a dimension mod so i need 1-3 block ids below 256. I reading the block ids from a config file with forge configuration with a default id around 200, but forge says a warning that the modder does it wrong and change the default id's above 256 because he don't need that only if it's for dimension generation. And forge gives me ids around the maxvalue(4095). I exactly need that ids for dimension generation!!!!! It's really nerve-racking. So, is there a way to get block ids below 256 with a config file? Thanks for your help!
  5. Hi There is a class in forge called AdvancedModelLoader in packege net.minecraftforge.client.model. It has a method called loadModel(String path) wich returns an instance of IModelCustom that has render methods. ... IModelCustom yourModel = AdvancedModelLoader.loadModel("path.obj"); ... yourModel.renderAll(); ...
  6. Hi Yout Y coord is random(60), I think it's too rare. It means the value will be 59 in only every 60th chunk. That's why you can't see your structure anywhere in your world. Try Y coord with 48+random(32) or something like that. On a flat world the ground level is 5-10 that's why you have more structure.
  7. Hi There is a class in forge called AdvancedModelLoader in packege net.minecraftforge.client.model. It has a method called loadModel(String path) wich returns an instance of IModelCustom that has render methods. ... IModelCustom yourModel = AdvancedModelLoader.loadModel("path.obj"); ... yourModel.renderAll(); ...
  8. Hi If you want to kill the mob instantly you can kill it in the block's onEntityWalking(World world, int x, int y, int z, Entity entity) method. @Override public void onEntityWalking(World world, int x, int y, int z, Entity entity) { entity.setDead(); // or something like that. } I hope you can find some entity detection releated stuff in the vanilla pressure plate's code.
  9. Hi I can't get your code to work. I don't think it can clear any key presses. Here's the code. The commented lines are my try. package me.dawars.CraftingPillars.handlers; import java.util.EnumSet; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import me.dawars.CraftingPillars.CraftingPillars; import me.dawars.CraftingPillars.blocks.BasePillar; import me.dawars.CraftingPillars.client.KeyBindingInterceptor; import me.dawars.CraftingPillars.network.packets.PacketClick; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.client.settings.GameSettings; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; public class TickHandler implements ITickHandler { public boolean doClick(int button) { World world = Minecraft.getMinecraft().theWorld; EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer; for(int x = (int)player.posX-5; x <= (int)player.posX+5; x++) for(int y = (int)player.posY-5; y <= (int)player.posY+5; y++) for(int z = (int)player.posZ-5; z <= (int)player.posZ+5; z++) if(Block.blocksList[world.getBlockId(x, y, z)] instanceof BasePillar) { int id = ((BasePillar)Block.blocksList[world.getBlockId(x, y, z)]).getClickedButtonId(world, x, y, z, button, player); if(id > -1) { //System.out.println("Packet sent! "+button+" "+id+" "+x+" "+y+" "+z); CraftingPillars.proxy.sendToServer(new PacketClick(button, id, x, y, z).pack()); return true; } } return false; } boolean pleft, pright; GameSettings gs; KeyBindingInterceptor intLeft, intRight; public TickHandler() { gs = Minecraft.getMinecraft().gameSettings; intLeft = new KeyBindingInterceptor(gs.keyBindAttack); intRight = new KeyBindingInterceptor(gs.keyBindUseItem); intLeft.setInterceptionActive(true); intRight.setInterceptionActive(true); } @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { // This code doesn't clear any presses if(intLeft.isKeyDown()) { if(!pleft) { if(doClick(0)) pleft = true; } if(pleft) intLeft.retrieveClick(); } else pleft = false; if(intRight.isKeyDown()) { if(!pright) { if(doClick(2)) pright = true; } if(pright) intRight.retrieveClick(); } else pright = false; // This is my code, it works fine expect the first tick of click /*if(gs.keyBindAttack.pressed) { if(!pleft && doClick(0)) { pleft = true; gs.keyBindAttack.pressed = false; } } else { pleft = false; } if(gs.keyBindUseItem.pressed) { System.out.println("right"); if(!pright && doClick(2)) { pright = true; gs.keyBindUseItem.pressed = false; } } else { pright = false; }*/ } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.CLIENT); } @Override public String getLabel() { return CraftingPillars.name+" TickHandler"; } } I want to clear the keypress when i can handle it so no vanilla click packets will be send to the server. In my code it is done but the first tick. What am i doing wrong?
  10. How are you using this? With a tick handler? Am I right? protected void copyClickInfoFromOriginal() { this.pressTime += interceptedKeyBinding.pressTime; this.interceptedPressTime += interceptedKeyBinding.pressTime; interceptedKeyBinding.pressTime = 0; // this line clears the data from the original binding if I don't do that LEFT_CLICK_BLOCK will be called else it won't be called this.pressed = interceptedKeyBinding.pressed; }
  11. So the dimension generate it self but don't with the right blocks? It can be caused by not casting blockID-s to byte when adding it to the noisearray or something like that. I hope you will find the problem.
  12. Hi, I'm one of the modders of the Crafting Pillars mod and I'm working on a better interraction handling system. My problem is that the client side doesn't call the onClick method with LEFT_CLICK_BLOCK event. I want to cancel that event and send a custom packet to the server. My event handler: @ForgeSubscribe public void onClick(PlayerInteractEvent event) { if(event.entityPlayer.worldObj.isRemote) { if(event.action == Action.LEFT_CLICK_BLOCK) // Never true { if(doClick(0, event)) event.setCanceled(true); } else if(event.action == Action.RIGHT_CLICK_BLOCK) // Works perfectly { if(doClick(2, event)) event.setCanceled(true); } else if(event.action == Action.RIGHT_CLICK_AIR) // Works perfectly { if(doClick(2, event)) event.setCanceled(true); } } } Thanks for your help!
  13. Hi You render the text twice. Once for the shadow in darkgrey color. This is what you see because you enable the DEPTH_TEST before rendering the white overlay text. Try to move the DEPTH_TEST enabling after the second text rendering. Tip: you may translate the shadow with 1 pixel in each direction (glTranslatef(1F, 1F, 0F))
  14. Hi, all! I want to make a command that's name is in a config file. But I can't use the command, Minecraft says no command with this name. If I type a name, not a variable, then the command works fine. Please help! (I think @ServerStarting is before ) Commandspluss.java ... @ServerStarting public void serverStarting(FMLServerStartingEvent event) { //commandManager = (CommandHandler)event.getServer().getCommandManager(); //commandManager.registerCommand(new CommandTpHere()); event.registerServerCommand(new CommandTpHere()); } ... @PreInit public void load(FMLPreInitializationEvent event) { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); config.load(); ... commandname_tphere = config.get("Teleport a player here", "Command", "tphere").getName(); commandlevel_tphere = config.get("Teleport a player here", "Required permission", 1).getInt(); ... config.save(); } ... CommandTpHere.java ... public String getCommandName() { return Commandspluss.commandname_tphere; } public int getRequiredPermissionLevel() { return Commandspluss.commandlevel_tphere; } ...
  15. Hi, all! I want to make a command that's name is in a config file. But I can't use the command, Minecraft says no command with this name. If I type a name, not a variable, then the command works fine. Please help! (I think @ServerStarting is before ) Commandspluss.java ... @ServerStarting public void serverStarting(FMLServerStartingEvent event) { //commandManager = (CommandHandler)event.getServer().getCommandManager(); //commandManager.registerCommand(new CommandTpHere()); event.registerServerCommand(new CommandTpHere()); } ... @PreInit public void load(FMLPreInitializationEvent event) { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); config.load(); ... commandname_tphere = config.get("Teleport a player here", "Command", "tphere").getName(); commandlevel_tphere = config.get("Teleport a player here", "Required permission", 1).getInt(); ... config.save(); } ... CommandTpHere.java ... public String getCommandName() { return Commandspluss.commandname_tphere; } public int getRequiredPermissionLevel() { return Commandspluss.commandlevel_tphere; } ...
  16. Hy Guys! I want to make a block that has two boxes. I want to know the simplest way of rendering a block with to boxes. I have a blockrenderinghandler class. Thanks for help!
  17. I made a modding API that has nether and end generation included. See the link below. http://www.minecraftforum.net/topic/1608655-fbalazss-modding-api/ My mods with my API http://www.minecraftforum.net/topic/1609828-fbalazss-mods/ But I want to make a rotating block with a rotating box and a static box. Anybody can help me how to render this in my block rendering handler?
  18. Hy Guys! I want to make some rotating block but I'm not at home in rendering. I want to know the simplest way of rendering a block with to boxes (1 static and 1 rotating). Thanks for help!
  19. Hy, all! I wan't to release my mod to server, but when I install forge for MCP in recompile the installer sad: Skipping server-side recompile, this is normal. When I open up eclipse I find only one server source file: Minecraft.java I doesn't have server sources. Please help!
  20. Hy, guys! When I install my mod with OptiFine my mods textures are go bad! The texture indexes stay only the texture file goes to the default terrain.png and /gui/items.png. Link for my mod: http://www.minecraftforum.net/topic/1435190-132-netherlive-mod/ Please help!
  21. Many thanks gudenau!!! Thanks, it's work!!!
  22. Hy all!!! I got an error, when I install MC Forge 4.0.0.200 for MCP 7.2. The error code (in the consol of install.cmd) I know forge says modified server jar, but I download this from minecraft.net and I don't modified. I did this: Please help me!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.