use of net.minecraft.entity.decoration.ArmorStandEntity in project EmissiveMod by Traben-0.
the class MixinBedBlockEntityRenderer method etf$getChestTexture.
@Inject(method = "render(Lnet/minecraft/block/entity/BedBlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/entity/BedBlockEntity;getWorld()Lnet/minecraft/world/World;", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILSOFT)
private void etf$getChestTexture(BedBlockEntity bedBlockEntity, float f, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j, CallbackInfo ci, SpriteIdentifier spriteIdentifier) {
// hopefully works in modded scenarios, assumes the mod dev uses the actual vanilla code process and texture pathing rules
String nameSpace = spriteIdentifier.getTextureId().getNamespace();
String texturePath = "textures/" + spriteIdentifier.getTextureId().getPath() + ".png";
etf$textureOfThis = new Identifier(nameSpace, texturePath);
etf$vertexConsumerProviderOfThis = vertexConsumerProvider;
if (ETFConfigData.enableCustomTextures) {
etf$bedStandInDummy = new ArmorStandEntity(EntityType.ARMOR_STAND, MinecraftClient.getInstance().world);
// System.out.println(MinecraftClient.getInstance().world.getBlockState(bedBlockEntity.getPos().down()).toString());
etf$bedStandInDummy.setPos(bedBlockEntity.getPos().getX(), bedBlockEntity.getPos().getY(), bedBlockEntity.getPos().getZ());
// chests don't have uuid so set UUID from something repeatable I chose from block pos
etf$bedStandInDummy.setUuid(UUID.nameUUIDFromBytes(bedBlockEntity.getPos().toString().getBytes()));
}
}
use of net.minecraft.entity.decoration.ArmorStandEntity in project MCDoom by AzureDoom.
the class MaykrDoomArmor method predicate.
private <P extends IAnimatable> PlayState predicate(AnimationEvent<P> event) {
LivingEntity livingEntity = event.getExtraDataOfType(LivingEntity.class).get(0);
if (livingEntity instanceof ArmorStandEntity) {
return PlayState.STOP;
}
event.getController().setAnimation(new AnimationBuilder().addAnimation("idle", true));
return PlayState.CONTINUE;
}
use of net.minecraft.entity.decoration.ArmorStandEntity in project MCDoom by AzureDoom.
the class CultistDoomArmor method predicate.
private <P extends IAnimatable> PlayState predicate(AnimationEvent<P> event) {
LivingEntity livingEntity = event.getExtraDataOfType(LivingEntity.class).get(0);
if (livingEntity instanceof ArmorStandEntity) {
return PlayState.STOP;
}
event.getController().setAnimation(new AnimationBuilder().addAnimation("idle", true));
return PlayState.CONTINUE;
}
use of net.minecraft.entity.decoration.ArmorStandEntity in project More-Weaponry by DakotaPride.
the class SickenedArmorItem method predicate.
// Predicate runs every frame
private <P extends IAnimatable> PlayState predicate(AnimationEvent<P> event) {
// This is all the extradata this event carries. The livingentity is the entity
// that's wearing the armor. The itemstack and equipmentslottype are self
// explanatory.
LivingEntity livingEntity = event.getExtraDataOfType(LivingEntity.class).get(0);
// Always loop the animation but later on in this method we'll decide whether or
// not to actually play it
event.getController().setAnimation(new AnimationBuilder().addAnimation("idle", true));
// If the living entity is an armorstand just play the animation nonstop
if (livingEntity instanceof ArmorStandEntity) {
return PlayState.CONTINUE;
} else // full set of armor
if (livingEntity instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity) livingEntity;
// Get all the equipment, aka the armor, currently held item, and offhand item
List<Item> equipmentList = new ArrayList<>();
player.getItemsEquipped().forEach((x) -> equipmentList.add(x.getItem()));
// elements 2 to 6 are the armor so we take the sublist. Armorlist now only
// contains the 4 armor slots
List<Item> armorList = equipmentList.subList(2, 6);
// Make sure the player is wearing all the armor. If they are, continue playing
// the animation, otherwise stop
boolean isWearingAll = armorList.containsAll(Arrays.asList(MoreWeaponryItems.SICKENED_HELMET, MoreWeaponryItems.SICKENED_CHESTPLATE));
return isWearingAll ? PlayState.CONTINUE : PlayState.STOP;
}
return PlayState.STOP;
}
use of net.minecraft.entity.decoration.ArmorStandEntity in project More-Weaponry by DakotaPride.
the class WandererArmorItem method predicate.
// Predicate runs every frame
private <P extends IAnimatable> PlayState predicate(AnimationEvent<P> event) {
// This is all the extradata this event carries. The livingentity is the entity
// that's wearing the armor. The itemstack and equipmentslottype are self
// explanatory.
LivingEntity livingEntity = event.getExtraDataOfType(LivingEntity.class).get(0);
// Always loop the animation but later on in this method we'll decide whether or
// not to actually play it
event.getController().setAnimation(new AnimationBuilder().addAnimation("idle", true));
// If the living entity is an armorstand just play the animation nonstop
if (livingEntity instanceof ArmorStandEntity) {
return PlayState.CONTINUE;
} else // full set of armor
if (livingEntity instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity) livingEntity;
// Get all the equipment, aka the armor, currently held item, and offhand item
List<Item> equipmentList = new ArrayList<>();
player.getItemsEquipped().forEach((x) -> equipmentList.add(x.getItem()));
// elements 2 to 6 are the armor so we take the sublist. Armorlist now only
// contains the 4 armor slots
List<Item> armorList = equipmentList.subList(2, 6);
// Make sure the player is wearing all the armor. If they are, continue playing
// the animation, otherwise stop
boolean isWearingAll = armorList.containsAll(Arrays.asList(MoreWeaponryItems.WANDERER_HELMET, MoreWeaponryItems.WANDERER_CHESTPLATE));
return isWearingAll ? PlayState.CONTINUE : PlayState.STOP;
}
return PlayState.STOP;
}
Aggregations