Jump to content

[1.11.2] Crash when trying to open my custom gui. [Solved]


Recommended Posts

Posted

Hi I have created a custom furnace but when i try to open the gui i get this crash here is my code.

---- Minecraft Crash Report ----
// This doesn't make any sense!

Time: 1/11/17 8:58 PM
Description: Ticking player

java.lang.NullPointerException: Ticking player
at net.minecraft.item.ItemStack.areItemStacksEqual(ItemStack.java:442)
at net.minecraft.inventory.Container.detectAndSendChanges(Container.java:89)
at com.github.tompinn23.tprocessing.gui.ContainerTFurnace.detectAndSendChanges(ContainerTFurnace.java:162)
at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:318)
at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2108)
at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:875)
at net.minecraft.world.World.updateEntity(World.java:2075)
at net.minecraft.world.WorldServer.tickPlayers(WorldServer.java:676)
at net.minecraft.world.World.updateEntities(World.java:1864)
at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:647)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:794)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:698)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:547)
at java.lang.Thread.run(Thread.java:745)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Server thread
Stacktrace:
at net.minecraft.item.ItemStack.areItemStacksEqual(ItemStack.java:442)
at net.minecraft.inventory.Container.detectAndSendChanges(Container.java:89)
at com.github.tompinn23.tprocessing.gui.ContainerTFurnace.detectAndSendChanges(ContainerTFurnace.java:162)
at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:318)
at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2108)
at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:875)
at net.minecraft.world.World.updateEntity(World.java:2075)

-- Player being ticked --
Details:
Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
Entity ID: 71
Entity Name: Player76
Entity's Exact location: 1173.95, 4.00, -1346.13
Entity's Block location: World: (1173,4,-1347), Chunk: (at 5,0,13 in 73,-85; contains blocks 1168,0,-1360 to 1183,255,-1345), Region: (2,-3; contains chunks 64,-96 to 95,-65, blocks 1024,0,-1536 to 1535,255,-1025)
Entity's Momentum: 0.00, -0.08, 0.00
Entity's Passengers: []
Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Stacktrace:
at net.minecraft.world.WorldServer.tickPlayers(WorldServer.java:676)
at net.minecraft.world.World.updateEntities(World.java:1864)
at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:647)

-- Affected level --
Details:
Level name: New World
All players: 1 total; [EntityPlayerMP['Player76'/71, l='New World', x=1173.95, y=4.00, z=-1346.13]]
Chunk stats: ServerChunkCache: 657 Drop: 0
Level seed: -4789802384015756941
Level generator: ID 01 - flat, ver 0. Features enabled: true
Level generator options: 
Level spawn location: World: (1179,4,-1250), Chunk: (at 11,0,14 in 73,-79; contains blocks 1168,0,-1264 to 1183,255,-1249), Region: (2,-3; contains chunks 64,-96 to 95,-65, blocks 1024,0,-1536 to 1535,255,-1025)
Level time: 31784 game time, 3208 day time
Level dimension: 0
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 54992 (now: false), thunder time: 9323 (now: true)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
Stacktrace:
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:794)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:698)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:547)
at java.lang.Thread.run(Thread.java:745)

