Jump to content

Crafting dont work


Xetapro12

Recommended Posts

Hey i added crafting and when i try crafting the item it crash here the report

 

---- Minecraft Crash Report ----

// Don't be sad. I'll do better next time, I promise!

 

Time: 10/27/14 9:22 PM

Description: Rendering item

 

java.lang.NullPointerException: Rendering item

at net.minecraft.item.ItemStack.getItemDamage(ItemStack.java:262)

at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:415)

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:560)

at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:287)

at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:114)

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1013)

at net.minecraft.client.Minecraft.run(Minecraft.java:900)

at net.minecraft.client.main.Main.main(Main.java:112)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at net.minecraft.item.ItemStack.getItemDamage(ItemStack.java:262)

at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:415)

 

-- Item being rendered --

Details:

Item Type: null

Item Aux: ~~ERROR~~ NullPointerException: null

Item NBT: null

Item Foil: ~~ERROR~~ NullPointerException: null

Stacktrace:

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:560)

at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:287)

at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:114)

 

-- Screen render details --

Details:

Screen name: net.minecraft.client.gui.inventory.GuiCrafting

Mouse location: Scaled: (186, 99). Absolute: (372, 281)

Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['Player578'/317, l='MpServer', x=194.32, y=69.62, z=244.24]]

Chunk stats: MultiplayerChunkCache: 225, 225

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: World: (192,64,248), Chunk: (at 0,4,8 in 12,15; contains blocks 192,0,240 to 207,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 1124 game time, 1124 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 108 total; [EntityBat['Bat'/31, l='MpServer', x=123.44, y=36.51, z=281.34], EntityZombie['Zombie'/39, l='MpServer', x=115.59, y=37.00, z=191.72], EntitySheep['Sheep'/42, l='MpServer', x=115.31, y=76.00, z=229.47], EntityZombie['Zombie'/40, l='MpServer', x=115.50, y=37.00, z=194.50], EntityChicken['Chicken'/47, l='MpServer', x=116.50, y=75.00, z=225.50], EntityClientPlayerMP['Player578'/317, l='MpServer', x=194.32, y=69.62, z=244.24], EntitySheep['Sheep'/50, l='MpServer', x=124.50, y=75.00, z=237.50], EntitySheep['Sheep'/49, l='MpServer', x=124.50, y=75.00, z=237.50], EntityChicken['Chicken'/48, l='MpServer', x=116.50, y=76.00, z=226.50], EntityBat['Bat'/55, l='MpServer', x=123.25, y=25.10, z=285.75], EntityBat['Bat'/54, l='MpServer', x=122.94, y=23.04, z=279.44], EntitySheep['Sheep'/53, l='MpServer', x=123.50, y=70.00, z=242.50], EntitySheep['Sheep'/52, l='MpServer', x=125.50, y=72.00, z=240.50], EntityCreeper['Creeper'/57, l='MpServer', x=119.03, y=33.00, z=273.59], EntityBat['Bat'/56, l='MpServer', x=127.91, y=22.67, z=285.31], EntityEnderman['Enderman'/71, l='MpServer', x=127.50, y=22.00, z=324.50], EntitySheep['Sheep'/77, l='MpServer', x=137.59, y=63.00, z=254.22], EntitySheep['Sheep'/78, l='MpServer', x=133.88, y=64.00, z=248.16], EntitySheep['Sheep'/79, l='MpServer', x=138.31, y=63.00, z=255.44], EntityZombie['Zombie'/72, l='MpServer', x=127.50, y=23.00, z=320.50], EntityBat['Bat'/85, l='MpServer', x=132.75, y=24.10, z=296.50], EntityBat['Bat'/84, l='MpServer', x=132.75, y=25.10, z=295.75], EntityBat['Bat'/81, l='MpServer', x=135.44, y=24.05, z=263.44], EntityBat['Bat'/80, l='MpServer', x=124.66, y=21.98, z=284.59], EntityBat['Bat'/83, l='MpServer', x=130.47, y=22.33, z=293.34], EntitySheep['Sheep'/82, l='MpServer', x=139.19, y=63.00, z=256.69], EntityChicken['Chicken'/93, l='MpServer', x=157.50, y=63.00, z=177.50], EntitySheep['Sheep'/95, l='MpServer', x=152.53, y=67.00, z=183.53], EntityChicken['Chicken'/94, l='MpServer', x=153.50, y=63.00, z=177.50], EntityChicken['Chicken'/100, l='MpServer', x=155.59, y=65.00, z=186.66], EntitySheep['Sheep'/101, l='MpServer', x=172.94, y=63.00, z=256.94], EntitySheep['Sheep'/98, l='MpServer', x=155.31, y=65.00, z=182.53], EntityChicken['Chicken'/99, l='MpServer', x=157.50, y=64.00, z=179.50], EntitySheep['Sheep'/96, l='MpServer', x=150.34, y=70.00, z=184.44], EntitySheep['Sheep'/97, l='MpServer', x=150.16, y=69.00, z=183.06], EntitySheep['Sheep'/119, l='MpServer', x=161.94, y=64.00, z=245.03], EntitySheep['Sheep'/118, l='MpServer', x=162.53, y=63.00, z=255.22], EntitySheep['Sheep'/117, l='MpServer', x=165.50, y=63.00, z=182.50], EntitySheep['Sheep'/120, l='MpServer', x=153.81, y=63.00, z=261.88], EntitySheep['Sheep'/137, l='MpServer', x=187.75, y=74.00, z=311.13], EntitySheep['Sheep'/136, l='MpServer', x=181.22, y=77.00, z=312.72], EntitySheep['Sheep'/135, l='MpServer', x=180.31, y=77.00, z=311.50], EntitySheep['Sheep'/134, l='MpServer', x=185.47, y=75.00, z=309.47], EntitySkeleton['Skeleton'/159, l='MpServer', x=198.50, y=22.00, z=191.50], EntityZombie['Zombie'/171, l='MpServer', x=195.94, y=24.00, z=319.31], EntityZombie['Zombie'/170, l='MpServer', x=196.50, y=29.00, z=314.50], EntityCreeper['Creeper'/169, l='MpServer', x=200.50, y=60.00, z=295.50], EntityCreeper['Creeper'/168, l='MpServer', x=192.00, y=60.00, z=300.44], EntitySkeleton['Skeleton'/163, l='MpServer', x=198.66, y=26.00, z=232.31], EntitySpider['Spider'/162, l='MpServer', x=207.50, y=26.00, z=230.78], EntityZombie['Zombie'/161, l='MpServer', x=200.50, y=26.00, z=233.50], EntitySquid['Squid'/160, l='MpServer', x=200.84, y=53.34, z=182.84], EntityCreeper['Creeper'/167, l='MpServer', x=199.50, y=60.00, z=295.50], EntityCreeper['Creeper'/166, l='MpServer', x=199.50, y=60.00, z=296.50], EntitySheep['Sheep'/165, l='MpServer', x=204.63, y=69.00, z=264.47], EntitySheep['Sheep'/164, l='MpServer', x=195.31, y=68.00, z=250.25], EntitySpider['Spider'/186, l='MpServer', x=210.38, y=27.00, z=224.81], EntityCreeper['Creeper'/187, l='MpServer', x=216.50, y=21.00, z=234.06], EntitySkeleton['Skeleton'/184, l='MpServer', x=220.63, y=38.00, z=195.31], EntityZombie['Zombie'/185, l='MpServer', x=211.94, y=25.00, z=208.31], EntitySheep['Sheep'/190, l='MpServer', x=215.78, y=68.00, z=254.72], EntitySheep['Sheep'/191, l='MpServer', x=215.91, y=67.00, z=253.50], EntitySpider['Spider'/188, l='MpServer', x=215.44, y=20.00, z=236.22], EntitySheep['Sheep'/189, l='MpServer', x=201.52, y=69.00, z=242.60], EntityZombie['Zombie'/178, l='MpServer', x=216.00, y=25.00, z=212.44], EntityZombie['Zombie'/179, l='MpServer', x=211.09, y=23.00, z=201.44], EntityZombie['Zombie'/177, l='MpServer', x=212.31, y=24.00, z=206.69], EntitySkeleton['Skeleton'/182, l='MpServer', x=221.28, y=38.00, z=196.31], EntitySkeleton['Skeleton'/183, l='MpServer', x=217.56, y=38.00, z=193.94], EntityCreeper['Creeper'/180, l='MpServer', x=213.47, y=24.00, z=206.69], EntitySkeleton['Skeleton'/181, l='MpServer', x=222.50, y=39.00, z=197.00], EntityBat['Bat'/207, l='MpServer', x=251.53, y=37.19, z=221.75], EntityZombie['Zombie'/197, l='MpServer', x=205.53, y=21.00, z=323.01], EntitySheep['Sheep'/196, l='MpServer', x=222.94, y=68.00, z=261.06], EntitySpider['Spider'/193, l='MpServer', x=222.75, y=52.00, z=269.09], EntitySheep['Sheep'/192, l='MpServer', x=213.81, y=68.00, z=239.13], EntityZombie['Zombie'/195, l='MpServer', x=216.84, y=52.00, z=263.72], EntityZombie['Zombie'/194, l='MpServer', x=220.63, y=52.00, z=267.16], EntityWitch['Witch'/220, l='MpServer', x=243.94, y=32.00, z=257.47], EntityBat['Bat'/221, l='MpServer', x=246.97, y=41.05, z=242.31], EntitySheep['Sheep'/222, l='MpServer', x=245.50, y=67.00, z=248.50], EntitySheep['Sheep'/223, l='MpServer', x=246.50, y=64.00, z=250.50], EntitySheep['Sheep'/216, l='MpServer', x=241.61, y=64.00, z=278.78], EntitySpider['Spider'/219, l='MpServer', x=242.72, y=35.00, z=238.78], EntitySkeleton['Skeleton'/212, l='MpServer', x=238.44, y=13.00, z=272.09], EntitySheep['Sheep'/213, l='MpServer', x=237.44, y=66.00, z=282.47], EntitySheep['Sheep'/214, l='MpServer', x=237.50, y=74.00, z=276.50], EntitySheep['Sheep'/215, l='MpServer', x=235.50, y=73.00, z=279.50], EntityItem['item.item.seeds'/208, l='MpServer', x=224.19, y=67.13, z=214.09], EntitySheep['Sheep'/209, l='MpServer', x=225.91, y=68.00, z=244.91], EntitySheep['Sheep'/210, l='MpServer', x=235.97, y=69.00, z=243.97], EntitySkeleton['Skeleton'/211, l='MpServer', x=236.50, y=15.00, z=263.50], EntitySheep['Sheep'/239, l='MpServer', x=266.50, y=65.00, z=288.47], EntitySheep['Sheep'/238, l='MpServer', x=256.31, y=64.00, z=301.19], EntitySheep['Sheep'/237, l='MpServer', x=264.50, y=65.00, z=287.50], EntityZombie['Zombie'/236, l='MpServer', x=268.44, y=25.00, z=284.56], EntityZombie['Zombie'/235, l='MpServer', x=256.88, y=17.00, z=202.34], EntityCreeper['Creeper'/230, l='MpServer', x=255.00, y=52.00, z=309.59], EntitySheep['Sheep'/229, l='MpServer', x=254.50, y=63.00, z=308.50], EntitySheep['Sheep'/228, l='MpServer', x=253.50, y=64.00, z=303.50], EntityCreeper['Creeper'/227, l='MpServer', x=246.22, y=18.00, z=280.06], EntityBat['Bat'/226, l='MpServer', x=244.53, y=32.05, z=258.72], EntityBat['Bat'/225, l='MpServer', x=246.50, y=28.39, z=277.91], EntitySheep['Sheep'/224, l='MpServer', x=245.50, y=67.00, z=248.50], EntityCreeper['Creeper'/246, l='MpServer', x=273.50, y=33.00, z=184.50], EntitySheep['Sheep'/242, l='MpServer', x=253.84, y=64.00, z=293.50], EntitySheep['Sheep'/240, l='MpServer', x=266.50, y=65.00, z=289.53], EntitySheep['Sheep'/241, l='MpServer', x=266.50, y=65.00, z=290.53]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:410)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2510)

