mod for the islanders smp

1.0.0-rc4

+3 -22
+1 -1
gradle.properties
··· 10 10 fabric_kotlin_version=1.13.4+kotlin.2.2.0 11 11 12 12 # Mod Properties 13 - mod_version=1.0.0-rc3 13 + mod_version=1.0.0-rc4 14 14 maven_group=net.radsteve.islanders 15 15 archives_base_name=islanders-smp 16 16
-12
src/main/java/net/radsteve/islanders/mixin/LivingEntityAccessor.java
··· 1 - package net.radsteve.islanders.mixin; 2 - 3 - import net.minecraft.entity.LivingEntity; 4 - import net.minecraft.entity.damage.DamageSource; 5 - import org.spongepowered.asm.mixin.Mixin; 6 - import org.spongepowered.asm.mixin.gen.Accessor; 7 - 8 - @Mixin(LivingEntity.class) 9 - public interface LivingEntityAccessor { 10 - @Accessor 11 - DamageSource getLastDamageSource(); 12 - }
+1 -7
src/main/java/net/radsteve/islanders/mixin/PlayerEntityMixin.java
··· 2 2 3 3 import kotlin.Pair; 4 4 import net.minecraft.entity.LivingEntity; 5 - import net.minecraft.entity.damage.DamageSource; 6 5 import net.minecraft.entity.player.PlayerEntity; 7 6 import net.minecraft.entity.player.PlayerInventory; 8 7 import net.minecraft.item.ItemStack; ··· 32 31 @Inject(method = "dropInventory", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerInventory;dropAll()V")) 33 32 private void islanders$dropInventory(ServerWorld world, CallbackInfo ci) { 34 33 final LivingEntity entity = (LivingEntity) (Object) this; 35 - final DamageSource lastDamageSource = ((LivingEntityAccessor) entity).getLastDamageSource(); 36 34 37 - if (lastDamageSource == null) { 38 - return; 39 - } 40 - 41 - if (lastDamageSource.getAttacker() instanceof PlayerEntity) { 35 + if (entity.getPrimeAdversary() instanceof PlayerEntity) { 42 36 return; 43 37 } 44 38
+1 -1
src/main/kotlin/net/radsteve/islanders/crown/CrownAnimation.kt
··· 170 170 1.0f, 171 171 1.0f 172 172 ) 173 - val item = ItemEntity(world, startLocation!!.x, startLocation!!.y + 11, startLocation!!.z, CrownFactory.crown(), 0.0, -1.5, 0.0) 173 + val item = ItemEntity(world, startLocation!!.x, startLocation!!.y + 11, startLocation!!.z, CrownFactory.crown(), 0.0, -0.75, 0.0) 174 174 item.isGlowing = true 175 175 world.scoreboard.addScoreHolderToTeam(item.nameForScoreboard, SpecialItem.Crown.team) 176 176 world.spawnEntity(item)
-1
src/main/resources/islanders.mixins.json
··· 15 15 "ItemEntityMixin", 16 16 "ItemStackMixin", 17 17 "LivingEntityMixin", 18 - "LivingEntityAccessor", 19 18 "PlayerEntityMixin", 20 19 "PlayerInventoryAccessor", 21 20 "ScreenHandlerMixin",