-- System Details --
Details:
Minecraft Version: 1.11.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_111, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 1007328424 bytes (960 MB) / 1339031552 bytes (1277 MB) up to 2856321024 bytes (2724 MB)
JVM Flags: 0 total; 
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP 9.38 Powered by Forge 13.20.0.2206 5 mods loaded, 5 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJAAAA	minecraft{1.11.2} [Minecraft] (minecraft.jar) 
UCHIJAAAA	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
UCHIJAAAA	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.0.2206.jar) 
UCHIJAAAA	forge{13.20.0.2206} [Minecraft Forge] (forgeSrc-1.11.2-13.20.0.2206.jar) 
UCHIJAAAA	tprocessing{1.0.0} [T's Processing] (Modding) 
Loaded coremods (and transformers): 
GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
Profiler Position: N/A (disabled)
Player Count: 1 / 8; [EntityPlayerMP['Player76'/71, l='New World', x=1173.95, y=4.00, z=-1346.13]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'

 

ContainerTFurnace

package com.github.tompinn23.tprocessing.gui;

import com.github.tompinn23.tprocessing.block.TileEntityTFurnace;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.*;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
* Created by Tom Pinnock on 11/01/2017.
*/
public class ContainerTFurnace extends Container {

    // Stores the tile entity instance for later use
    private TileEntityTFurnace tileEntityTFurnace;

    // These store cache values, used by the server to only update the client side tile entity when values have changed
    private int [] cachedFields;

    // must assign a slot index to each of the slots used by the GUI.
    // For this container, we can see the furnace fuel, input, and output slots as well as the player inventory slots and the hotbar.
    // Each time we add a Slot to the container using addSlotToContainer(), it automatically increases the slotIndex, which means
    //  0 - 8 = hotbar slots (which will map to the InventoryPlayer slot numbers 0 - 
    //  9 - 35 = player inventory slots (which map to the InventoryPlayer slot numbers 9 - 35)
    //  36 - 37 = fuel slots (tileEntity 0 - 1)
    //  37 - 38 = input slots (tileEntity 1 - 2)
    //  38 - 39 = output slots (tileEntity 2 - 3)

    private final int HOTBAR_SLOT_COUNT = 9;
    private final int PLAYER_INVENTORY_ROW_COUNT = 3;
    private final int PLAYER_INVENTORY_COLUMN_COUNT = 3;
    private final int PLAYER_INVENTORY_SLOT_COUNT = PLAYER_INVENTORY_COLUMN_COUNT * PLAYER_INVENTORY_ROW_COUNT;
    private final int VANILLA_SLOT_COUNT = HOTBAR_SLOT_COUNT + PLAYER_INVENTORY_SLOT_COUNT;

    public final int FUEL_SLOTS_COUNT = 1;
    public final int INPUT_SLOTS_COUNT = 1;
    public final int OUTPUT_SLOTS_COUNT = 1;
    public final int FURNACE_SLOTS_COUNT = 3;

    // slot index is the unique index for all slots in this container i.e. 0 - 35 for invPlayer then 36 - 39 for tileEntityTFurnace
    private final int VANILLA_FIRST_SLOT_INDEX = 0;
    private final int FIRST_FUEL_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT;
    private final int FIRST_INPUT_SLOT_INDEX = FIRST_FUEL_SLOT_INDEX + FUEL_SLOTS_COUNT;
    private final int FIRST_OUTPUT_SLOT_INDEX = FIRST_INPUT_SLOT_INDEX + INPUT_SLOTS_COUNT;

    // slot number is the slot number within each component; i.e. invPlayer slots 0 - 35, and tileEntityTFurnace slots 0 - 14
    private final int FIRST_FUEL_SLOT_NUMBER = 0;
    private final int FIRST_INPUT_SLOT_NUMBER =1;
    private final int FIRST_OUTPUT_SLOT_NUMBER = 2;

    public ContainerTFurnace(InventoryPlayer inventory, TileEntityTFurnace tileEntityTFurnace) {
        this.tileEntityTFurnace = tileEntityTFurnace;

        final int SLOT_X_SPACING = 18;
        final int SLOT_Y_SPACING = 18;
        final int HOTBAR_XPOS = 8;
        final int HOTBAR_YPOS = 142;

        // Add the players hotbar to the gui - the [xpos, ypos] location of each item
        for (int x = 0; x < HOTBAR_SLOT_COUNT; x++) {
            int slotNumber = x;
            addSlotToContainer(new Slot(inventory, slotNumber, HOTBAR_XPOS + SLOT_X_SPACING * x, HOTBAR_YPOS));
        }

        final int PLAYER_INVENTORY_XPOS = 8;
        final int PLAYER_INVENTORY_YPOS = 84;
        // Add the rest of the players inventory to the gui
        for (int y = 0; y < PLAYER_INVENTORY_ROW_COUNT; y++) {
            for (int x = 0; x < PLAYER_INVENTORY_COLUMN_COUNT; x++) {
                int slotNumber = HOTBAR_SLOT_COUNT + y * PLAYER_INVENTORY_COLUMN_COUNT + x;
                int xpos = PLAYER_INVENTORY_XPOS + x * SLOT_X_SPACING;
                int ypos = PLAYER_INVENTORY_YPOS + y * SLOT_Y_SPACING;
                addSlotToContainer(new Slot(inventory, slotNumber,  xpos, ypos));
            }
        }

        final int FUEL_SLOTS_XPOS = 56;
        final int FUEL_SLOTS_YPOS = 53;
        // Add the tile fuel slots
        addSlotToContainer(new SlotFuel(tileEntityTFurnace, 0, FUEL_SLOTS_XPOS, FUEL_SLOTS_YPOS));


        final int INPUT_SLOTS_XPOS = 56;
        final int INPUT_SLOTS_YPOS = 17;
        // Add the tile input slots
        addSlotToContainer(new SlotSmeltableInput(tileEntityTFurnace, 1, INPUT_SLOTS_XPOS, INPUT_SLOTS_YPOS));

        final int OUTPUT_SLOTS_XPOS = 134;
        final int OUTPUT_SLOTS_YPOS = 24;
        // Add the tile output slots
        addSlotToContainer(new SlotOutput(tileEntityTFurnace, 2, OUTPUT_SLOTS_XPOS, OUTPUT_SLOTS_YPOS));
        System.out.println(super.inventorySlots.size());
        System.out.println(tileEntityTFurnace.getSizeInventory());
    }

    @Override
    public boolean canInteractWith(EntityPlayer playerIn) {
        return tileEntityTFurnace.isUseableByPlayer(playerIn);
    }

    @Override
    public ItemStack transferStackInSlot(EntityPlayer player, int sourceSlotIndex)
    {
        Slot sourceSlot = (Slot)inventorySlots.get(sourceSlotIndex);
        if (sourceSlot == null || !sourceSlot.getHasStack()) return null;
        ItemStack sourceStack = sourceSlot.getStack();
        ItemStack copyOfSourceStack = sourceStack.copy();

        // Check if the slot clicked is one of the vanilla container slots
        if (sourceSlotIndex >= VANILLA_FIRST_SLOT_INDEX && sourceSlotIndex < VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT) {
            // This is a vanilla container slot so merge the stack into one of the furnace slots
            // If the stack is smeltable try to merge merge the stack into the input slots
            if(TileEntityTFurnace.getSmeltingResultForItem(sourceStack) != null){
                if (!mergeItemStack(sourceStack, FIRST_INPUT_SLOT_INDEX, FIRST_INPUT_SLOT_INDEX + INPUT_SLOTS_COUNT, false)){
                    return null;
                }
            }	else if(TileEntityTFurnace.getItemBurnTime(sourceStack) > 0) {
                if (!mergeItemStack(sourceStack, FIRST_FUEL_SLOT_INDEX, FIRST_FUEL_SLOT_INDEX + FUEL_SLOTS_COUNT, true)) {
                    // Setting the boolean to true places the stack in the bottom slot first
                    return null;
                }
            }	else {
                return null;
            }
        } else if (sourceSlotIndex >= FIRST_FUEL_SLOT_INDEX && sourceSlotIndex < FIRST_FUEL_SLOT_INDEX + FURNACE_SLOTS_COUNT) {
            // This is a furnace slot so merge the stack into the players inventory: try the hotbar first and then the main inventory
            //   because the main inventory slots are immediately after the hotbar slots, we can just merge with a single call
            if (!mergeItemStack(sourceStack, VANILLA_FIRST_SLOT_INDEX, VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT, false)) {
                return null;
            }
        } else {
            System.err.print("Invalid slotIndex:" + sourceSlotIndex);
            return null;
        }

        // If stack size == 0 (the entire stack was moved) set slot contents to null
        if (sourceStack.getCount() == 0) {
            sourceSlot.putStack(null);
        } else {
            sourceSlot.onSlotChanged();
        }

        sourceSlot.onTake(player, sourceStack);
        return copyOfSourceStack;
    }

    /* Client Synchronization */

    // This is where you check if any values have changed and if so send an update to any clients accessing this container
    // The container itemstacks are tested in Container.detectAndSendChanges, so we don't need to do that
    // We iterate through all of the TileEntity Fields to find any which have changed, and send them.
    // You don't have to use fields if you don't wish to; just manually match the ID in sendProgressBarUpdate with the value in
    //   updateProgressBar()
    // The progress bar values are restricted to shorts.  If you have a larger value (eg int), it's not a good idea to try and split it
    //   up into two shorts because the progress bar values are sent independently, and unless you add synchronisation logic at the
    //   receiving side, your int value will be wrong until the second short arrives.  Use a custom packet instead.
    @Override
    public void detectAndSendChanges() {
        super.detectAndSendChanges();

        boolean allFieldsHaveChanged = false;
        boolean fieldHasChanged [] = new boolean[tileEntityTFurnace.getFieldCount()];
        if (cachedFields == null) {
            cachedFields = new int[tileEntityTFurnace.getFieldCount()];
            allFieldsHaveChanged = true;
        }
        for (int i = 0; i < cachedFields.length; ++i) {
            if (allFieldsHaveChanged || cachedFields[i] != tileEntityTFurnace.getField(i)) {
                cachedFields[i] = tileEntityTFurnace.getField(i);
                fieldHasChanged[i] = true;
            }
        }

        // go through the list of listeners (players using this container) and update them if necessary
        for (IContainerListener listener : this.listeners) {
            for (int fieldID = 0; fieldID < tileEntityTFurnace.getFieldCount(); ++fieldID) {
                if (fieldHasChanged[fieldID]) {
                    // Note that although sendProgressBarUpdate takes 2 ints on a server these are truncated to shorts
                    listener.sendProgressBarUpdate(this, fieldID, cachedFields[fieldID]);
                }
            }
        }
    }

    // Called when a progress bar update is received from the server. The two values (id and data) are the same two
    // values given to sendProgressBarUpdate.  In this case we are using fields so we just pass them to the tileEntity.
    @SideOnly(Side.CLIENT)
    @Override
    public void updateProgressBar(int id, int data) {
        tileEntityTFurnace.setField(id, data);
    }

    // SlotFuel is a slot for fuel items
    public class SlotFuel extends Slot {
        public SlotFuel(IInventory inventoryIn, int index, int xPosition, int yPosition) {
            super(inventoryIn, index, xPosition, yPosition);
        }

        // if this function returns false, the player won't be able to insert the given item into this slot
        @Override
        public boolean isItemValid(ItemStack stack) {
            return tileEntityTFurnace.isItemValidForFuelSlot(stack);
        }
    }

    // SlotSmeltableInput is a slot for input items
    public class SlotSmeltableInput extends Slot {
        public SlotSmeltableInput(IInventory inventoryIn, int index, int xPosition, int yPosition) {
            super(inventoryIn, index, xPosition, yPosition);
        }

        // if this function returns false, the player won't be able to insert the given item into this slot
        @Override
        public boolean isItemValid(ItemStack stack) {
            return tileEntityTFurnace.isItemValidForInputSlot(stack);
        }
    }

    // SlotOutput is a slot that will not accept any items
    public class SlotOutput extends Slot {
        public SlotOutput(IInventory inventoryIn, int index, int xPosition, int yPosition) {
            super(inventoryIn, index, xPosition, yPosition);
        }

        // if this function returns false, the player won't be able to insert the given item into this slot
        @Override
        public boolean isItemValid(ItemStack stack) {
            return tileEntityTFurnace.isItemValidForOutputSlot(stack);
        }
    }
}

 

GuiTFurnace

package com.github.tompinn23.tprocessing.gui;

import com.github.tompinn23.tprocessing.block.TileEntityTFurnace;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import java.awt.*;
import java.util.ArrayList;
import java.util.List;

/**
* Created by Tom Pinnock on 11/01/2017.
*/
@SideOnly(Side.CLIENT)
public class GuiTFurnace extends GuiContainer{

    private static final ResourceLocation texture = new ResourceLocation("tprocessing", "textures/gui/tfurnace.png");
    private final TileEntityTFurnace tileEntity;

    public GuiTFurnace(InventoryPlayer inventory, TileEntityTFurnace tileEntityTFurnace) {
        super(new ContainerTFurnace(inventory, tileEntityTFurnace));

        // Set the width and height of the gui
        xSize = 176;
        ySize = 166;

        this.tileEntity = tileEntityTFurnace;
    }

    // some [x,y] coordinates of graphical elements
    final int COOK_BAR_XPOS = 79;
    final int COOK_BAR_YPOS = 35;
    final int COOK_BAR_ICON_U = 176;   // texture position of white arrow icon
    final int COOK_BAR_ICON_V = 14;
    final int COOK_BAR_WIDTH = 24;
    final int COOK_BAR_HEIGHT = 17;

    final int FLAME_XPOS = 57;
    final int FLAME_YPOS = 37;
    final int FLAME_ICON_U = 176;   // texture position of flame icon
    final int FLAME_ICON_V = 0;
    final int FLAME_WIDTH = 14;
    final int FLAME_HEIGHT = 14;



    @Override
    protected void drawGuiContainerBackgroundLayer(float partialTicks, int x, int y) {
        // Bind the image texture
        Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
        // Draw the image
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);

        // get cook progress as a double between 0 and 1
        double cookProgress = tileEntity.fractionOfCookTimeComplete();
        // draw the cook progress bar
        drawTexturedModalRect(guiLeft + COOK_BAR_XPOS, guiTop + COOK_BAR_YPOS, COOK_BAR_ICON_U, COOK_BAR_ICON_V,
                (int)(cookProgress * COOK_BAR_WIDTH), COOK_BAR_HEIGHT);

        // draw the burn remaining
            double burnRemaining = tileEntity.fractionOfFuelRemaining();
            int yOffset = (int)((1.0 - burnRemaining) * FLAME_HEIGHT);
            drawTexturedModalRect(guiLeft + FLAME_XPOS , guiTop + FLAME_YPOS + yOffset,
                    FLAME_ICON_U, FLAME_ICON_V + yOffset, FLAME_WIDTH, FLAME_HEIGHT - yOffset);
        }

    @Override
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        super.drawGuiContainerForegroundLayer(mouseX, mouseY);

        final int LABEL_XPOS = 5;
        final int LABEL_YPOS = 5;
        fontRendererObj.drawString(tileEntity.getDisplayName().getUnformattedText(), LABEL_XPOS, LABEL_YPOS, Color.darkGray.getRGB());

        List<String> hoveringText = new ArrayList<String>();

        // If the mouse is over the progress bar add the progress bar hovering text
        if (isInRect(guiLeft + COOK_BAR_XPOS, guiTop + COOK_BAR_YPOS, COOK_BAR_WIDTH, COOK_BAR_HEIGHT, mouseX, mouseY)){
            hoveringText.add("Progress:");
            int cookPercentage =(int)(tileEntity.fractionOfCookTimeComplete() * 100);
            hoveringText.add(cookPercentage + "%");
        }

        // If the mouse is over one of the burn time indicator add the burn time indicator hovering text

            if (isInRect(guiLeft + FLAME_XPOS , guiTop + FLAME_YPOS, FLAME_WIDTH, FLAME_HEIGHT, mouseX, mouseY)) {
                hoveringText.add("Fuel Time:");
                hoveringText.add(tileEntity.secondsOfFuelRemaining() + "s");
            }
        // If hoveringText is not empty draw the hovering text
        if (!hoveringText.isEmpty()){
            drawHoveringText(hoveringText, mouseX - guiLeft, mouseY - guiTop, fontRendererObj);
        }
//		// You must re bind the texture and reset the colour if you still need to use it after drawing a string
//		Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
//		GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

    }

    // Returns true if the given x,y coordinates are within the given rectangle
    public static boolean isInRect(int x, int y, int xSize, int ySize, int mouseX, int mouseY){
        return ((mouseX >= x && mouseX <= x+xSize) && (mouseY >= y && mouseY <= y+ySize));
    }
}

 