at net.minecraft.client.Minecraft.run(Minecraft.java:921)

at net.minecraft.client.main.Main.main(Main.java:112)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

-- System Details --

Details:

Minecraft Version: 1.7.2

Operating System: Windows 8 (amd64) version 6.2

Java Version: 1.7.0_71, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 689370624 bytes (657 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 9206 (515536 bytes; 0 MB) allocated, 1472 (82432 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95

FML: MCP v9.03 FML v7.2.211.1121 Minecraft Forge 10.12.2.1121 4 mods loaded, 4 mods active

mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{7.2.211.1121} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{10.12.2.1121} [Minecraft Forge] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Ruby Mod{1.7.2} [Ruby Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Launched Version: 1.6

LWJGL: 2.9.0

OpenGL: GeForce GTX 780/PCIe/SSE2 GL version 4.3.0, NVIDIA Corporation

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs: []

Current Language: ~~ERROR~~ NullPointerException: null

Profiler Position: N/A (disabled)

Vec3 Pool Size: 1850 (103600 bytes; 0 MB) allocated, 869 (48664 bytes; 0 MB) used

Anisotropic Filtering: Off (1)

NEWB! in java im sorry :/

Link to comment
Share on other sites

package com.Ruby.RubyMod;

 

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.ItemStack;

import cpw.mods.fml.common.registry.GameRegistry;

 

public class Recipes {

 

public static void MainClass() {

addCraftingRecipes();

//addSmeltingRecipes();

}

 

private static void addCraftingRecipes() {

 

GameRegistry.addRecipe(new ItemStack(RubyMod.RubyPickaxe), "iii", " s ", " s ", 'i', RubyMod.RubyIngot, 's', Items.stick);

 

 

GameRegistry.addRecipe(new ItemStack(RubyMod.RubySword), " i ", " i ", " s ", 'i', RubyMod.RubyIngot, 's', Items.stick);

 

 

GameRegistry.addRecipe(new ItemStack(Blocks.grass, 9),

new Object[] { "XXX", "XXX", "XXX", 'X', Blocks.dirt });

}

 

 

}

 

 

 

NEWB! in java im sorry :/

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • KILAT77 : Waspada Situs Scam dengan Withdraw Yang Tidak Dibayar Di era digital saat ini, banyak orang yang mencari keberuntungan melalui situs perjudian online. Namun, dibalik gemerlap janji-janji manis kemenangan, ada bahaya yang mengintai. Salah satu situs yang patut diwaspadai adalah KILAT77. Situs ini mendapat reputasi buruk karena banyak laporan dari pengguna yang mengklaim bahwa mereka tidak bisa menarik dana kemenangan mereka. Dalam artikel ini, kita akan membahas mengapa ROTER88 dianggap sebagai situs scam dan bagaimana Anda bisa melindungi diri dari penipuan serupa. Pengalaman Pengguna: Penarikan Tidak Dibayar Beberapa pengguna telah melaporkan pengalaman buruk mereka dengan KILAT77. Mereka mengaku bahwa setelah memenangkan sejumlah uang dan mencoba menariknya, proses penarikan mereka ditolak tanpa alasan yang jelas. Bahkan, beberapa pengguna melaporkan bahwa akun mereka tiba-tiba diblokir setelah mencoba melakukan penarikan, sehingga mereka kehilangan akses ke dana mereka sama sekali.
    • It is a dupe mod issue Remove Rubidium - you are already using Embeddium which is a fork of Rubidium
    • I made a block entity in forge 1.20.1, I want to prevent hopper from taking input slot item, i tried to override the extractItem method, it prevented hopper from taking input slot item, but the player also unable to take/change the item in input slot unless the slot is empty. public class FluidSeparatorBlockEntity extends BlockEntity implements MenuProvider { private static final int INPUT_SLOT = 0; private final CustomItemHandler itemHandler = new CustomItemHandler(3){ @Override protected void onContentsChanged(int slot) { setChanged(); } @Override public boolean isItemValid(int slot, @NotNull ItemStack stack) { return slot == INPUT_SLOT; } @Override public @NotNull ItemStack extractItem(int slot, int amount, boolean simulate) { if (slot == INPUT_SLOT) { return ItemStack.EMPTY; } return super.extractItem(slot, amount, simulate); } }; private LazyOptional<IItemHandler> lazyItemHandler = LazyOptional.empty(); protected final ContainerData data; private int progress = 0; private int maxProgress = 78; public FluidSeparatorBlockEntity(BlockPos pPos, BlockState pBlockState) { super(ModBlockEntities.FLUID_SEPARATOR_BE.get(), pPos, pBlockState); this.data = new ContainerData() { @Override public int get(int pIndex) { return switch (pIndex) { case 0 -> FluidSeparatorBlockEntity.this.progress; case 1, 2 -> FluidSeparatorBlockEntity.this.maxProgress; default -> 0; }; } @Override public void set(int pIndex, int pValue) { switch (pIndex) { case 0 -> FluidSeparatorBlockEntity.this.progress = pValue; case 1, 2 -> FluidSeparatorBlockEntity.this.maxProgress = pValue; } } @Override public int getCount() { return 3; } }; } @Override public @NotNull <T> LazyOptional<T> getCapability(@NotNull Capability<T> cap, @Nullable Direction side) { if(cap == ForgeCapabilities.ITEM_HANDLER) { return lazyItemHandler.cast(); } return super.getCapability(cap, side); } @Override public void onLoad() { super.onLoad(); lazyItemHandler = LazyOptional.of(() -> itemHandler); } @Override public void invalidateCaps() { super.invalidateCaps(); lazyItemHandler.invalidate(); } public void drops() { SimpleContainer inventory = new SimpleContainer(itemHandler.getSlots()); for(int i = 0; i < itemHandler.getSlots(); i++) { inventory.setItem(i, itemHandler.getStackInSlot(i)); } Containers.dropContents(this.level, this.worldPosition, inventory); } @Override public Component getDisplayName() { return Component.translatable("block.chemmaster.fluid_separator"); } @Nullable @Override public AbstractContainerMenu createMenu(int pContainerId, Inventory pPlayerInventory, Player pPlayer) { return new FluidSeparatorMenu(pContainerId, pPlayerInventory, this, this.data); } @Override protected void saveAdditional(CompoundTag pTag) { pTag.put("inventory", itemHandler.serializeNBT()); pTag.putInt("fluid_separator.progress", progress); super.saveAdditional(pTag); } @Override public void load(CompoundTag pTag) { super.load(pTag); itemHandler.deserializeNBT(pTag.getCompound("inventory")); progress = pTag.getInt("fluid_separator.progress"); } public void tick(Level pLevel, BlockPos pPos, BlockState pState) { ItemStack inputStack = this.itemHandler.getStackInSlot(INPUT_SLOT); if (inputStack.getCount() < 2) { resetProgress(); return; } if(hasRecipe()) { increaseCraftingProgress(); setChanged(pLevel, pPos, pState); if(hasProgressFinished()) { craftItem(); resetProgress(); } } else { resetProgress(); } } private void resetProgress() { progress = 0; } private void craftItem() { Optional<FluidSeparatingRecipe> recipe = getCurrentRecipe(); if (recipe.isPresent()) { List<ItemStack> results = recipe.get().getOutputs(); ItemStack inputStack = this.itemHandler.getStackInSlot(INPUT_SLOT); if (inputStack.getCount() < 2) { // If there are not enough items, do not proceed with crafting return; } // Extract the input item from the input slot this.itemHandler.internalExtractItem(INPUT_SLOT, 2, false); // Loop through each result item and find suitable output slots for (ItemStack result : results) { int outputSlot = findSuitableOutputSlot(result); if (outputSlot != -1) { this.itemHandler.setStackInSlot(outputSlot, new ItemStack(result.getItem(), this.itemHandler.getStackInSlot(outputSlot).getCount() + result.getCount())); } else { // Handle the case where no suitable output slot is found // This can be logging an error, throwing an exception, or any other handling logic System.err.println("No suitable output slot found for item: " + result); } } } } private int findSuitableOutputSlot(ItemStack result) { // Implement logic to find a suitable output slot for the given result // Return the slot index or -1 if no suitable slot is found for (int i = 0; i < this.itemHandler.getSlots(); i++) { // Ensure we do not place the output item in the input slot if (i == INPUT_SLOT) { continue; } ItemStack stackInSlot = this.itemHandler.getStackInSlot(i); if (stackInSlot.isEmpty() || (stackInSlot.getItem() == result.getItem() && stackInSlot.getCount() + result.getCount() <= stackInSlot.getMaxStackSize())) { return i; } } return -1; } private boolean hasRecipe() { Optional<FluidSeparatingRecipe> recipe = getCurrentRecipe(); if (recipe.isEmpty()) { return false; } List<ItemStack> results = recipe.get().getOutputs(); for (ItemStack result : results) { if (!canInsertAmountIntoOutputSlot(result) || !canInsertItemIntoOutputSlot(result.getItem())) { return false; } } return true; } private Optional<FluidSeparatingRecipe> getCurrentRecipe(){ SimpleContainer inventory = new SimpleContainer(this.itemHandler.getSlots()); for (int i = 0; i < itemHandler.getSlots(); i++) { inventory.setItem(i, this.itemHandler.getStackInSlot(i)); } return this.level.getRecipeManager().getRecipeFor(FluidSeparatingRecipe.Type.INSTANCE, inventory, level); } private boolean canInsertAmountIntoOutputSlot(ItemStack result) { for (int i = 1; i < this.itemHandler.getSlots(); i++) { ItemStack stackInSlot = this.itemHandler.getStackInSlot(i); if (stackInSlot.isEmpty() || (stackInSlot.getItem() == result.getItem() && stackInSlot.getCount() + result.getCount() <= stackInSlot.getMaxStackSize())) { return true; } } return false; } private boolean canInsertItemIntoOutputSlot(Item item) { for (int i = 1; i < this.itemHandler.getSlots(); i++) { ItemStack stackInSlot = this.itemHandler.getStackInSlot(i); if (stackInSlot.isEmpty() || stackInSlot.getItem() == item) { return true; } } return false; } private boolean hasProgressFinished() { return progress >= maxProgress; } private void increaseCraftingProgress() { progress++; } }  
    • No dice. Unfortunately this fix didn't work, thank you though.
  • Topics

×
×
  • Create New...

Important Information

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