Posted August 12, 20205 yr So I just created a custom purple campfire. I have a few problems I've registered the block (Code attached to the bottom). But for some reason it doesn't act like a campfire at all. The problems are that there is: no smoke no recipes working (the items stay raw) the inputted items don't render on the block the campfire doesn't re-light (with flint and steel) after it is put out public static final RegistryObject<Block> PURPLE_CAMPFIRE = BLOCKS.register("purple_campfire", () -> new CampfireBlock(false, 3, AbstractBlock.Properties.create(Material.WOOD, MaterialColor.OBSIDIAN) .hardnessAndResistance(2.0F) .sound(SoundType.WOOD) .setLightLevel(getLightValueLit(10)) .notSolid())); private static ToIntFunction<BlockState> getLightValueLit(int lightValue) { return (block) -> { return block.get(BlockStateProperties.LIT) ? lightValue : 0; }; }
August 13, 20205 yr Ok, let's do a breakdown of lazy coding. 3 hours ago, PuppyWuppy said: no smoke You need a tile entity for that. 3 hours ago, PuppyWuppy said: no recipes working (the items stay raw) You need a tile entity for that. 3 hours ago, PuppyWuppy said: the inputted items don't render on the block You need a tile entity renderer for that. 3 hours ago, PuppyWuppy said: the campfire doesn't re-light (with flint and steel) after it is put out You need to put your block in the block tags for campfires. Just because you decide to copy one part of a block doesn't necessarily mean it will work. At least check and make sure the block isn't referencing anything else before doing so.
August 13, 20205 yr Author 11 hours ago, ChampionAsh5357 said: Ok, let's do a breakdown of lazy coding. You need a tile entity for that. You need a tile entity for that. You need a tile entity renderer for that. You need to put your block in the block tags for campfires. Just because you decide to copy one part of a block doesn't necessarily mean it will work. At least check and make sure the block isn't referencing anything else before doing so. Okay, so I've added the Tile entity and the tile entity renderer here: TileEntityInit: public static final DeferredRegister<TileEntityType<?>> TILE_ENTITY = DeferredRegister .create(ForgeRegistries.TILE_ENTITIES, Reference.MOD_ID); public static final RegistryObject<TileEntityType<CampfireTileEntity>> CAMPFIRE = TILE_ENTITY.register("purple_campfire", () -> TileEntityType.Builder.create(CampfireTileEntity::new, BlockList.PURPLE_CAMPFIRE.get()).build(null)); ClientProxy / FMLClientSetupEvent ClientRegistry.bindTileEntityRenderer(TileEntityInit.CAMPFIRE.get(), CampfireTileEntityRenderer::new); I've registered the TILE_ENTITY DeferredRegister to the event bus so it works (I have other Tile Entities now so that is registered correctly). Still no change
August 13, 20205 yr Your block still needs to say "Hey! I have a tile entity!" and instantiate it. 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.
August 13, 20205 yr Author 15 minutes ago, Draco18s said: Your block still needs to say "Hey! I have a tile entity!" and instantiate it. Right, well before you said that I copied the classes from the normal campfire - CampfireBlock, CampfireTileEntity, CampfireTileEntityRenderer, but changed them to my own names, and also changed any instance of CampfireBlock, CampfireTileEntity, CampfireTileEntityRenderer to my own, instead of the vanilla ones, hoping that this would work, as then the block would be a separate thing. The smoke works now, but nothing else does 😂 Not sure what I'm doing now. Not sure I should have done that lol, what do you mean by that?
August 13, 20205 yr Just now, PuppyWuppy said: Not sure I should have done that lol, what do you mean by that? Look at: - hasTileEntity - getTileEntity 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.
August 13, 20205 yr Author 24 minutes ago, Draco18s said: Look at: - hasTileEntity - getTileEntity Where would these be?
August 13, 20205 yr 4 hours ago, PuppyWuppy said: CampfireTileEntity::new So your tile entity can never exist then? This has a set tile entity type that is unchangeable. You need to make your own class or at least extend and super correctly. 55 minutes ago, PuppyWuppy said: Where would these be? In the block class. Edited August 13, 20205 yr by ChampionAsh5357
August 13, 20205 yr Author 1 hour ago, ChampionAsh5357 said: So your tile entity can never exist then? This has a set tile entity type that is unchangeable. You need to make your own class or at least extend and super correctly. Which is why I made my own classes instead of using the vanilla ones (only using the recipe and particle), but that didn't work Quote In the block class. Okay, I can see hasTileEntity, but getTileEntity doesn't seem to be there Edited August 13, 20205 yr by PuppyWuppy
August 13, 20205 yr Author Right so the cooking works now, the only problems now are the TER doesn't work, and I can't extinguish it with a shovel/re-light it
August 14, 20205 yr Quote On 8/13/2020 at 12:16 AM, PuppyWuppy said: the campfire doesn't re-light (with flint and steel) after it is put out You need to put your block in the block tags for campfires. ChampionAsh already gave you the answer for that Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
August 14, 20205 yr Author 2 hours ago, Beethoven92 said: ChampionAsh already gave you the answer for that Yeah, I realised I made a mistake, I put the json file in my area for tags instead of the minecraft area. The TER still doesn't work though
August 14, 20205 yr 42 minutes ago, PuppyWuppy said: The TER still doesn't work though Did you even register/attach the TER to the respective TE in the client setup?
August 14, 20205 yr Author 49 minutes ago, ChampionAsh5357 said: Did you even register/attach the TER to the respective TE in the client setup? I think so: I have this line inside of my ClienProxy class (inside the FMLClientSetupEvent) which gets called on the EventBus ClientRegistry.bindTileEntityRenderer(TileEntityList.CAMPFIRE.get(), PurpleCampfireTileEntityRenderer::new);
August 14, 20205 yr 52 minutes ago, PuppyWuppy said: I think so Then I would like to see the tile entity class and the renderer class.
August 14, 20205 yr Author 7 minutes ago, ChampionAsh5357 said: Then I would like to see the tile entity class and the renderer class. TileEntity (Copied from the vanilla Campfire (Changed references of campfire to my own)): https://pastebin.com/n7eQTjUa TileEntityRenderer (Again copied from the vanilla Campfire (Changed references of campfire to my own)): https://pastebin.com/9xLm4TjG And the Block just in case you need it (Again changed and updated references): https://pastebin.com/vk7AXrZK
August 14, 20205 yr Author 1 hour ago, ChampionAsh5357 said: You probably want to look at this. Forge synchronizes differently than mc. Ah yeah, that'll probably why then lol, I'll take a look
August 17, 20205 yr On 8/14/2020 at 7:41 PM, PuppyWuppy said: Ah yeah, that'll probably why then lol, I'll take a look Did you by any chance get your client synchronization to work, im having the exact problem.
August 18, 20205 yr 20 hours ago, greetthemoth said: Did you by any chance get your client synchronization to work, im having the exact problem. You should make your own post for this Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
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.