BlockTFurnace

package com.github.tompinn23.tprocessing.block;

import com.github.tompinn23.tprocessing.TProcessing;
import com.github.tompinn23.tprocessing.gui.TGuiHandler;
import com.github.tompinn23.tprocessing.item.ItemModelProvider;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.stats.StatList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

/**
* Created by Tom Pinnock on 09/01/2017.
*/
public class BlockTFurnace extends BlockContainer implements ItemModelProvider {

    public static final PropertyDirection FACING = BlockHorizontal.FACING;

    public BlockTFurnace() {
        super(Material.ROCK);
        this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));

        setUnlocalizedName("t_furnace");
        setRegistryName("t_furnace");
        setCreativeTab(TProcessing.creativeTab);

    }

    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
    {
        if (worldIn.isRemote)
        {
            return true;
        }
        else
        {
            TileEntity tileentity = worldIn.getTileEntity(pos);

            if (tileentity instanceof TileEntityTFurnace)
            {
                playerIn.openGui(TProcessing.instance, TGuiHandler.getGuiID(), worldIn, pos.getX(), pos.getY(), pos.getZ());
                playerIn.addStat(StatList.FURNACE_INTERACTION);
                return true;
            }

            return true;
        }
    }


    @Override
    public EnumBlockRenderType getRenderType(IBlockState state)
    {
        return EnumBlockRenderType.MODEL;
    }

    private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state)
    {
        if (!worldIn.isRemote)
        {
            IBlockState iblockstate = worldIn.getBlockState(pos.north());
            IBlockState iblockstate1 = worldIn.getBlockState(pos.south());
            IBlockState iblockstate2 = worldIn.getBlockState(pos.west());
            IBlockState iblockstate3 = worldIn.getBlockState(pos.east());
            EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);

            if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock())
            {
                enumfacing = EnumFacing.SOUTH;
            }
            else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock())
            {
                enumfacing = EnumFacing.NORTH;
            }
            else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock())
            {
                enumfacing = EnumFacing.EAST;
            }
            else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock())
            {
                enumfacing = EnumFacing.WEST;
            }

            worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
        }
    }
    @Override
    @SuppressWarnings("deprecation")
    public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
    {
        return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
    }

    /**
     * Convert the given metadata into a BlockState for this Block
     */
    @Override
    @SuppressWarnings("deprecation")
    public IBlockState getStateFromMeta(int meta)
    {
        EnumFacing enumfacing = EnumFacing.getFront(meta);

        if (enumfacing.getAxis() == EnumFacing.Axis.Y)
        {
            enumfacing = EnumFacing.NORTH;
        }

        return this.getDefaultState().withProperty(FACING, enumfacing);
    }

    /**
     * Convert the BlockState into the correct metadata value
     */
    @Override
    public int getMetaFromState(IBlockState state)
    {
        return ((EnumFacing)state.getValue(FACING)).getIndex();
    }

    /**
     * Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed
     * blockstate.
     */
    @Override
    @SuppressWarnings("deprecation")
    public IBlockState withRotation(IBlockState state, Rotation rot)
    {
        return state.withProperty(FACING, rot.rotate((EnumFacing)state.getValue(FACING)));
    }

    @Override
    protected BlockStateContainer createBlockState()
    {
        return new BlockStateContainer(this, new IProperty[] {FACING});
    }

    @Override
    public TileEntity createNewTileEntity(World worldIn, int meta) {
        return new TileEntityTFurnace();
    }

    @Override
    public void registerItemModel(Item item) {
        TProcessing.proxy.registerItemRenderer(item, 0, "t_furnace");
    }
}

 

