Jump to content

Recommended Posts

Posted

Hi!

 

I created a new crafting Table with new recipes which take Mana from the Player.

Everything works fine except from one fact:

If I perform a shift-klick to craft as much Items as possible, neither the Crafting result is placed in the Inventory of the player, nor the Mana is reduced by the specified amount. Only the Crafting-items are removed. Can anybody tell me, why?

 

The Slot for the Crafting result:

 

package magicum.minecraft.items.crafting;

import magicum.minecraft.blocks.container.ContainerMagicCrafting;
import magicum.minecraft.extendedproperties.ExtendedProperties;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.AchievementList;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
import cpw.mods.fml.common.registry.GameRegistry;

public class ModSlotCrafting extends Slot
{
    /** The craft matrix inventory linked to this result slot. */
    private final IInventory craftMatrix;

    /** The player that is using the GUI where this slot resides. */
    private EntityPlayer thePlayer;
    
    public boolean canTake;
    
    private Container owner;

    /**
     * The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset.
     */
    private int amountCrafted;

    public ModSlotCrafting(Container owner, EntityPlayer par1EntityPlayer, IInventory par2IInventory, IInventory par3IInventory, int par4, int par5, int par6)
    {
        super(par3IInventory, par4, par5, par6);
        this.thePlayer = par1EntityPlayer;
        this.craftMatrix = par2IInventory;
        this.owner = owner;
    }

    /**
     * Check if the stack is a valid item for this slot. Always true beside for the armor slots.
     */
    @Override
public boolean isItemValid(ItemStack par1ItemStack)
    {
        return false;
    }

    /**
     * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new
     * stack.
     */
    @Override
public ItemStack decrStackSize(int par1)
    {
        if (this.getHasStack())
        {
            this.amountCrafted += Math.min(par1, this.getStack().stackSize);
        }

        return super.decrStackSize(par1);
    }

    /**
     * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an
     * internal count then calls onCrafting(item).
     */
    @Override
protected void onCrafting(ItemStack par1ItemStack, int par2)
    {
        this.amountCrafted += par2;
        this.onCrafting(par1ItemStack);
    }

    /**
     * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
     */
    @Override
protected void onCrafting(ItemStack par1ItemStack)
    {
        par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
        this.amountCrafted = 0;

        if (par1ItemStack.itemID == Block.workbench.blockID)
        {
            this.thePlayer.addStat(AchievementList.buildWorkBench, 1);
        }
        else if (par1ItemStack.itemID == Item.pickaxeWood.itemID)
        {
            this.thePlayer.addStat(AchievementList.buildPickaxe, 1);
        }
        else if (par1ItemStack.itemID == Block.furnaceIdle.blockID)
        {
            this.thePlayer.addStat(AchievementList.buildFurnace, 1);
        }
        else if (par1ItemStack.itemID == Item.hoeWood.itemID)
        {
            this.thePlayer.addStat(AchievementList.buildHoe, 1);
        }
        else if (par1ItemStack.itemID == Item.bread.itemID)
        {
            this.thePlayer.addStat(AchievementList.makeBread, 1);
        }
        else if (par1ItemStack.itemID == Item.cake.itemID)
        {
            this.thePlayer.addStat(AchievementList.bakeCake, 1);
        }
        else if (par1ItemStack.itemID == Item.pickaxeStone.itemID)
        {
            this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1);
        }
        else if (par1ItemStack.itemID == Item.swordWood.itemID)
        {
            this.thePlayer.addStat(AchievementList.buildSword, 1);
        }
        else if (par1ItemStack.itemID == Block.enchantmentTable.blockID)
        {
            this.thePlayer.addStat(AchievementList.enchantments, 1);
        }
        else if (par1ItemStack.itemID == Block.bookShelf.blockID)
        {
            this.thePlayer.addStat(AchievementList.bookcase, 1);
        }
    }

    @Override
