Jump to content

k-off

Members
  • Posts

    22
  • Joined

  • Last visited

Everything posted by k-off

  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.
  16. Per the title, I'm trying to add a particle like the vanilla sweep attack one. I've read through Jabelar's posts on it and it seems like I may not need to? Since it says I only need to call ParticleManager#addEffect (not sure if that's changed in 1.15). Thanks!
  17. I think I got it, my problem was that when the player joins the world, I was initializing the member variables as if it was uninitialized, so it kept setting to 256.
  18. I modified my mana class a bit, and now it correctly reads the saved value when the player rejoins the game (checked by printing inside readnbt), so it's being saved/read correctly now. I.e. if it's 124/256 when exiting, it's 124/256 when rejoining. But when I then fall, absorb damage, etc, the server's counter reads back to the maximum. This is definitely a server/client issue right? It's uninitialized on the client so it still prints 0 there, while it's 256 on the server. So correct me if I'm wrong: I handle the mana counter on the server, and when the player falls, the event fires and if on the logical server, I decrement the mana counter. Then when I exit the game, the game writes nbt data to the client, which I must then write back to server upon rejoining the game. Is that about right?
  19. I want my capability data to persist between deaths, dimensions, and when the player exits the game and returns but I'm confused as to how it works. I already have everything set up and my Mana capability works so that if the player falls, it will absorb damage. Then it regenerates after some time. However, while it's doing so, if I exit the game and return, the mana is automatically filled up because every variable is reset when the player rejoins the world. I do this in the player joining world event. But where should I be retreiving this data when the player rejoins? If I set all my capability's mana variables when the object is created, how is it supposed to remember them if the player exits the world? I can confirm that indeed my write and read nbt methods are called, and the data I print in writenbt are correct. It's just that when I reload the game, the value printed in readnbt is the default value 0, that's set in the constructor.
  20. and I get these weird effects when the entity is in water, probably meaning it's trying to go one way but either the client or server is telling it otherwise:
  21. There's no errors, no warnings, etc. Just tried rebuilding, resetting up the decomp, and generating the intellij runs and it's still happening
  22. I have a basic entity that extends the vanilla skeleton with only the vanilla wandering AI, but it appears that its movement is not syncing correctly with the server. Even though its speed is set to 0.5 (and it was wandering around correctly earlier), for SOME reason, now it will stand in-place, and then a few seconds later it will zoom across to its destination where this pattern repeats. When this happens, valid arrow hits do not register all the time either. However I can still punch him and he'll take damage, and I can still push his hitbox around as well. Anyone know why this could be? I don't call anything else that could possible meddle with anything. It was working perfectly fine one moment, and then without changing anything about the entity, this started happening. https://pastebin.com/Q0hFr0hq
×
×
  • Create New...

Important Information

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