TileEntityTFurnace

package com.github.tompinn23.tprocessing.block;

import com.github.tompinn23.tprocessing.ModItems;
import com.sun.istack.internal.Nullable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagInt;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;


import java.util.Arrays;

/**
* Created by Tom Pinnock on 09/01/2017.
*/
public class TileEntityTFurnace extends TileEntity implements IInventory, ITickable {

    // Create and initialize the itemStacks variable that will store store the itemStacks
    public static final int FUEL_SLOTS_COUNT = 1;
    public static final int TOTAL_SLOTS_COUNT = 3;

    private ItemStack[] itemStacks = new ItemStack[TOTAL_SLOTS_COUNT];

    /** The number of burn ticks remaining on the current piece of fuel */
    private int burnTimeRemaining;
    /** The initial fuel value of the currently burning fuel (in ticks of burn duration) */
    private int burnTimeInitialValue;

    /**The number of ticks the current item has been cooking*/
    private short cookTime;
    /**The number of ticks required to cook an item*/
    private static final short COOK_TIME_FOR_COMPLETION = 200;  // vanilla value is 200 = 10 seconds

    private int cachedNumberOfBurningSlots = -1;

    /**
     * Returns the amount of fuel remaining on the currently burning item
     * @return fraction remaining, between 0 - 1
     */
    public double fractionOfFuelRemaining()
    {
        if (burnTimeInitialValue <= 0 ) return 0;
        double fraction = burnTimeRemaining / (double)burnTimeInitialValue;
        return MathHelper.clamp(fraction, 0.0, 1.0);
    }

    /**
     * return the remaining burn time of the fuel slot
     * @return seconds remaining
     */
    public int secondsOfFuelRemaining()
    {
        if (burnTimeRemaining <= 0 ) return 0;
        return burnTimeRemaining / 20; // 20 ticks per second
    }

    /**
     * Returns the amount of cook time completed on the currently cooking item.
     * @return fraction remaining, between 0 - 1
     */
    public double fractionOfCookTimeComplete()
    {
        double fraction = cookTime / (double)COOK_TIME_FOR_COMPLETION;
        return MathHelper.clamp(fraction, 0.0, 1.0);
    }


    // This method is called every tick to update the tile entity, i.e.
    // - see if the fuel has run out, and if so turn the furnace "off" and slowly uncook the current item (if any)
    // - see if any of the items have finished smelting
    // It runs both on the server and the client.
    @Override
    public void update() {
        // If there is nothing to smelt or there is no room in the output, reset cookTime and return
        if (canSmelt()) {
            int numberOfFuelBurning = burnFuel();

            // If fuel is available, keep cooking the item, otherwise start "uncooking" it at double speed
            if (numberOfFuelBurning > 0) {
                cookTime += numberOfFuelBurning;
            }	else {
                cookTime -= 2;
            }

            if (cookTime < 0) cookTime = 0;

            // If cookTime has reached maxCookTime smelt the item and reset cookTime
            if (cookTime >= COOK_TIME_FOR_COMPLETION) {
                smeltItem();
                cookTime = 0;
            }
        }	else {
            cookTime = 0;
        }
    }

    /**
     * 	for each fuel slot: decreases the burn time, checks if burnTimeRemaining = 0 and tries to consume a new piece of fuel if one is available
     * @return the number of fuel slots which are burning
     */
    private int burnFuel() {
        int burningCount = 0;
        boolean inventoryChanged = false;
            if (burnTimeRemaining > 0) {
                --burnTimeRemaining;
                ++burningCount;
            }
            if (burnTimeRemaining == 0) {
                if (itemStacks[0] != null && getItemBurnTime(itemStacks[0]) > 0) {
                    // If the stack in this slot is not null and is fuel, set burnTimeRemaining & burnTimeInitialValue to the
                    // item's burn time and decrease the stack size
                    burnTimeRemaining = burnTimeInitialValue = getItemBurnTime(itemStacks[0]);
                    int size = itemStacks[0].getCount();
                    --size;
                    itemStacks[0].setCount(size);
                    ++burningCount;
                    inventoryChanged = true;
                    // If the stack size now equals 0 set the slot contents to the items container item. This is for fuel
                    // items such as lava buckets so that the bucket is not consumed. If the item dose not have
                    // a container item getContainerItem returns null which sets the slot contents to null
                    if (itemStacks[0].getCount() == 0) {
                        itemStacks[0] = itemStacks[0].getItem().getContainerItem(itemStacks[0]);
                    }
                }
            }
        if (inventoryChanged) markDirty();
        return burningCount;
    }

    /**
     * Check if any of the input items are smeltable and there is sufficient space in the output slots
     * @return true if smelting is possible
     */
    private boolean canSmelt() {return smeltItem(false);}

    /**
     * Smelt an input item into an output slot, if possible
     */
    private void smeltItem() {smeltItem(true);}

    /**
     * checks that there is an item to be smelted in one of the input slots and that there is room for the result in the output slots
     * If desired, performs the smelt
     * @param performSmelt if true, perform the smelt.  if false, check whether smelting is possible, but don't change the inventory
     * @return false if no items can be smelted, true otherwise
     */
    private boolean smeltItem(boolean performSmelt)
    {
        Integer firstSuitableInputSlot = null;
        Integer firstSuitableOutputSlot = null;
        ItemStack result = null;

        // finds the first input slot which is smeltable and whose result fits into an output slot (stacking if possible)
            if (itemStacks[1] != null) {
                result = getSmeltingResultForItem(itemStacks[1]);
                if (result != null) {
                    // find the first suitable output slot- either empty, or with identical item that has enough space
                        ItemStack outputStack = itemStacks[2];
                        if (outputStack == null) {
                            firstSuitableInputSlot = 1;
                            firstSuitableOutputSlot = 2;
                        }

                        if (outputStack.getItem() == result.getItem() && (!outputStack.getHasSubtypes() || outputStack.getMetadata() == outputStack.getMetadata())
                                && ItemStack.areItemStackTagsEqual(outputStack, result)) {
                            int combinedSize = itemStacks[2].getCount() + result.getCount();
                            if (combinedSize <= getInventoryStackLimit() && combinedSize <= itemStacks[2].getMaxStackSize()) {
                                firstSuitableInputSlot = 1;
                                firstSuitableOutputSlot = 2;

                            }
                        }
                    }
                }



        if (firstSuitableInputSlot == null) return false;
        if (!performSmelt) return true;

        // alter input and output

        int size = itemStacks[firstSuitableInputSlot].getCount();
        --size;
        itemStacks[firstSuitableInputSlot].setCount(size);
        if (itemStacks[firstSuitableInputSlot].getCount() <=0) itemStacks[firstSuitableInputSlot] = null;
        if (itemStacks[firstSuitableOutputSlot] == null) {
            itemStacks[firstSuitableOutputSlot] = result.copy(); // Use deep .copy() to avoid altering the recipe
        } else {
            int osize = itemStacks[firstSuitableOutputSlot].getCount();
            osize += result.getCount();
            itemStacks[firstSuitableOutputSlot].setCount(osize);
        }
        markDirty();
        return true;
    }

    // returns the smelting result for the given stack. Returns null if the given stack can not be smelted
    public static ItemStack getSmeltingResultForItem(ItemStack stack) { return FurnaceRecipes.instance().getSmeltingResult(stack); }

