Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

wiffington

Members
  • Joined

  • Last visited

Everything posted by wiffington

  1. I am going to finish this mod first. This version has the most tutorials so I am using it to get the hang of modding then I will switch. It really doesn't make any sense that forge would discontinue 1.7.10... I am sorry I am still stuck in the past but I have only played 1.7.10 and earlier and I have never ever played on any version above it.
  2. wiffington posted a topic in Modder Support
    I made a model that takes up a 3x3 area now i am trying to code the part that when 1 of the blocks is broken they all break. When I try to code my breakBlock method it gets all screwy. The method is being called when I place the item and i have no idea why? GagBlock class package com.wiffington.pizzeria.blocks; import com.wiffington.pizzeria.Main; import com.wiffington.pizzeria.tileentity.TileEntityGag; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityPiston; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockGag extends BlockContainer{ public BlockGag() { super(Material.rock); this.setBlockName("blockGag"); this.setHardness(3.5F); this.setCreativeTab(Main.tabPizza); } @Override public void breakBlock(World world, int i, int j, int k, Block block, int par6) { if (block == Main.blockGag) { if (!(world.isRemote)) { TileEntityGag tileEntity = (TileEntityGag) world.getTileEntity(i, j, k); if (tileEntity != null) { for (int height = 0; height < 3; height++) { for (int row = 0; row < 3; row++) { for (int col = 0; col < 3; col++) { System.out.println("this is being called"); /* super.breakBlock(world, tileEntity.primary_x + 1 - row, tileEntity.primary_y + 3 - height, tileEntity.primary_z + 1 - col, block, par6); world.removeTileEntity(tileEntity.primary_x + 1 - row, tileEntity.primary_y + 3 - height, tileEntity.primary_z + 1 - col); world.setBlockToAir(tileEntity.primary_x + 1 - row, tileEntity.primary_y + 3 - height, tileEntity.primary_z + 1 - col); */ } } } } } } } @Override public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l){ return false; } @Override public boolean isOpaqueCube(){ return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityGag(); } } The Item placer class package com.wiffington.pizzeria.items; import com.wiffington.pizzeria.Main; import com.wiffington.pizzeria.tileentity.TileEntityGag; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraft.util.MathHelper; public class ItemTest extends Item { public ItemTest(){ this.setCreativeTab(Main.tabPizza); } // Called when a player right-clicks with this item in his hand @Override public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffSet) { boolean canPlace = true; if (!world.isRemote) { //this is checking the 3x3 area around where you clicked to see if you can place the oven for (int height = 0; height < 3; height++) { for (int row = 0; row < 3; row++) { for (int col = 0; col < 3; col++) { if (!world.isAirBlock(x + 1 - row, y + 3 - height, z + 1 - col)) { canPlace = false; } } } } if (canPlace) { //this is where it is setting the gag blocks and storing where the center cords are. for (int height = 0; height < 3; height++) { for (int row = 0; row < 3; row++) { for (int col = 0; col < 3; col++) { world.setBlock(x, y + 1, z, Main.blockPizzaOven); world.setBlock(x+1, y + 1, z+1, Main.blockGag); if (!(height == 2 && row == 0 && col == 0)) { world.setBlock(x + 1 - row, y + 3 - height, z + 1 - col, Main.blockGag); TileEntityGag tileEntity = (TileEntityGag) world.getTileEntity(x + 1 - row, y + 3 - height, z + 1 - col); if (tileEntity != null) { tileEntity.primary_x = x; tileEntity.primary_y = y + 1; tileEntity.primary_z = z; } } } } } return true; } return false; } return false; } }
  3. LOL Thanks you are a savior.
  4. Here ya go. package com.wiffington.pizzeria.gui; import org.lwjgl.opengl.GL11; import com.wiffington.pizzeria.Main; import com.wiffington.pizzeria.container.ContainerGrinder; import com.wiffington.pizzeria.tileentity.TileEntityGrinder; import javafx.scene.paint.Color; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; public class GuiGrinder extends GuiContainer{ public static final ResourceLocation bground = new ResourceLocation(Main.MODID + ":"+"textures/gui/guiGrinder.png"); public TileEntityGrinder grinder; public GuiGrinder(InventoryPlayer inventoryPlayer,TileEntityGrinder entity) { super(new ContainerGrinder(inventoryPlayer, entity)); this.grinder = entity; //size of gui this.xSize = 176; this.ySize = 166; } public void drawGuiConatinerForegroundLayer(int par1, int par2){ //This gets the name so when we open the gui it says Grinder String name = "Grinder"; //sets where it says Grinder this.fontRendererObj.drawString(name,80, 6, 4210752); //sets where it says Inventory this.fontRendererObj.drawString("Inventory", 128, this.ySize - 96 + 2, 4210752); } @Override protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { GL11.glColor4f(1F, 1F, 1F, 1F); Minecraft.getMinecraft().getTextureManager().bindTexture(bground); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; if(this.grinder.isPowered()){ int k1 = this.grinder.getCookProgressScaled(24); System.out.println(k1); drawTexturedModalRect(guiLeft+79, guiTop+21, 176, 0, k1+1, 29); } } }
  5. I am using this to draw a string onto my GUI but it does not show up. public void drawGuiConatinerForegroundLayer(int par1, int par2){ //This gets the name so when we open the gui it says Grinder String name = "Grinder"; //sets where it says Grinder this.fontRendererObj.drawString(name,80, 6, 4210752); //sets where it says Inventory this.fontRendererObj.drawString("Inventory", 128, this.ySize - 96 + 2, 4210752); }
  6. Thank you for that hint! I see what i did, lol and it now works! But why would it never crash if the value I was adding was 1? And if others want to know how i fixed it, i forgot to check if it was null in the for loop.
  7. It is not, I tried removing it but it still crashes sometimes with the same crash report.
  8. Hello! I have been working on spawning these flame particles and I have run into a problem... I want to spawn more of them so I am trying to do this by decreasing the value in the for loop but whenever I set it below 1 it sometimes crashes when they spawn in. When the .5 is 1 there is no crash and when its lower it sometimes crashes. @Override @SideOnly(Side.CLIENT) public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ MovingObjectPosition objectMouseOver = player.rayTrace(5, 1); if(objectMouseOver != null) { for(double x = 5D;x>0D;x = x-.5){ world.spawnParticle("flame", objectMouseOver.blockX+(Math.random()), (objectMouseOver.blockY+.75D)+(Math.random()), objectMouseOver.blockZ+(Math.random()), 0.0D, 0.0D, 0.0D); System.out.println(x); objectMouseOver = player.rayTrace(x, 1); } } return stack; } Crash Report

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.