Jump to content

fanor

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by fanor

  1. I found the solution, you need a music in MONO not in STEREO ... @kaydogz
  2. So, I guess, two things: - our ogg music is badly encoded - It's hard coded in the game but it's clairly WTF. UPDATE : I tried to get a Minecraft music, and rename it, and its going on .. so I think the problem is the music file ..
  3. For try if it's only work in "minecraft" .. for try what you said before :
  4. Nope i have placed my music in : src/main/resources/assets/minecraft/sounds/records/ but my sounds.json is in assets/mymodid/
  5. It's strange, cause for me, even in "minecraft" it's doesn't work : "myRecords": { "category": "record", "sounds": [ { "name": "minecraft:records/myRecords", "stream": true } ] }, I have the same issue, no attenuation
  6. Well i have solved it with @Override public IPacket createSpawnPacket() { return NetworkHooks.getEntitySpawningPacket(this); }
  7. I have try @Override public void processPacket(INetHandler handler) { Entity entity = new CustomProjectil(Minecraft.getInstance().world, x, y, z); Minecraft.getInstance().world.addEntity(entity); } i have try many things like this, but doesn't seem to work i'm feel stupid
  8. I know how to spawn the entity : CustomProjectil projectilEntity = new CustomProjectil(worldIn, playerIn); projectilEntity.shoot(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F); worldIn.addEntity(projectilEntity); it's what i need to put in "processPacket" method ...
  9. package fr.mvinet.craftal.packet; import net.minecraft.client.network.play.IClientPlayNetHandler; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.network.INetHandler; import net.minecraft.network.IPacket; import net.minecraft.network.PacketBuffer; import net.minecraft.util.math.MathHelper; import net.minecraft.util.registry.Registry; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import java.util.UUID; public class SpawnPacket implements IPacket { private int entityId; private UUID uniqueId; private double x; private double y; private double z; private int speedX; private int speedY; private int speedZ; private int pitch; private int yaw; private EntityType<?> type; public SpawnPacket() { } public SpawnPacket(Entity entity) { this(); this.entityId = entity.getEntityId(); this.uniqueId = entity.getUniqueID(); this.x = entity.posX; this.y = entity.posY; this.z = entity.posZ; this.pitch = MathHelper.floor(entity.rotationPitch * 256.0F / 360.0F); this.yaw = MathHelper.floor(entity.rotationYaw * 256.0F / 360.0F); this.type = entity.getType(); this.speedX = (int) (MathHelper.clamp(entity.getMotion().x, -3.9D, 3.9D) * 8000.0D); this.speedY = (int) (MathHelper.clamp(entity.getMotion().y, -3.9D, 3.9D) * 8000.0D); this.speedZ = (int) (MathHelper.clamp(entity.getMotion().z, -3.9D, 3.9D) * 8000.0D); } /** * Reads the raw packet data from the data stream. */ public void readPacketData(PacketBuffer buf) { this.entityId = buf.readVarInt(); this.uniqueId = buf.readUniqueId(); this.type = Registry.ENTITY_TYPE.getByValue(buf.readVarInt()); this.x = buf.readDouble(); this.y = buf.readDouble(); this.z = buf.readDouble(); this.pitch = buf.readByte(); this.yaw = buf.readByte(); this.speedX = buf.readShort(); this.speedY = buf.readShort(); this.speedZ = buf.readShort(); } /** * Writes the raw packet data to the data stream. */ public void writePacketData(PacketBuffer buf) { buf.writeVarInt(this.entityId); buf.writeUniqueId(this.uniqueId); buf.writeVarInt(Registry.ENTITY_TYPE.getId(this.type)); buf.writeDouble(this.x); buf.writeDouble(this.y); buf.writeDouble(this.z); buf.writeByte(this.pitch); buf.writeByte(this.yaw); buf.writeShort(this.speedX); buf.writeShort(this.speedY); buf.writeShort(this.speedZ); } @Override public void processPacket(INetHandler handler) { //Like this ? i really don't know how to do that handler.getNetworkManager().sendPacket(this); } @OnlyIn(Dist.CLIENT) public int getEntityID() { return this.entityId; } @OnlyIn(Dist.CLIENT) public UUID getUniqueId() { return this.uniqueId; } @OnlyIn(Dist.CLIENT) public double getX() { return this.x; } @OnlyIn(Dist.CLIENT) public double getY() { return this.y; } @OnlyIn(Dist.CLIENT) public double getZ() { return this.z; } @OnlyIn(Dist.CLIENT) public double func_218693_g() { return (double) this.speedX / 8000.0D; } @OnlyIn(Dist.CLIENT) public double func_218695_h() { return (double) this.speedY / 8000.0D; } @OnlyIn(Dist.CLIENT) public double func_218692_i() { return (double) this.speedZ / 8000.0D; } @OnlyIn(Dist.CLIENT) public int getPitch() { return this.pitch; } @OnlyIn(Dist.CLIENT) public int getYaw() { return this.yaw; } @OnlyIn(Dist.CLIENT) public EntityType<?> getType() { return this.type; } } Nothing .. like i said, i don't know how to implement this .. so i have nothing ..
  10. Heay i know .. but i really don't know how to implemet this ..
  11. mm Okay .. But how to implement this function? public void processPacket(IClientPlayNetHandler handler) {...} cause this function : handler.handleSpawnGlobalEntity take only SSpawnGlobalEntityPacket ..
  12. Why we need to override createSpawnPacket ? i don't get it .. ?
  13. Maybe it's a forge bug ? cause i really don't know why it's doesn't work ..
  14. I have try too "attenuation_distance" but it's doesn't' work .. And i have try to debug this with intellij but i have see no difference between my music and minecraft music .. My music : Minecraft Music :
  15. BUMP ! I have the same problem, Someone can help ?
  16. Guys, have you an idea of remplace Natural_stone by other block ? like custom block ?
  17. https://github.com/SNGTech/Beneath-Mod This mod in 1.14 can help
×
×
  • Create New...

Important Information

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