Jump to content

SaoModder

Members
  • Posts

    31
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

SaoModder's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. just use an array x being the number of different textures you want IIcon[] Textures = new IIcon[x]; @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { // example of different textures assigned to a number this.Textures[0] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture one"); this.Textures[1] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture two"); this.Textures[2] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture three"); this.Textures[3] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture four"); } once you have this just change the texture based on its damage value maybe?
  2. so an image tells 1000 words so lets start with one for some reason my block is rendering above my head whenever its placed in game i cant seem to figure out why this unusual bug happens since its never before lol, it is quite annoying would anyone have a clue as to why its happening? im not incredibly familiar with rendering so if its something derpy i apologize my tile entity render class (im rendering a .obj not a normal techne model btw) package com.souleater.Blocks.TileEntities; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; import org.lwjgl.opengl.GL11; import com.souleater.Main.SoulEater; import java.awt.*; public class SoulBankTileEntityRender extends TileEntitySpecialRenderer { private final IModelCustom model; ResourceLocation rs; public SoulBankTileEntityRender() { model = AdvancedModelLoader.loadModel(new ResourceLocation(SoulEater.MODID, "Models/soulbank.obj")); rs = new ResourceLocation(SoulEater.MODID, "textures/models/soulbank.png"); } @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { if(te instanceof TileEntitySoulBank){ GL11.glPushMatrix(); TileEntitySoulBank tile = (TileEntitySoulBank)te; int dir = tile.getBlockMetadata(); GL11.glPushMatrix(); if(dir == 2) { GL11.glTranslatef((float) x + 0.5F, (float) y + 0.0F, (float) z + 1.2F); GL11.glRotatef(180, 0F, 1F, 0F); } else if(dir == 3) { GL11.glTranslatef((float) x + 0.5F, (float) y + 0.0F, (float) z + 0.2F); GL11.glRotatef(180, 0F, 1F, 0F); } else if(dir == 4) { GL11.glTranslatef((float) x + 0.8F, (float) y + 0.0F, (float) z + 0.5F); GL11.glRotatef(90, 0F, 1F, 0F); } else if(dir == 5){ GL11.glTranslatef((float) x - 0.2F, (float) y + 0.0F, (float) z + 0.5F); GL11.glRotatef(90, 0F, 1F, 0F); } GL11.glRotatef(180, 0F, 1F, 0F); bindTexture(rs); GL11.glScaled(60, 60, 60); this.model.renderAll(); GL11.glPopMatrix(); GL11.glPopMatrix(); } } }
  3. ItemStack NBT is just like TE NBT. They just store different things. I think he was referring to the way tile nbt is read and saved to fields inside the tile entity class. The difference is with tile entities every single block that has a tile entity has its own unique instance of the tile entity class not unlike regular entities. But with items all items share one instance of the item class so if you change something in the item class it affects all items. It can be a little confusing at first but there aren't actually any items in game. Every item is an items stack that contains that item and it is the item stack that you can store data in using nbt. yeah that was what i was getting at lol
  4. omg haha must of been a derp moment auto generating code when extending my tile entity base i made to save writing unnecessary code what line in the logs tipped you to know that for future reference?
  5. so my tile entity works fine but when exiting and entering world it messes up, from what i can gather the tile entity data isnt being saved and loaded properly but im not sure, its a very simple tile entity ive got more complicated ones that arent messing up so i dont know what the issue is, ill post any code relevant upon request heres the error its a multiblock btw
  6. oh thanks! done and works a charm ive never really used nbt before outside of tile entities and they seem to be different off memory (may be wrong)
  7. i have a problem with my nbt data inside an item, this is for 1.7.10 the nbt data works perfect... the only issue is whatever one items nbt data is all other instances of that item in your inventory shares the same nbt data, example if one item has an int set to nbt data with a value of 23 and you have 3 of said item in your inventory all 3 copies are having that same int (23) if the int gets raised they all raise etc how do i get each instance of the item have its own independent nbt? item code below package com.souleater.Items; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; public class ModItemWorldEater extends ItemPickaxe{ private int soulefficiency = 0; private String Owner = null; private boolean created = false; protected ModItemWorldEater(ToolMaterial WorldEater) { super(WorldEater); this.setMaxDamage(soulefficiency); } @Override public float getDigSpeed(ItemStack stack, Block block, int meta) { if (soulefficiency > 0) { return (soulefficiency/2); }else if(soulefficiency == 0){return 0;} return super.getDigSpeed(stack, block, meta); } @Override public void onCreated(ItemStack itemStack, World world, EntityPlayer player) { if(!world.isRemote){ itemStack.stackTagCompound = new NBTTagCompound(); itemStack.stackTagCompound.setInteger("SoulPower", soulefficiency); itemStack.stackTagCompound.setString("Owner", player.getDisplayName()); } created = true; } /** * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and * update it's contents. */ @Override public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) { System.out.println(soulefficiency); } @Override public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { if(Owner!= null){ String owner = Owner; list.add(EnumChatFormatting.BLUE + "Owner: " + Owner);} else {list.add(EnumChatFormatting.BLUE + "Owner: null");} int Soul = soulefficiency; list.add(EnumChatFormatting.GREEN + "Souls: " + Soul); } public void AddSouls(int soul){ soulefficiency += soul; } /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { soulefficiency = (soulefficiency +1); Owner = player.getDisplayName(); return stack; } }
  8. register it all appropriately in your main class and make the block you want to generate (flower) then create a code similar to mine below to spawn it in its no different to spawning an ore public class WorldGenPlants implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { ####-1 is nether and 1 is the end 0 obviously surface########### switch(world.provider.dimensionId){ case 0 : generateSurface(world, random, chunkX*16, chunkZ*16); } } private void generateSurface(World world, Random random, int x, int z) { ######### replace X with a number the higher the more common the lower the number the rarer ########## for(int k = 0; k < X; k++) { ######3 if you want it to spawn in a specific biome then use the code below in "****" if not remove it ******BiomeGenBase Biome = world.getBiomeGenForCoords(x, z); if(Biome != BiomeGenBase.desert && Biome != BiomeGenBase.desertHills && Biome != BiomeGenBase.icePlains && Biome != BiomeGenBase.iceMountains)*****{ int j1 = x + random.nextInt(16); int i2 = random.nextInt(128); ####below this height will they spawn int l2 = z + random.nextInt(16); (new WorldGenFlowers(ModBlocks.YourFlower)).generate(world, random, j1, i2, l2); ######## input your flower ###### } } } }
  9. did you re run all the commands again ie gradlew setupDecompWorkspace, gradlew setupDevWorkspace etc?
  10. yeah there is quite a lot more involved mate you have just made it render for 3rd person, theres inventory rendering first person item frame (entity item on the ground also gets covered by this) etc ill give you my render class to peek at and see where the rest comes in to play
  11. i want to begin by saying this is definitely the highlight of my morning hahaha!!! that made me laugh quite a bit reading this thanks that answered pretty much all of my questions and by world cap a point where a player couldnt travel any further is the best idea thanks! i can achieve that easily enough i was only thinking about making a sort of world cap because a multiplayer server + 100 dimensions could = some serious hard drive space used up for world saves... cause all servers have those people who travel to X - 10000000 to build a house if that happens on every dimensions it could use a lot of space to answer your question to why i need 100 dimensions - http://swordartonline.wikia.com/wiki/Aincrad
  12. then use Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(**your mod in lower case** , "textures/models/YOURIMAGE.png"));
  13. how many dimensions can one add to minecraft? is there a limit? is there a point where too many can become an issue (obviously HD space wise) if that is the issue is it possible to make a world cap in your dimensions, IE the world only generates to x - 10,000 to + 10,000 z - 10,000 to +10,000 or something to combat that issue ? because i need to create 100 different and separate world types (sort of like biomes but they cannot be linked in the same world)
×
×
  • Create New...

Important Information

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