Jump to content

WildHeart

Members
  • Posts

    236
  • Joined

  • Last visited

Posts posted by WildHeart

  1. Just now, diesieben07 said:

    Why not? A mod should be self-contained. Mod installation should always be "put this jar into the mods folder, done", in my opinion.

     

    Depends on the type of model. But again, please don't do this.

    I need this because I have a custom mod, i.e. you can create many items and blocks without programming knowledge, but not everyone knows about, what resources should be in the jar file. And I want to do more conveniently, without any knowledge it was possible to add models, textures, etc. Now we've seen one mod that does what I need, but he does it with asm. Link. Still before I start using this mod, will I be able to do it with standard tools without the intervention of asm?

  2. Just now, Draco18s said:

    Given that you didn't say how you were drawing the block...because you supplied no code...

    How was I supposed to know that you were using a TESR for this?

    I wrote that for a block has been applied to the render, I have not seen the new versions of the render which was in 1.7.10, so tesr the easiest way to do this.

  3. 4 minutes ago, Jay Avery said:

    Store the size of the list as an integer, then loop through the list and store each string. To read it, create a new list, read the size, and then loop through that number of times to read each string.

    So?

    private byte[] writeToByteArray(ArrayList<UObject> list) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(baos);
        for (UObject element : list) {
            out.writeObject(element);
        }
        return baos.toByteArray();
    }

     

  4. 4 minutes ago, jeffryfisher said:

    Minecraft sound handling can be confusing because  decision code for the server and "rendering" code for the client are partly mixed together with  similarly named methods. Take some time to trace both the execution and data flows with an eye toward logical client-server separation.

     

    Then look for a client-side vanilla classes with "continuous" in their names (I hope they haven't changed too much since I used them in 1.10). Finally, look up other threads about changes to Minecraft sounds in 1.12. I think there's some info on sound in 1.12 in the Forge docs area too.

    Currently working with 1.11.2 :) I found a mod Siren Mod, it does what I need, and most interestingly, the code is identical to mine, it's very strange:\

  5. Hello, i created radio for my mod and i want to have music playing all the time. I created class extended from MovingSound(As well as MovingSoundMinecart):

    public class RepeatSound extends MovingSound
    {
        public RepeatSound(TileRadio radio)
        {
            super(new ResourceLocation("modid", "radio_sound_1"));
            this.repeat = true;
            this.volume = 1.0F;
            this.xPosF = radio.xCoord;
            this.yPosF = radio.yCoord;
            this.zPosF = radio.zCoord;
        }
    
        @Override
        public void update() {}
    }

    In sounds:

    {
    	"radio_sound_1": {
    		"category": "music",
    		"sounds": [
    			{
    				"name": "modid:radio_sound_1",
    				"stream": true
    			}
    		]
    	}
    }

    In TileRadio

    @Override
        public void updateEntity()
        {
            if (play)
            {
                play = false;
                Minecraft.getMinecraft().getSoundHandler().playSound(new RepeatSound(this));
            }
        }

    And it's not working, there is a small period of 1 second, and sometimes does not work. How to fix it? The fact that I used the same code on 1.7.10 and 1.11.2, and still all the same.

  6. Hello, i created Entity and interact with him, but i have a problem. If click to entity, it entity name is updated on server and if relogged to world, it the name appears on the client. Before that, the name is not displayed. How to fix it?

     

    Code in entity for interact(method processInitialInteract):

    BlockPos pos = this.getPosition();
    this.code.put("hand", new HandMethods(this));
    this.code.setCodeFromBook(this.getEntityWorld(), player, this, pos, heldItem);
    PythonBookItem bookItem = (PythonBookItem) item;
    bookItem.itemInteract(heldItem, this);

     

    And method itemInteract:

    public boolean itemInteract(ItemStack stack, HandEntity handEntity)
        {
            if (handEntity != null)
            {
                if (stack.getItem() == ModItems.python_book)
                {
                    NBTTagCompound tagCompound = stack.getTagCompound();
    
                    if (tagCompound == null) return false;
    
                    if (tagCompound.hasKey("title"))
                    {
                        if (tagCompound.getString("title").isEmpty())
                        {
                            handEntity.setCustomNameTag(I18n.format("item.hand.tooltip.info"));
                        }
                        else
                        {
                            handEntity.setCustomNameTag(tagCompound.getString("title"));
                        }
                    }
                }
                return true;
            }
            return false;
        }

     

    And in processInitialInteract:

            if (!world.isRemote)
            {
                return handleItemInteraction(player, player.getHeldItem(hand));
            }
            return true;

     

×
×
  • Create New...

Important Information

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