Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DBLouis

Members
  • Joined

  • Last visited

Everything posted by DBLouis

  1. Hi There is no ambient occlusion on the ore block, which are rendered with a custom model. Here one image to understand the problem : And some code : Block class : https://gist.github.com/Spooky4672/92d49f456b063e2fecdb Model class : https://gist.github.com/Spooky4672/6adc83c99b7593e4ab98 That's weird because in the model class ambient occlusion is set to true ...
  2. I had to change getBlockLayer() to return CUTOUT_MIPPED
  3. Now the items works, and the blocks in the world have the overlay but on a white background ... Any ideas ?
  4. I found it ! @SideOnly(Side.CLIENT) final class TexturesRegistrationHandler { @SubscribeEvent public void registerOverlays(TextureStitchEvent.Pre e) { assert !OresTexturizer.overlaysLocations.isEmpty() : "overlaysLocations is empty !"; OresTexturizer.overlaysLocations.forEach(new BiConsumer<String, ResourceLocation>() { @Override public void accept(String srt, ResourceLocation location) { // I need only this : e.map.registerSprite(location); // I removed this : TextureSprite tx = new TextureSprite(location); boolean done = e.map.setTextureEntry(srt, tx); } }); } }
  5. This is very very weird ! When I comment some code which normally affect nothing (log), it changes the overlays which works. And if I decomment, other overlays that did not works, works ...
  6. The texture i'm trying to add as an overlay is partially transparent. Is there something in particular to do in this case ? Because I get the "missingno" texture even if the overlay is correctly registered !
  7. Thank, I already know your tutorials I just want to make the 6 faces for a simple block, not a complex one like this chessboard. The coordinates origin is at the center of the block ? Or at a corner ?
  8. Hi ! Everything is in the title. I think a BakedQuad is a "face" of a cube but I'm not sure. I looked into Minecraft code and I found a method makeBakedQuad() in FaceBakery class. Should I use this or just "new BakedQuad()" ? If yes, what do I put as arguments, because there is a lot of them. Thanks in advance
  9. I don't understand, with the following code, it says the texture is missing : public IFlexibleBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { ModelResourceLocation stoneModelLocation = new ModelResourceLocation("minecraft:stone", null); IModel stoneModel = ModelLoaderRegistry.getModel(stoneModelLocation); IBakedModel stoneBakedModel = stoneModel.bake(stoneModel.getDefaultState(), format, bakedTextureGetter); Logger.info(stoneBakedModel.getTexture().getIconName()); } I think I have to do something with the texture getter, but I don't even know how it works.
  10. Also if someone could explain to me how what is a TextureAtlasSprite and how the Function<ResourceLocation, TextureAtlasSprite> textureGetter (one of the bake method argument) works. textureGetter.apply(stoneModelLocation); should return my stone texture right ?
  11. Hi ! I have implemented an IModel to render a custom ore block with different stone backgrounds and an overlay. I have two questions : - If the bake() method is called for all the instances of my custom ores (I have checked with a logger), does that mean there model are correctly registered or not necessarily ? Because in game, all the different ores have no textures (purple and black cube) - What should I return at the end of this method ? A Wrapper (default implementation of IFlexibleModel) ? Because I can't return a IBakedModel In my opinion, the problem is inside the bake method , but even with the minimum, it doesn't works : public IFlexibleBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { ModelResourceLocation stoneModelLocation = new ModelResourceLocation("minecraft:stone", null); IModel stoneModel = ModelLoaderRegistry.getModel(stoneModelLocation); IBakedModel stoneBakedModel = stoneModel.bake(stoneModel.getDefaultState(), format, bakedTextureGetter); return new Wrapper(stoneBakedModel, format); }
  12. That was the problem, thank you !
  13. The class argument of registerBlock(), it does not matter where it is, local class or with it own file, right ? The fact that it is final either A class is a class, or not ?
  14. I print the classes of the two arguments, they matches the constructor.
  15. Hi, I cant register a slab, I have a problem with the registerBlock() method, I got a NoSuchMethodException I know the arguments classes have to matches, it doesn't works anyway. The slab block class : class BlockStoneSlab extends BlockSlab { @Override public void register() { if (isDouble()) GameRegistry.registerBlock(this, itemClass, name, getOther(this), this); else GameRegistry.registerBlock(this, itemClass, name, this, getOther(this)); } } getOther() return the half slab if the instance is the double and vice versa The itemclass : final class ItemSlab extends ItemSlab { public ItemSlab(Block block, BrickSlabHalf half, BrickSlabDouble full) { super(block, half, full); } } The error : Caused by: java.lang.NoSuchMethodException: BrickSlab$ItemClass.<init>(Block, BrickSlabHalf, BrickSlabDouble)
  16. ok thank you for this quick answer !
  17. Hi ! I was exploring the code of forge (actually fml) on github in a purpose of learning. I want to find were the 3 methods of a mod (preInit, init, postInit) annotated with @EventHandler are called. I think I already found were they are "loaded" somewhere in a package named discovery. Is it done by using reflection with "invoke" or something like that ? Can someone help me find it please ? Thanks

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.