Failender
Forge Modder-
Posts
1091 -
Joined
-
Last visited
Everything posted by Failender
-
oooor you could replace the stews instead of the melons, because there is no reason the replace the behaviour of the melon. you want to change the behavior of the stews, and tell them where to put melons
-
get the stack in slot 0 from the furnace, then get the amount of items in that stack
-
Thank you, it is working now. Problem is that the texture seems to scale really strange. I created the button to be 16x16 pixel big, which is exactly the size of the texture I am using. Link to the graphic below http://www.directupload.net/file/d/4018/ima7zxlf_png.htm TexturedButton public class TexturedButton extends GuiButton{ protected ResourceLocation buttonTextures; public TexturedButton(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText, String texture) { super(buttonId, x, y, widthIn, heightIn, buttonText); buttonTextures= new ResourceLocation("basewars:textures/gui/"+texture+".png"); } @Override public void drawButton(Minecraft mc, int mouseX, int mouseY) { if (this.visible) { FontRenderer fontrenderer = mc.fontRendererObj; mc.getTextureManager().bindTexture(buttonTextures); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; int k = this.getHoverState(this.hovered); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); GlStateManager.blendFunc(770, 771); this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height); this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height); this.mouseDragged(mc, mouseX, mouseY); int l = 14737632; if (packedFGColour != 0) { l = packedFGColour; } else if (!this.enabled) { l = 10526880; } else if (this.hovered) { l = 16777120; } } } }
-
I am triing to create a custom GuiButton, so I created a new class overwrote GuiButton and changed the drawButton method. Problem is that I dont know how to create a ResourceLocation that is leading into the right package. I want to deposit my texture in the assets.basewars.textures.gui (e.g. assets.basewars.textures.gui.furnace) Sadly this isnt working new ResourceLocation("basewars:gui/"+texture); Anyone here who knows? Greetz Fail
-
[1.7.2] Teleport the player to precise coordinates
Failender replied to laserflip's topic in Modder Support
You could add three Textfields to unter coordinates and a confirm button. After pressing The confirm button send a package with The coordinates to The Server which will handle The teleport -
[1.7.10][SOLVED]Healing Entities via code?
Failender replied to BuddingDev's topic in Modder Support
Be aware that your code will crash a Server. The class Minecraft is non existant on a server -
1.8 Game crashes after I tried to add a block
Failender replied to Kingz101's topic in Modder Support
well. it seems like your mod is searching ur proxy in Kingz.CDM.proxy.ClientProxy. but it seems like ur proxy is in the package called "proxy". cant work that way. -
[1.7.10][SOLVED]Healing Entities via code?
Failender replied to BuddingDev's topic in Modder Support
show your code please. we cant tell you the problem without any further informations -
[1.8] Editing day lenght - can it be unsafe? (+question)
Failender replied to Ernio's topic in Modder Support
The Best way i could imagine would be to use a tick Handler, count a variable, if the variable is!=3 Set the worldtime to time-1. If the variable is 3 reset it and Do nothing. That way your mod should be compatible and the daytime gets three times longer. This is just an idea so it might not work, I havent testesd it -
I feel to dumb to ask this, but I cant see a crash in your log
-
show the crash and use code tags please
-
Also please use subjects that tell people what you want.
-
download it, extract it, gradle it and throw your old code inside the src
-
well then still use the method, but make a switch with the actual metadata
-
Just create your own block? There was a method that is called everytime an entity is standing above ur block, I am nhot sure which it was.. Override that
-
Lightning striking entity [1.7.10]
Failender replied to BoonieQuafter-CrAfTeR's topic in Modder Support
I am not sure, but setting event.ammount might work -
[1.8] Check if a block gets hit by rain/has sun light
Failender replied to Kander16's topic in Modder Support
Block.canBlockSeeSky(BlockPos pos) sometimes eclipse can give u a lot of informations, you just need to look for them.. -
If you want to create lots of items/blocks you should think about writing/using a JSON generator
-
[1.8]Best way to build structures step by step
Failender replied to Failender's topic in Modder Support
Well separating lines with a scanner is also kinda easy, since you can just read each line, proceed it and read the next line. But if you recommend the BufferedReader for performance reasons I guess I'll be using that one. I aready worked with both, but might take a peak at your code, thank you sir! -
[1.8]Best way to build structures step by step
Failender replied to Failender's topic in Modder Support
So create a textFile throw it into the resources location and use a scanner to read it, right? -
Lightning striking entity [1.7.10]
Failender replied to BoonieQuafter-CrAfTeR's topic in Modder Support
Gettting the block under an entity is simple math.. Take The actual Position of the entity and go down until you find an entity To increase The dmg of a lightning Bild use entityHurt -
[1.8][SOLVED]Crash when handling packets
Failender replied to The_Fireplace's topic in Modder Support
Thats exactly the error, I just looked through the preInit Also dont Do if(event.getSide().isClient()){ registerItemRenders(); } Please. Use proxies thats what they are made for. -
Hey guys, I want to have a structure that will be building itself step by step, using tickRandomly from the block class. That means I want to have one base block which will be placed down that will be building a whole base. My question right now is what would be the best way to store the information of how to build the building? Use a static final array of IBlockstates which would be called via index? Use a method in which I would use a switch case to find out which block to set right now? Or save the blocks via numbers (cobble 0 glass 1 ... ) and save the structure as numbers and translate these into the fitting IBlockstates Greetz Fail
-
Oh man thank you very much. missed the return there.............
-
Hey everyone, I am working on a Block with a guicontainer and it seems that it wont open, guess I am missing something the GuiHandler is registered in the init method NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); The block that should open the gui public class Base extends BlockContainer{ public Base( ) { super(Material.iron); setCreativeTab(CreativeTabs.tabFood); } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { // TODO Auto-generated method stub return new TileEntityBase(); } @Override public int getRenderType() { return 3; } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if(!worldIn.isRemote) { System.out.println("call"); playerIn.openGui(BaseWars.instance, BaseWars.BASEGUIID, worldIn, pos.getX(), pos.getY(), pos.getZ()); } return true; } } Heres the handler public class GuiHandler implements IGuiHandler{ @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { case BaseWars.BASEGUIID: new ContainerBase(player.inventory, (TileEntityBase) world.getTileEntity(new BlockPos(x,y,z))); default: return null; } } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { case BaseWars.BASEGUIID: return new GuiBase(new ContainerBase(player.inventory, (TileEntityBase) world.getTileEntity(new BlockPos(x,y,z)))); default: return null; } } } the GUI public class GuiBase extends GuiContainer{ private final ResourceLocation background = new ResourceLocation("basewars:textures/gui/base.png"); public GuiBase(Container container) { super(container); } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { mc.renderEngine.bindTexture(background); int k = (this.width - this.xSize) /2 ; int l = (this.width - this.xSize) /2 ; drawTexturedModalRect(k, l, 0, 0, xSize, ySize); } } and the (not finished) container public class ContainerBase extends Container{ @Override public boolean canInteractWith(EntityPlayer playerIn) { // TODO Auto-generated method stub return true; } public ContainerBase(IInventory playerInv, TileEntityBase base) { int i= -18; for (int j = 0; j < 3; ++j){ for (int k = 0; k < 9; ++k) { this.addSlotToContainer(new Slot(playerInv, k + j * 9 + 9, 8 + k * 18, 102 + j * 18 + i)); } } for (int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(playerInv, j, 8 + j * 18, 160 + i)); } } }