Jump to content

Jummit

Members
  • Posts

    19
  • Joined

  • Last visited

1 Follower

Converted

  • URL
    jummit.com

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Jummit's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. For anyone searching for this, I managed to get it working in 1.15.2 with this code: public static final ResourceLocation INTERACT_WITH_SHIP_CONTROLLER = registerCustomStat("interact_with_ship_controller"); private static ResourceLocation registerCustomStat(String name) { ResourceLocation resourcelocation = new ResourceLocation(MOD_ID, name); Registry.register(Registry.CUSTOM_STAT, name, resourcelocation); Stats.CUSTOM.get(resourcelocation, IStatFormatter.DEFAULT); return resourcelocation; } You can then increase the stat: player.addStat(Registry.INTERACT_WITH_SHIP_CONTROLLER); Don't forget to localize it so it has a name in the stat list: "stat.sol.interact_with_ship_controller": "Interactions with Ship Controller" For fun, you can track your new stat with these commands: /scoreboard objectives add stat minecraft.custom:minecraft.interact_with_ship_controller /scoreboard objectives setdisplay sidebar stat
  2. You can do this: public class ModBlocks { @GameRegistry.ObjectHolder("modtut:firstblock") public static FirstBlock firstBlock; } (taken from https://wiki.mcjty.eu/modding/index.php?title=Basic_Block-1.12)
  3. I want to render planets in a space dimension, but don't know where to put the code to do that. Is RenderTickEvent what I want? I found this pretty helpful, but I don't want it to depend on blocks: http://greyminecraftcoder.blogspot.com/2014/12/the-tessellator-and-worldrenderer-18.html This is what I have so far: @Mod.EventBusSubscriber public class EventHandler { @SubscribeEvent public static void renderTick(RenderTickEvent event) { if (Minecraft.getMinecraft().currentScreen != null) { return; } if (event.phase==Phase.START) { // render sphere .obj } } EDIT: Turns out RenderTickEvent isn't the right event. Using RenderWorldLastEvent worked.
  4. I want to make a spaceship that can teleport from earth to a space dimensions with all blocks and entities it's made of. What is the best way of doing that?
  5. I got something to work, I now have an entity that renders an obj model. How can I make it textured? I tried setting the map in the .mtl file, but it always gives me the error texture. The forge wiki states But when I put in "minecraft:stone" or "mymod:mytexture" it doesn't work either. Never mind, I just read the "Resources" page of the forg e wiki and figured it out: "minecraft:stone" should be "minecraft:blocks/stone". I still can't get my own textures to work...
  6. Thanks a lot! That is exactly what I need.
  7. And that's where I'm struggling... OBJLoader.INSTANCE.addDomain(MOD_ID); OBJLoader.INSTANCE.onResourceManagerReload(Minecraft.getMinecraft().getResourceManager()); IModel model = OBJLoader.INSTANCE.loadModel(new ResourceLocation(MOD_ID, "models/cube.obj")); //model.bake(state, format, bakedTextureGetter) ? @Override public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) { // what to put in here? } Or is this the better way? @Override public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) { TileEntityRendererDispatcher.instance.render(MY_TILE_ENTITY, x, y, z, 0); }
  8. I only found tutorials about rendering obj models as items, armor or blocks. How can I make an entity use an obj? I have a net.minecraft.client.renderer.entity.Render ready to go.
  9. I need to find an item by its id for when I load recipes from json. How can I do that?
  10. Yeah, I didn't notice it was nullable. Fixed.
  11. What do I have to give the getCapability function? This doesn't work: container.getCapability(IItemHandler.class, EnumFacing.EAST); EDIT: Got it. container.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.EAST);
  12. I want to pass the data to the ItemStackHelper to get the items it contains. ItemStackHelper.loadAllItems(container.getTileData(), items);
  13. I have this problem that when I get the tile data of a chest it is empty. I use world.getTileEntity(pos).getTileData(), and that works on one of my custom ones, which looks like this: "{built:1b,multiblock:"test.json",multiblockcenter:[I;-906,5,310]}", but if I print the chest data it is empty ("{}"). Why is that?
  14. Thanks for the answer! My only question left is: Why do so many mods still use this method if it means tons of copied code and many inconveniences?
  15. I recently looked at the common issues and recommendations and saw why base classes are bad. I can't seem to find any mod that has no ItemBase and BlockBase classes. How would I do it differently?
×
×
  • Create New...

Important Information

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