Jump to content

ZigTheHedge

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by ZigTheHedge

  1. I can't see the part of code which should call registerItemModel from item class. I think, you've missed ModelRegistryEvent. @Mod.EventBusSubscriber public static class RegistrationHandler { // ... @SubscribeEvent public static void registerItems(ModelRegistryEvent event) { ModItems.registerModels(); } }
  2. I hope you haven't forgot to call OBJLoader.INSTANCE.addDomain in your clientProxy? UPD: And your model is HUGE btw!
  3. Try flipping "V" in your blockstate "custom": { "flip-v": true }
  4. Just point the "model" parameter in your blockstate to .obj file (extension is needed!) instead of json-model and include OBJLoader.INSTANCE.addDomain(YOUR_MOD_ID); in your ClientProxy (in static).
  5. Well... Just in case. Add this parameter to your "defaults" in blockstate: ... "defaults": { "custom": { "flip-v": true } }, ...
  6. Okay... Let's try some thingies: 1. Your OBJLoader.INSTANCE.addDomain(Reference.MODID); is called thriсe. You should remove two unneeded calls (leave only one that is in preInit in ClientProxy) 2. Your collector's classes "init"s called twice for whatever reason. Why? 3. TextureStitchEvent.Pre <- the reason it is needed may lay in incorrect texture dimensions (should be a power of 2) 4. Try to remove shouldSideBeRendered override
  7. Did you try to set NBT of Item to this? https://minecraft.gamepedia.com/Player.dat_format#Attribute_Modifiers
  8. No, I mead registration stuff (MachineBlocks, I think)
  9. Ok, let's see the class which machine_tardis belongs to.
  10. You have a looooooot of messages about incorrect textures/models in your log, but nothing wrong I can see with machine_tardis. What doesn't work exactly?
  11. Yep. It looks fine.
  12. Take a look at "Project Structure...". Path in "Project compiler output" should be valid.
  13. Why do you need actual World for it? Dimension ID and coordinates will be enough
  14. In your blockstate json add a couple of "normal" variants with different rotations. For example: { "forge_marker": 1, "defaults": { "model": "modid:modblock" }, "variants": { "normal": [ { "model": "modid:modblock" }, { "model": "modid:modblock", "y": 90 }, { "model": "modid:modblock", "y": 180 }, { "model": "modid:modblock", "y": 270 } ], "inventory": [{ "transform": "forge:default-block" }] } }
  15. Hello, community! I would like to replace vanilla trees to make logs unbreakable by default. So, I overrode BlockNewLog and BlockOldLog with my classes and registered new blocks with vanilla registry names ("log" and "log2"). Now, every previously generated tree has my blocks with the desired behavior, but trees grown from saplings has "minecraft:air" with log's properties instead of minecraft:log/log2. I've noticed that WorldGenTrees (for example) accesses Blocks.LOG to get the IBlockState to place in the world, but I cannot figure out, why it gets "AIR" instead of actual block. Do I have to re-implement World Generators for trees?
  16. Problem solved. The problem was in my armature file name. It was "engine.json" instead of animated part of block, which is called "engine_ring.json". Thanks for the help!
  17. I'll try this out, thanks.
  18. I've seen the documentation. And even tried to include something in "parameters" with no luck. I don't get the main idea of animation basis I think... I thought that system will automatically pass world time or something to ASM file, so clips from Arm can animate...
  19. I've experienced the same behavior with new Gradle and latest IDEA. Fixed by running gradlew genIntelliJRuns from separate command line (not from IDEA Terminal).
  20. Well, that thingy is really lacks documentation The problem is: every information about it that I've found has examples of multi-state animation (starting by click for example). But I need animation with only one animated state. And animation just doesn't start. "static==false" state model is rendered properly above "static==true" model, but doesn't move. I think the problem is - I need to pass worldTime to ASM somehow, but I cannot figure out how to do that exactly. I even made a separate mod just for testing. Here's the contents: Block: public class Engine extends Block implements ITileEntityProvider { public static final PropertyDirection FACING = PropertyDirection.create("facing"); public Engine(String name) { super(Material.IRON, MapColor.BLACK); setRegistryName(name); setUnlocalizedName(AnimTest.MODID + ":" + name); setCreativeTab(CreativeTabs.MISC); } @Override @SuppressWarnings("deprecation") public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(FACING, EnumFacing.values()[meta]); } @Override public int getMetaFromState(IBlockState state) { return state.getValue(FACING).ordinal(); } @Override public ExtendedBlockState createBlockState() { return new ExtendedBlockState(this, new IProperty[]{ FACING, Properties.StaticProperty }, new IUnlistedProperty[]{ Properties.AnimationProperty }); } @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { worldIn.setBlockState(pos, state.withProperty(FACING, EnumFacing.getDirectionFromEntityLiving(pos, placer)), 2); } public void initModel() { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory")); ClientRegistry.bindTileEntitySpecialRenderer(EngineTE.class, new AnimationTESR<EngineTE>()); } public void initItemBlockModel() { Item itemBlock = Item.REGISTRY.getObject(getRegistryName()); ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(getRegistryName(), "inventory"); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, 0, itemModelResourceLocation); } @Override @SuppressWarnings("deprecation") public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { return state.withProperty(Properties.StaticProperty, true); } @Override @SuppressWarnings("deprecation") public boolean isFullCube(IBlockState state) { return false; } @Override @SuppressWarnings("deprecation") public boolean isOpaqueCube(IBlockState state) { return false; } @Override @SuppressWarnings("deprecation") public boolean hasTileEntity() { return true; } @Nullable @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new EngineTE(); } } TileEntity: public class EngineTE extends TileEntity{ private final IAnimationStateMachine asm; public EngineTE() { asm = AnimTest.proxy.load(new ResourceLocation(AnimTest.MODID, "asms/block/engine.json"), ImmutableMap.of()); } @Override public boolean hasFastRenderer() { return true; } @Override public boolean hasCapability(@Nonnull Capability<?> capability, @Nullable EnumFacing side) { if(capability == CapabilityAnimation.ANIMATION_CAPABILITY) { return true; } return super.hasCapability(capability, side); } @Override @Nullable public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing side) { if(capability == CapabilityAnimation.ANIMATION_CAPABILITY) { return CapabilityAnimation.ANIMATION_CAPABILITY.cast(asm); } return super.getCapability(capability, side); } } BlockState: { "forge_marker": 1, "defaults": { "model": "animtest:engine" }, "variants": { "normal": [{}], "inventory": [{ "model": "animtest:engine", "submodel": { "ring": { "model": "animtest:engine_ring" } }, "transform": "forge:default-block" }], "facing": { "north": { "x": 90 }, "south": { "x": 90, "y": 180 }, "west": { "x": 90, "y": 270 }, "east": { "x": 90, "y": 90 }, "up": {}, "down": { "x": 180 } }, "static": { "true": { "model": "animtest:engine" }, "false": { "model": "animtest:engine_ring" } } } } Armature: { "joints": { "piston": { "0": [ 1.0 ] } }, "clips": { "default": { "loop": true, "joint_clips": { "piston": [ { "variable": "offset_y", "type": "uniform", "interpolation": "linear", "samples": [0, 1, 2, 3, 4, 3, 2, 1] } ] }, "events": {} } } } ASM: { "parameters": { }, "clips": { "default": "animtest:block/engine@default" }, "states": [ "default" ], "transitions": { }, "start_state": "default" }
  21. That actually works! Thanks! The only problem, I should think about some way to remove TE after world load as well, but I'll find a way. Thanks again!
×
×
  • Create New...

Important Information

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