public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack)
    {
        GameRegistry.onItemCrafted(par1EntityPlayer, par2ItemStack, this.craftMatrix);
        this.onCrafting(par2ItemStack);
        
        if (par1EntityPlayer instanceof EntityPlayerMP)
        {
        	ExtendedProperties.get((EntityPlayerMP) par1EntityPlayer).rem("Mana", ((ContainerMagicCrafting)this.owner).manaNeeded);
        } 

        for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i)
        {
            ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);

            if (itemstack1 != null)
            {
                this.craftMatrix.decrStackSize(i, 1);

                if (itemstack1.getItem().hasContainerItem())
                {
                    ItemStack itemstack2 = itemstack1.getItem().getContainerItemStack(itemstack1);

                    if (itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage())
                    {
                        MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2));
                        itemstack2 = null;
                    }

                    if (itemstack2 != null && (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)))
                    {
                        if (this.craftMatrix.getStackInSlot(i) == null)
                        {
                            this.craftMatrix.setInventorySlotContents(i, itemstack2);
                        }
                        else
                        {
                            this.thePlayer.dropPlayerItem(itemstack2);
                        }
                    }
                }
            }
        }
        
        this.owner.onCraftMatrixChanged(((ContainerMagicCrafting)this.owner).tileEntity);
    }

@Override
public boolean canTakeStack(EntityPlayer par1EntityPlayer) {
	return this.canTake;
}
}

 

The Container:

 

package magicum.minecraft.blocks.container;

import java.util.ArrayList;
import java.util.List;

import magicum.Main;
import magicum.minecraft.blocks.tileentity.TileEntityMagicCrafting;
import magicum.minecraft.elements.ElementCounted;
import magicum.minecraft.items.crafting.ModCraftingManager;
import magicum.minecraft.items.crafting.ModSlotCraftMatrix;
import magicum.minecraft.items.crafting.ModSlotCrafting;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCraftResult;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class ContainerMagicCrafting extends Container {

public TileEntityMagicCrafting tileEntity;
public IInventory craftResult = new InventoryCraftResult();
private World worldObj;

public int manaNeeded;
public List<ElementCounted> Elements = new ArrayList<ElementCounted>();
private ModSlotCrafting crafting;

    public ContainerMagicCrafting (InventoryPlayer inventoryPlayer, TileEntityMagicCrafting te){
    	this.tileEntity = te;
    	this.worldObj = inventoryPlayer.player.worldObj;
    	
    	for (int i = 0; i < 3; i++) {
    		for (int j = 0; j < 3; j++) {
    			this.addSlotToContainer(new ModSlotCraftMatrix(this, this.tileEntity, j + i * 3, 44 + j * 18, 17 + i * 18));
    		}
    	}
    	
    	for (int i = 0; i < 3; i++)
    		this.addSlotToContainer(new Slot(this.tileEntity, 9 + i, 8, 17 + i * 18));
    	
    	this.crafting = new ModSlotCrafting(this, inventoryPlayer.player, this.tileEntity, this.craftResult, 0, 138, 35);
    	this.addSlotToContainer(this.crafting);

    	this.addPlayerInventory(inventoryPlayer);
    	
    	this.onCraftMatrixChanged(this.tileEntity);
    }

    @Override
    public boolean canInteractWith(EntityPlayer player) {
    	return this.tileEntity.isUseableByPlayer(player);
    }


    protected void addPlayerInventory(InventoryPlayer inventoryPlayer) {
    	for (int i = 0; i < 3; i++) {
    		for (int j = 0; j < 9; j++) {
    			this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9,  8 + j * 18, 95 + i * 18));
    		}
    	}

    	for (int i = 0; i < 9; i++) {
    		this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 153));
    	}
    }

    @Override
    public ItemStack transferStackInSlot(EntityPlayer player, int slot) {
    	ItemStack stack = null;
    	Slot slotObject = (Slot) this.inventorySlots.get(slot);

    	if (slotObject != null && slotObject.getHasStack()) {
    		ItemStack stackInSlot = slotObject.getStack();
    		stack = stackInSlot.copy();
    		
    		if (slot < 9) {
    			if (!this.mergeItemStack(stackInSlot, 0, 35, true)) {
    				return null;
    			}
    		}
    		
    		else if (!this.mergeItemStack(stackInSlot, 0, 9, false)) {
    			return null;
    		}
    		
    		if (stackInSlot.stackSize == 0) {
    			slotObject.putStack(null);
    		} else {
    			slotObject.onSlotChanged();
    		}
    		
    		if (stackInSlot.stackSize == stack.stackSize) {
    			return null;
    		}
    		slotObject.onPickupFromSlot(player, stackInSlot);
    	}
    	return stack;
    }
    
    /**
     * Callback for when the crafting matrix is changed.
     */
    @Override
