-
Posts
687 -
Joined
-
Last visited
-
Days Won
10
Everything posted by Beethoven92
-
[1.16.1]Game Crashes When I Shoot My Custom Arrow
Beethoven92 replied to Chuck16's topic in Modder Support
You are already registering an entity type of your custom arrow entity in the code above...just use the ENTITY_TYPES#register method of your deferred register instead of using the vanilla registry. Also, did you remember to bind your entity to its renderer? -
[Solved] [1.16.3] Blocks adjacent to transparent block not showing
Beethoven92 replied to twcrime's topic in Modder Support
I apologize, it was my mistake, the method is of course notSolid. If you can't see setOpaque though that means you have outdated mappings -
[Solved] [1.16.3] Blocks adjacent to transparent block not showing
Beethoven92 replied to twcrime's topic in Modder Support
You also need to chain setOpaque to your block properties. See the Blocks class and vanilla transparent blocks to get and idea how to use it -
Oh, so you are trying to do a block you can sit on. The animation for sitting when the player mounts on a rideable entity is handled in the LivingRenderer class, take a look there. You will see you won't have to use setPose at all. You would need to set the rider of the dummy entity you use to simulate sitting on a block to the player that right clicks on that block, then the rest is already taken care for you in the background. Take a look at how vanilla rideable entities handle mount/dismount
-
RegistryEvent.Register("ModTypeTile", () -> TileEntityType.Builder(new ModTypeRenderer(new ResourceLocation(Mod.MODID, "textures/blocks/mod_item.png", )); This is not how you register a tile entity type, and the bindTileEntityRenderer method is not the place where you would want to register a registry object. I suggest taking a look at the docs regarding tile entity creation: https://mcforge.readthedocs.io/en/latest/tileentities/tileentity/ Also use your IDE to see what the bindTileEntityRenderer method accepts in its parameters, currently you are not telling it which is the tile entity renderer you want to bind to your tile entity
-
It "works" temporarily, and just for you. The block appears to be there (only in your client) but it actually doesn't exist for the server world. Example..creating an explosion on the client side makes blocks disappear visually, but in fact they are still there and you can still collide with them, just unload/reload the chunk or exit/re enter the world, and you will see that everything is back in its original place like nothing ever happened (and in fact this is the point)..try it youself if you don't believe me
-
Not an expert in rendering stuff but..i don't think you "rotate" a 2d texture to get a 3d effect. You either rotate a 3d model or render a sequence of 2d images represeting a planet that is rotating, each one drawing your planet in a different angle
-
Because this is all hardcoded inside the BipedArmorLayer class and the field ARMOR_ENTITY_GLINT in the class RenderType..i suggest you take a look into those classes to understand how this system works
-
World#addEntity is what you are searching for..though keep in mind you spawn entities on server side, not client. Also, for the future, when you are trying to do something like that (spawning entity), which vanilla has lot of example to look at, i suggest looking into vanilla code to see if you can find the way yourself. For example, in this case, a good point to start searching would have been spawn eggs, because, as you may know very well, they add entities to the world
-
I see that in the previous post you made you have already been told by diesieben07 what the problem is. It seems that you are using the same exact code you posted in the previous post, so you cannot really expect this to work the way you want. You are basically trying to generate your ore inside existing iron clusters, when iron itself hasn't been generated in the world yet! In this case you would need to manually place in the world clusters of iron ore containing inside your custom ore. You could use a Feature to implement that
-
Thats because in the above posts i suggested you to look into the Blocks class, where the properties for each block are actually defined
-
[1.16.4] minCount and maxCount seemingly ignored in biome spawns
Beethoven92 replied to HowBoutNo's topic in Modder Support
You could implement your mob spawning in the form of a Feature that generates in the world. The only thing that feature would do when generating in the world is spawn one (and only one) of your custom entity type. The ice and fire mod for example uses features to make some of their entities spawn singularly -
Aha good find! Of course i did some research for any matching vanilla bug before reporting an issue here, but for whatever reason i did non manage to find this..unfortunately the bug seems to have been fixed only in the first 1.17 snapshot
-
I would like to bring what i believe is a bug on forge side to your attention, tested and verified to be happening both in 1.16.3 and 1.16.4. When using the bee spawn egg to change the entity inside a spawner the console keeps spamming this error (though the game does not actually crash): [14nov2020 02:01:50.879] [Render thread/FATAL] [net.minecraftforge.common.ForgeMod/]: Preparing crash report with UUID ff74860d-b4ef-4698-b95c-17dae8737e90 [14nov2020 02:01:50.879] [Render thread/WARN] [net.minecraft.entity.EntityType/]: Exception loading entity: net.minecraft.crash.ReportedException: Loading entity NBT at net.minecraft.entity.Entity.read(Entity.java:1672) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.entity.EntityType.lambda$loadEntityUnchecked$2(EntityType.java:461) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.util.Util.acceptOrElse(Util.java:321) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.entity.EntityType.loadEntityUnchecked(EntityType.java:458) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.entity.EntityType.loadEntity(EntityType.java:516) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.entity.EntityType.loadEntityAndExecute(EntityType.java:498) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.world.spawner.AbstractSpawner.getCachedEntity(AbstractSpawner.java:255) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.renderer.tileentity.MobSpawnerTileEntityRenderer.render(MobSpawnerTileEntityRenderer.java:24) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.renderer.tileentity.MobSpawnerTileEntityRenderer.render(MobSpawnerTileEntityRenderer.java:14) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.render(TileEntityRendererDispatcher.java:101) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.lambda$renderTileEntity$0(TileEntityRendererDispatcher.java:85) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.runCrashReportable(TileEntityRendererDispatcher.java:121) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntity(TileEntityRendererDispatcher.java:84) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:1060) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:619) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:437) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1002) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_192] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_192] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_192] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_192] at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.6.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.6.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.6.jar:?] at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.6.jar:?] at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.6.jar:?] at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] Caused by: java.lang.ClassCastException: net.minecraft.client.world.ClientWorld cannot be cast to net.minecraft.world.server.ServerWorld at net.minecraft.entity.passive.BeeEntity.readAdditional(BeeEntity.java:190) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] at net.minecraft.entity.Entity.read(Entity.java:1657) ~[forge-1.16.4-35.0.2_mapped_snapshot_20201028-1.16.3-recomp.jar:?] ... 29 more I should note this happens in a fresh new environment, when there is nohing but the basic mod setup code. Also it seems to happen only with the bee spawn egg..i discovered this because i was implementing an entity that can get the form (visually) of any EntityType, using code inspired by the spawner tile entity, and when i got to test it with the bee entity it actually crashed the game (probably due to poor code on my side)..so i tested what happened if i tried to change the spawner entity to a Bee and the above error was thrown Edit: this error seems to happen also with the following entities: zombified piglin, wolf, polar bear and enderman
-
Well, it already tells you what is required, and its not an unmapped name. Follow my above suggestion and see how vanilla glass blocks are defined in their properties
-
I believe that method was renamed to setOpaque in recent mappings. Anyway in your case it should be the func_235828_a_. You can take a look here to see what unmapped methods looks like in the most recent mappings: https://docs.google.com/spreadsheets/d/14knNUYjYkKkGpW9VTyjtlhaCTUsPWRJ91GLOFX2d23Q/edit#gid=721555859 Alternatively if you do not know what method does what you want you can try to search where those methods could have been used in vanilla code..for example, you are trying to create a block that is similar to glass in behaviour. Then go inside the Blocks class and see how the various glass blocks and their properties are defined, and you may found the informations that could help you deducing which of those non-sense name method is the one you need to use
-
[1.16.3] Generate structure in custom biome
Beethoven92 replied to Beethoven92's topic in Modder Support
Yep, i am porting the BetterEnd fabric mod to Forge, because i find their asthetics crazy good (not really minecrafty though) and i think this mod deserves to be played by forge users also. Luckily they are working under the MIT license! -
Take a look here: https://gist.github.com/williewillus/353c872bcf1a6ace9921189f6100d09a The above link includes also changes in 1.13 and 1.14 since most of that stuff has been inherited by 1.15..there is also a section specific for 1.15
-
[1.16.3] Generate structure in custom biome
Beethoven92 replied to Beethoven92's topic in Modder Support
Oh sorry Vemerion, i actually solved that issue yesterday and forgot to say that in the post..i have not tried what you suggest so i don't know if it works but it seems it actually could. Anyway i solved it by giving away the structure deferred register and by using static initializers for the Structure and the StructureFeature. Those are then registered inside the RegistryEvent.Register<Structure<?>. This way the code above works because now the structure is known at the time the biome is initalized. I was kinda hoping to do the job without giving away the deferred register though..so i may also try your idea. World generation stuff really seems to be a dirty job to handle right now.. -
About Suppliers...https://www.geeksforgeeks.org/supplier-interface-in-java-with-examples/
-
If i am not mistaken you have to register a custom property for your bow (because the vanilla properties for the bow works only with Items.BOW, so the vanilla bow). You can do that with the ItemModelProperties.registerProperty method (if you have outdated mappings it probably won't be named like that for you). You can see how the properties "pulling" and "pull" for the vanilla bow are defined inside the ItemModelProperties class. If you want your bow to behave exactly like the vanilla one you just need to register two new properties (which are also "pull" and "pulling" as you defined them in your item model json) and use the same code as vanilla does, while linking those properties to your custom bow
-
[1.16.3] Generate structure in custom biome
Beethoven92 replied to Beethoven92's topic in Modder Support
I tried with this line at the end of the enqueueWork: ModBiomes.CRYSTAL_MOUNTAINS.get().getGenerationSettings().structures.add(() -> ModConfiguredStructures.MOUNTAIN_STRUCTURE); No crash but the structure is nowhere to be found inside the biome, and using the /locate command shows that in fact it is not generating anywhere -
[1.16.3] Generate structure in custom biome
Beethoven92 replied to Beethoven92's topic in Modder Support
Does that imply i need to grab the structures list from the BiomeGenerationSettings and manually adding my own structure to the list? -
I am experiencing troubles trying to add a custom structure into a custom biome. The problem is that my biome is registering before my structure and so of course i get a "Registry object not present" error on startup: I saw this post a while ago but this seems to not be applicable concerning structure registration: https://forums.minecraftforge.net/topic/93134-solved-1163-registering-biome-with-modded-features/ at least not in a way i can figure out. It seems that there is not an overload of BiomeGenerationSettings.Builder#withStructure that accepts a Supplier. I should mention that both the biome and the structure works perfectly on their own. My biome is correctly added and generated in the End and i can generate my structure in vanilla biomes using the BiomeLoadingEvent, so the problem shows up only when trying to register the structure in my custom biome. Code for reference: BiomeTemplate is just workaround wrapper to help constructing the biome, and BetterEndBiome stores a Biome object internally public class CrystalMountainsBiome extends BetterEndBiome { public CrystalMountainsBiome() { super(new BiomeTemplate("crystal_mountains").setGrassColor(255, 133, 211). setFoliageColor(255, 133, 211). setMobSpawn(EntityClassification.MONSTER, EntityType.ENDERMAN, 50, 1, 2). addStructure(ModConfiguredStructures.MOUNTAIN_STRUCTURE)); // This will crash on startup } } Biome registry: public class ModBiomes { public static final DeferredRegister<Biome> BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, BetterEnd.MOD_ID); public static final RegistryObject<Biome> CRYSTAL_MOUNTAINS = BIOMES.register("crystal_mountains", () -> new CrystalMountainsBiome().getBiome()); } Structure registry: public class ModStructures { public static final Map<Structure<?>, StructureSeparationSettings> BETTEREND_STRUCTURES = new HashMap<>(); public static final DeferredRegister<Structure<?>> STRUCTURES = DeferredRegister.create(ForgeRegistries.STRUCTURE_FEATURES, BetterEnd.MOD_ID); public static final RegistryObject<Structure<NoFeatureConfig>> MOUNTAIN = registerStructure("mountain_structure", new MountainStructure(NoFeatureConfig.field_236558_a_)); private static <T extends Structure<?>> RegistryObject<T> registerStructure(String name, T structure) { return STRUCTURES.register(name, () -> structure); } public static void setupStructures() { setupStructure(MOUNTAIN.get(), new StructureSeparationSettings(5, 2, 1234567890)); } private static <F extends Structure<?>> void setupStructure(F structure, StructureSeparationSettings structureSeparationSettings) { //NAME_STRUCTURE_BIMAP Structure.field_236365_a_.put(structure.getRegistryName().toString(), structure); DimensionStructuresSettings.field_236191_b_ = // Default structures ImmutableMap.<Structure<?>, StructureSeparationSettings>builder() .putAll(DimensionStructuresSettings.field_236191_b_) .put(structure, structureSeparationSettings) .build(); BETTEREND_STRUCTURES.put(structure, structureSeparationSettings); } } Configured structures: public class ModConfiguredStructures { public static final StructureFeature<NoFeatureConfig, ? extends Structure<NoFeatureConfig>> MOUNTAIN_STRUCTURE = ModStructures.MOUNTAIN.get().func_236391_a_(IFeatureConfig.NO_FEATURE_CONFIG); private static <FC extends IFeatureConfig, F extends Structure<FC>> StructureFeature<FC, F> register(String name, StructureFeature<FC, F> structureFeature) { return WorldGenRegistries.register(WorldGenRegistries.CONFIGURED_STRUCTURE_FEATURE, name, structureFeature); } public static void registerStructureFeatures() { WorldGenRegistries.register(WorldGenRegistries.CONFIGURED_STRUCTURE_FEATURE, new ResourceLocation(BetterEnd.MOD_ID, "mountain_structure"), MOUNTAIN_STRUCTURE); } } Relevant main class code: public BetterEnd() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); modEventBus.addListener(this::setupCommon); ModStructures.STRUCTURES.register(modEventBus); ModBiomes.BIOMES.register(modEventBus); } private void setupCommon(final FMLCommonSetupEvent event) { event.enqueueWork(() -> { ModStructures.setupStructures(); ModConfiguredStructures.registerStructureFeatures(); }); } Does anyone know which way to go about this?