    // returns the number of ticks the given item will burn. Returns 0 if the given item is not a valid fuel
    public static short getItemBurnTime(ItemStack stack)
    {
        int burntime = TileEntityFurnace.getItemBurnTime(stack);  // just use the vanilla values
        return (short)MathHelper.clamp(burntime, 0, Short.MAX_VALUE);
    }

    // Gets the number of slots in the inventory
    @Override
    public int getSizeInventory() {
        return itemStacks.length;
    }

    @Override
    public boolean isEmpty() {
        return false;
    }

    // Gets the stack in the given slot
    @Override
    public ItemStack getStackInSlot(int i) {
        return itemStacks[i];
    }

    /**
     * Removes some of the units from itemstack in the given slot, and returns as a separate itemstack
     * @param slotIndex the slot number to remove the items from
     * @param count the number of units to remove
     * @return a new itemstack containing the units removed from the slot
     */
    @Override
    public ItemStack decrStackSize(int slotIndex, int count) {
        ItemStack itemStackInSlot = getStackInSlot(slotIndex);
        if (itemStackInSlot == null) return null;

        ItemStack itemStackRemoved;
        if (itemStackInSlot.getCount() <= count) {
            itemStackRemoved = itemStackInSlot;
            setInventorySlotContents(slotIndex, null);
        } else {
            itemStackRemoved = itemStackInSlot.splitStack(count);
            if (itemStackInSlot.getCount() == 0) {
                setInventorySlotContents(slotIndex, null);
            }
        }
        markDirty();
        return itemStackRemoved;
    }

    // overwrites the stack in the given slotIndex with the given stack
    @Override
    public void setInventorySlotContents(int slotIndex, ItemStack itemstack) {
        itemStacks[slotIndex] = itemstack;
        if (itemstack != null && itemstack.getCount() > getInventoryStackLimit()) {
            itemstack.setCount(getInventoryStackLimit());
        }
        markDirty();
    }

    @Override
    public int getInventoryStackLimit() {
        return 64;
    }

    @Override
    public boolean isUsableByPlayer(EntityPlayer player) {
        return false;
    }

    // Return true if the given player is able to use this block. In this case it checks that
    // 1) the world tileentity hasn't been replaced in the meantime, and
    // 2) the player isn't too far away from the centre of the block
   public boolean isUseableByPlayer(EntityPlayer player) {
        if (this.world.getTileEntity(this.pos) != this) return false;
        final double X_CENTRE_OFFSET = 0.5;
        final double Y_CENTRE_OFFSET = 0.5;
        final double Z_CENTRE_OFFSET = 0.5;
        final double MAXIMUM_DISTANCE_SQ = 8.0 * 8.0;
        return player.getDistanceSq(pos.getX() + X_CENTRE_OFFSET, pos.getY() + Y_CENTRE_OFFSET, pos.getZ() + Z_CENTRE_OFFSET) < MAXIMUM_DISTANCE_SQ;
    }

    // Return true if the given stack is allowed to be inserted in the given slot
    // Unlike the vanilla furnace, we allow anything to be placed in the fuel slots
    static public boolean isItemValidForFuelSlot(ItemStack itemStack)
    {
        if (TileEntityFurnace.isItemFuel(itemStack) || itemStack.getItem() == ModItems.energyCoupler){
            return true;
        }
        else
        {
            return false;
        }
    }

    // Return true if the given stack is allowed to be inserted in the given slot
    // Unlike the vanilla furnace, we allow anything to be placed in the fuel slots
    static public boolean isItemValidForInputSlot(ItemStack itemStack)
    {
        return true;
    }

    // Return true if the given stack is allowed to be inserted in the given slot
    // Unlike the vanilla furnace, we allow anything to be placed in the fuel slots
    static public boolean isItemValidForOutputSlot(ItemStack itemStack)
    {
        return false;
    }

    // This is where you save any data that you don't want to lose when the tile entity unloads
    // In this case, it saves the state of the furnace (burn time etc) and the itemstacks stored in the fuel, input, and output slots
    @Override
    public NBTTagCompound writeToNBT(NBTTagCompound parentNBTTagCompound)
    {
        super.writeToNBT(parentNBTTagCompound); // The super call is required to save and load the tiles location

//		// Save the stored item stacks

        // to use an analogy with Java, this code generates an array of hashmaps
        // The itemStack in each slot is converted to an NBTTagCompound, which is effectively a hashmap of key->value pairs such
        //   as slot=1, id=2353, count=1, etc
        // Each of these NBTTagCompound are then inserted into NBTTagList, which is similar to an array.
        NBTTagList dataForAllSlots = new NBTTagList();
        for (int i = 0; i < this.itemStacks.length; ++i) {
            if (this.itemStacks[i] != null) {
                NBTTagCompound dataForThisSlot = new NBTTagCompound();
                dataForThisSlot.setByte("Slot", (byte) i);
                this.itemStacks[i].writeToNBT(dataForThisSlot);
                dataForAllSlots.appendTag(dataForThisSlot);
            }
        }
        // the array of hashmaps is then inserted into the parent hashmap for the container
        parentNBTTagCompound.setTag("Items", dataForAllSlots);

        // Save everything else
        parentNBTTagCompound.setShort("CookTime", cookTime);
        parentNBTTagCompound.setTag("burnTimeRemaining", new NBTTagInt(burnTimeRemaining));
        parentNBTTagCompound.setTag("burnTimeInitial", new NBTTagInt(burnTimeInitialValue));
        return parentNBTTagCompound;
    }

    // This is where you load the data that you saved in writeToNBT
    @Override
    public void readFromNBT(NBTTagCompound nbtTagCompound)
    {
        super.readFromNBT(nbtTagCompound); // The super call is required to save and load the tiles location
        final byte NBT_TYPE_COMPOUND = 10;       // See NBTBase.createNewByType() for a listing
        NBTTagList dataForAllSlots = nbtTagCompound.getTagList("Items", NBT_TYPE_COMPOUND);

        Arrays.fill(itemStacks, null);           // set all slots to empty
        for (int i = 0; i < dataForAllSlots.tagCount(); ++i) {
            NBTTagCompound dataForOneSlot = dataForAllSlots.getCompoundTagAt(i);
            byte slotNumber = dataForOneSlot.getByte("Slot");
            if (slotNumber >= 0 && slotNumber < this.itemStacks.length) {
                this.itemStacks[slotNumber] = new ItemStack(dataForOneSlot);
            }
        }

        // Load everything else.  Trim the arrays (or pad with 0) to make sure they have the correct number of elements
        cookTime = nbtTagCompound.getShort("CookTime");
        burnTimeRemaining = nbtTagCompound.getInteger("burnTimeRemaining");
        burnTimeInitialValue = nbtTagCompound.getInteger("burnTimeInitial");
        cachedNumberOfBurningSlots = -1;
    }

    //	// When the world loads from disk, the server needs to send the TileEntity information to the client
//	//  it uses getUpdatePacket(), getUpdateTag(), onDataPacket(), and handleUpdateTag() to do this
    @Override
    @Nullable
    public SPacketUpdateTileEntity getUpdatePacket()
    {
        NBTTagCompound updateTagDescribingTileEntityState = getUpdateTag();
        final int METADATA = 0;
        return new SPacketUpdateTileEntity(this.pos, METADATA, updateTagDescribingTileEntityState);
    }

