Jump to content

LemADEC

Members
  • Posts

    12
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

LemADEC's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I've a model of my block in .obj format. I'm able to load and rotate it from the blockstate JSON. However I'm unable to change its texture/materials. Am I missing something? Here's my blockstate JSON: { "forge_marker": 1, "defaults": { "model": "warpdrive:forcefield/projector_base.obj", "textures": { "particle": "warpdrive:blocks/forcefield/projector-side_not_connected", "mbase" : "warpdrive:blocks/forcefield/projector-shape_none", "mbase2" : "warpdrive:blocks/forcefield/projector-shape_none", "side" : "warpdrive:blocks/forcefield/projector-side_not_connected" }, "transform": "forge:default-block" }, "variants": { "normal": [{}], "inventory": [{}], "facing": { "north": { "x": 90 }, "south": { "x": -90 }, "west" : { "x": 90, "y": -90 }, "east" : { "x": 90, "y": 90 }, "up" : { }, "down" : { "x": 180 } }, "shape": { "none" : { "textures": { "mbase": "warpdrive:blocks/forcefield/projector-shape_none" } }, "cube" : { "textures": { "mbase": "warpdrive:blocks/forcefield/projector-shape_cube" } }, "cylinder_h": { "textures": { "mbase": "warpdrive:blocks/forcefield/projector-shape_cylinder_h" } }, "cylinder_v": { "textures": { "mbase": "warpdrive:blocks/forcefield/projector-shape_cylinder_v" } }, "plane" : { "textures": { "mbase": "warpdrive:blocks/forcefield/projector-shape_plane" } }, "sphere" : { "textures": { "mbase": "warpdrive:blocks/forcefield/projector-shape_sphere" } }, "tube" : { "textures": { "mbase": "warpdrive:blocks/forcefield/projector-shape_tube" } }, "tunnel" : { "textures": { "mbase": "warpdrive:blocks/forcefield/projector-shape_tunnel" } } }, "is_double_sided": { "false": { "shape": { "none" : { }, "cube" : { }, "cylinder_h": { }, "cylinder_v": { }, "plane" : { }, "sphere" : { }, "tube" : { }, "tunnel" : { } } }, "true": { "shape": { "none" : { "textures": { "mbase2": "warpdrive:blocks/forcefield/projector-shape_none" } }, "cube" : { "textures": { "mbase2": "warpdrive:blocks/forcefield/projector-shape_cube" } }, "cylinder_h": { "textures": { "mbase2": "warpdrive:blocks/forcefield/projector-shape_cylinder_h" } }, "cylinder_v": { "textures": { "mbase2": "warpdrive:blocks/forcefield/projector-shape_cylinder_v" } }, "plane" : { "textures": { "mbase2": "warpdrive:blocks/forcefield/projector-shape_plane" } }, "sphere" : { "textures": { "mbase2": "warpdrive:blocks/forcefield/projector-shape_sphere" } }, "tube" : { "textures": { "mbase2": "warpdrive:blocks/forcefield/projector-shape_tube" } }, "tunnel" : { "textures": { "mbase2": "warpdrive:blocks/forcefield/projector-shape_tunnel" } } } } }, "state": { "not_connected" : { "textures": { "side": "warpdrive:blocks/forcefield/projector-side_not_connected" } }, "connected_not_powered": { "textures": { "side": "warpdrive:blocks/forcefield/projector-side_connected_not_powered" } }, "connected_offline" : { "textures": { "side": "warpdrive:blocks/forcefield/projector-side_offline" } }, "connected_powered" : { "textures": { "side": "warpdrive:blocks/forcefield/projector-side_powered" } } } } } The model is from McJty tutorial (https://github.com/McJty/ModTutorials) # Blender v2.67 (sub 0) OBJ File: 'projector_base.blend' # www.blender.org mtllib projector_base.mtl o Cube.002_Cube v 0.000000 0.000000 1.000000 v 0.000000 0.000000 0.000000 v 1.000000 0.000000 0.000000 v 1.000000 0.000000 1.000000 v 0.000000 0.200000 1.000000 v 0.000000 0.200000 0.000000 v 1.000000 0.200000 0.000000 v 1.000000 0.200000 1.000000 v 0.105162 0.300000 0.894838 v 0.105162 0.300000 0.105162 v 0.894838 0.300000 0.105162 v 0.894838 0.300000 0.894838 v 0.178033 0.700000 0.821967 v 0.178033 0.700000 0.178033 v 0.821967 0.700000 0.178033 v 0.821967 0.700000 0.821967 vt 0.989803 0.284731 vt 0.004179 0.284731 vt 0.004179 0.007866 vt 0.989803 0.007866 vt 0.990240 0.289015 vt 0.007213 0.289015 vt 0.007213 0.008363 vt 0.990240 0.008363 vt 0.989797 0.289133 vt 0.009384 0.289133 vt 0.009384 0.011379 vt 0.989797 0.011379 vt 0.997982 0.292245 vt 0.009121 0.292245 vt 0.009121 0.014439 vt 0.999135 0.014439 vt 0.001669 0.001666 vt 0.998337 0.001666 vt 0.998337 0.998334 vt 0.001669 0.998334 vt 0.994819 0.431148 vt 0.005943 0.431148 vt 0.005705 0.428010 vt 0.993477 0.428010 vt 0.989785 0.983519 vt 0.004785 0.987554 vt 0.992167 0.424260 vt 0.001816 0.424260 vt 0.991165 0.429341 vt 0.006288 0.429341 vt 0.995247 0.986760 vt 0.009550 0.990795 vt 0.990514 0.986758 vt 0.007624 0.990793 vt 0.987054 0.990643 vt 0.005786 0.994679 usemtl mbase s off f 5/1 6/2 2/3 1/4 f 6/5 7/6 3/7 2/8 f 7/9 8/10 4/11 3/12 f 8/13 5/14 1/15 4/16 f 1/17 2/18 3/19 4/20 f 5/14 8/13 12/21 9/22 f 12/23 11/24 15/25 16/26 f 8/10 7/9 11/24 12/23 f 6/2 5/1 9/27 10/28 f 7/6 6/5 10/29 11/30 f 9/22 12/21 16/31 13/32 f 10/28 9/27 13/33 14/34 f 11/30 10/29 14/35 15/36 f 13/17 16/18 15/19 14/20 # Blender MTL File: 'projector_base.blend' # Material Count: 1 newmtl mbase # Ns 0 Ka 0.000000 0.000000 0.000000 Kd 0.8 0.8 0.8 # Ks 0.8 0.8 0.8 d 1 # illum 2 map_Kd warpdrive:blocks/forcefield/projector-side_not_connected
  2. Indeed, I had completely missed the getRenderType() override in BlockContainer, thanks! For the record, if we use Block instead of BlockContainer as a parent class, there's also breakBlock() to override as it removes the TileEntity.
  3. I've been able to update my mod from 1.7.10 to 1.10.2 with rendering for non-TileEntity blocks, but for some reason all TileEntity blocks are fully transparent, even through they render fine in inventory. Is there some additional code needed when using BlockContainers? Here's my block reduce to it's simplest form reproducing the issue: 1- blockstates/air_generator.json { "variants": { "normal" : { "model": "warpdrive:air_generator" } } } 2- models/block/air_generator.json { "parent": "block/cube_all", "textures": { "all" : "minecraft:blocks/log_birch_top" } } 3- models/item/air_generator.json { "parent": "warpdrive:block/air_generator", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } } 4- Block code without tile entity public class BlockAirGenerator extends Block { public BlockAirGenerator(final String dummy) { super(Material.IRON); String registryName = "air_generator"; setUnlocalizedName("xxx"); // setCreativeTab(xxx); setRegistryName(registryName); GameRegistry.register(this); ItemBlock itemBlock = new ItemBlock(this); itemBlock.setRegistryName(registryName); GameRegistry.register(itemBlock); } } => in this case, the block renders properly in the world, on my player and in my inventory 5- Block with a tile entity public class BlockAirGenerator extends BlockContainer { public BlockAirGenerator(final String dummy) { super(Material.IRON); String registryName = "air_generator"; setUnlocalizedName("xxx"); // setCreativeTab(xxx); setRegistryName(registryName); GameRegistry.register(this); ItemBlock itemBlock = new ItemBlock(this); itemBlock.setRegistryName(registryName); GameRegistry.register(itemBlock); GameRegistry.registerTileEntity(TileEntityAirGenerator.class, "xxx"); } @Nonnull public TileEntity createNewTileEntity(@Nonnull World world, int metadata) { return new TileEntityAirGenerator(); } } public class TileEntityAirGenerator extends TileEntity { public TileEntityAirGenerator() { super(); } } => in this case, the block is fully transparent in the world (I can even see through it) but it renders fine on my player and in my inventory
  4. Since all assets paths needs to be lower case in MC1.11, and item models use registry name, I guess all registry name will also need to be lower case?
  5. I've seen multiple variations on how to name things in a mod regarding whether lowercase is mandatory or not. Are the following true? - in the @mod or mcmod.info, modid should always be lower case (especially from MC1.11) - in a ResourceLocation, resourceDomain should always be lower case - in a ResourceLocation, resourcePath can be any case provided it match with the JAR content - in a unlocalizedName, the string can be any case provided it match with the lang file content - in a command, it's only 'recommended' to use lowercase command names - in a DamageSource, according to vanilla 1.10.2, damageType can be camelCase - in a sounds.json, the keys should be lower case - in a PropertyEnum, the name should be lower case - in a PropertyEnum, the values should be lower case
  6. I'm used to Eclipse where I can directly search for a method through my mod and Forge itself with a full text search, it's not perfect but it does the job. Now, I'm giving a try to IntelliJ IDEA and I can't find a way to search through Forge source. The global search doesn't go through Forge sources. The 'find usage' just stop at my mod, unlike in Eclipse where it actually go through Forge sources too. I did a setupDecompWorkspace on my mod and forge itself before importing them through grade into IntelliJ IDEA. What am I missing? I'm on Mac with forge 1.7.10 and IntelliJ IDEA 2016.1.2.
  7. Thanks for your answers! Original code is here: https://github.com/LemADEC/ArsMagica2/blob/master/src/main/java/am2/AMEventHandler.java#L583 I've tried using AttackEntityEvent as such: Sadly, it doesn't seem to get cancelled whether I'm inside or outside a protected area (spawn with WorldGuard in my case).
  8. I'm trying to fix a few spawn bypasses in mods, notably ArsMagica2. For block placing, I was able to use ForgeEventFactory.onPlayerBlockPlace and ForgeEventFactory.onPlayerMultiBlockPlace. It's a bit tedious, but it does the job. What about entity attack? Notably, how can I detect if a player can attack an entity in an area?
  9. My mod depends on a specific version of another mod. I know how to detect that mod presence with Loader.isModLoaded("modid"). My issue is to access that mod version. Is there any easy way to access it?
×
×
  • Create New...

Important Information

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