Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Alpvax

Members
  • Posts

    260
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Alpvax

  1. Unfortunately, I believe your only approach is to have either a custom leaf block (because you can't override the properties of vanilla blocks) or a custom log block which would set nearby leaves to non-persistent when it is removed, and generate the leaves with persistent set (which would be more prone to bugs such as breaking player placed leaves, or leaving behind leaves if the player breaks the link between the leaves and the trunk).
  2. Checking for the word "sapling" means your mod won't work in any language except English, so that's a really bad idea. Is there a sapling tag? (hint: there is: #minecraft:saplings) The approach that I would probably use is a capability in one of 2 ways: Either on the item (add using the event and check for saplings there), or on the EntityItem (check the entity is entityitem with contained sapling). Then subscribe to the entity tick event and check the capability (or check it's an entityItem, then check the item has the capability). Use the capability to store your 600 tick cooldown, then plant the sapling.
  3. I'm afraid we need more than a line number... What is the exception?
  4. I believe part of the reason for forge moving to an event-based registration approach was to begin to make things possible. If everyone created and registered everything at the correct time (in the events), it wouldn't be too much of a stretch to begin working on hotloading (restore vanilla registry state, re run registry events, continue). However, it is not really a priority for anyone, and isn't feasible until everyone starts playing by the rules.
  5. Make sure you only render once per tick. The RenderGameOverlayEvent fires for each HUD element, pick one to use.
  6. I believe this error appears if you aren't sending any packets, and so haven't registered a network channel.
  7. Is this what you actually meant to do? Just register the command you have created, instead of redirecting it to itself. Yup, you are registering it on the server, so any packets you send need to be from the server to the client (HINT: you have the correct client to send to passed into your 'run' function). Perform your logic directly in the 'run' function of your command, and if you need it on the client, send a packet to just update the client with the new value (don't do any calculation on the client, do it on the server and send the result).
  8. Then you need to create a custom IRecipe type, which checks whether or not the player has the advancement as part of the recipe. Last time I looked, the only way to get the crafting player was by reflection (although that was a while ago).
  9. Oh dear, I can see multiple issues with your code: What on earth are you trying to achieve with this? This will never work. If you are on the server (i.e. trying to send a message to the client), you CANNOT use Minecraft.getInstance(). Also, I'm pretty sure most (if not all, I haven't looked in a while) commands run on the server, so you shouldn't need to send packets (unless you need to update the client(s)). Please show where PointsCommand::register is called (just to check that it is being registered on the server).
  10. That is a really bad idea. If your mod does nothing, there's no point having it installed. If your mod does something, it should show up in the mod list. Otherwise, if there is a strange interaction between your mod and another one, it becomes very hard to find the problem (because the users don't know they have your mod installed).
  11. Try looking at the ender dragon code. I havent looked in a long time (so it could well have changed) but it used to be made up of multiple parts.
  12. Use the dependencies in mods.toml. If they aren't satisfied, the mod won't load and the user will be shown an error
  13. Show where you are sending your packet (the command). If you send the packet to the client, it will be handled on the client, so the server won't get updated.
  14. Vanilla has this feature: /gamerule doLimitedCrafting See http://minecraft.gamepedia.com/Recipe_book#Obtaining
  15. You still haven't taken into account user resource packs (i.e. those which are not in a mod jar). You would have to re-hash every time someone changed a resource pack, including in-game.
  16. I seem to remember one of the mdk versions shipping with the vanilla code (and all the blocks) but the newer versions have that all stripped. What remains is helper functions to create standard blocks, fences, stairs etc. It is easy to strip from your mod if you really want to, as it is all called by events. Just exclude that class file from the build task, but how much space does a single class file take up (for me, including all my blockstates, models, recipes, tags etc., it's < 40kb uncompressed, and I've got a load of junk in mine that I was experimenting with)? For example, it is far easier to create a new fence model by creating the "fence_post" and "fence_side" models (just binding a texture to the parent models, can be done easily with a function call each) and calling a single method, passing those ResourceLocations in, than it is to manually create the multipart model file.
  17. It was added by Mojang for their use, and has been extended to be usable by forge mods. It means that you don't have to manually create json files for all your basic blocks which are identical apart from texture. No, you can leave it there. During normal running, the event isn't fired, so the code isn't used (and probably isn't even loaded if it is in a separate file).
  18. Hmmm... I wonder what would happen if someone wanted to change the textures with a resource pack? Which can be done in-game, and now instead of just loading and stitching the textures, it has to hash and save. And then the player decides they didn't like that resource pack after all...
  19. What exactly are you trying to do? I use that method to conditionally highlight sub segments of my block (by returning a different voxelshape).
  20. Unfortunately, so much has changed since 1.7 that you're better off rewriting the mod from scratch (create a new workspace so you can copy the old functionality).
  21. Oh, re-reading the code, I think you need to override canStickTo to only return true if the other block is itself or non sticky. To be honest, I'm surprised that slime doesn't push your block.
  22. So you have an instance of the player (the one using the table). Use that player to get the server: player.world.getServer();
  23. Your way will crash on a server. Where are you calling this from? What are you trying to achieve?
  24. If it's your own block, you can override Block#getShape: @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { if(context instanceof EntitySelectionContext) { Entity e = context.getEntity(); if (e != null) { // Perform your logic } } return super.getShape(state, worldIn, pos, context); }
  25. I think you need to leave the default implementation of canStickTo, just override isStickyBlock
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.