public void onCraftMatrixChanged(IInventory par1IInventory)
    {    	
        this.manaNeeded = ModCraftingManager.getInstance().getManaRequired(this.tileEntity, this.worldObj);
        this.Elements = ModCraftingManager.getInstance().getElementsRequired(this.tileEntity, this.worldObj);
        
        this.crafting.canTake = Main.proxy.playerMana >= this.manaNeeded && this.elementsCorrect();
        this.craftResult.setInventorySlotContents(0, ModCraftingManager.getInstance().findMatchingRecipe(this.tileEntity, this.worldObj));
    }

private boolean elementsCorrect() {
	return true;
}
}

 

Write if you need more code!

Posted

OK, I solved it now, but I really don't understand y´why:

I just put addPlayerInventory(inventoryPlayer); to the Top. Now it works..

Such a little problem  :-\

 

But now, I got another Problem:

 

If I do a shift klick, I craft as much Items as possible from the Item Count. But if I got maybe the Mana for 2 Items and the Items for 4, it will craft 4. How can I add a Control for the Mana when performing a Shiftklick?

 

Posted

Its just me who's posting..

I now solved the problem. Final Code:

ContainerMagicCrafting:

package magicum.minecraft.blocks.container;

import java.util.ArrayList;
import java.util.List;

import magicum.Main;
import magicum.minecraft.blocks.tileentity.TileEntityMagicCrafting;
import magicum.minecraft.elements.ElementCounted;
import magicum.minecraft.items.crafting.ModCraftingManager;
import magicum.minecraft.items.crafting.ModSlotCraftMatrix;
import magicum.minecraft.items.crafting.ModSlotCrafting;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCraftResult;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class ContainerMagicCrafting extends Container {

public TileEntityMagicCrafting tileEntity;
public IInventory craftResult = new InventoryCraftResult();
private World worldObj;

public int manaNeeded;
public List<ElementCounted> Elements = new ArrayList<ElementCounted>();
private ModSlotCrafting crafting;

    public ContainerMagicCrafting (InventoryPlayer inventoryPlayer, TileEntityMagicCrafting te){
    	this.tileEntity = te;
    	this.worldObj = inventoryPlayer.player.worldObj;
    	
    	this.addPlayerInventory(inventoryPlayer);
    	
    	for (int i = 0; i < 3; i++) {
    		for (int j = 0; j < 3; j++) {
    			this.addSlotToContainer(new ModSlotCraftMatrix(this, this.tileEntity, j + i * 3, 44 + j * 18, 17 + i * 18));
    		}
    	}
    	
    	for (int i = 0; i < 3; i++)
    		this.addSlotToContainer(new Slot(this.tileEntity, 9 + i, 8, 17 + i * 18));
    	
    	this.crafting = new ModSlotCrafting(this, inventoryPlayer.player, this.tileEntity, this.craftResult, 0, 138, 35);
    	this.addSlotToContainer(this.crafting);
    	
    	this.onCraftMatrixChanged(this.tileEntity);
    }

    @Override
    public boolean canInteractWith(EntityPlayer player) {
    	return this.tileEntity.isUseableByPlayer(player);
    }


    protected void addPlayerInventory(InventoryPlayer inventoryPlayer) {
    	for (int i = 0; i < 3; i++) {
    		for (int j = 0; j < 9; j++) {
    			this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9,  8 + j * 18, 95 + i * 18));
    		}
    	}

    	for (int i = 0; i < 9; i++) {
    		this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 153));
    	}
    }

    @Override
    public ItemStack transferStackInSlot(EntityPlayer player, int slot) {
    	ItemStack stack = null;
    	Slot slotObject = (Slot) this.inventorySlots.get(slot);

    	if (slotObject != null && slotObject.getHasStack()) {
    		ItemStack stackInSlot = slotObject.getStack();
    		stack = stackInSlot.copy();
    		
    		if (slot < 9) {
    			if (!this.mergeItemStack(stackInSlot, 0, 35, true)) {
    				return null;
    			}
    		}
    		
    		else if (!this.mergeItemStack(stackInSlot, 0, 9, false)) {
    			return null;
    		}
    		
    		if (stackInSlot.stackSize == 0) {
    			slotObject.putStack(null);
    		} else {
    			slotObject.onSlotChanged();
    		}
    		
    		if (stackInSlot.stackSize == stack.stackSize) {
    			return null;
    		}
    		slotObject.onPickupFromSlot(player, stackInSlot);
    	}
    	return stack;
    }
    
    /**
     * Callback for when the crafting matrix is changed.
     */
    @Override
