use of net.minecraft.sound.SoundEvent in project wildmod by Osmiooo.
the class ChestBoatEntity method tick.
public void tick() {
this.lastLocation = this.location;
this.location = this.checkLocation();
if (this.location != ChestBoatEntity.Location.UNDER_WATER && this.location != ChestBoatEntity.Location.UNDER_FLOWING_WATER) {
this.ticksUnderwater = 0.0F;
} else {
++this.ticksUnderwater;
}
if (!this.world.isClient && this.ticksUnderwater >= 60.0F) {
this.removeAllPassengers();
}
if (this.getDamageWobbleTicks() > 0) {
this.setDamageWobbleTicks(this.getDamageWobbleTicks() - 1);
}
if (this.getDamageWobbleStrength() > 0.0F) {
this.setDamageWobbleStrength(this.getDamageWobbleStrength() - 1.0F);
}
super.tick();
this.method_7555();
if (this.isLogicalSideForUpdatingMovement()) {
if (!(this.getFirstPassenger() instanceof PlayerEntity)) {
this.setPaddleMovings(false, false);
}
this.updateVelocity();
if (this.world.isClient) {
this.updatePaddles();
this.world.sendPacket(new BoatPaddleStateC2SPacket(this.isPaddleMoving(0), this.isPaddleMoving(1)));
}
this.move(MovementType.SELF, this.getVelocity());
} else {
this.setVelocity(Vec3d.ZERO);
}
this.handleBubbleColumn();
for (int i = 0; i <= 1; ++i) {
if (this.isPaddleMoving(i)) {
if (!this.isSilent() && (double) (this.paddlePhases[i] % 6.2831855F) <= 0.7853981852531433D && ((double) this.paddlePhases[i] + 0.39269909262657166D) % 6.2831854820251465D >= 0.7853981852531433D) {
SoundEvent soundEvent = this.getPaddleSoundEvent();
if (soundEvent != null) {
Vec3d vec3d = this.getRotationVec(1.0F);
double d = i == 1 ? -vec3d.z : vec3d.z;
double e = i == 1 ? vec3d.x : -vec3d.x;
this.world.playSound((PlayerEntity) null, this.getX() + d, this.getY(), this.getZ() + e, soundEvent, this.getSoundCategory(), 1.0F, 0.8F + 0.4F * this.random.nextFloat());
this.world.emitGameEvent(this.getPrimaryPassenger(), GameEvent.SPLASH, new BlockPos(this.getX() + d, this.getY(), this.getZ() + e));
}
}
float[] var10000 = this.paddlePhases;
var10000[i] = (float) ((double) var10000[i] + 0.39269909262657166D);
} else {
this.paddlePhases[i] = 0.0F;
}
}
}
use of net.minecraft.sound.SoundEvent in project meteor-client by MeteorDevelopment.
the class SoundEventListSetting method load.
@Override
public List<SoundEvent> load(NbtCompound tag) {
get().clear();
NbtList valueTag = tag.getList("value", 8);
for (NbtElement tagI : valueTag) {
SoundEvent soundEvent = Registry.SOUND_EVENT.get(new Identifier(tagI.asString()));
if (soundEvent != null)
get().add(soundEvent);
}
return get();
}
use of net.minecraft.sound.SoundEvent in project meteor-client by MeteorDevelopment.
the class SoundEventListSetting method parseImpl.
@Override
protected List<SoundEvent> parseImpl(String str) {
String[] values = str.split(",");
List<SoundEvent> sounds = new ArrayList<>(values.length);
try {
for (String value : values) {
SoundEvent sound = parseId(Registry.SOUND_EVENT, value);
if (sound != null)
sounds.add(sound);
}
} catch (Exception ignored) {
}
return sounds;
}
use of net.minecraft.sound.SoundEvent in project MiniMap by pl3xgaming.
the class Sound method initialize.
public static void initialize() {
REGISTERED_SOUNDS.forEach(sound -> {
sound.soundEvent = new SoundEvent(sound.identifier);
MiniMap.LOG.info("Loaded sound " + sound.identifier);
});
}
use of net.minecraft.sound.SoundEvent in project MCDoom by AzureDoom.
the class ModSoundEvents method of.
static SoundEvent of(String id) {
SoundEvent sound = new SoundEvent(new Identifier(DoomMod.MODID, id));
Registry.register(Registry.SOUND_EVENT, new Identifier(DoomMod.MODID, id), sound);
return sound;
}
Aggregations