Jump to content

salvestrom

Members
  • Posts

    116
  • Joined

  • Last visited

Posts posted by salvestrom

  1. Anyone got any thoughts? The fact the husk on a horse won't move is pretty confusing. I tried updating to the latest version of forged today, but that did nothing.Also, just to note having a saddle is key. Without a saddle the horse/custom mount will skip all the passenger code in the travel method…

  2. 6 hours ago, Lyon said:

    But is there a way to change the item rotation based on the direction the player is looking?

    One small point: the item's position will be relative to the arm which you are already adjusting to match the direction the player is looking, so you shouldn't actually need the item to do any additional rotation itself; just have it set up in the json file. Right?

    • Thanks 1
  3. Okay. Bare with me. I've been updating from 1.12 to 1.14. I created a custom rideable entity in 1.12 that functioned fine. In 1.14 it still functions fine unless it's being ridden. In which case, it refuses to move. If I remove the rider by knocking it off or killing it, the custom mount will behave normally. Until another rider gets on. Eventually I tested the custom mount by having it spawn ridden by a husk. It also wouldn't move. I then tested having my custom rider spawn on a vanilla horse. They also wouldn't move. I then spawned (via my custom mounts spawn egg) a husk riding a horse and they also would not move. At this point, I'm very confused. Help…

     

    This is the code from the custom mounts spawn egg that I was using to spawn a husk on My custom mount, I also used this to spawn a husk riding a horse, which I stress again would not move in game.…

        public ILivingEntityData onInitialSpawn(IWorld worldIn, DifficultyInstance difficulty, SpawnReason reason, @Nullable ILivingEntityData entityLivingData, @Nullable CompoundNBT itemNbt)
        {
            entityLivingData = super.onInitialSpawn(worldIn, difficulty, reason, entityLivingData, itemNbt);
    
            if (this.rand.nextInt(5) == 0)
            {
                this.setGrowingAge(-24000);
            }
        	int i = this.rand.nextInt(100);
        	
        	this.setRaptorVariant(i > 89 ? 2 : (i > 44 ? 1 : 0));
    /*    	HuskEntity sacskel = EntityType.HUSK.create(this.world);
            sacskel.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
            sacskel.onInitialSpawn(worldIn, difficulty, reason, (ILivingEntityData)null, (CompoundNBT)null);
            this.setGrowingAge(0);
            this.raptorChest.setInventorySlotContents(0, new ItemStack(Items.SADDLE));
            this.updateRaptorSlots();
            this.setRaptorTamed(1);
            worldIn.addEntity(sacskel);
            sacskel.startRiding(this);*/
            return entityLivingData;
        } 

     

  4. Spoiler
    
        public void updatePassenger(Entity passenger)
        {    	
            float f5 = 0;
        	float f6 = 0;
    
        	if (this.world.isRemote && this.isPassenger(passenger))
            {
        		f5 = this.prevLimbSwingAmount + (this.limbSwingAmount - this.prevLimbSwingAmount) * 
            			Minecraft.getMinecraft().getRenderPartialTicks();
            	//"Time" in the model file
        		f6 = this.limbSwing - this.limbSwingAmount * 
            			(1.0F - Minecraft.getMinecraft().getRenderPartialTicks());
            	
            	if (f5 > 1.0F)
                {
                    f5 = 1.0F;
                }
            }
            	float f0 = MathHelper.sin(((1.0995574287564276334619251841478f) 
            			+ (f6*1.226612f)) )
            			* (f5);
    
            	passenger.setPosition(this.posX + 0,
                		this.posY + this.getMountedYOffset() + passenger.getYOffset() 
                		+ (this.isRaptorJumping() ? 0 : f0 * 0.0625),
                		this.posZ - 0);
            
            
            if (passenger instanceof EntityLiving)
            {
            	EntityLiving entityliving = (EntityLiving)passenger;
            	this.renderYawOffset = entityliving.renderYawOffset;
            }
           
        }

     

    This is what I currently have. I had to move the passenger.setPosition outside of the isRemote check because the player was immediately warping back to the position they mounted the entity at on dismounting. I have no idea if this will actually cure the original problem on a server, or if there is some other way around this.

  5. Here's the top few lines of the crash log I was supplied with. This never happened while testing in the development environment. This may only be occurring on servers.

    Spoiler
    1. Time: 2019-08-08 17:45:02 CEST
    2. Description: Ticking entity
    3.  
    4. java.lang.NoClassDefFoundError: net/minecraft/client/Minecraft
    5.     at com.salvestrom.w2theJungle.mobs.entity.EntityRhinopter.updatePassenger(EntityRhinopter.java:1689)
    6.     at net.minecraft.entity.Entity.updateRidden(Entity.java:2020)
    7.     at net.minecraft.entity.EntityLivingBase.updateRidden(EntityLivingBase.java:2489)
    8.     at com.salvestrom.w2theJungle.mobs.entity.EntityLizardmanBase.updateRidden(EntityLizardmanBase.java:157)
    9.     at com.salvestrom.w2theJungle.mobs.entity.EntityLizardmanSticker.updateRidden(EntityLizardmanSticker.java:179)
    10.     at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:1988)

    And here is the method from the entity file. This was an attempt to give a rider a bobbing effect while mounted. It was mostly successful. Am I doing something wrong with the Minecraft.get Minecraft() call?The line specified by the crash log corresponds to the first usage of Minecraft.getMinecraft. Again this never happens while in the development environment.

    Spoiler
    
        public void updatePassenger(Entity passenger)
        {    	
            if (this.isPassenger(passenger))
            {
            	float f5 = this.prevLimbSwingAmount + (this.limbSwingAmount - this.prevLimbSwingAmount) * 
            			Minecraft.getMinecraft().getRenderPartialTicks();
            	//"Time" in the model file
            	float f6 = this.limbSwing - this.limbSwingAmount * 
            			(1.0F - Minecraft.getMinecraft().getRenderPartialTicks());
            	
            	if (f5 > 1.0F)
                {
                    f5 = 1.0F;
                }
            	
            	float f0 = MathHelper.sin(((1.0995574287564276334619251841478f) 
            			+ (f6*1.226612f)) )
            			* (f5);
    
            	passenger.setPosition(this.posX + 0,
                		this.posY + this.getMountedYOffset() + passenger.getYOffset() 
                		+ (this.isRaptorJumping() ? 0 : f0 * 0.0625),
                		this.posZ - 0);
            }
            
            if (passenger instanceof EntityLiving)
            {
            	EntityLiving entityliving = (EntityLiving)passenger;
            	this.renderYawOffset = entityliving.renderYawOffset;
            }
           
        }

     

     

  6. 3 hours ago, Drachenbauer said:

    Now i found a way to add the size in the registration-lines, like at the munitions.

     

    But now i noticed, that my entities get hutr, if swimming in water.

    How to fix this?

    to see the size thing at my entities, look in my repository:AngryBirdsMod on Github in the main-class "AngryBirds" in the entity-registry-event.

    Drowning in water is determined by the mobs "eye height" which can be set independently of the collision box. Turn on collision boxes in game and you should see a red square either within or above the collision box: this is the mobs eye height.

     

    Edit: looking at your source code, it seems you have mob eye height set at as little as a quarter of the mob height.

  7. 13 hours ago, abused_master said:

     

    PS. You really should move to 1.14 from 1.13

    I see. As for moving to 1.14, I'm about done with 1.13.2 – just a few specialty blocks and all of the structure/world generation rewriting to do. I figured I'd see it out, but it seems largely pointless. No one is going to play 1.13 mods, just as it skipped from 1.7 to 1.9.

  8. You can still create sub-items, and successfully register them and use them in game. But there seems to be no way to distinguish them in a recipe file. But for separate classes does seem to be the only way forward. Seems odd to leave the sub item functionality in place.

    Edit: and even if I use four separate classes, each prewritten book will have to be registered as a sub item still. It will resolve my issue with recipes, but it won't remove my use of subitems.

  9. 3 hours ago, waluigiisbest99 said:

    i set them to "any" when selecting natural spawning, They will spawn at day but not night. The same goes for monster spawners nothing will happen regardless at night, They only work in the day. What do you mean by code?... 

    Sorry, I clicked on this post from another part of the forums and thought this was a coding issue. I'm not familiar with the mod you are using and can't help you I'm afraid.

  10. I have four prewritten books stored as sub-items of a single book item class. The issue is referencing them in recipes and advancements.

    This is the Advancement Json as it was in 1.12.2:

    Spoiler
    
    {
        "parent": "thejungle:junglestory/root",
        "display": {
            "icon": {
                "item": "thejungle:book_scale"
            },
            "title": {
                "translate": "advancements.junglestory.book_scale_i.title"
            },
            "description": {
                "translate": "advancements.junglestory.book_scale_i.description"
            },
            "show_toast": true,
            "announce_to_chat": true
        },
        "criteria": {
            "book_scale_i": {
                "trigger": "minecraft:inventory_changed",
                "conditions": {
                    "items": [
                        {
                            "item": "thejungle:book_scale",
                            "data": 367
                            }
                        ]}}}
                    }}

     

    In 1.13.2 "data" causes an error reading "disallowed data tag".

    The following is an extract from the book scale item class. There are four prewritten books in total:

    Spoiler
    
    		eastScale = new ItemStack(this);
    		eastScale.setDamage(367);
    
    		NBTTagCompound tag = new NBTTagCompound();
        	eastScale.setTag(tag);
    	    		
    		tag.setString("author", ("Salvestrom"));
    		tag.setString("title", ("The Books of Scale: The Bringer"));//Lord of the Living"));
    		NBTTagList bookPages = new NBTTagList();
    		tag.setTag("pages", bookPages);
    	    bookPages.add(new NBTTagString
    	    		("\"Who really knows\n"
    	    		+ " and who can swear\n"
    [And so on…]

     

    Initially I thought flattening wouldn't work since I would still need a sub item within each flattened book item class, but then I realised that each separate class would be sufficient for distinguishing them. However, if it's possible to resolve this by changing the word "data" to something else, that would be great! :)

  11. In 1.13.2 armour textures seem to be fixed at "64, 32". Or some ratio of that. My armour texture is "128, 128" so the game is looking for the chest plate texture, for example, at (32, 64) instead of (16, 16). It completely ignores any numbers that I pass over or try to set in the model file.

     I can't fit my armour texture into a 64 by 32, but I think think it is possible to have more than two textures associated with an armour.

    But is it possible to overcome the above problem?

  12. 	protected void preRenderCallback(EntityJungleSpider nttLizSt, float par2) 
    	{
    		GL11.glScalef(0.2F, 0.2F, 0.2F);
    	}

    I think this is what you're looking for: it goes in the render class. Obviously just change it to your entity and Whatever scale you want.

    Oh, this is still working 1.13. I have no 1.14 version.

    • Sad 1
  13. On 6/28/2019 at 7:29 PM, regele said:

    Hello!

    Today I was starting a new mod on minecraft 1.13.2 and now i'm messing with naming blocks... i can't name them but items work fine

    it's something special about naming blocks? plz help me

    Your language file does not contain any translations for block names. What are you seeing in game?

  14. It seems to be a cart before the horse issue: items are registered before sounds so the record has no sound attached to it. I can get around this by using a static initialiser, but I'm looking for other options. I also have a similar issue using custom spawn eggs: the entity type is a null. In this case I'm using spawn eggs directly so they can be placed in my mod's creative tab.

     

    @ObjectHolder(References.MODID)
    public class JungleSounds {
    
    	public static SoundEvent RECORD_SURVIVORS;
    	public static SoundEvent SAUROHN_DEATH;
    	public static SoundEvent SAUROHN_HURT;
    	public static SoundEvent SAUROHN_LAUGH;
    	public static SoundEvent SAUROHN_MOCK;
    	public static SoundEvent SAUROHN_TALK;
    	
    	
    	public static void init() //Not currently called, doesn't work if used from pre-init
    	{
    		/*RECORD_SURVIVORS = registerSound("records.eyetyrant");
    		
    		SAUROHN_DEATH = registerSound("saurohn.saurohn_death");
    		SAUROHN_HURT = registerSound("saurohn.saurohn_hurt");
    		SAUROHN_LAUGH = registerSound("saurohn.saurohn_laugh");
    		SAUROHN_MOCK = registerSound("saurohn.saurohn_mock");
    		SAUROHN_TALK = registerSound("saurohn.saurohn_talk");*/
    	}
    
    	private static SoundEvent registerSound(String soundName) 
    	{
    	    //soundID;//SoundEvent soundID = IRegistry.field_212633_v.func_212608_b(new ResourceLocation(soundName));
    		final ResourceLocation soundID = new ResourceLocation(References.MODID, soundName);
    		return new SoundEvent(soundID).setRegistryName(soundID);
    	}
    	
    	@EventBusSubscriber(modid = References.MODID, bus = EventBusSubscriber.Bus.MOD)
    	public static class RegistrationHandlerSound 
    	{
    		@SubscribeEvent
    		public static void registerSoundEvents(final RegistryEvent.Register<SoundEvent> event) 
    		{
    			init();
    			event.getRegistry().registerAll
    			(
    					RECORD_SURVIVORS = registerSound("records.eyetyrant"),
    					
    					SAUROHN_DEATH = registerSound("saurohn.saurohn_death"),
    					SAUROHN_HURT = registerSound("saurohn.saurohn_hurt"),
    					SAUROHN_LAUGH = registerSound("saurohn.saurohn_laugh"),
    					SAUROHN_MOCK = registerSound("saurohn.saurohn_mock"),
    					SAUROHN_TALK = registerSound("saurohn.saurohn_talk")
    					
    			);
    		}
    	}

     

  15. I noticed that the openHorseInventory method in EntityPlayerSP makes a call to displayGuiScreen in the Minecraft class, which is public. All that happens in the player class is a few parameters are picked up which are actually available in the horse class itself. I still have a lot of errors before I can launch the game, but as far as I can tell having a GUI handler doesn't matter… Which seems odd, but I no longer make a reference to it.

  16. So I have an entity that can be saddled via an inventory slot.

    This is an error in the entity file:
     

                   playerEntity.displayGuiScreen(w2theJungle.JUNGLE_GUI_ID, world, 
                       this.getEntityId(), 0, 0);

    The method has been replaced with displayGui calling an IInteractionObject, but vanilla only uses this for blocks.

     

    The other error:

            NetworkRegistry.registerGui(new RaptorInventoryGuiHandler());

    The class has moved and the method no longer exists.

    Will IInteractionObject actually work from entities?

  17. So this is how I have it in 1.12:

    Method method;
            for (int i=0; i < JungleTriggerRegistry.TRIGGER_ARRAY.length; i++)
            {
                try
                {
                    method = ReflectionHelper.findMethod(CriteriaTriggers.class, "register", "func_192118_a", ICriterionTrigger.class);
                    method.setAccessible(true);            
    
                    method.invoke(null, JungleTriggerRegistry.TRIGGER_ARRAY[i]);
                }
                catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e)
                {
                    System.out.println("Failed to register trigger " + JungleTriggerRegistry.TRIGGER_ARRAY[i].getId() + "!");
                    e.printStackTrace();
                }
            }

    Reflection helper doesn't exist in 1.13. The reflection class available doesn't seem to have a similar "find method" method. Is there a substitute for this? Is using reflection to do this necessary any more? The method for registering criteria is public, I noticed.

×
×
  • Create New...

Important Information

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