public void onCraftMatrixChanged(IInventory par1IInventory)
    {    	
        this.manaNeeded = ModCraftingManager.getInstance().getManaRequired(this.tileEntity, this.worldObj);
        this.Elements = ModCraftingManager.getInstance().getElementsRequired(this.tileEntity, this.worldObj);
        
        if (Main.proxy.playerMana >= this.manaNeeded && this.elementsCorrect())
        	this.craftResult.setInventorySlotContents(0, ModCraftingManager.getInstance().findMatchingRecipe(this.tileEntity, this.worldObj));
    }

private boolean elementsCorrect() {
	return true;
}
}

ModSlotCrafting:

package magicum.minecraft.items.crafting;

import magicum.Main;
import magicum.minecraft.blocks.container.ContainerMagicCrafting;
import magicum.minecraft.extendedproperties.ExtendedProperties;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.AchievementList;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
import cpw.mods.fml.common.registry.GameRegistry;

public class ModSlotCrafting extends Slot
{
    /** The craft matrix inventory linked to this result slot. */
    private final IInventory craftMatrix;

    /** The player that is using the GUI where this slot resides. */
    private EntityPlayer thePlayer;
    
    private ContainerMagicCrafting owner;

    /**
     * The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset.
     */
    private int amountCrafted;

    public ModSlotCrafting(ContainerMagicCrafting owner, EntityPlayer par1EntityPlayer, IInventory par2IInventory, IInventory par3IInventory, int par4, int par5, int par6)
    {
        super(par3IInventory, par4, par5, par6);
        this.thePlayer = par1EntityPlayer;
        this.craftMatrix = par2IInventory;
        this.owner = owner;
    }

    /**
     * Check if the stack is a valid item for this slot. Always true beside for the armor slots.
     */
    @Override
public boolean isItemValid(ItemStack par1ItemStack)
    {
        return false;
    }

    /**
     * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new
     * stack.
     */
    @Override
public ItemStack decrStackSize(int par1)
    {
        if (this.getHasStack())
        {
            this.amountCrafted += Math.min(par1, this.getStack().stackSize);
        }

        return super.decrStackSize(par1);
    }

    /**
     * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an
     * internal count then calls onCrafting(item).
     */
    @Override
protected void onCrafting(ItemStack par1ItemStack, int par2)
    {
        this.amountCrafted += par2;
        this.onPickupFromSlot(this.thePlayer, par1ItemStack);
    }

    /**
     * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
     */
    @Override
protected void onCrafting(ItemStack par1ItemStack)
    {   
    		if (this.thePlayer instanceof EntityPlayerMP)
    			ExtendedProperties.get((EntityPlayerMP) this.thePlayer).rem("Mana", this.owner.manaNeeded);
    		Main.proxy.playerMana -= this.owner.manaNeeded;
    	
    		par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
    		this.amountCrafted = 0;

    		if (par1ItemStack.itemID == Block.workbench.blockID)
    		{
    			this.thePlayer.addStat(AchievementList.buildWorkBench, 1);
    		}
    		else if (par1ItemStack.itemID == Item.pickaxeWood.itemID)
    		{
    			this.thePlayer.addStat(AchievementList.buildPickaxe, 1);
    		}
    		else if (par1ItemStack.itemID == Block.furnaceIdle.blockID)
    		{
    			this.thePlayer.addStat(AchievementList.buildFurnace, 1);
    		}
    		else if (par1ItemStack.itemID == Item.hoeWood.itemID)
    		{
    			this.thePlayer.addStat(AchievementList.buildHoe, 1);
    		}
    		else if (par1ItemStack.itemID == Item.bread.itemID)
    		{
    			this.thePlayer.addStat(AchievementList.makeBread, 1);
    		}
    		else if (par1ItemStack.itemID == Item.cake.itemID)
    		{
    			this.thePlayer.addStat(AchievementList.bakeCake, 1);
    		}
    		else if (par1ItemStack.itemID == Item.pickaxeStone.itemID)
    		{
    			this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1);
    		}
    		else if (par1ItemStack.itemID == Item.swordWood.itemID)
    		{
    			this.thePlayer.addStat(AchievementList.buildSword, 1);
    		}
    		else if (par1ItemStack.itemID == Block.enchantmentTable.blockID)
    		{
    			this.thePlayer.addStat(AchievementList.enchantments, 1);
    		}
    		else if (par1ItemStack.itemID == Block.bookShelf.blockID)
    		{
    			this.thePlayer.addStat(AchievementList.bookcase, 1);
    		}
    }
    	
    @Override
