Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

vassdeniss

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by vassdeniss

  1. I tried playing with a friend today on our server but it's crashing. I do not know why and need some help. The server worked fine the other day, we played on the 24th last time. Pastebin link to the log P.S Yes I have tried deleting the config folder
  2. From the looks of it LoomContainer still doesn't call onCraftMatrixChanged... What am i missing seriously?
  3. Something like this? @Override public void onCraftMatrixChanged(IInventory inventoryIn) { ItemStack itemStack = base.getStack(); ItemStack itemStack1 = addition.getStack(); ItemStack itemStack2 = result.getStack(); if (itemStack2.isEmpty() && itemStack.isEmpty() || itemStack1.isEmpty()) { this.result.putStack(ItemStack.EMPTY); } super.onCraftMatrixChanged(inventoryIn); updateOutput(); }
  4. because everytime i try to find a reference it never finds me one... Do I need to call it from the tile entity # insertItem?
  5. No but i meant it never gets called manually in vanilla either. I presume i need to call it whenever i place an item inside?
  6. As far as i can see the onMatrixChange never gets called manually? How should I go about implementing this?
  7. I knew it. But isnt that called whenever something in the container is placed?
  8. here: https://github.com/vassdeniss/makoru-1-16-4-source Dont mind the clutter of unorganization ill get to that soon
  9. i can't seem to handle the debugger. never used it for mods. How exactly do I do it
  10. I didn’t thought of a debugger. Ill check now. The output doesnt change so no it doesnt work properly. Are the methods written properly?
  11. I made a custom machine in my mod alongside a custom recipe but I can't seem to get the output to update based on the input. Help would be appreciated! Here is how i am trying to implement it in my container. public void updateOutput() { List<SpiritRecipe> list = world.getRecipeManager().getRecipes(ModRecipeSerializers.SPIRIT_TYPE, inventory, world); if (list.isEmpty()) { craftResultInventory.setInventorySlotContents(0, ItemStack.EMPTY); System.out.println("List is empty"); } else { SpiritRecipe spiritRecipe = list.get(0); ItemStack itemstack = spiritRecipe.getCraftingResult(inventory); craftResultInventory.setRecipeUsed(spiritRecipe); craftResultInventory.setInventorySlotContents(0, itemstack); } } @Override public void onCraftMatrixChanged(IInventory inventoryIn) { super.onCraftMatrixChanged(inventoryIn); if (inventoryIn == inventory) { updateOutput(); } }
  12. I know about custom recipes but the anvil uses a recipe container to check if the item can be used and i dont know how to make a custom one.
  13. Well nevermind it does work! Now just how would i be able to make custom recipes for it that a normal anvil can't do?
  14. Why not yeah but that won't make things all work yet in my opinion
  15. I am trying to create a custom anvil for my mod and the approach i am trying is to create a normal vanilla anvil with custom recipe container - i tried creating the block and passing a custom container to it but i do feel a bit stuck and confused on how to do this. Some explanation and guidence would be great! Thanks in advance. package com.vassdeniss.makoru.blocks; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.container.INamedContainerProvider; import net.minecraft.inventory.container.SimpleNamedContainerProvider; import net.minecraft.stats.Stats; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.IWorldPosCallable; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.World; import net.minecraftforge.fml.network.NetworkHooks; public class AngelAnvilBlock extends Block { private static final ITextComponent AngelAnvilContainer = new TranslationTextComponent("container.crafting"); public AngelAnvilBlock() { super(Block.Properties.create()); } @Override public ActionResultType onBlockActivated(BlockState p_225533_1_, World worldIn, BlockPos p_225533_3_, PlayerEntity player, Hand p_225533_5_, BlockRayTraceResult p_225533_6_) { if (worldIn.isRemote) { return ActionResultType.SUCCESS; } else { NetworkHooks.openGui(player, ); player.addStat(Stats.INTERACT_WITH_ANVIL); return ActionResultType.CONSUME; } } @Override public INamedContainerProvider getContainer(BlockState state, World world, BlockPos pos) { return new SimpleNamedContainerProvider((id, inventory, player) -> new AngelAnvilContainer(id, inventory, IWorldPosCallable.of(world, pos)), AngelAnvilContainer); } } package com.vassdeniss.makoru.blocks; import com.vassdeniss.makoru.util.RegistryHandler; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.container.RepairContainer; import net.minecraft.util.IWorldPosCallable; public class AngelAnvilContainer extends RepairContainer { private final IWorldPosCallable field_217070_e; public AngelAnvilContainer(int id, PlayerInventory playerInventory, IWorldPosCallable p_i50102_3_) { super(id, playerInventory, p_i50102_3_); this.field_217070_e = p_i50102_3_; } @Override public boolean canInteractWith(PlayerEntity player) { return isWithinUsableDistance(this.field_217070_e, player, RegistryHandler.ANGEL_ANVIL.get()); } }
  16. I recently got an iMac and now I' m transferring everything i need over - including my mod - but when i try to run it i get this error which i can't find information on it anywhere and would appreciate if anyone can help! Heres the error
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.