Jump to content

ModMCdl

Members
  • Posts

    188
  • Joined

  • Last visited

Everything posted by ModMCdl

  1. There is a specific class that defines the recipes for your new workbench block. I'll post a few of the key ideas below, but just know it's only to make the git I provide later on to make a little more sense for your situation. In the recipes class, I "defined" recipes through a table: private static final TwoByTwoRecipe INSTANCE = new TwoByTwoRecipes(); private final Table<ItemStack, ItemStack, ItemStack> craftingList = HashBasedTable.<ItemStack, ItemStack, ItemStack>create(); // Item One | Item Two | Result The recipes would then be constructed as such: addCustomRecipe(new ItemStack(Items.ItemOne), new ItemStack(Items.ItemTwo), new ItemStack(Items.Result)); Of which would call on: public void addCustomRecipe(ItemStack input1, ItemStack input2, ItemStack result) { if(getRecipeResult(input1, input2) != ItemStack.EMPTY) return; this.craftingList.put(input1, input2, result); } A final method would compare the two results, and determine if the item can be crafted by checking each of the slots. You can take a look at how I did it through the files here: https://github.com/CammiePone/Voidaic-Arcania/tree/master/src/main/java/com/camellias/voidaicarcania/common/blocks/machines/blockbotanyaltar , but be aware that the block is more based off of a furnace and requires a fuel. But you should be able to reverse engineer it based off of the examples above. It's interaction with the container should be relatively the same, but you can disregard the fuel requirements.
  2. Sorry for the delayed reply. Neither of those solutions worked. However, after clearing the cache, CMD threw up a whole lot of "expired" or "invalid" cookie errors, yet still managed to complete successfully.
  3. Hello. This is a problem unique to me I find on my dev team, so I'm pretty sure it's just a problem with either a : my gradle setup, b : my java setup, or c : just my system in general. Whenever I try to reload the dependencies in our mod's build.gradle file, the command prompt reports success, but the dependencies either aren't added at all, or if they're already there, they aren't updated. I usually need to end up packaging what I have, and getting the correctly updated source from another team member. Does anyone know what possible causes for this exist, and any solutions for proposed cause? (Again, everyone else can refresh and update it fine, so I'm 99% that it isn't a problem with the build.gradle, but I'll link it anyways: https://github.com/CammiePone/Voidaic-Arcania/blob/master/build.gradle)
  4. I understand what they are. I didn't say anything about "fake achievements." You didn't even answer my question. I know there's a way to do it, I know there's an interface to use. Where do I call this method?
  5. I'm having trouble trying to find any info on implementing custom toast messages in 1.12.2 (ie. the advancements/crafting messages in top right corner). I've skimmed through the docs but I can't seem to find any info there. Could someone possibly provide links to documentation/tutorials or source that implements these? Or just point me in the right direction? Thanks.
  6. Does this affect the player's data at all? (Asking because I, too, run a forge server).
  7. So... don't do what they said? Also, @jabelar's idea worked out fine, so thanks. Can't believe I missed that!
  8. Hello! I'm trying to make a message pop up when a player joins the world, similar to how mods like Mekanism lets players know if there's an update. However, it doesn't show up in-game, and when I add a system print line, the print line doesn't pop up in the console either. I know it's being registers and called properly, because the method is called in my WorldEventsHandler, and everything else in there works. @SubscribeEvent public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) { event.player.sendMessage(new TextComponentString("Voidaic Arcania: This mod is still in BETA. Additional gameplay information can be found in the wiki here: https://github.com/CammiePone/Voidaic-Arcania/wiki")); } If you need to poke around, here is the git: https://github.com/CammiePone/Voidaic-Arcania/blob/master/src/main/java/com/camellias/voidaicarcania/util/handlers/WorldEventHandler.java Note: this development is still in beta, and being developed by two people who are still learning, so sloppy code is to be expected.
  9. Thank you for the help. I'd like to apologise for my partner's behavior. Can you explain why you'd recommend the aforementioned changes?
  10. This is the code snippet I'm currently working with: ContainerPestle(TileEntityPestle tileentity, EntityPlayer player) { //CustomSlots this.tileentity = tileentity; this.addSlotToContainer(new SlotItemHandler(tileentity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null), 0, 32, 25)); this.addSlotToContainer(new SlotItemHandler(tileentity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null), 1, 67, 44)); this.addSlotToContainer(new SlotPestleOutput(player, player.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null), 2, 124, 35)); for(int y = 0; y < 3; ++y) { //Player Inv for(int x = 0; x < 9; ++x) { this.addSlotToContainer(new Slot((IInventory) player, x + y * 9 + 9, 8 + x * 18, 84 + y * 18)); } } for(int x = 0; x < 9; ++x) //Hotbar this.addSlotToContainer(new Slot((IInventory) player, x, 8 + x * 18, 142 )); } I've changed it like so, replacing every appearance of IInventory with InventoryPlayer and/or EntityPlayer#inventory. Since Minecraft does not seem to follow Java as I've been taught, in this instance (mainly just the GUI and Custom Crafting thing I'm trying to get going), I really have absolutely no clue what I'm doing. I can't find any tutorials or examples that may be able to help me out, so I'm mostly just going with advice here, and trying to figure everything out myself.
  11. If I do that, Eclipse wants me to change it to IInventory. Should I implement it elsewhere in the code, or could you provide and example. It's totally possible I just don't understand where you want me to change it.
  12. So then what would the solution be? Is this cast just not needed at all, and can I do without it? What would you suggest replacing this with?
  13. If you're referring to the Player Inventory and Hotbar sections of my ContainerPestle, then isn't that needed because you're calling it from the Player's inventory? I was under the impression from previous advice this is what you needed to do.
  14. So now that I have time again, I've torn apart the console logs, and found this error whenever I try to open up the pestle GUI: [11:05:36] [Server thread/FATAL]: Error executing task java.util.concurrent.ExecutionException: java.lang.ClassCastException: net.minecraft.entity.player.EntityPlayerMP cannot be cast to net.minecraft.inventory.IInventory at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_131] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_131] at net.minecraft.util.Util.runTask(Util.java:30) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:754) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:699) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) [IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:548) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_131] Caused by: java.lang.ClassCastException: net.minecraft.entity.player.EntityPlayerMP cannot be cast to net.minecraft.inventory.IInventory at com.modmcdl.magitech.gui.ContainerPestle.<init>(ContainerPestle.java:30) ~[ContainerPestle.class:?] at com.modmcdl.magitech.gui.GuiHandler.getServerGuiElement(GuiHandler.java:19) ~[GuiHandler.class:?] at net.minecraftforge.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:254) ~[NetworkRegistry.class:?] at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:89) ~[FMLNetworkHandler.class:?] at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2741) ~[EntityPlayer.class:?] at com.modmcdl.magitech.blocks.BlockPestle.onBlockActivated(BlockPestle.java:92) ~[BlockPestle.class:?] at net.minecraft.server.management.PlayerInteractionManager.processRightClickBlock(PlayerInteractionManager.java:474) ~[PlayerInteractionManager.class:?] at net.minecraft.network.NetHandlerPlayServer.processTryUseItemOnBlock(NetHandlerPlayServer.java:712) ~[NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:68) ~[CPacketPlayerTryUseItemOnBlock.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:13) ~[CPacketPlayerTryUseItemOnBlock.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_131] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_131] at net.minecraft.util.Util.runTask(Util.java:29) ~[Util.class:?]
  15. How are you structuring your mod overall? Are you registering each item in their specific class, or do you have a main class like "ModItem" or "ModBlocks" where you list them all? It's unclear from the code you've given us.
  16. Oh there. I had one professor who did that, and another who didn't. My dept. head nowadays doesn't like it, so I just don't do it. I thought he was referring to an actual error in my scripting.
  17. Added system outs, and it really didn't help at all. Everything is loading fine, its just "not working". As I don't understand the problem, I can't get much more descriptive than that. Digging down deeper tho, I do get an error, its just blocked by console "skipping lines" so I had to open that remotely. I'll try to work this out later, as I have to leave now as well. Where do you see missing brackets?
  18. Yea. I managed to get the forge to work, hence why I haven't been citing it. But I can't figure out the problem, because I can't tell any differences.
  19. I can't find any errors when trying to open the GUI. It just doesn't open.
  20. Not quite sure. I was looking somewhere, and the code there made it seem like it was necessary for my output. I'm trying to make a custom crafting utility that combines two items. Sort of the equivalent of an equals sign. My GuiHander did error, and I've fixed that along with other corresponding errors. Everything checks out, and the game launches, but the GUI still does not show up. (I've uploaded the changed files to the git).
  21. Can you explain in a little bit more detail please? Omitting the TileEntity produces errors, along with any other solution Eclipse suggests. While I am familiar with java and a little bit of modding, some of these concepts are still a bit fuzzy to me.
  22. Simply an error and nothing happens. java.util.concurrent.ExecutionException: java.lang.ClassCastException: com.modmcdl.magitech.tileenitity.TileEntityPestle cannot be cast to net.minecraftforge.items.IItemHandler at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_131] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_131] at net.minecraft.util.Util.runTask(Util.java:30) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:754) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:699) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) [IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:548) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_131] Caused by: java.lang.ClassCastException: com.modmcdl.magitech.tileenitity.TileEntityPestle cannot be cast to net.minecraftforge.items.IItemHandler at com.modmcdl.magitech.slot.SlotPestleOutput.<init>(SlotPestleOutput.java:22) ~[SlotPestleOutput.class:?] at com.modmcdl.magitech.gui.ContainerPestle.<init>(ContainerPestle.java:26) ~[ContainerPestle.class:?] at com.modmcdl.magitech.gui.GuiHandler.getServerGuiElement(GuiHandler.java:19) ~[GuiHandler.class:?] at net.minecraftforge.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:254) ~[NetworkRegistry.class:?] at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:89) ~[FMLNetworkHandler.class:?] at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2741) ~[EntityPlayer.class:?] at com.modmcdl.magitech.blocks.BlockPestle.onBlockActivated(BlockPestle.java:92) ~[BlockPestle.class:?] at net.minecraft.server.management.PlayerInteractionManager.processRightClickBlock(PlayerInteractionManager.java:474) ~[PlayerInteractionManager.class:?] at net.minecraft.network.NetHandlerPlayServer.processTryUseItemOnBlock(NetHandlerPlayServer.java:712) ~[NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:68) ~[CPacketPlayerTryUseItemOnBlock.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:13) ~[CPacketPlayerTryUseItemOnBlock.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_131] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_131] at net.minecraft.util.Util.runTask(Util.java:29) ~[Util.class:?]
  23. Both fail to cast to IITemHandler. But I cannot see where that fails.
  24. Hello, been trying to push a problem I've been having for a while. I've created a tile entity, gui, and container for two of my blocks BlockForge and BlockPestle, but when trying to implement them, I cannot get them to appear in game. The purpose of these blocks is for custom crafting, recipes, which I have also created. (But seem to be unable to implement). Not sure where I am going wrong here. GUI Folder (easier than linking each file specifically, as I do not know where the problem is): https://github.com/ModMCdl/Magitech/tree/master/src/main/java/com/modmcdl/magitech/gui BlockPestle: https://github.com/ModMCdl/Magitech/blob/master/src/main/java/com/modmcdl/magitech/blocks/BlockPestle.java BlockForge: https://github.com/ModMCdl/Magitech/blob/master/src/main/java/com/modmcdl/magitech/blocks/BlockForge.java TileEntity Folder: https://github.com/ModMCdl/Magitech/tree/master/src/main/java/com/modmcdl/magitech/tileenitity Slot Folder (idk if this is specifically needed, but I'll include it anyways): https://github.com/ModMCdl/Magitech/tree/master/src/main/java/com/modmcdl/magitech/slot Thanks in advance!
  25. Oh wow. I probably will never make a server-only mod, but this is actually VERY useful information!
×
×
  • Create New...

Important Information

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