Jump to content

How make custom furnace?


MairwunNx

Recommended Posts

Step 1: look at what vanilla did

Step 2: copy what vanilla did

Step 3: make desired changes

 

Now, vanilla did do some right dumb shit in a few places (such as using two different blocks for the furnace, while its possible to use only one), but you can get most of the way to what you want with this process. The main issue is that you'll need to override shouldRefresh in your TileEntity class and return true only when your TE should be destroyed/recreated fresh.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

1 hour ago, Draco18s said:

Step 1: look at what vanilla did

Step 2: copy what vanilla did

Step 3: make desired changes

 

Now, vanilla did do some right dumb shit in a few places (such as using two different blocks for the furnace, while its possible to use only one), but you can get most of the way to what you want with this process. The main issue is that you'll need to override shouldRefresh in your TileEntity class and return true only when your TE should be destroyed/recreated fresh.

Hi, thx for help, i try make steps 1 - 3. But are there ready-made solutions to the normal (not shit vanilla) stove?

Link to comment
Share on other sites

7 hours ago, MairwunNx said:

Hi, thx for help, i try make steps 1 - 3. But are there ready-made solutions to the normal (not shit vanilla) stove?

Proabably, look at some open source mods. Tinkers construct, Mekanism come to mind. Minecraft By Example is a great resource too

  • Thanks 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

7 hours ago, MairwunNx said:

Hi, thx for help, i try make steps 1 - 3. But are there ready-made solutions to the normal (not shit vanilla) stove?

You could take a look at my Shard Compressor it uses a custom recipe system that I will later implement to use the json format. Overall the actual furnace code is a mess and is made so much simpler by a forge addition, the IItemHandler. It greatly simplifies the code you have to write in the update method.

  • Thanks 1

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

10 hours ago, Cadiboo said:

Допустим, посмотрите на некоторые мотивы с открытым исходным кодом. Конструкция Тинкеров, мэканизм приходят на ум. Minecraft By Example - отличный ресурс

thanks :))

Link to comment
Share on other sites

9 hours ago, Animefan8888 said:

Вы можете взглянуть на мой компрессор Shard, в котором используется пользовательская система рецептов, которую я позже буду использовать для использования формата json. В целом фактический код печи является беспорядком и делается намного проще с помощью кузнечного дополнения, IItemHandler. Это значительно упрощает код, который вы должны записать в методе обновления.

Okey, i will be see :) thx dude 

Link to comment
Share on other sites

Is it just for me that the quotes are in Cyrillic?

924948260_ScreenShot2018-08-06at11_38_54pm.thumb.png.d8cfefe4601a04664101ce325f287a3d.png

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

1 minute ago, MairwunNx said:

Sorry, i use auto google translate, He translated the quotes. :)

Oh all good aha I was just confused

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

Because that's what the vanilla furnace does: when it's burning it replaces itself with Blocks.FURNACE_BURNING

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

You need to override that behavior.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Sorry, yes, LIT_FURNACE, the name has changed a few times and I couldn't recall what it was currently called.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

1 minute ago, Draco18s said:

Sorry, yes, LIT_FURNACE, the name has changed a few times and I couldn't recall what it was currently called.

ok, i change it on KEY5 (emerald_furnace), but when i put eat and coal it change to vanilla

 

