Now working on vanilla clients!

This commit is contained in:
Martin Prokoph
2024-07-31 22:28:10 +02:00
parent 1033dbc8b3
commit 94116c43cb
3 changed files with 6 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package eu.midnightdust.motschen.decorative.init;
import eu.midnightdust.motschen.decorative.block.ChoppingLog;
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
import eu.midnightdust.motschen.decorative.item.BathTireItem;
import eu.pb4.polymer.core.api.entity.PolymerEntityUtils;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
@@ -63,6 +64,7 @@ public class BathTires {
private static EntityType<BathTireEntity> registerBathTire(Identifier id) {
EntityType<BathTireEntity> entity = Registry.register(Registries.ENTITY_TYPE, id, EntityType.Builder.create(BathTireEntity::new, SpawnGroup.AMBIENT).dimensions(1.5f,1).maxTrackingRange(100).trackingTickInterval(4).build());
FabricDefaultAttributeRegistry.register(entity, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
PolymerEntityUtils.registerType(entity);
registerItem(id, new BathTireItem(entity, new Item.Settings()), PoolGroup);
return entity;
}

View File

@@ -5,6 +5,7 @@ import eu.midnightdust.motschen.decorative.block.PoolWall;
import eu.midnightdust.motschen.decorative.block.Springboard;
import eu.midnightdust.motschen.decorative.entity.BeachBallEntity;
import eu.midnightdust.motschen.decorative.item.BathTireItem;
import eu.pb4.polymer.core.api.entity.PolymerEntityUtils;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityType;
@@ -39,6 +40,7 @@ public class Pool {
private static EntityType<BeachBallEntity> registerBeachBall(Identifier id) {
EntityType<BeachBallEntity> entity = Registry.register(Registries.ENTITY_TYPE, id, EntityType.Builder.create(BeachBallEntity::new, SpawnGroup.AMBIENT).dimensions(0.9f,0.9f).maxTrackingRange(100).trackingTickInterval(4).build());
FabricDefaultAttributeRegistry.register(entity, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 100000.0D).add(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, -10D));
PolymerEntityUtils.registerType(entity);
return entity;
}
}

View File

@@ -1,5 +1,6 @@
package eu.midnightdust.motschen.decorative.sound;
import eu.pb4.polymer.core.api.other.PolymerSoundEvent;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.sound.SoundEvent;
@@ -15,6 +16,6 @@ public class DecorativeSoundEvents {
}
private static SoundEvent register(Identifier id) {
return Registry.register(Registries.SOUND_EVENT, id, SoundEvent.of(id));
return Registry.register(Registries.SOUND_EVENT, id, PolymerSoundEvent.of(id, null));
}
}