PuppyWuppy Posted August 12, 2020 Posted August 12, 2020 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; }; } Quote
ChampionAsh5357 Posted August 13, 2020 Posted August 13, 2020 Ok, let's do a breakdown of lazy coding. On 8/12/2020 at 10:16 PM, PuppyWuppy said: no smoke Expand You need a tile entity for that. On 8/12/2020 at 10:16 PM, PuppyWuppy said: no recipes working (the items stay raw) Expand You need a tile entity for that. On 8/12/2020 at 10:16 PM, PuppyWuppy said: the inputted items don't render on the block Expand You need a tile entity renderer for that. On 8/12/2020 at 10:16 PM, PuppyWuppy said: the campfire doesn't re-light (with flint and steel) after it is put out Expand 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. 1 Quote
PuppyWuppy Posted August 13, 2020 Author Posted August 13, 2020 On 8/13/2020 at 2:07 AM, 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. Expand 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 Quote
Draco18s Posted August 13, 2020 Posted August 13, 2020 Your block still needs to say "Hey! I have a tile entity!" and instantiate it. Quote 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.
PuppyWuppy Posted August 13, 2020 Author Posted August 13, 2020 On 8/13/2020 at 4:09 PM, Draco18s said: Your block still needs to say "Hey! I have a tile entity!" and instantiate it. Expand 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? Quote
Draco18s Posted August 13, 2020 Posted August 13, 2020 On 8/13/2020 at 4:39 PM, PuppyWuppy said: Not sure I should have done that lol, what do you mean by that? Expand Look at: - hasTileEntity - getTileEntity Quote 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.
PuppyWuppy Posted August 13, 2020 Author Posted August 13, 2020 On 8/13/2020 at 4:40 PM, Draco18s said: Look at: - hasTileEntity - getTileEntity Expand Where would these be? Quote
ChampionAsh5357 Posted August 13, 2020 Posted August 13, 2020 (edited) On 8/13/2020 at 1:48 PM, PuppyWuppy said: CampfireTileEntity::new Expand 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. On 8/13/2020 at 5:05 PM, PuppyWuppy said: Where would these be? Expand In the block class. Edited August 13, 2020 by ChampionAsh5357 Quote
PuppyWuppy Posted August 13, 2020 Author Posted August 13, 2020 (edited) On 8/13/2020 at 6:00 PM, 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. Expand 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. Expand Okay, I can see hasTileEntity, but getTileEntity doesn't seem to be there Edited August 13, 2020 by PuppyWuppy Quote
PuppyWuppy Posted August 13, 2020 Author Posted August 13, 2020 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 Quote
Beethoven92 Posted August 14, 2020 Posted August 14, 2020 Quote On 8/12/2020 at 10:16 PM, PuppyWuppy said: the campfire doesn't re-light (with flint and steel) after it is put out Expand You need to put your block in the block tags for campfires. Expand ChampionAsh already gave you the answer for that Quote Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
PuppyWuppy Posted August 14, 2020 Author Posted August 14, 2020 On 8/14/2020 at 4:16 PM, Beethoven92 said: ChampionAsh already gave you the answer for that Expand 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 Quote
ChampionAsh5357 Posted August 14, 2020 Posted August 14, 2020 On 8/14/2020 at 7:00 PM, PuppyWuppy said: The TER still doesn't work though Expand Did you even register/attach the TER to the respective TE in the client setup? Quote
PuppyWuppy Posted August 14, 2020 Author Posted August 14, 2020 On 8/14/2020 at 7:43 PM, ChampionAsh5357 said: Did you even register/attach the TER to the respective TE in the client setup? Expand 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); Quote
ChampionAsh5357 Posted August 14, 2020 Posted August 14, 2020 On 8/14/2020 at 8:34 PM, PuppyWuppy said: I think so Expand Then I would like to see the tile entity class and the renderer class. Quote
PuppyWuppy Posted August 14, 2020 Author Posted August 14, 2020 On 8/14/2020 at 9:28 PM, ChampionAsh5357 said: Then I would like to see the tile entity class and the renderer class. Expand 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 Quote
ChampionAsh5357 Posted August 14, 2020 Posted August 14, 2020 You probably want to look at this. Forge synchronizes differently than mc. Quote
PuppyWuppy Posted August 14, 2020 Author Posted August 14, 2020 On 8/14/2020 at 10:00 PM, ChampionAsh5357 said: You probably want to look at this. Forge synchronizes differently than mc. Expand Ah yeah, that'll probably why then lol, I'll take a look Quote
greetthemoth Posted August 17, 2020 Posted August 17, 2020 On 8/14/2020 at 11:41 PM, PuppyWuppy said: Ah yeah, that'll probably why then lol, I'll take a look Expand Did you by any chance get your client synchronization to work, im having the exact problem. Quote
Beethoven92 Posted August 18, 2020 Posted August 18, 2020 On 8/17/2020 at 2:53 PM, greetthemoth said: Did you by any chance get your client synchronization to work, im having the exact problem. Expand You should make your own post for this Quote Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
greetthemoth Posted August 19, 2020 Posted August 19, 2020 i already did. and ive posted the solution. Quote
Recommended Posts
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.