    @Override
    public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
        NBTTagCompound updateTagDescribingTileEntityState = pkt.getNbtCompound();
        handleUpdateTag(updateTagDescribingTileEntityState);
    }

    /* Creates a tag containing the TileEntity information, used by vanilla to transmit from server to client
       Warning - although our getUpdatePacket() uses this method, vanilla also calls it directly, so don't remove it.
     */
    @Override
    public NBTTagCompound getUpdateTag()
    {
        NBTTagCompound nbtTagCompound = new NBTTagCompound();
        writeToNBT(nbtTagCompound);
        return nbtTagCompound;
    }

    /* Populates this TileEntity with information from the tag, used by vanilla to transmit from server to client
     Warning - although our onDataPacket() uses this method, vanilla also calls it directly, so don't remove it.
   */
    @Override
    public void handleUpdateTag(NBTTagCompound tag)
    {
        this.readFromNBT(tag);
    }
    //------------------------

    // set all slots to empty
    @Override
    public void clear() {
        Arrays.fill(itemStacks, null);
    }

    // will add a key for this container to the lang file so we can name it in the GUI
    @Override
    public String getName() {
        return "container.mbe31_inventory_furnace.name";
    }

    @Override
    public boolean hasCustomName() {
        return false;
    }

    // standard code to look up what the human-readable name is
    @Nullable
    @Override
    public ITextComponent getDisplayName() {
        return this.hasCustomName() ? new TextComponentString(this.getName()) : new TextComponentTranslation(this.getName());
    }

    // Fields are used to send non-inventory information from the server to interested clients
    // The container code caches the fields and sends the client any fields which have changed.
    // The field ID is limited to byte, and the field value is limited to short. (if you use more than this, they get cast down
    //   in the network packets)
    // If you need more than this, or shorts are too small, use a custom packet in your container instead.

    private static final byte COOK_FIELD_ID = 0;
    private static final byte FIRST_BURN_TIME_REMAINING_FIELD_ID = 1;
    private static final byte FIRST_BURN_TIME_INITIAL_FIELD_ID = FIRST_BURN_TIME_REMAINING_FIELD_ID + (byte)FUEL_SLOTS_COUNT;
    private static final byte NUMBER_OF_FIELDS = FIRST_BURN_TIME_INITIAL_FIELD_ID + (byte)FUEL_SLOTS_COUNT;

    @Override
    public int getField(int id) {
        if (id == COOK_FIELD_ID) return cookTime;
        if (id >= FIRST_BURN_TIME_REMAINING_FIELD_ID && id < FIRST_BURN_TIME_REMAINING_FIELD_ID + FUEL_SLOTS_COUNT) {
            return burnTimeRemaining;
        }
        if (id >= FIRST_BURN_TIME_INITIAL_FIELD_ID && id < FIRST_BURN_TIME_INITIAL_FIELD_ID + FUEL_SLOTS_COUNT) {
            return burnTimeInitialValue;
        }
        System.err.println("Invalid field ID in TileInventorySmelting.getField:" + id);
        return 0;
    }

    @Override
    public void setField(int id, int value)
    {
        if (id == COOK_FIELD_ID) {
            cookTime = (short)value;
        } else if (id >= FIRST_BURN_TIME_REMAINING_FIELD_ID && id < FIRST_BURN_TIME_REMAINING_FIELD_ID + FUEL_SLOTS_COUNT) {
            burnTimeRemaining = value;
        } else if (id >= FIRST_BURN_TIME_INITIAL_FIELD_ID && id < FIRST_BURN_TIME_INITIAL_FIELD_ID + FUEL_SLOTS_COUNT) {
            burnTimeInitialValue = value;
        } else {
            System.err.println("Invalid field ID in TileInventorySmelting.setField:" + id);
        }
    }

    @Override
    public int getFieldCount() {
        return NUMBER_OF_FIELDS;
    }

    // -----------------------------------------------------------------------------------------------------------
    // The following methods are not needed for this example but are part of IInventory so they must be implemented

    // Unused unless your container specifically uses it.
    // Return true if the given stack is allowed to go in the given slot
    @Override
    public boolean isItemValidForSlot(int slotIndex, ItemStack itemstack) {
        return false;
    }

    /**
     * This method removes the entire contents of the given slot and returns it.
     * Used by containers such as crafting tables which return any items in their slots when you close the GUI
     * @param slotIndex
     * @return
     */
    @Override
    public ItemStack removeStackFromSlot(int slotIndex) {
        ItemStack itemStack = getStackInSlot(slotIndex);
        if (itemStack != null) setInventorySlotContents(slotIndex, null);
        return itemStack;
    }

    @Override
    public void openInventory(EntityPlayer player) {}

    @Override
    public void closeInventory(EntityPlayer player) {}



}



Posted
ItemStack

s can't be

null

anymore, so you'll have to replace that with

ItemStack.EMPTY

. You'll also have to use a

NonNullList<ItemStack>

instead of an

ItemStack[]

to avoid

null

