Jump to content

k-off

Members
  • Posts

    22
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

k-off's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I still don't know what causes this to happen, but I overrode the rendering method and manually checked for render indexes to call the appropriate limbs, and it all works now.
  2. I went and commented out the part where the player model parts are parented to my armor parts (so I expected the armor NOT to render), but this is the result: These are the parts that are rendering underneath my armors in the pics above. So bizzarre, I can't figure out what to make of this.
  3. It looks like for some reason there's an overlay over the player model's skin and this is somehow applying the texture on that? The same happens for the boots:
  4. This is the model straight from Tabula, body and leg are on separate textures too: this.textureWidth = 64; this.textureHeight = 64; this.ll_shoulder_r = new ModelRenderer(this, 36, 8); this.ll_shoulder_r.mirror = true; this.ll_shoulder_r.setRotationPoint(0.0F, 0.0F, 0.0F); this.ll_shoulder_r.addBox(-4.0F, -2.5F, -2.5F, 5, 5, 5, 0.0F); this.ll_elbow_l = new ModelRenderer(this, 0, 18); this.ll_elbow_l.mirror = true; this.ll_elbow_l.setRotationPoint(3.0F, 3.0F, 0.0F); this.ll_elbow_l.addBox(-1.0F, 0.0F, -2.5F, 2, 2, 5, 0.0F); this.ll_elbow_r = new ModelRenderer(this, 0, 18); this.ll_elbow_r.mirror = true; this.ll_elbow_r.setRotationPoint(-3.0F, 3.0F, 0.0F); this.ll_elbow_r.addBox(-1.0F, 0.0F, -2.5F, 2, 2, 5, 0.0F); this.ll_collar = new ModelRenderer(this, 0, 35); this.ll_collar.setRotationPoint(0.0F, 0.0F, 0.0F); this.ll_collar.addBox(-4.5F, -1.0F, -2.0F, 9, 3, 5, 0.0F); this.ll_hair = new ModelRenderer(this, 0, 53); this.ll_hair.setRotationPoint(0.0F, -9.0F, 0.0F); this.ll_hair.addBox(-0.5F, -1.0F, -0.5F, 1, 1, 5, 0.0F); this.ll_torso = new ModelRenderer(this, 14, 18); this.ll_torso.setRotationPoint(0.0F, 0.0F, 0.0F); this.ll_torso.addBox(-4.5F, 0.0F, -2.5F, 9, 12, 5, 0.0F); this.ll_helm = new ModelRenderer(this, 0, 0); this.ll_helm.setRotationPoint(0.0F, 0.0F, 0.0F); this.ll_helm.addBox(-4.5F, -9.0F, -4.5F, 9, 9, 9, 0.0F); this.ll_shoulder_l = new ModelRenderer(this, 36, 8); this.ll_shoulder_l.setRotationPoint(0.0F, 0.0F, 0.0F); this.ll_shoulder_l.addBox(-1.0F, -2.5F, -2.5F, 5, 5, 5, 0.0F); this.ll_leg_r = new ModelRenderer(this, 0, 0); this.ll_leg_r.setRotationPoint(0.0F, 0.0F, 0.0F); this.ll_leg_r.addBox(-3.0F, 0.0F, -2.5F, 5, 6, 5, 0.0F); this.ll_leg_l = new ModelRenderer(this, 0, 0); this.ll_leg_l.mirror = true; this.ll_leg_l.setRotationPoint(0.0F, 0.0F, 0.0F); this.ll_leg_l.addBox(-2.0F, 0.0F, -2.5F, 5, 6, 5, 0.0F); this.ll_foot_r = new ModelRenderer(this, 0, 43); this.ll_foot_r.setRotationPoint(0.0F, 7.0F, 0.0F); this.ll_foot_r.addBox(-3.0F, 0.0F, -2.5F, 5, 5, 5, 0.0F); this.ll_foot_l = new ModelRenderer(this, 0, 43); this.ll_foot_l.mirror = true; this.ll_foot_l.setRotationPoint(0.0F, 7.0F, 0.0F); this.ll_foot_l.addBox(-2.0F, 0.0F, -2.5F, 5, 5, 5, 0.0F); this.ll_shoulder_r.addChild(this.ll_elbow_r); this.ll_helm.addChild(this.ll_hair); this.ll_torso.addChild(this.ll_collar); this.ll_shoulder_l.addChild(this.ll_elbow_l); if (legs) { this.bipedRightLeg.addChild(this.ll_leg_r); this.bipedLeftLeg.addChild(this.ll_leg_l); } else { this.bipedHead.addChild(this.ll_helm); this.bipedRightArm.addChild(this.ll_shoulder_r); this.bipedBody.addChild(this.ll_torso); this.bipedLeftArm.addChild(this.ll_shoulder_l); this.bipedRightLeg.addChild(this.ll_foot_r); this.bipedLeftLeg.addChild(this.ll_foot_l); } Then in my item file, I literally just return the armor model (returning null if the equipment slot is empty). I even tried giving the helmet its own separate texture and while everything else is fixed, another cube inside the head gets rendered as well: As you can see, the helmet itself renders fine, but inside it there's another cube that uses the helmet texture but messes it all up.
  5. So blah blah blah I'm doing custom armor models, the models are done in Tabula and then manually edited so it works for this version. Anyways the model and textures all look good and the texture offsets are set correctly, as can be seen here: And then in my model class everything is parented correctly, and renders. However, I noticed that there are random texture artifacts for some reason in-game. This happens on every armor piece, this one is without the chestplate: I thought it might be some kind of texture offset problem so I tried making the texture size bigger and more spread out, but it still happens. What could be causing this?
  6. Yeah that's fair, life moves on and so do minecraft forge versions 👍 This thread should be locked then. For anyone with a similar problem in the future, I wasn't registering the entity correctly (make sure you're registering stuff that's supposed to happen in pre vs post, etc) and resolving that fixed it.
  7. I just went and tested this with a Vanilla mob, and it works just fine. Hmm.
  8. worldentityspawner is a 1.14.4 class (also in previous versions as well but i digress) fyi Anyway the exact error isn't very helpful, it's just a standard nullptr exception which is what i was talking about above: and worldentityspawner is that class I showed above. Using forgeregistries I tried doing this which I found on another post here: public static void spawnMobs() { ForgeRegistries.BIOMES.getValues().stream() //This is just some randsom filtering but do whatever you want her, or dont filter at all //if you want your entity to appear anywhere. .filter(biome -> biome.getRegistryName().toString().equals("minecraft:mushroom_fields") || biome.getRegistryName().toString().equals("minecraft:mushroom_fields_field_shore")) //this is the main dish .forEach(biome -> { biome.getSpawns(EntityClassification.<depends on what you want>) //min and max refer to number of entities in a group. .add(new SpawnListEntry(<static reference to your entity>, <weight>, <min>, <max>)); }); }
  9. Still can't figure this out for the life of me, I also tried adding the mob to the list of biomes and still nothing, the same crash.
  10. So I've got a custom entity set up and it works just fine when spawned with an egg. I then wanted to have it spawn naturally, so I went and added a spawn to the entity registry of my mob's class (and to its placement registry), and gave it a set of biomes to spawn in. However, WorldEntitySpawner gets a nullptr here with the entity: Anyone know why this could be?
  11. Yup that's exactly what it was, the blockstate. I set up a proper block handler class for all my blocks, and now referencing that made it work.
  12. So I have a custom plant that works perfectly normally when placed, and I can interact with it perfectly fine, and it renders just fine. This block has a custom blockstate called isflowered, when the player right clicks the plant the little fruit is removed. By default the fruit is always there when placed. However, when I go to generate this block when subscribed to the biome decoration event, this happens: The block on the left is one I placed from the inventory, and the janky ones are the ones generated by the biome decoration event. I can still interact with the block, if I right click it it performs the effect that it's supposed to (it makes a slime sound and drops an item). So two things that went wrong: 1. The block obviously doesn't render properly 2. The block disappears when I save and exit the game, and randomly shows up here and there. Anyone have any idea what it might be? The event: @SubscribeEvent public void onBiomeDecorate(DecorateBiomeEvent.Pre event) { World world = event.getWorld(); Biome biome = world.getBiomeForCoordsBody(event.getPos()); Random rand = event.getRand(); if (rand.nextDouble() > 0.1) return; int x = rand.nextInt(16) + 8; int y = rand.nextInt(16) + 8; WorldGenRepitifleur gen = new WorldGenRepitifleur(); gen.generate(world, rand, world.getHeight(event.getPos().add(x, 0, y))); } The generator: public class WorldGenRepitifleur extends WorldGenerator { public WorldGenRepitifleur() {} @Override public boolean generate(World worldIn, Random rand, BlockPos position) { BlockRepitifleur tPlant = new BlockRepitifleur(); for (int i = 0; i < 64; ++i) { BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8)); if (worldIn.isAirBlock(blockpos) && (!worldIn.provider.isNether() || blockpos.getY() < 255) && tPlant.canBlockStay(worldIn, blockpos, tPlant.getDefaultState())) { worldIn.setBlockState(blockpos, tPlant.getDefaultState(), 2); } } return true; } } and the block: public class BlockRepitifleur extends BlockBush { public static final PropertyInteger IS_FLOWERED = PropertyInteger.create("isflowered", 0, 1); public BlockRepitifleur() { super(Material.PLANTS); this.setRegistryName("repitifleur"); this.setDefaultState(this.blockState.getBaseState().withProperty(IS_FLOWERED, Integer.valueOf(1))); this.setCreativeTab(CreativeTabs.DECORATIONS); this.setUnlocalizedName("repitifleur"); this.setTickRandomly(true); this.setSoundType(SoundType.PLANT); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (state.getValue(IS_FLOWERED) == 0) { worldIn.setBlockState(pos, state.withProperty(IS_FLOWERED, Integer.valueOf(1)), 3); if (playerIn.world.isRemote) { PlayerData data = (PlayerData) NecropolisPlayerData.get(playerIn); data.setPlayerStamina(400); playerIn.playSound(SoundEvents.BLOCK_SLIME_BREAK, 0.6F, 1.0F); return true; } playerIn.playSound(SoundEvents.BLOCK_SLIME_BREAK, 0.6F, 1.0F); } return true; } public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { super.updateTick(worldIn, pos, state, rand); if (!worldIn.isAreaLoaded(pos, 1)) return; if (state.getValue(IS_FLOWERED) == 1) { if (worldIn.getLightFromNeighbors(pos.up()) >= 9 && rand.nextInt(3) == 0) { worldIn.setBlockState(pos, state.withProperty(IS_FLOWERED, Integer.valueOf(0)), 3); } } } @Override public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { IBlockState soil = worldIn.getBlockState(pos.down()); return super.canPlaceBlockAt(worldIn, pos) && this.canSustainBush(soil); } @Override protected boolean canSustainBush(IBlockState state) { return state.getBlock() == Blocks.GRASS; } @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { return null; } @Override public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack stack) { if (worldIn.isRemote) return; if (stack.getItem() == Items.SHEARS && state.getValue(IS_FLOWERED) == 0) { player.addStat(StatList.getBlockStats(this)); worldIn.setBlockToAir(pos); spawnAsEntity(worldIn, pos, new ItemStack(BlockHandler.REPITIFLEUR, 1)); } else { return; //super.harvestBlock(worldIn, player, pos, state, te, stack); } } @Nullable public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return NULL_AABB; } @Override public boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos) { return false; } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } @Override @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.CUTOUT_MIPPED; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] {IS_FLOWERED}); } @Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(IS_FLOWERED, Integer.valueOf(meta)); } @Override public int getMetaFromState(IBlockState state) { return ((Integer)state.getValue(IS_FLOWERED)).intValue(); } public IBlockState getPlantState() { return this.blockState.getBaseState().withProperty(IS_FLOWERED, Integer.valueOf(1)); } @Override public boolean isFullCube(IBlockState state) { return false; } }
  13. So I'm just trying to register a basic block, and I've created a block handler and registered it and its item, the same way I did for the items in my mod by subscribing to the event bus. However, it's giving me errors that I didn't get when registering items for my swords. The first error is: "Exception loading model for variant koff:bake_kettle#normal for blockstate "koff:bake_kettle" net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model koff:bake_kettle#normal with loader VariantLoader.INSTANCE, skipping" Caused by: "java.lang.RuntimeException: Encountered an exception when loading model definition of model koff:blockstates/bake_kettle.json" Caused by: "Caused by: java.io.FileNotFoundException: koff:blockstates/bake_kettle.json" This is my bake_kettle.json (in the same assets directory that all of my custom items are in, under block): { "textures": { "particle": "koff:blocks/bake_kettle" }, "elements": [ { "name": "kettle_body", "from": [ -7, 0, -7 ], "to": [ 7, 12, 7 ], "rotation": { "origin": [ 0, 12, 0 ], "axis": "z", "angle": 0.0 }, "faces": { "down": { "uv": [ 10.5, 0.0, 7.0, 3.5 ], "texture": "#particle" }, "up": { "uv": [ 7.0, 3.5, 3.5, 0.0 ], "texture": "#particle" }, "north": { "uv": [ 3.5, 3.5, 7.0, 6.5 ], "texture": "#particle" }, "south": { "uv": [ 10.5, 3.5, 14.0, 6.5 ], "texture": "#particle" }, "west": { "uv": [ 7.0, 3.5, 10.5, 6.5 ], "texture": "#particle" }, "east": { "uv": [ 0.0, 3.5, 3.5, 6.5 ], "texture": "#particle" } } }, { "name": "kettle_lid_handle", "from": [ -2, 12, 0 ], "to": [ 2, 14, 1 ], "rotation": { "origin": [ 0, 14, 0 ], "axis": "z", "angle": 0.0 }, "faces": { "down": { "uv": [ 2.25, 7.5, 1.25, 7.75 ], "texture": "#particle" }, "up": { "uv": [ 1.25, 7.75, 0.25, 7.5 ], "texture": "#particle" }, "north": { "uv": [ 0.25, 7.75, 1.25, 8.25 ], "texture": "#particle" }, "south": { "uv": [ 1.5, 7.75, 2.5, 8.25 ], "texture": "#particle" }, "west": { "uv": [ 1.25, 7.75, 1.5, 8.25 ], "texture": "#particle" }, "east": { "uv": [ 0.0, 7.75, 0.25, 8.25 ], "texture": "#particle" } } }, { "name": "kettle_left_handle", "from": [ 6, 12, -1 ], "to": [ 7, 12, 2 ], "rotation": { "origin": [ 7, 12, 0 ], "axis": "z", "angle": 0.0 }, "faces": { "down": { "uv": [ 3.25, 0.0, 3.0, 0.75 ], "texture": "#particle" }, "up": { "uv": [ 3.0, 0.75, 2.75, 0.0 ], "texture": "#particle" }, "north": { "uv": [ 2.75, 0.75, 3.0, 0.75 ], "texture": "#particle" }, "south": { "uv": [ 3.75, 0.75, 4.0, 0.75 ], "texture": "#particle" }, "west": { "uv": [ 3.0, 0.75, 3.75, 0.75 ], "texture": "#particle" }, "east": { "uv": [ 2.0, 0.75, 2.75, 0.75 ], "texture": "#particle" } } }, { "name": "kettle_right_handle", "from": [ -7, 12, -1 ], "to": [ -6, 12, 2 ], "rotation": { "origin": [ -7, 12, 0 ], "axis": "z", "angle": 0.0 }, "faces": { "down": { "uv": [ 1.25, 0.0, 1.0, 0.75 ], "texture": "#particle" }, "up": { "uv": [ 1.0, 0.75, 0.75, 0.0 ], "texture": "#particle" }, "north": { "uv": [ 0.75, 0.75, 1.0, 0.75 ], "texture": "#particle" }, "south": { "uv": [ 1.75, 0.75, 2.0, 0.75 ], "texture": "#particle" }, "west": { "uv": [ 1.0, 0.75, 1.75, 0.75 ], "texture": "#particle" }, "east": { "uv": [ 0.0, 0.75, 0.75, 0.75 ], "texture": "#particle" } } } ] } BlockBakeKettle class: public class BlockBakeKettle extends Block { public BlockBakeKettle() { super(Material.IRON,MapColor.STONE); this.setUnlocalizedName("BakeKettle"); this.setRegistryName("bake_kettle"); this.setLightLevel(0.0f); useNeighborBrightness = true; } @Override public boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos) { return false; } } BlockHandler class: @GameRegistry.ObjectHolder(MyFirstMod.MODID) @Mod.EventBusSubscriber(value = Side.CLIENT, modid = MyFirstMod.MODID) public final class BlockHandler { public BlockHandler() {} public static final BlockBakeKettle BAKE_KETTLE = null; @SubscribeEvent public static void register(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll( new BlockBakeKettle() ); } } ItemHandler class: @GameRegistry.ObjectHolder(MyFirstMod.MODID) @Mod.EventBusSubscriber(modid = MyFirstMod.MODID) public final class ItemHandler { public ItemHandler(){}; public static final ItemWoodenRapier WOODEN_RAPIER = null; public static final ItemGoldRapier GOLD_RAPIER = null; public static final ItemStoneRapier STONE_RAPIER = null; public static final ItemIronRapier IRON_RAPIER = null; public static final ItemDiamondRapier DIAMOND_RAPIER = null; @SubscribeEvent public static void register(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll ( new ItemBlock(BlockHandler.BAKE_KETTLE).setRegistryName(BlockHandler.BAKE_KETTLE.getRegistryName()), new ItemWoodenRapier(Item.ToolMaterial.WOOD), new ItemGoldRapier(Item.ToolMaterial.GOLD), new ItemStoneRapier(Item.ToolMaterial.STONE), new ItemIronRapier(Item.ToolMaterial.IRON), new ItemDiamondRapier(Item.ToolMaterial.DIAMOND) ); } } my mod's model class: @SideOnly(Side.CLIENT) @Mod.EventBusSubscriber(value = Side.CLIENT, modid = MyFirstMod.MODID) public class KoffModels { private KoffModels() {}; @SubscribeEvent public static void register(ModelRegistryEvent event) { registerBlockModel(BlockHandler.BAKE_KETTLE, "bake_kettle"); registerItemModel(ItemHandler.WOODEN_RAPIER, "wooden_rapier"); registerItemModel(ItemHandler.GOLD_RAPIER, "gold_rapier"); registerItemModel(ItemHandler.STONE_RAPIER, "stone_rapier"); registerItemModel(ItemHandler.IRON_RAPIER, "iron_rapier"); registerItemModel(ItemHandler.DIAMOND_RAPIER, "diamond_rapier"); } private static ModelResourceLocation registerBlockModel(Block block, String name) { return registerItemModel(Item.getItemFromBlock(block), 0, name); } private static ModelResourceLocation registerItemModel(Item item, String name) { return registerItemModel(item, 0, name); } private static ModelResourceLocation registerItemModel(Item item, int id, String name) { ModelResourceLocation resource = new ModelResourceLocation(MyFirstMod.MODID + ":" + name, "inventory"); ModelLoader.setCustomModelResourceLocation(item, id, resource); return resource; } } Anyone know why this might be? EDIT: Figured it out, I forgot the blockstate like an idiot. I really shouldn't doubt the error logs.
  14. So now the particle's various ticking methods are being called, but the particle is not being rendered. I can also confirm that the texture's frame is correctly calculated as well. mc.getTextureManager().bindTexture(SLASH_TEXTURE); float f = (float)(currentAnimationFrame / 2.0); float f1 = f + 0.4995F; float f2 = 0.0F; float f3 = f2; float f4 = 1.0F; float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX); float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY); float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ); GlStateManager.pushMatrix(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); GlStateManager.alphaFunc(516, 0.003921569F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); bufferIn.begin(7, VERTEX_FORMAT); bufferIn.pos((double)(f5 - rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4 * 0.5F), (double)(f7 - rotationYZ * f4 - rotationXZ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); bufferIn.pos((double)(f5 - rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4 * 0.5F), (double)(f7 - rotationYZ * f4 + rotationXZ * f4)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); bufferIn.pos((double)(f5 + rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4 * 0.5F), (double)(f7 + rotationYZ * f4 + rotationXZ * f4)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); bufferIn.pos((double)(f5 + rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4 * 0.5F), (double)(f7 + rotationYZ * f4 - rotationXZ * f4)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); Tessellator.getInstance().draw(); GlStateManager.popMatrix(); It's supposed to spawn at the player's position.
  15. I'm trying to draw something similar to the vanilla sweeping attack particle, except where that's a 128x16 texture with 8 frames, I have a 96x16 with only 2 frames. I'm looking through the vanilla code and trying to decipher how they've drawn the vertices, but I'm confused on a couple things: int i = (int)(((float)this.life + partialTicks) * 3.0F / (float)this.lifeTime); if (i <= 7) { this.textureManager.bindTexture(SWEEP_TEXTURE); float f = (float)(i % 4) / 4.0F; float f1 = f + 0.24975F; float f2 = (float)(i / 2) / 2.0F; float f3 = f2 + 0.4995F; float f4 = 1.0F * this.size; float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX); float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY); float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableLighting(); RenderHelper.disableStandardItemLighting(); buffer.begin(7, VERTEX_FORMAT); buffer.pos((double)(f5 - rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4 * 0.5F), (double)(f7 - rotationYZ * f4 - rotationXZ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); buffer.pos((double)(f5 - rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4 * 0.5F), (double)(f7 - rotationYZ * f4 + rotationXZ * f4)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); buffer.pos((double)(f5 + rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4 * 0.5F), (double)(f7 + rotationYZ * f4 + rotationXZ * f4)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); buffer.pos((double)(f5 + rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4 * 0.5F), (double)(f7 + rotationYZ * f4 - rotationXZ * f4)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); Tessellator.getInstance().draw(); GlStateManager.enableLighting(); } 1. What is the purpose of adding what seems like arbitrary values f1 and f2 if they're already in the correct positions relative to the texture? Unless it's not 0->0.25 but instead 0.25->0? 2. The image is 128 pixels wide with 4 frames across the columns, meaning each frame is 32 pixels wide and 16 pixels tall. How does this know to draw a quad with the correct size for a frame? Everything appears to be in terms of the texture ratios.
×
×
  • Create New...

Important Information

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