Jump to content

FLUFFY2

Forge Modder
  • Posts

    424
  • Joined

  • Last visited

Everything posted by FLUFFY2

  1. Yeah i also experianced that, try to mirror the texture vertically or horisontally.
  2. Well, even that i changed the mappings field inside the build.gradle, i still got that error. -I did delete the .gradle inside the user folder, yet no luck.
  3. If you have any questions regarding with this, feel free to ask me, since i was able to get it working. Its fairly simple AND laggy. DO not plan to use "HQ" models, because MC engine cannot handle it.
  4. Well i did achived to get items to work. Since my pistol is an item only. I think you have problems with your json. Here is what i did: -Create blockstate folder -Create models/item folders -Put obj with mtl into the models/item folder -In the blockstate create a .json file with the registered name Here is my Usp.json file: { "forge_marker": 1, "defaults": { "textures": { "#Usp": "csgo:Usp" }, "model": "csgo:Usp.obj" }, "variants": { "normal": [{}], "inventory": [{ "transform": { "firstperson": { "translation": [0.1, 0, -0.3], "rotation": [ { "y": 130}, {"x": 0}, {"z": 0} ], "scale": 0.2 }, "thirdperson": { "translation": [0.02, 0.05, -0.05], "rotation": [ { "y": 0}, {"x": -92}, {"z": 0} ], "scale": 0.07 }, "gui": { "translation": [0, -0.1, 0], "scale": 0.16 } } }] } } In the textures "#Usp" has to match the material name, that is in the mtl file. Also check out the Forge's ModelLoaderRegistryDebug.class in github, also the resources and the actual debug obj/mtl files. You need to correct some data in your model, or in wont load!
  5. "return (Integer)w.getBlockState(pos).getValue(meta) != 3;" Now, where the hell you check, if the block is air? There is a builtin method for that! return w.isAirBlock(pos);
  6. Try to run CMD as admin!
  7. Yeah, after a bit of testing i figured this out. So i fixed the UV mapping, and also fixed the material. So it renders okay now. I can see that some triangular face has rendering issues, because they are brighter, so it looks wierd. But other than that, i manage to get it working!
  8. Well i got it working! The UVs are pretty sassy tho....
  9. Yeah, i was wrong and i wrote the lines about @SideOnly, oups. What i meant was, as far as i know in the inits, you can use event.getSide() checking for resource registering.
  10. Look, im not that stupid, i know what im doing thats not the problem anyways. You can trust me i started a server and it worked fine. You can use Side.CLIENT checking if you know how and where. In the matter of fact Side checking, prevents the Client/Server to even see the code. Not like isRemote. Thats why most are confused, and create a crash. Anyways i fixed the 1st problem, now it detects the model, but i get this error: net.minecraftforge.client.model.obj.OBJModel$UVsOutOfBoundsException: Model 'csgo:models/item/Usp.obj' has UVs ('vt') out of bounds 0-1! The missing model will be used instead. Support for UV processing will be added to the OBJ loader in the future. I see what it means, but i dont know how i could fix the model.
  11. Well you can use: if(world.isRemote), to play the sound client only.
  12. worldIn.playSoundEffect(pos.getX(), pos.getY(), pos.getZ(), "minecraft:sound", 1.0F, 1.0F); Simple as that . Also here is a list of all sounds in minecraft! If you want to hear it "inside" your head, you have to use PositionedSound with ITickableSound, and update the sound pos to the player pos every tick.
  13. Yeah okay, still watch out for side checking when you open your gui, because it can cause a crash when you fire up a server. Glad you figured it out!
  14. Oh, i didnt know that. shadekiller666, THANK YOU as well! Its inside my main class, like its should be. This: if(event.getSide() == Side.CLIENT) actullay is useful there, but it shouldnt really matter, the server wont gonan crash. The Unlocalized and Registered name are both "Usp". Now... Why would i exactly need a blocksate file for an item?
  15. If you could show me your tile entity class, i could help. Few things to notice: -You open gui, in onBlockActivated() without checking if its a client. The code will crash the server. -Why you open your gui inside your tile entity? I suggest you to route your gui opening throught your ClientProxy, it can slove your poblem. You can use: Minecraft.getMinecraft().displayGuiScreen(new Gui(player));
  16. Hello there, So i saw that we can register .obj models again wich is cool (thx fry)! But im a little confused why it not loads, i mean it should right? In the preInit, i got this, after the item is registered: if(event.getSide() == Side.CLIENT){ OBJLoader.instance.addDomain(Csgo.ModID); ModelLoader.setCustomModelResourceLocation(Usp, 0, new ModelResourceLocation(ModID + ":Usp", "inventory")); } The modid is already lower case!!! The model are in: assets/modid/models/item Both .obj and .mtl! I didnt forget about: mtllib models/item/Usp.mtl And here is my .mtl newmtl pist_223.bmp Ns 96.078431 Ka 1.000000 1.000000 1.000000 Kd 0.762566 0.426902 0.414958 Ks 0.500000 0.500000 0.500000 Ke 0.000000 0.000000 0.000000 Ni 1.000000 d 1.000000 illum 2 map_Kd csgo:Usp The texture is in: assets/modid/textures! In case, i triangulated the faces, but thats the only thing i have done to the model. Also, can i implement IPerspectiveModelAware, event if its an obj model? Thanks for helping!
  17. Yep, it works now! Thank you!
  18. Good to know! Thanks diesieben!
  19. Thank you, it does fix the issue! Its not related here, but what changes happend to the lighting algorithm? Just because i have dynamic lighting and in 1.7.10 it dosent drop that much FPS, but in 1.8 it makes it unplayable. Optifin does fix this, but im just curious. Thanks again!
  20. I use it in canPlaceBlockAt(). I check wether that block is there above my block. if(block == GameRegistry.findBlock("AmnesiaDecorations", "Chain")) This returns null, not just here! The modid IS matching and the block registered name is the same too! In 1.7.10 its worked fine.
  21. Well, my model has nothing to do with vanilla models. Its builded up with elements. Here is a snippet: { "__comment": "Designed by FLUFFY2", "textures": { "LanternTop": "amnesialights:models/LanternTop", "LanternOffSide": "amnesialights:models/LanternOffSide" }, "elements": [ { "__comment": "Lantern", "from": [ 5.25, 0, 6.5 ], "to": [ 10.25, 1.5, 9.5 ], "faces": { "down": { "uv": [ 10.75, 9.5, 5.75, 6.5 ], "texture": "#LanternTop", "cullface": "down" }, "up": { "uv": [ 5.25, 6.5, 10.25, 9.5 ], "texture": "#LanternTop" }, "north": { "uv": [ 5.75, 14.5, 10.75, 16 ], "texture": "#LanternOffSide" }, "south": { "uv": [ 5.25, 14.5, 10.25, 16 ], "texture": "#LanternOffSide" }, "west": { "uv": [ 6.5, 14.5, 9.5, 16 ], "texture": "#LanternOffSide" }, "east": { "uv": [ 6.5, 14.5, 9.5, 16 ], "texture": "#LanternOffSide" } } }, //Bunch more elements here ], "display": { "thirdperson": { "rotation": [ 180, -90, 30 ], "translation": [ 0, 3.6, 0.8 ], "scale": [ 0.8, 0.8, 0.8 ] }, "ground": { "rotation": [ 0, 0, 0 ], "translation": [ 0, -1, 0 ], "scale": [ 1.5, 1.5, 1.5 ] }, "fixed": { "rotation": [ 0, 90, 0 ], "translation": [ 0, 0, -0.2 ], "scale": [ 1.5, 1.5, 1.5 ] }, "firstperson": { "rotation": [ 0, -137, 0 ], "translation": [ -2.4, 0.1, -1.4 ], "scale": [ 2, 2, 2 ] }, "gui": { "rotation": [ 0, 0, 0 ], "translation": [ 0, 0, 0 ], "scale": [ 1, 1, 1 ] } } }
  22. Hi, I dont know why but GameRegistry.findBlock always gives null. You can test this with: System.out.println(GameRegistry.findBlock("minecraft", "stone")); This will say null, no matter what! I wanted to get a block form another mod, but yeah.... BUT, there is a workaround since .findItem does work. Block.getItemFromBlock(GameRegistry.findItem("minecraft", "stone")); Might worth looking into it! Thanks!
  23. Okay, here you go. Model class public class ModelLanternOn implements ISmartItemModel, IPerspectiveAwareModel{ public static final ModelResourceLocation modelLanternOn = new ModelResourceLocation(AmnesiaLights.ModID + ":LanternOn", "inventory"); public IBakedModel LanternOn; public Minecraft mc; public ModelLanternOn(IBakedModel LanternOn){ this.LanternOn = LanternOn; this.mc = Minecraft.getMinecraft(); } @Override public IBakedModel handleItemState(ItemStack stack){ return this; } @Override public List getFaceQuads(EnumFacing p_177551_1_){ return LanternOn.getFaceQuads(p_177551_1_); } @Override public List getGeneralQuads(){ return LanternOn.getGeneralQuads(); } @Override public boolean isAmbientOcclusion(){ return LanternOn.isAmbientOcclusion(); } @Override public boolean isGui3d(){ return LanternOn.isGui3d(); } @Override public boolean isBuiltInRenderer(){ return false; } @Override public TextureAtlasSprite getTexture(){ return LanternOn.getTexture(); } @Override @Deprecated public ItemCameraTransforms getItemCameraTransforms(){ return LanternOn.getItemCameraTransforms(); } @Override public Pair<IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType){ switch (cameraTransformType){ case FIRST_PERSON: this.renderFirstPersonArm();//Not the problem, same without this!!! RenderItem.applyVanillaTransform(LanternOn.getItemCameraTransforms().firstPerson); return Pair.of(LanternOn, null); case THIRD_PERSON: RenderItem.applyVanillaTransform(LanternOn.getItemCameraTransforms().thirdPerson); return Pair.of(LanternOn, null); case GUI: RenderItem.applyVanillaTransform(LanternOn.getItemCameraTransforms().gui); return Pair.of(LanternOn, null); case HEAD: RenderItem.applyVanillaTransform(LanternOn.getItemCameraTransforms().head); return Pair.of(LanternOn, null); default: return Pair.of(LanternOn, null); } } ModelBakeEvent Object LanternOn = event.modelRegistry.getObject(ModelLanternOn.modelLanternOn); if(LanternOn instanceof IBakedModel){ IBakedModel newLanternOn = (IBakedModel)LanternOn; ModelLanternOn customModel = new ModelLanternOn(newLanternOn); event.modelRegistry.putObject(ModelLanternOn.modelLanternOn, customModel); } Yes i dont combine models, because im doing additional rendering based on perspectives! But thats not the problem! So "RenderItem.applyVanillaTransform" does nothing! Thanks Lex!
  24. In Build 1.8-11.14.3.1529, they did something to the PerspectiweAwareModel, and its not working. In Build 1.8-11.14.3.1525, its working fine!
  25. Hi, I was about to publish my mod, but i noticed that after i updated to the latest Forge, the PerspectiveAwareModel got messed up. Neither the vanilla(RenderItem.applyVanillaTransform) or the Forge(ForgeClientHooks.getMatrix) transform got applied. Basically if i change the .json file the model is still the default. I really dont want to use GlStateManager to rotate it back. Thanks!
×
×
  • Create New...

Important Information

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