entries in your array.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Unlock Massive Savings with T e m u Coupon Code (acp856709): 40% Off for New & Existing Customers T e m u has rapidly become a go-to destination for savvy shoppers seeking unbeatable deals on a vast array of products. With the exclusive T e m u coupon code (acp856709), both new and existing customers can enjoy substantial savings, including a flat 40% discount, additional percentage-based discounts, and access to special coupon bundles. T e m u's extensive collection of trending items, combined with fast delivery and free shipping to 67 countries, makes it an ideal platform for budget-conscious consumers. Why Choose T e m u? T e m u stands out in the crowded e-commerce landscape for several reasons: Diverse Product Range: From fashion and electronics to home goods and beauty products, T e m u offers a vast selection to cater to every shopper's needs. Unbeatable Prices: With discounts of up to 90% on select items, T e m u ensures that customers get the best value for their money. Fast & Free Shipping: T e m u provides free shipping to 67 countries, ensuring that customers worldwide can enjoy their purchases without additional costs. Exclusive Coupon Codes: Utilize the T e m u coupon code (acp856709) to unlock significant savings, including a 40% discount and more. Benefits of Using T e m u Coupon Codes By applying the T e m u coupon code (acp856709), shoppers can access a range of benefits: Flat 40% Discount: Enjoy an immediate 40% reduction on your order total. Additional Percentage Discounts: Receive up to 40% extra off on selected items. Free Gifts: New users can receive complimentary gifts with their first purchase. 40% Coupon Bundle: Access a bundle of coupons totaling 40% for use on future purchases. How to Stay Updated on the Best T e m u Deals? To ensure you never miss out on the latest T e m u coupon codes for new users and T e m u coupons for existing users, follow these tips: Subscribe to T e m u’s newsletter for exclusive deals. Follow T e m u on social media for flash sales and promotions. Check the official T e m u website regularly for new discount codes. Use the T e m u app for app-exclusive discounts and offers. How to Redeem Your T e m u Coupon Code Redeeming your T e m u coupon code is straightforward: Visit T e m u's Website or App: Browse through the extensive product offerings. Add Items to Your Cart: Select the products you wish to purchase. Proceed to Checkout: Navigate to the checkout page. Apply the Coupon Code: Enter "acp856709" in the designated promo code field. Enjoy Your Savings: The applicable discounts will be reflected in your order total. T e m u Coupon Codes by Region T e m u offers region-specific discounts to cater to its global customer base: USA: T e m u coupon code 40% off for new and existing users with "acp856709". Canada: T e m u coupon code 40% off with "acp856709". UK: T e m u new user coupon with 40% off using "acp856709". Japan: T e m u discount code 40% off with "acp856709". Mexico: T e m u promo code 40% off for all users using "acp856709". Brazil: T e m u coupon bundle for 40% off with "acp856709". T e m u’s New Offers in 2025 T e m u new user coupon – Exclusive discounts for first-time buyers. T e m u coupon codes for new users – Get the best deals as a new shopper. T e m u coupon codes for existing users – Continue saving with repeat purchase discounts. T e m u 40% coupon bundle – Maximize your savings with this exclusive deal. T e m u discount code (acp856709) for 2025 – Get guaranteed savings. T e m u promo code (acp856709) for 2025 – Unlock extra discounts on a variety of products. Maximizing Your Savings To get the most out of your T e m u shopping experience: Combine Offers: Use the coupon code (acp856709) alongside ongoing sales and promotions for maximum discounts. Stay Updated: Regularly check T e m u's website or app for new deals and exclusive offers. Refer Friends: Share your positive experiences with friends and family to potentially access referral bonuses. Conclusion T e m u's commitment to providing quality products at affordable prices is evident through its generous coupon offerings. By utilizing the T e m u coupon code (acp856709), shoppers can enjoy significant savings, making their shopping experience both enjoyable and economical. Whether you're a new user or a returning customer, T e m u ensures that every purchase is rewarding.
    • Introduction Looking for unbelievable savings on your next T e m u shopping spree? Verified T e m u Coupon Code 90% OFF [acp856709] For New Customers is your golden ticket to massive discounts. T e m u is taking savings to the next level with its exclusive acp856709 coupon code that’s delivering unmatched value. Whether you live in the USA, Canada, or anywhere in Europe, this is the best code you can use today. If you're searching for T e m u Coupon 90% off or T e m u 90% off Coupon code, you're in the right place. We’ve verified this code ourselves, and it’s working like a charm for new and existing customers alike. What Is The Coupon Code For T e m u 90% Off? Want to unlock serious savings at checkout? Both new and existing T e m u customers can enjoy amazing perks with our T e m u Coupon 90% off and 90% off T e m u Coupon when using the exclusive “acp856709” code. acp856709 – Get a flat 90% off your order with no minimum spend. acp856709 – Unlock a 90% Coupon pack usable multiple times. acp856709 – Enjoy a 90% flat discount as a new T e m u shopper. acp856709 – Existing users can redeem an extra 90% off Coupon code. acp856709 – Perfect for T e m u users in the USA, Canada, and Europe seeking a 90% Coupon. T e m u Coupon Code 90% Off For New Users In 2025 New to T e m u? You’re in for a treat because the T e m u Coupon 90% off and T e m u Coupon code 90% off work best for first-time users when you apply the “acp856709” code. acp856709 – Flat 90% discount for new users on their first purchase. acp856709 – Get a 90% Coupon bundle for added value. acp856709 – Up to 90% in savings with multi-use Coupons. acp856709 – Free shipping to 68 countries, including the USA and Europe. acp856709 – Extra 90% off instantly for first-time buyers. How To Redeem The T e m u Coupon 90% Off For New Customers? Using the T e m u 90% Coupon and T e m u 90% off Coupon code for new users is super simple and takes only a minute. Just follow these steps: Download the T e m u app or visit the official website. Sign up for a new account with your email. Add items to your shopping cart that you wish to buy. Head to checkout and locate the “Apply Coupon” section. Enter the code acp856709 and hit "Apply." Instantly enjoy your 90% discount! T e m u Coupon 90% Off For Existing Customers Already a T e m u shopper? Don’t worry—you’re still eligible for exciting rewards with the T e m u 90% Coupon codes for existing users and T e m u Coupon 90% off for existing customers free shipping by using our trusted “acp856709” code. acp856709 – Get an extra 90% discount on your next order. acp856709 – Redeem a 90% Coupon bundle across multiple orders. acp856709 – Receive a free gift with express shipping in the USA/Canada. acp856709 – Stack an extra 90% off on top of existing promos. acp856709 – Enjoy global free shipping across 68 countries. How To Use The T e m u Coupon Code 90% Off For Existing Customers? To use the T e m u Coupon code 90% off and T e m u Coupon 90% off code as a returning customer, follow these quick steps: Open the T e m u app or go to the official site. Log into your existing account. Shop for your favorite items and proceed to checkout. In the “Coupon Code” field, type acp856709. Click “Apply” and see the 90% discount reflected immediately. Latest T e m u Coupon 90% Off First Order Looking to make the most out of your first T e m u order? Use our T e m u Coupon code 90% off first order, T e m u Coupon code first order, and T e m u Coupon code 90% off first time user for maximum savings. acp856709 – Grab a flat 90% discount for your first T e m u purchase. acp856709 – Activate your 90% T e m u Coupon code on the first order. acp856709 – Redeem up to 90% off with multi-use Coupons. acp856709 – Free international shipping to 68 countries included. acp856709 – Extra 90% discount just for first-time shoppers. How To Find The T e m u Coupon Code 90% Off? Finding the T e m u Coupon 90% off and T e m u Coupon 90% off Reddit codes is easier than ever. Simply subscribe to T e m u’s newsletter and stay updated on the latest deals and promotions. We also recommend checking T e m u’s official social media platforms for flash Coupons. For verified and working codes like acp856709, visit our trusted coupon website anytime. Is T e m u 90% Off Coupon Legit? Yes, the T e m u 90% Off Coupon Legit and T e m u 90% off Coupon legit keywords represent real, working offers. Our exclusive T e m u Coupon code “acp856709” is 100% authentic. We test and verify this code regularly to ensure it works across different accounts. It’s valid globally and comes with no expiration, making it one of the best long-term savings options. How Does T e m u 90% Off Coupon Work? The T e m u Coupon code 90% off first-time user and T e m u Coupon codes 90% off work by applying a special promotional discount directly to your checkout amount. Once you enter the code “acp856709,” T e m u’s system instantly deducts 90% from your total purchase, without any minimum spending requirement. This works for both new and returning customers, and it can even be used on top of existing deals and free shipping offers. How To Earn T e m u 90% Coupons As A New Customer? To earn the T e m u Coupon code 90% off and 90% off T e m u Coupon code as a new user, simply sign up on T e m u for the first time and apply our verified code. You'll automatically unlock 90% in discounts, free gifts, and shipping perks across 68 countries. This makes it incredibly rewarding for first-time users who want to save big on trending items. What Are The Advantages Of Using The T e m u Coupon 90% Off? Here are the top benefits of using the T e m u Coupon code 90% off and T e m u Coupon code 90% off on your next order: 90% discount on your first order 90% Coupon bundle for multiple uses 90% discount on trending items and top brands Extra 90% off for existing T e m u customers Up to 90% off on selected product categories Free gift included for all new users Free delivery to 68 countries worldwide T e m u 90% Discount Code And Free Gift For New And Existing Customers Whether you're a first-timer or a loyal shopper, our T e m u 90% off Coupon code and 90% off T e m u Coupon code bring outstanding value. acp856709 – Unlock a 90% discount instantly on your first order. acp856709 – Extra 90% off available on almost all items. acp856709 – Free welcome gift for new T e m u users. acp856709 – Save up to 90% on any product in the T e m u app. acp856709 – Enjoy a free gift with free shipping across 68 countries including the USA, UK, and Canada. Pros And Cons Of Using The T e m u Coupon Code 90% Off This Month Here are the top reasons to use the T e m u Coupon 90% off code and T e m u 90% off Coupon, along with a couple of things to keep in mind: Pros: Valid for both new and existing users No minimum order required Free international shipping included Verified and safe to use Multi-use Coupon pack available Cons: July not work with certain flash sales Limited to 68 countries only Terms And Conditions Of Using The T e m u Coupon 90% Off In 2025 Before using the T e m u Coupon code 90% off free shipping and latest T e m u Coupon code 90% off, please review the following terms: The coupon has no expiration date—use it whenever you want. Valid for both new and returning users. Works in 68 countries, including the USA, UK, and Europe. No minimum order value required to activate the Coupon. Use code acp856709 to access all benefits. Final Note: Use The Latest T e m u Coupon Code 90% Off Don't miss your chance to save big with the T e m u Coupon code 90% off—it’s the best deal available this month. Apply code acp856709 and experience top-tier discounts instantly. When you’re ready to check out, just enter the T e m u Coupon 90% off and watch your total drop. It's fast, simple, and totally worth it. FAQs Of Verified T e m u Coupon Code 90% OFF [acp856709] For Existing Customers Q1: Is the acp856709 code valid for existing customers?  Yes, the acp856709 code works for both new and existing customers, offering a flat 90% discount, even on repeat purchases. No tricks, no gimmicks. Q2: Can I use the T e m u Coupon 90% off code multiple times?  Yes! The acp856709 code includes a 90% Coupon pack for multiple uses, making it a great long-term value for consistent shoppers. Q3: Is the T e m u 90% off Coupon legit and safe to use?  Absolutely. Our code is tested and verified to ensure it's T e m u 90% off Coupon legit and ready to use on any qualifying purchase. Q4: Will the code work in my country (USA, Canada, UK)?  Yes, the acp856709 code is valid in all 68 supported countries, including the USA, Canada, UK, and European nations. Q5: How can I make sure the code applies successfully?  Just enter the acp856709 code in the Coupon section at checkout. If entered correctly, the discount is automatically applied to your total.
    • Our Verified T e m u Coupon Code $100 off OFF [acp856709] For Existing Customers is designed to put more money back in your pocket. This isn't just a small discount; it's a significant saving that allows you to indulge in your favorite items without the guilt. We believe everyone deserves to enjoy high-quality products at unbeatable prices, and this code makes that a reality. The [acp856709]T e m u Coupon code is your golden ticket to maximum benefits, especially if you're located in the USA, Canada, or any of the European nations. We've ensured this code is optimized to provide the best possible value for our Western audience, making your shopping sprees on T e m u more rewarding than ever before. Get ready to transform your online shopping habits and enjoy incredible deals. What Is The Coupon Code For T e m u $100 Off Off? We are thrilled to announce that both new and existing customers can unlock amazing benefits if they use our $100 off Coupon code on the T e m u app and website. This T e m u Coupon $100 off off is your gateway to a more affordable and enjoyable shopping experience, giving you direct access to substantial discounts. With this $100 off off T e m u Coupon, you can confidently shop for all your needs and wants, knowing you're getting a fantastic deal. [acp856709]: Enjoy a flat $100 off your purchase, directly reducing your total spend. This immediate saving means more value for your money from the moment you apply the code. [acp856709]: Receive a $100 Coupon pack, offering multiple uses across different orders, giving you ongoing savings. This bundle ensures your discounts continue long after your initial purchase. [acp856709]: New customers can revel in a $100 flat discount on their very first order, making their initial T e m u experience truly exceptional. We want your introduction to be unforgettable. [acp856709]: Existing loyal customers are rewarded with an extra $100 off off Coupon code, showing our appreciation for your continued support. Your loyalty doesn't go unnoticed! [acp856709]: Specifically for our users in the USA and Canada, this $100 off Coupon ensures localized savings that truly matter, catering to your specific regional shopping needs. T e m u Coupon Code $100 Off Off For New Users In 2025 For new users, the benefits of applying our Coupon code on the T e m u app are truly exceptional, designed to give you the warmest welcome. This T e m u Coupon $100 off off is specifically crafted to maximize your initial savings, making your first foray into T e m u an incredibly rewarding one. We want to ensure that your first shopping trip with T e m u is as exciting and economical as possible, and this T e m u Coupon code $100 off off helps us achieve that. [acp856709]: A flat $100 discount exclusively for new users, instantly lowering the cost of your first purchase. This immediate reduction makes trying T e m u risk-free and incredibly attractive. [acp856709]: A generous $100 Coupon bundle, providing new customers with a collection of discounts for future purchases. This bundle allows you to keep saving on subsequent orders. [acp856709]: Unlock an up to $100 Coupon bundle for multiple uses, allowing you to spread your savings across various items in your cart. This flexibility means more savings on more products. [acp856709]: Benefit from free shipping to 68 countries, ensuring your new treasures arrive without extra delivery costs. This perk adds even more value to your discounted purchases. [acp856709]: Receive an extra $100 off off on any purchase for first-time users, stacking up the savings even further! This additional discount makes your inaugural purchase exceptionally affordable. How To Redeem The T e m u Coupon $100 Off For New Customers? Redeeming your T e m u $100 off Coupon is a straightforward process, designed to get you saving quickly and effortlessly. Follow our simple step-by-step guide to apply the T e m u $100 off off Coupon code for new users and watch your total drop! Download the T e m u app or visit their website: Start by downloading the official T e m u app from your device's app store (available on iOS and Android) or by navigating to the T e m u website on your desktop browser. Create a new account: If you're a new user, you'll need to create an account. This usually involves signing up with your email address or linking a social media account. It's a quick and easy process to get started. Browse and add items to your cart: Explore the extensive range of products on T e m u, from electronics and fashion to home goods and unique gadgets. Take your time to find everything you desire and add it to your shopping cart. Proceed to checkout: Once you've finished shopping, click on the cart icon, typically located in the top right corner of the screen, and proceed to the checkout page. Locate the coupon code field: On the checkout page, you will find a designated field for "Promo Code" or "Coupon Code." It's usually located near the order summary or payment details section. Enter the coupon code: Carefully type or paste the coupon code acp856709 precisely into this field. Double-check for any typos to ensure it's entered correctly. Apply the code: Click "Apply" or "Redeem." You will instantly see the $100 discount, along with any additional offers, reflected in your total order amount. Congratulations, you've just saved big on your first T e m u order! T e m u Coupon $100 Off Off For Existing Customers Great news for our loyal T e m u shoppers! The savings aren't just for new users – existing customers can also benefit significantly from our exclusive coupons. With T e m u $100 off Coupon codes for existing users, you can continue to enjoy fantastic discounts on your favorite products. We value your loyalty and want to ensure that every purchase you make on T e m u is as rewarding as possible. That's why we're excited to offer T e m u Coupon $100 off off for existing customers free shipping designed to bring you ongoing savings and added perks. [acp856709]: Provides a $100 extra discount for existing T e m u users as a thank you for being a valued customer. This extra saving is our way of showing appreciation. [acp856709]: Unlocks a $100 Coupon bundle for multiple purchases, meaning you can enjoy discounts on more than just one order. It's perfect for regular shoppers who want to maximize their savings. [acp856709]: Enjoy a free gift with express shipping all over the USA/Canada, adding an exciting bonus to your existing customer benefits. Who doesn't love a free surprise delivered quickly? [acp856709]: Offers an extra $100 off off on top of any existing discounts you might already have, maximizing your savings potential. This allows for stacking discounts for even bigger reductions. [acp856709]: Includes free shipping to 68 countries, ensuring convenience and additional savings on your international orders, regardless of where you are in our supported regions. How To Use The T e m u Coupon Code $100 Off Off For Existing Customers? Using the T e m u Coupon code $100 off off as an existing customer is just as easy as it is for new users, ensuring you can continue to save effortlessly. To activate your T e m u Coupon $100 off off code, simply follow these steps: Log in to your existing T e m u account: Access your account either through the T e m u app or their website. Browse and add items to your cart: Explore T e m u's vast selection and add all the products you wish to purchase to your shopping cart. Go to the checkout page: Once your cart is ready, proceed to the checkout section, where you'll finalize your order. Locate the coupon code field: Look for the designated field to enter a coupon or promo code. It's usually found near the order summary or payment details. Enter the code: Type or paste [acp856709]into the coupon code box. Apply the code: Click the "Apply" or "Redeem" button to activate the discount. Verify the discount: You will see the $100 discount applied to your order total, confirming your savings before you complete your purchase.
    • Add the crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here  
  • Topics

×
×
  • Create New...

Important Information

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