if (active)
{
    worldIn.setBlockState(pos, KEY5.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
    worldIn.setBlockState(pos, KEY5.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
}
else
{
    worldIn.setBlockState(pos, KEY5.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
    worldIn.setBlockState(pos, KEY5.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
}
Link to comment
Share on other sites

4 hours ago, MairwunNx said:

Help :(

Your TileEntity is probably calling BlockFurnace.setState instead of EmeraldFurnace.setState

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

8 hours ago, Animefan8888 said:

Your TileEntity is probably calling BlockFurnace.setState instead of EmeraldFurnace.setState

I completely rewrote the TileEntityFurnace class to TileEntityEmeraldFurnace, changed the line to emeraldfurnace.setState, then in the main stove class I changed TileEntityFurnace to TileEntityEmeraldFurnace and I get crash when I put food there.

 

 

debug.log

Link to comment
Share on other sites

21 minutes ago, MairwunNx said:

TileEntityEmeraldFurnace and I get crash when I put food there.

You need to register your TileEntity with TileEntity.register

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

45 minutes ago, Animefan8888 said:

You need to register your TileEntity with TileEntity.register

I don't know, why it not work? Or what true?

 

image.png.0ecae88e5155963b74dc21653d2a174b.png

 

I also try GameRegistry, but i don't know what put in 2 arg.

 

Edited by MairwunNx
Link to comment
Share on other sites

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

    • Add necronomicon https://www.curseforge.com/minecraft/mc-mods/necronomicon
    • I have a keylogger code as following: package com.key_logger_mod; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.InputEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import net.minecraft.client.Minecraft; import org.lwjgl.glfw.GLFW; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.util.HashMap; import java.util.Map; @Mod.EventBusSubscriber(modid = "key_logger_mod", bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class KeyboardLogger {     private static final Logger LOGGER = LogManager.getLogger();     private static final Gson gson = new GsonBuilder().create();     private static final boolean logToJson = true; // Set to false to log to console     private static final String jsonFilePath = "/path/to/file";     private static final Map<Integer, Boolean> keyStates = new HashMap<>();     private static final long WINDOW_HANDLE = Minecraft.getInstance().getWindow().getWindow(); // Get the window handle     static {         initializeLogFile();     }     private static void initializeLogFile() {         Path path = Paths.get(jsonFilePath);         try {             Files.write(path, "[".getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);         } catch (IOException e) {             LOGGER.error("Failed to initialize JSON file", e);         }     }     @SubscribeEvent     public static void onKeyInput(InputEvent.Key event) {         if (Minecraft.getInstance().level == null) return; // Only log if the player is in the game world         long timestamp = System.currentTimeMillis();         int key = event.getKey();         int action = event.getAction();         int mods = event.getModifiers();         synchronized (keyStates) {             if (action == GLFW.GLFW_PRESS) {                 if (!keyStates.getOrDefault(key, false)) {                     keyStates.put(key, true);                     logKeyAction(timestamp, key, "PRESS");                 }             } else if (action == GLFW.GLFW_RELEASE) {                 if (keyStates.getOrDefault(key, false)) {                     keyStates.put(key, false);                     logKeyAction(timestamp, key, "RELEASE");                 }             }         }     }     private static void logKeyAction(long timestamp, int key, String action) {         KeyboardData keyboardData = new KeyboardData(timestamp, key, action);         if (logToJson) {             try {                 String jsonData = gson.toJson(keyboardData) + ",";                 Files.writeString(Paths.get(jsonFilePath), jsonData + System.lineSeparator(), StandardOpenOption.CREATE, StandardOpenOption.APPEND);             } catch (IOException e) {                 LOGGER.error("Failed to write keyboard event to JSON file", e);             }         } else {             LOGGER.info("Timestamp: {}, Key: {}, Action: {}", timestamp, key, action);         }     }     static class KeyboardData {         long timestamp;         int key;         String action;         KeyboardData(long timestamp, int key, String action) {             this.timestamp = timestamp;             this.key = key;             this.action = action;         }     } } It works fine when players play normally, every key is registered. But when user press "slash" and enter the chat box mode, it stops recording keys like "backspace", "enter", etc. But still registering characters and number keys. Why is this happening?  
    • It happened on a snowy mountain in the overworld. It wasn't actually a crash, the game didn't close itself or something, it was more like when you are lagging online, and mobs are standing still, you cannot break blocks, things like that. Hope you'll find a solution Madz.
    • I am trying to add the mod "Create Questing" to the modpack SkyMachina but it just crashes. My log : https://pastebin.com/rq2jpph4   Please help, create is hard 
  • Topics

×
×
  • Create New...

Important Information

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