public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack)
    {
        GameRegistry.onItemCrafted(par1EntityPlayer, par2ItemStack, this.thePlayer.inventory);
        this.onCrafting(par2ItemStack);

        for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i)
        {
            ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);

            if (itemstack1 != null)
            {
                this.craftMatrix.decrStackSize(i, 1);

                if (itemstack1.getItem().hasContainerItem())
                {
                    ItemStack itemstack2 = itemstack1.getItem().getContainerItemStack(itemstack1);

                    if (itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage())
                    {
                        MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2));
                        itemstack2 = null;
                    }

                    if (itemstack2 != null && (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)))
                    {
                        if (this.craftMatrix.getStackInSlot(i) == null)
                        {
                            this.craftMatrix.setInventorySlotContents(i, itemstack2);
                        }
                        else
                        {
                            this.thePlayer.dropPlayerItem(itemstack2);
                        }
                    }
                }
            }
        }
        this.inventory.setInventorySlotContents(0, null);
        this.owner.onCraftMatrixChanged(this.owner.tileEntity);
    }
}

 

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

    • Reach Out To Rapid Digital: What sapp Info: +1 41 4 80 7 14 85 Email INFO: rap iddi gita lrecov ery @ exe cs. com Hello, my name is Jayson, and I’m 35 years old from the United Kingdom. My family and I recently endured an incredibly challenging experience that I wouldn’t wish on anyone. We became victims of a cryptocurrency investment fraud scheme that saw us lose a staggering $807,000 in USDT and Bitcoins. The fraudsters had created a convincing facade, and we were lured into investing, only to discover later that the platform was a complete scam. We were left devastated, not just financially, but emotionally, as we had trusted these people and believed in the legitimacy of the investment. After the initial shock wore off, we desperately searched for ways to recover the lost funds. It seemed like an impossible task, and we felt as though there was no hope. That’s when, by sheer luck, we stumbled across a post about Rapid Digital Recovery, a cryptocurrency and funds recovery organization with a proven track record in cybersecurity and fraud recovery. We decided to reach out to them, and from the first interaction, we were impressed with their professionalism and transparency. They explained the recovery process in detail and reassured us that they had the skills and expertise to track down the perpetrators and recover our funds. This gave us a renewed sense of hope, something we hadn’t felt in months. What truly stood out during our experience with Rapid Digital Recovery was their dedication to the recovery process. The team went above and beyond, using sophisticated tracking tools and cyber forensics to gather critical information. Within a matter of weeks, they had successfully located the funds and traced the scam back to the fraudsters responsible. They worked with the authorities to ensure the criminals were held accountable for their actions. To our relief, the team at Rapid Digital Recovery was able to recover every single penny we had lost. The funds were returned in full, and the sense of closure we felt was invaluable. We couldn’t have imagined such a positive outcome in the early stages of our recovery journey, and we are deeply grateful for the work they did. If you ever find yourself in a similar situation, I highly recommend contacting Rapid Digital Recovery. Their expertise, transparency, and dedication to their clients make them the go-to choice for anyone seeking to recover lost cryptocurrency or funds. They truly gave us back our financial future.  
    • This is my first time modding anything, so maybe just skill issue. I'm using Forge 54.0.12 and Temurin 21.0.5+11-LTS I wanted to create a custom keybind and to check whether it works I'd like to send a chat message. I tried using Minecraft.getInstance().player.sendSystemMessage(Component.literal("test")); but IntelliJ couldnt resolve sendSystemMessage(...). Since I saw people using it in earlier versions, I tried the same thing with 1.20.6(- 50.1.0), where it works fine, now I can't figure out if this is intentional and whether there are other options for sending chat messages. On that note, is there more documentation than https://docs.minecraftforge.net/en/1.21.x/? It seems very incomplete compared to something like the Oracle Java docs
    • Hi, i'm having this error and I wanna fix it. we try: -Reload drivers -Eliminate .minecraft -Eliminate Java -Restart launcher -Verify if minecraft is using gpu -Mods  in .minecraft is empty -Install the latest and recomended version of forge idk what i have to do, help me pls. the lastest log is: https://mclo.gs/WAMao8x  
    • Read the FAQ, Rule #2. (https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/)  
    • The link to your log does not work, it says it is forbidden, Error, this is a private paste or is pending moderation.
  • Topics

×
×
  • Create New...

Important Information

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