Jump to content

jhonny97

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by jhonny97

  1. Ok, thanks for the hint. I will look into it.
  2. So instead when I reach a specified age, I should place another crop block on top but with another texture?
  3. Hi, I'm testing a mod idea and I want to create a 3 or 4 block tall crop. I'm able to create the crop with the collision box of the size that I want, but I didn't find a way to use a taller texture at some stage of growth. Thanks
  4. I don't know where to place that code, the only place that possibly can go is the DistExecutor, but not work. I updated the repo to reflect this change.
  5. I tried also extending the SignTileEntity instead of extending TileEntity but not work.
  6. I was doing some testing and i accidentally pushed the changes. I replaced TileEntityType.SIGN with my custom type, but the result is the same
  7. This is the Git repo https://github.com/michele-grifa/MoreStuffMod.git The branch is the 1.16.1
  8. My tile entity extend the SignTileEntity class CustomSignTileEntity : SignTileEntity() { override fun getType(): TileEntityType<*> { return TileEntityInit.signTileEntity } } val signTileEntity: TileEntityType<CustomSignTileEntity> by tileEntities.register("my_sign") { TileEntityType.Builder.create({ CustomSignTileEntity() }, BlockInit.mySign, BlockInit.myWallSign).build(null) } If i extend SignTileEntity, the TE sync shouldn't happen by itself?
  9. I used the DistExecutor and the code is now the following val flag = super.onBlockPlaced(pos, worldIn, player, stack, state) if (worldIn.isRemote && !flag && player != null) { DistExecutor.safeRunWhenOn(Dist.CLIENT) { DistExecutor.SafeRunnable { Minecraft.getInstance().displayGuiScreen(CustomEditSignScreen(worldIn.getTileEntity(pos) as CustomSignTileEntity)) } } } return flag Now my custom sign screen is opened and i can edit it, but when i exit and re-enter the world, the sign is blank. If i use !worldIn.isRemote instead of worldIn.isRemote the game crash even if i use the DistExecutor
  10. I tried checking for logical client, but by calling it directly, Minecraft stuck after i place the sign. I will try with DistExecutor.
  11. I had the same problem a while ago, i created the custom sign screen but i don't know how to open the custom screen instead of the vanilla one. In the ClientPlayerEntity class, the EditSignScreen is hardcoded this.mc.displayGuiScreen(new EditSignScreen(signTile)); So in a custom SignItem, i cannot use: player.openSignEditor(worldIn.getTileEntity(pos) as CustomSignTileEntity) I also tried using this code, but the game crash after placing the sign. class CustomSignItem(propertiesIn: Properties?, floorBlockIn: Block?, wallBlockIn: Block?) : WallOrFloorItem(floorBlockIn, wallBlockIn, propertiesIn) { override fun onBlockPlaced( pos: BlockPos, worldIn: World, player: PlayerEntity?, stack: ItemStack, state: BlockState ): Boolean { val flag = super.onBlockPlaced(pos, worldIn, player, stack, state) if (!worldIn.isRemote && !flag && player != null) { Minecraft.getInstance().displayGuiScreen(CustomEditSignScreen(worldIn.getTileEntity(pos) as CustomSignTileEntity)) } return flag } } How i can override them?
  12. Your hint about the chaining placement was helpful, using this two placement i'm able to achieve the previous behavior .withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT) .withPlacement(Placement.field_242902_f.configure(AtSurfaceWithExtraConfig(5, 0.1f, 1))
  13. Thanks for the explanation. After a bit of testing, i managed to register and spawn the biome without using json, but now the problem is another. In this biome i spawn a custom tree that worked until now. Instead of randomly place tree, like vanilla ones, they are placed in a grid (i attached a screenshot). Nothing has changed in my code since 1.16.1. This is the code that i use to add the tree to my biome withFeature( GenerationStage.Decoration.VEGETAL_DECORATION, Feature.TREE.withConfiguration(MyTree.treeConfig) .withPlacement(Placement.field_242902_f.configure(AtSurfaceWithExtraConfig(9, 0.1f, 1))) ) And this is the tree code: val treeConfig: BaseTreeFeatureConfig = BaseTreeFeatureConfig.Builder( SimpleBlockStateProvider(MyBlocks.log.defaultState), SimpleBlockStateProvider(MyBlocks.leaves.defaultState), BlobFoliagePlacer(FeatureSpread.func_242252_a(2), FeatureSpread.func_242252_a(0), 3), StraightTrunkPlacer(4, 2, 0), TwoLayerFeature(1, 0, 1)) .setIgnoreVines() .build() This happen with Forge 34.1.17, if i update to the latest Forge version they don't spawn at all.
  14. In 1.16.1 i used to add the biome using this code: BiomeManager.addBiome(BiomeManager.BiomeType.WARM, BiomeManager.BiomeEntry(biome, 10)) but now BiomeEntry require RegistryKey instead of biome itself and in 1.16.3 don't spawn anymore.
  15. Hi, i created added a custom biome in minecraft 1.16.1 and works perfectly, but now updating to 1.16.3, all of the biome code is not working, like BiomeDictionary that is not present anymore. I know of the change made by Mojang in 1.16.3 for the data driven biomes, but how i can convert this biome to the new version?
  16. You have to add sprite in TextureStitchEvent.Pre Event
  17. Thanks, it worked perfectly
  18. Ok thanks, i resolved using only using a custom Renderer for the sign and adding the sprite to the atlas and it works. the only problem is the EditSignScreen that show the default Oak WoodType instead of my texture because the screen, call "SignTileEntity.getMaterial" that search for the texture in the minecraft namespace and not my mod namespace. I tried creating a new EditSignScreen, but unfortunately when i try to display the screen, Minecraft crash without error. I checked the original call to display the gui and is done Server side, maybe there is some sort of synchronization between server and client that i have to implement myself.
  19. i checked more the IFluidHandler::fill but i can't figure out what to do. I the fill method i have only the fluidstack to insert and the action for the fill. If you were a little more specific, I would appreciate it.
  20. Have you tried in IntelliJ IDEA to do the Invalidate Caches / Restart under the File menu? Could you also share the build.gradle file content?
  21. 1.8 is no longer supported on this forum. Update to a newer version
  22. the folder is called "blockStates", it should be "blockstates"
  23. I created a custom block with a TileEntity that implements IFluidHandler and it works good, but i want to know if there is a way to tell the input handler to only accept a specific amount of fluid per tick
  24. I copy-pasted the renderer from the original sign renderer, because afaik I cannot instantiate a new woodtype, that has a protected constructor. So i overrided the getRenderMaterial to find my texture and there isn't a error in the log. How can I add that texture to the Atlas? There are some resources where I can learn this type of things about rendering and so on?
×
×
  • Create New...

Important Information

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