Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 05/12/24 in all areas

  1. No I didnt, I havent installed OptiFine yet, and that is the full crash report oh wait, it suddenly worked, idk how but I tested it rn and it worked, literally didnt do anything but um yeah cool I guess
    1 point
  2. 1 point
  3. Did you test it with Forge and Optifine only? Without any other mods? If yes, add the full crash-report Also try the Optifine alternative Embeddium + Oculus
    1 point
  4. It is an issue with the mod morewaterlogged - looks like this mod requires another Create: New Age build
    1 point
  5. The player doesn’t have a respawn point because you haven’t used a bed or respawn anchor or something. When the players respawn point is null and the player wants to respawn, the server calculates when the player should respawn. If getRespawnPosition is null, get the world spawn from the ServerLevel
    1 point
  6. Try and replace () -> new Item(Item.properties….. in ModItems with () -> new HoneyBottleItem(Item.properties……
    1 point
  7. Okay, I shall look into this problem more in depth and look at Kaupenjoe's Java tutorials on YouTube. Thank you so much for all of your support over these last two weeks, you have helped me so much and I think that now I have a better understanding of Java thanks to you. 😊
    1 point
  8. All I know is what I've told you; I can't help more without inspecting the entirety of your code, and I think you'd probably learn the most from working this problem out yourself at this point. If you're still confused, try finding some other tutorials for modding; if you don't understand what the code is doing, try looking for Java tutorials. I hope this helps.
    1 point
  9. Thank you you're the best!! It looks like timeless and classic has a conflict with origins in the latest update.
    1 point
  10. Ok, so, I'm not sure at all what I did, but this time when I loaded into the game, it says 3 mods loaded. The 3rd one is WorldEdit. And, when I do "//" in chat, the WorldEdit commands show up. I have no idea what happened, but this is great!
    1 point
  11. I already made it, i follow this video and works perfect, its in spanish because im from Argentina but if someone need it i will leave it here in the post, Thank you for taking your time to help everyone @TileEntity
    1 point
  12. that fixed it! Thank you soo much!!! If there is a way I can like upvote your profile or something let me know!
    1 point
  13. There are two java lines and the / are mixed up Use this as script: "C:\Program Files\Java\jdk-17.0.10\bin\javaw.exe" -Xmx8G -Xms2048M @libraries/net/minecraftforge/forge/1.20.1-47.2.0/win_args.txt %* pause Replace the complete script with it (you don't need the REM lines) Make sure the java path is correct and keep the quotation marks
    1 point
  14. The problematic mods turned out to be: -- Supplementaries -- Amendments
    1 point
  15. 1 point
  16. You could but that would be stupid. And no people wouldnt buy it.
    1 point
  17. There are a ton of guides, and I felt like I just needed to make one of how I mod using 1.12.2. Table of Contents: 1. Getting Started 2. Registries 3. Proxies 3. Basic Block/Item 4. GUIs (There will be more coming, I am writing this as I learn.) Getting Started: Download Forge mdk Unzip it Run gradlew setupDecompWorkspace for Eclipse: Run gradlew eclipse in cmd.exe for Intellij: Run gradlew setupDevWorkspace ideaModule Import build.gradle as a project Go to File -> Project Structure -> Modules Click '+' and click import, choose (folder name).iml. (There is only one in the folder) Close intellij run gradlew genIntellijruns Open Intellij Run -> Profile -> Edit Configurations Choose server/client Set "Use classpath of module" to (folder name)_main Apply Registries: Registries are Forge's way of injecting instances of your classes into the game. Basic setup: You need a class annotated with EventBusSubscriber From there you add methods annotated with EventHandler to register blocks. Example: @EventHandler public static void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(blocks); } blocks is a List of all blocks in the mod. Note: When registering blocks, you also have to register an ItemBlock. To do this use the Item registry event, and register a new instance of ItemBlock(you have to set its registry name). Registering models: (This may need to be client side only, if it is please tell me) @SubscribeEvent public static void registerModels(ModelRegistryEvent event) { for (Block block : blocks) { if (block.getRegistryName() != null) ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(),"inventory")); } } Pretty simple, nothing too hard. ObjectHolder: What is ObjectHolder? ObjectHolder is used to get instances of your block. Use: @ObjectHolder("modid") public class ModBlocks { @ObjectHolder("mod_block") public static final Block MOD_BLOCK = null; After the block is registered, an instance of it will be injected into MOD_BLOCK. Proxies: Minecraft runs on 2 sides. Client and server. Certain things are only client side, some are only server side. Setting up proxies: Proxies require 2 classes, Client and Server. The SidedProxy annotation requires 2 arguments, the path to your client and server proxy (ex. "com.author.mod.proxies.ClientProxy") Then you can use the SidedProxy annotation with the argument saying what side it is to tell Forge to run that code on a certain side. If you want to check what side a method is, use world.isRemote(), true means client side, false means server side. Blocks/Items: This is pretty simple, just make a class extend Block/Item, put in the necessary methods and constructors (setRegistryName() is a big one). Then register an instance of that block/item in the appropriate registry. When making a texture/model, you need to have the appropriate files. (BlockState for a block, block model for blocks, item model for blocks and items, and textures) I suggest looking at the default MC asset files when making textures. I won't get too much into detail here because it's not that hard to do. GUIs: GUIs are a bit harder. A GUI can either be a container, or a screen. A GUI requires 2-3 classes bare minimum, depending on what type it is. Simple screen: Create a class that implements IGuiHandler. That class needs 2 overrided methods. Example: @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { return new Container(player.inventory, world); } @Override public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { return new Gui(new Container(player.inventory, world)); } Now you gotta register it in your main class's init method: NetworkRegistry.INSTANCE.registerGuiHandler(instance, new WorkbenchGuiHandler()); (instance is the instance of your main class) Note: the instance should be obtained by making a variable and annotating it with the Instance annotation, and your modid as an argument. Now, we have to make the actual GUI. For my example I am going to be making a custom crafting table. Here is the GUI screen with the crafting table background: GuiScreen(Container inventorySlotsIn) { super(inventorySlotsIn); } //This is for everything behind the items @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); //Makes the background darker like in a normal craftring table this.drawDefaultBackground(); //Size of the GUI image int i = (this.width - this.xSize) / 2; int j = (this.height - this.ySize) / 2; //Load the default crafting GUI texture this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/crafting_table.png")); //Draw it this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); } //Now for on top of the items @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { //Draw the name at the top, getting the name from the lang file. this.fontRenderer.drawString(I18n.format("gui.custom_workbench.name"), 28, 6, 4210752); } Now we need a container to contain all of the items. the container has to draw the player's inventory, the inventory, listen for click events, etc... just saying, this one's a big class. Commented code is code for making the inventory a crafting table public class GUIContainer extends Container { private World world; private InventoryCrafting matrix; private InventoryCraftResult result; private EntityPlayer player; GUIContainer(InventoryPlayer playerInventory, World world) { //matrix = new InventoryCrafting(this, 3, 3); player = playerInventory.player; this.world = world; //result = new InventoryCraftResult(); /* int index = 1; Output slot, code down below. addSlotToContainer(new CraftResultSlot(matrix, 0, 124, 35)); Crafting matrix for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { addSlotToContainer(new Slot(matrix, index, 30 + j * 18, 17 + i * 18)); index += 1; } } */ //Player's inventory for (int k = 0; k < 3; k++) { for (int i = 0; i < 9; i++) { addSlotToContainer(new Slot(playerInventory, index, 8 + i * 18, 84 + k * 18)); index += 1; } } //Player's hotbar for (int i = 0; i < 9; i++) { addSlotToContainer(new Slot(playerInventory, i, 8 + i * 18, 142)); } } //Checking if player can open the inventory @Override @ParametersAreNonnullByDefault public boolean canInteractWith(EntityPlayer playerIn) { /* Code to check if it is a custom crafting table Getting the block the player is looking at, with a max distance of 6 RayTraceResult ray = playerIn.rayTrace(6, 1.0f); if (ray == null) return false; //Get the position of the block BlockPos pos = ray.getBlockPos(); //Get the world World world = playerIn.getEntityWorld(); //And the block Block block = world.getBlockState(pos).getBlock(); //Check if it is our block return block.equals(ModBlocks.CUSTOM_WORKBENCH); */ return true; } @Override public void onContainerClosed(EntityPlayer playerIn) { super.onContainerClosed(playerIn); /* drop the items in the crafting grid if (!world.isRemote) { for (int i = 0; i < 9; ++i) { ItemStack itemstack = matrix.removeStackFromSlot(i); if (!itemstack.isEmpty()) { playerIn.dropItem(itemstack, false); } } } */ } //Code when item is shift clicked @Override @Nonnull public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = ItemStack.EMPTY; Slot slot = inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack currentItem = slot.getStack(); itemstack = currentItem.copy(); /* if (index == 0) { currentItem.getItem().onCreated(currentItem, world, playerIn); if (!mergeItemStack(currentItem, 37, 46, false)) { return ItemStack.EMPTY; } onPickupFromSlot(recipe); slot.onSlotChange(currentItem, itemstack); } */ if (index >= 11 && index < 38) { //if (!mergeItemStack(currentItem, 37, 46, false)) { //if (recipe != null) //Put correct output in output slot //putStackInSlot(0, recipe.output); //return ItemStack.EMPTY; //} //This might not work! if(!mergeItemStack(currentItem, 0, 8, false)) { return ItemStack.EMPTY; } } //else if (index >= 38 && index < 46) { //if (!mergeItemStack(currentItem, 10, 37, false)) { //return ItemStack.EMPTY; //} //} else if (!mergeItemStack(currentItem, 10, 46, false)) { //return ItemStack.EMPTY; //} if (currentItem.isEmpty()) { slot.putStack(ItemStack.EMPTY); } else { slot.onSlotChanged(); } if (currentItem.getCount() == itemstack.getCount()) { return ItemStack.EMPTY; } slot.onTake(playerIn, currentItem); } return itemstack; } @Override public boolean canMergeSlot(ItemStack stack, Slot slotIn) { return /*slotIn.inventory != result && */super.canMergeSlot(stack, slotIn); } /* @Override public void onCraftMatrixChanged(IInventory in) { IRecipe recipe = CraftingManager.findMatchingRecipe(matrix, world); if (recipe != null) putStackInSlot(0, recipe.getRecipeOutput()); } */ } If you want the CraftResultSlot code, here it is: public class CraftResultSlot extends Slot { public CraftResultSlot(InventoryCrafting matrix, int index, int x, int y) { super(matrix, index, x, y); } //Disable items getting put in the slot @Override public boolean isItemValid(ItemStack stack) { return false; } } Please comment anything i missed, things I should add, errors, etc... I will expand this soon!
    1 point
  18. Also add the latest.log from the server after such disconnects
    0 points
×
×
  • Create New...

Important Information

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