Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • hiotewdew

hiotewdew

Members
 View Profile  See their activity
  • Content Count

    101
  • Joined

    May 27, 2017
  • Last visited

    November 22, 2020
  • Days Won

    1

 Content Type 

  • All Activity

Profiles

  • Status Updates
  • Status Replies

Forums

  • Topics
  • Posts

Calendar

  • Events

Posts posted by hiotewdew

  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next
  • Page 3 of 5  
  1. [SOLVED] [1.12.2] High spawnrates in some modded biomes

    in Modder Support

    Posted October 5, 2018 · Edited October 5, 2018 by hiotewdew


    New bug: naturally spawned coyotes/bears have a bear model?

    It's a bear. That is named coyote, has coyote ai,  but has a bear model.

     

    Why? I have no idea.

     

    -------------SNIP

     

    I thought a spawn egg made it work fine, but no, deers are now brown bears.

    HELP!

  2. [SOLVED] [1.12.2] High spawnrates in some modded biomes

    in Modder Support

    Posted October 5, 2018


    5 hours ago, jabelar said:

    Firstly you're not using the proper way to register entities for 1.12.2. You should be using the registration event with the entry builder technique. The entry builder has addSpawn() method that can directly take an array of biomes.

     

    I have an example here: https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/init/ModEntities.java

    Thank you. I did know that they were old I wasn't really sure of the event I should be using. I have a question. Does the EntityEntry set have to be immutable? I converted my init function into a function that adds all the entity entries for all of my mobs to the set (non-final hashset) that is called before the registry set loop. Will that work? Also, for the resource location in the EntryBuilder, the number after is supposed to be modEntities++ (different number for each mob), right?

  3. [SOLVED] [1.12.2] High spawnrates in some modded biomes

    in Modder Support

    Posted October 5, 2018 · Edited January 6, 2019 by hiotewdew


    So my users have been experiencing a bug while using personal modpacks with my mod. For some reason, my animals spawn exceptionally fast (50+ per 4 chunks).

    But only sometimes. I have tested this with both my users trying to recreate a world seed with only BOP or traverse and remove all their other mods, and the bug seems to go away.

    I compared the modlists of 4 users experiencing the bug and found they share:

    - Biomes O Plenty/Traverse (either)

    - LLibrary

    - DynamicSurroundings

    - Bibliocraft

     

    I had one user remove DynamicSurroundings and nothing changed. Have not tested Bibliocraft, but there's no reason why it would mess with mob spawning.

     

    This is my mob registry.

    https://github.com/itsmeow/betteranimalsplus/blob/master/src/main/java/its_meow/betteranimalsplus/init/MobRegistry.java

    I register as EnumCreatureType.MONSTER because if I set them to creature they don't seem to spawn.
    Any ideas? (Ignore the BiomeType code, it's messy, but essentially you put a set of biome sets and it has to convert to an array with all of them)

     

    Users mostly discover high spawns of the Deer and the Lammergeier. I have tried setting getMaxSpawnedInChunk but it doesn't seem to do anything.

  4. Custom Biomes not Generating Properly

    in Modder Support

    Posted September 28, 2018


    I don't know the problem, but in the future, to avoid issues like this, please use version control. For example, use Git and use GitHub to store your code online and view past code in a more organized way.

  5. [SOLVED] NBT Data not syncing/saving

    in Modder Support

    Posted September 23, 2018


    10 minutes ago, Animefan8888 said:

    You also need to override TileEntity#getUpdateTag and TileEntity#handleUpdateTag

    Yeah, I just figured out it was the syncing that was the issue.

    That seems to have fixed it. Thanks! I read somewhere that those two were only nessecary for stuff related to capabilities.

  6. [SOLVED] NBT Data not syncing/saving

    in Modder Support

    Posted September 23, 2018


    11 hours ago, Cadiboo said:

    try using a constant for the tag name, first checking if the tag exists before setting your variable and please post your code as a github repository

    https://github.com/itsmeow/betteranimalsplus/blob/master/src/main/java/its_meow/betteranimalsplus/block/TileEntityHandOfFate.java

     

    After doing all the suggested the problem still persists.

  7. [SOLVED] NBT Data not syncing/saving

    in Modder Support

    Posted September 23, 2018 · Edited January 6, 2019 by hiotewdew


    I'm aware at least 50000 threads exist with this exact topic. And trust me, I have read them. But my tile entity just refuses to save/sync data.

    Here's my code.

    package its_meow.betteranimalsplus.block;
    
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.network.NetworkManager;
    import net.minecraft.network.play.server.SPacketUpdateTileEntity;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.util.math.AxisAlignedBB;
    import net.minecraftforge.fml.relauncher.Side;
    import net.minecraftforge.fml.relauncher.SideOnly;
    
    public class TileEntityHandOfFate extends TileEntity {
    	
    	private boolean onFire = false;
    	
    	
    	public TileEntityHandOfFate() {
    	}
    	
    	
    	public void setOnFire(boolean b) {
    		this.onFire = b;
    		this.markDirty();
    	}
    	
    	public boolean isOnFire() {
    		return onFire;
    	}
    	
    	
    	@Override
    	public void readFromNBT(NBTTagCompound compound) {
    		super.readFromNBT(compound);
    		this.onFire = compound.getBoolean("OnFire");
    	}
    
    
    
    	@Override
    	public NBTTagCompound writeToNBT(NBTTagCompound compound) {
    		super.writeToNBT(compound);
    		compound.setBoolean("OnFire", this.onFire);
    		return compound;
    	}
    
    	@Override
    	public SPacketUpdateTileEntity getUpdatePacket() {
    		NBTTagCompound tag = new NBTTagCompound();
    		this.writeToNBT(tag);
    		return new SPacketUpdateTileEntity(pos, 1, tag);
    	}
    
    
    	@Override
    	public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
    		readFromNBT(packet.getNbtCompound());
    		world.scheduleUpdate(this.pos, this.blockType, 100);
    	}
    	
    	
    	
    	
    	
    	@Override
    	@SideOnly(Side.CLIENT)
    	public AxisAlignedBB getRenderBoundingBox() {
    		return new AxisAlignedBB(getPos().add(-2, -4, -2), getPos().add(2, 4, 2));
    	}
    	
    }

     

    Yes, the tile entity is registered and exists. It has a TESR that renders fire (the render method uses the isOnFire() method and creates fire particles).

    When I exit the world and reload it (not even leave game) the fire disappears.

    Nothing external to this touches the NBT.

  8. [SOLVED] ItemBlock with custom java armor model

    in Modder Support

    Posted September 23, 2018


    57 minutes ago, Cadiboo said:

    You could copy most of the code from ItemBlock and put it into your ItemArmor class

    I could, but the Block Registry requires it to extend ItemBlock.

  9. [SOLVED] ItemBlock with custom java armor model

    in Modder Support

    Posted September 23, 2018


    I made a seperate wearable item and a seperate placeable item instead of an ItemBlock with armor attributes.

     

    Apparently minecraft requires it to extend ItemArmor for getArmorModel() to work.

    A shame.

  10. [SOLVED] ItemBlock with custom java armor model

    in Modder Support

    Posted September 23, 2018 · Edited September 23, 2018 by hiotewdew


    Bump

     

    Here's my code:

    http://github.com/itsmeow/betteranimalsplus

  11. [SOLVED] ItemBlock with custom java armor model

    in Modder Support

    Posted September 20, 2018


    16 hours ago, Cadiboo said:

    How dynamic is your block? Does it need a TESR or can it be rendered with a custom baked model? If it can be rendered with a custom model, do it this way for the block first, then work on the item model. 

    I cannot bake it, no.

  12. [SOLVED] ItemBlock with custom java armor model

    in Modder Support

    Posted September 20, 2018 · Edited January 6, 2019 by hiotewdew


    I have an ItemBlock connected that's tied to a block and I want it to be wearable as a helmet (it's a mob skull) and I have the block fully working but when I put it on as a helmet it just uses the JSON model for the Item (a flat texture) instead of the armor model that I define in the ItemBlock class.

    //In the itemblock class:
    @Override
    	public boolean isValidArmor(ItemStack stack, EntityEquipmentSlot armorType, Entity entity) {
    		return armorType == EntityEquipmentSlot.HEAD;
    	}
    
    	@Override
    	public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type)
    	{
    		return Ref.MOD_ID + ":textures/entites/hirschgeist.png";
    	}
    
    	@Override 	
    	@SideOnly(Side.CLIENT)
    	public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot,
    			ModelBiped defaultModel) {
    		return ClientProxy.helmetModel;
    	}
    
    //Client Proxy
    public static final ModelHirschgeistSkullArmorPiece helmetModel = new ModelHirschgeistSkullArmorPiece(0.0625F);
    
    //Block registry events
    
    		/**
    		 * Register this mod's {@link Block}s.
    		 *
    		 * @param event The event
    		 */
    		@SubscribeEvent
    		public static void registerBlocks(final RegistryEvent.Register<Block> event) {
    			final IForgeRegistry<Block> registry = event.getRegistry();
    
    			final Block[] blocks = {
    					trillium,
    					hirschgeistskull,
    			};
    
    			registry.registerAll(blocks);
    
    			GameRegistry.registerTileEntity(TileEntityTrillium.class, new ResourceLocation(Ref.MOD_ID + ":" + trillium.getRegistryName()));
    			GameRegistry.registerTileEntity(TileEntityHirschgeistSkull.class, Ref.MOD_ID + ":" + hirschgeistskull.getRegistryName());
    		}
    
    
    		/**
    		 * Register this mod's {@link ItemBlock}s.
    		 *
    		 * @param event The event
    		 */
    		@SubscribeEvent
    		public static void registerItemBlocks(final RegistryEvent.Register<Item> event) {
    			final ItemBlock[] items = {
    					new ItemBlock(trillium),
    					hirschgeistskull.getItemBlock(),
    			};
    
    			final IForgeRegistry<Item> registry = event.getRegistry();
    
    			for (final ItemBlock item : items) {
    				final Block block = item.getBlock();
    				final ResourceLocation registryName = Preconditions.checkNotNull(block.getRegistryName(), "Block %s has null registry name", block);
    				registry.register(item.setRegistryName(registryName));
    				ITEM_BLOCKS.add(item);
    			}
    		}

     

    How should I be registering the model?

    The Block is a TE with a TESR and that's registered, but I'm not sure how I should register my model.

    If I use ModelLoader.setCustomModelResourceLocation it's just the item texture on my head, not the java model. I put a print statement in getArmorModel and it doesn't seem like it's running.

    By the way, getItemBlock(); returns a new instance of my ItemBlock class.

  13. Rendering partially transparent entity with opaque child parts (and particles attached to parts)

    in Modder Support

    Posted September 4, 2018


    So I have an advanced rendering problem here.

    I understand that in order to add transparency you call GlStateManager.enableAlpha() and use GlStateManager(1,1,1,alpha) to change transparency.

     

    However, I have a ghost deer with bones inside that I want to be opaque. How would I go about making only some of these transparent while they are still children of each other? Even better: is there a way I can keep the skeleton and the outer ghost layer seperate but have the rotations match (keep them attached without having their rendering attached?)

    Here's what I want it to look like. I also seem to have this bug only the front ribs are visibile. The rest seemed to have disappeared as well as the hip area/leg attachment bones.

     

     v05DRCk.png

     

    On the side, if anyone knows how I can keep a particle at a specific position (relative to the entity's heading)/attached to piece, I also need to know how to do that without using translates and some trig.

    I'm not expecting for every part of this to be answered, as it is definitely an advanced question. I'm almost certain I'll have to figure out the invisible bones on my own, but if anyone has anything that could help with any of the above problems it would be great! Thanks!

  14. Full movement control while passenger on vanilla entity

    in Modder Support

    Posted August 28, 2018


    3 minutes ago, Animefan8888 said:

    Entity Grabber


     

    
    public void update() {
    
        if (isRiding()) {
    
            getRidingEntity().setVelocity(/** Apply correct velocity from AI. **/)
    
        } else {
    
            // Normal code.
    
        }
    
    }

     

    Sorry, this won't work for me. However, I found a solution. Instead of riding the attacked entity, it sets the attacked to ride IT and then overrides the updatePassenger method and sets the position of the attacked to below it.

    @Override
    	public void updatePassenger(Entity passenger)
        {
            if (this.isPassenger(passenger))
            {
                float f1 = (float)((this.isDead ? 0.009999999776482582D : this.getMountedYOffset()) + passenger.getYOffset());
              
                passenger.setPosition(this.posX, this.posY - passenger.height - 0.05, this.posZ);
                this.applyOrientationToEntity(passenger);
            }
        }

     

  15. Full movement control while passenger on vanilla entity

    in Modder Support

    Posted August 28, 2018


    1 minute ago, Animefan8888 said:

    Entity#getRidingEntity will return the entity that is being ridden.

    The velocity won't change on the grabber if it's riding something, so I can't apply its velocity

  16. Full movement control while passenger on vanilla entity

    in Modder Support

    Posted August 28, 2018


    1 minute ago, Animefan8888 said:

    Switch to using the caught entitiy's velocity instead of the riding entity's.

    Yes, but how?

  17. Full movement control while passenger on vanilla entity

    in Modder Support

    Posted August 28, 2018


    I have a flying mob that is supposed to grab on to an entity (ride the entity) and lift it upwards and drop it. I have the drop/lift fully set up but the only problem is the bird can't actually control movement while riding something. Is there something I can override to allow it to move while a passenger (and take the ridden entity with it)?

  18. MapSavedData confusion

    in Modder Support

    Posted June 25, 2018


    For the life of me I cannot understand HOW MapSavedData works. I know it's NBT but it's not traditional in any way whatsoever. I am trying to store many String values (or if possible custom Enums) into NBT with different keys. normally, I would call compound.setString("mykey", "data") but MapSavedData does not do this. Instead I am left with MapStorage.getWorldData() and some need-to-be implemented readFromNBT and writeFromNBT. It has something to do with MapStorage.getOrLoadData(); and MapStorage.setData(); which I think writes the class into the world? Do the classes only store ONE value? I want a compound that saves into the map.

     

    I feel very stupid, but I've searched all I can and read the documentation and STILL I cannot understand.

  19. Executing command added on the client side with send message

    in Modder Support

    Posted June 23, 2018 · Edited June 23, 2018 by hiotewdew


    use

    if(world.isRemote) {
    	player.sendMessage(new TextComponentString("Message Here"));
    }

     

     

    EDIT:

    Nevermind. You want the player to send messages into the chat box? WHY?!?

    Just run the command's execute function directly.

  20. [1.12.2] Change block texture in game

    in Modder Support

    Posted June 23, 2018


    Perhaps this could help?

     

  21. Detecting creation of ItemStack (specific item)

    in Modder Support

    Posted June 23, 2018


    20 minutes ago, Draco18s said:

    Option a: have your machines call onUpdate() on their stacks 

    Option b: have your machines give the stacks the NBT

    Thank you!

     I will be doing this.

  22. Detecting creation of ItemStack (specific item)

    in Modder Support

    Posted June 23, 2018


    I'm creating a mod that has ore chunks remember where they were mined at. This works fine when a player is the one mining, but I plan to add mining vehicles with storage. I'm currently using onUpdate to store the chunk location it was mined at in NBT, but onUpdate only executes when the item is held by a player. If I make the item and it goes directly into a container, it will not store where it was created.

     

    Is there a method in the Item class I can somehow use to store data into the ItemStack NBT when it is created? onCreated is for the item instance.

     

    @Override
    	public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
    		BlockPos playerPos = entityIn.getPosition();
    		Chunk creationChunk = worldIn.getChunkFromBlockCoords(playerPos);
    		if(stack.getTagCompound() == null) {
    			stack.setTagCompound(new NBTTagCompound());
    		}
    		NBTTagCompound tagcompound = stack.getTagCompound();
    		int[] chunk = tagcompound.getIntArray("chunk");
    		if(chunk.length == 0) {
    			int[] array = { creationChunk.x, creationChunk.z };
    			tagcompound.setIntArray("chunk", array);
    			stack.setTagCompound(tagcompound);
    		}	
    		super.onUpdate(stack, worldIn, entityIn, itemSlot, isSelected);
    	}

     

  23. Having trouble getting item textures to work

    in Modder Support

    Posted April 4, 2018


    Also, I would heavily suggest embedding an InitModel function within your block classes.

    @SideOnly(Side.CLIENT)
    	public void initModel() {
    		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory"));
    	}

    That way when you run onRegsiterModels, you can just call

    Items.STARRECORD.initModel();

     

     

    Also, blockstates aren't used for items! Only models are nessecary. Don't worry about a blockstate json.

  24. Having trouble getting item textures to work

    in Modder Support

    Posted April 4, 2018 · Edited April 4, 2018 by hiotewdew


    @SideOnly(Side.CLIENT)
    	@SubscribeEvent
    	public static void onRegisterModels(ModelRegistryEvent event) {	
    		ModelLoader.setCustomModelResourceLocation(Items.STARRECORD, 0, new ModelResourceLocation("starrecord", "inventory"));
    		System.out.println("record registry name is = " + Items.STARRECORD.getRegistryName());
    		System.out.println("record unlocalized name is = " + Items.STARRECORD.getUnlocalizedName());
    }

    This needs to be new ModelResourceLocation("record.starrecord", "inventory").

  25. Failing to find model json file

    in Modder Support

    Posted April 4, 2018


    I would make a new project in a little better of a folder. Hidden appdata folders are not a good place to have configuration heavy IDE projects.

  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next
  • Page 3 of 5  
  • All Activity
  • Home
  • hiotewdew
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community