Everything posted by DBLouis
-
[1.8] Custom block model -> no ambient occlusion
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 ...
-
What is a BakedQuad and how to create one
I had to change getBlockLayer() to return CUTOUT_MIPPED
-
What is a BakedQuad and how to create one
Now the items works, and the blocks in the world have the overlay but on a white background ... Any ideas ?
-
What is a BakedQuad and how to create one
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); } }); } }
-
What is a BakedQuad and how to create one
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 ...
-
What is a BakedQuad and how to create one
Bump !
-
What is a BakedQuad and how to create one
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 !
-
What is a BakedQuad and how to create one
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 ?
-
What is a BakedQuad and how to create one
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
-
IModel implementation for custom ores rendering
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.
-
IModel implementation for custom ores rendering
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 ?
-
IModel implementation for custom ores rendering
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); }
-
[Solved] Registering a slab
That was the problem, thank you !
-
[Solved] Registering a slab
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 ?
-
[Solved] Registering a slab
I print the classes of the two arguments, they matches the constructor.
-
[Solved] Registering a slab
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)
-
Question about forge source code
ok thank you for this quick answer !
-
Question about forge source code
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
IPS spam blocked by CleanTalk.