use of net.minecraft.entity.EntityType in project trofers by ochotonida.
the class TrophyBuilder method getLootTables.
protected Map<EntityType<?>, ResourceLocation> getLootTables() {
Map<EntityType<?>, ResourceLocation> result = new HashMap<>();
getPotionEffects().forEach((type, compoundTag) -> {
if (compoundTag.isEmpty()) {
String modid = Trofers.MODID.equals(getModId()) ? "" : getModId() + "/";
// noinspection ConstantConditions
result.put(type, new ResourceLocation(Trofers.MODID, String.format("trophies/%s", modid + type.getRegistryName().getPath())));
}
});
return result;
}
use of net.minecraft.entity.EntityType in project trofers by ochotonida.
the class VanillaTrophies method getEntityData.
@Override
public Map<EntityType<?>, CompoundNBT> getEntityData() {
Map<EntityType<?>, CompoundNBT> result = super.getEntityData();
result.get(EntityType.CAT).putInt("CatType", 0);
result.get(EntityType.CAT).putBoolean("Sitting", true);
result.get(EntityType.COW).putUUID("UUID", Util.NIL_UUID);
result.get(EntityType.ENDERMAN).put("carriedBlockState", new CompoundNBT());
result.get(EntityType.ENDERMAN).getCompound("carriedBlockState").putString("Name", "minecraft:tnt");
result.get(EntityType.FOX).putString("Type", "red");
result.get(EntityType.FOX).putBoolean("Sleeping", true);
result.get(EntityType.HOGLIN).putBoolean("IsImmuneToZombification", true);
result.get(EntityType.HORSE).putInt("Variant", 1 | 1 << 8);
result.get(EntityType.IRON_GOLEM).putUUID("UUID", Util.NIL_UUID);
result.get(EntityType.LLAMA).putInt("Variant", 3);
result.get(EntityType.MAGMA_CUBE).putInt("Size", 1);
result.get(EntityType.PANDA).putString("MainGene", "playful");
result.get(EntityType.PARROT).putInt("Variant", 0);
result.get(EntityType.PIGLIN).putBoolean("IsImmuneToZombification", true);
result.get(EntityType.PUFFERFISH).putInt("PuffState", 2);
result.get(EntityType.RABBIT).putInt("RabbitType", 0);
result.get(EntityType.SHULKER).putByte("Color", (byte) 16);
result.get(EntityType.SLIME).putInt("Size", 1);
result.get(EntityType.TRADER_LLAMA).putInt("Variant", 2);
result.get(EntityType.TROPICAL_FISH).putInt("Variant", 1 | 1 << 8 | 14 << 16 | 14 << 24);
result.get(EntityType.VILLAGER).put("VillagerData", new CompoundNBT());
result.get(EntityType.VILLAGER).getCompound("VillagerData").putInt("level", 1);
result.get(EntityType.VILLAGER).getCompound("VillagerData").putString("profession", "minecraft:weaponsmith");
result.get(EntityType.VILLAGER).getCompound("VillagerData").putString("type", "minecraft:plains");
result.get(EntityType.WOLF).putBoolean("Sitting", true);
result.get(EntityType.WOLF).putUUID("Owner", Util.NIL_UUID);
result.get(EntityType.ZOMBIE_VILLAGER).put("VillagerData", new CompoundNBT());
result.get(EntityType.ZOMBIE_VILLAGER).getCompound("VillagerData").putInt("level", 1);
result.get(EntityType.ZOMBIE_VILLAGER).getCompound("VillagerData").putString("profession", "minecraft:weaponsmith");
result.get(EntityType.ZOMBIE_VILLAGER).getCompound("VillagerData").putString("type", "minecraft:plains");
putHandItem(result.get(EntityType.PIGLIN_BRUTE), Items.GOLDEN_AXE);
putHandItem(result.get(EntityType.PILLAGER), Items.CROSSBOW);
putHandItem(result.get(EntityType.SKELETON), Items.BOW);
putHandItem(result.get(EntityType.STRAY), Items.BOW);
putHandItem(result.get(EntityType.WITHER_SKELETON), Items.STONE_SWORD);
putHandItem(result.get(EntityType.ZOMBIFIED_PIGLIN), Items.GOLDEN_SWORD);
return result;
}
use of net.minecraft.entity.EntityType in project trofers by ochotonida.
the class VanillaTrophies method getLootTables.
@Override
public Map<EntityType<?>, ResourceLocation> getLootTables() {
Map<EntityType<?>, ResourceLocation> result = super.getLootTables();
result.put(EntityType.CAT, new ResourceLocation("gameplay/cat_morning_gift"));
result.put(EntityType.PIGLIN, new ResourceLocation("gameplay/piglin_bartering"));
return result;
}
use of net.minecraft.entity.EntityType in project BudschieMorphMod by Budschie.
the class FilteredSimpleMorphGui method showGui.
@Override
public void showGui() {
@SuppressWarnings("resource") LazyOptional<IMorphCapability> cap = Minecraft.getInstance().player.getCapability(MorphCapabilityAttacher.MORPH_CAP);
if (cap.isPresent()) {
IMorphCapability resolved = cap.resolve().get();
// Create a list of indices of morphs
List<Integer> morphList = new ArrayList<>();
// This is dumb
for (int i = 0; i < resolved.getMorphList().getMorphArrayList().size(); i++) {
if (filter.test(resolved, i))
morphList.add(i);
}
morphWidgets.add(new MorphWidget(null, false, -1));
HashMap<EntityType<?>, Pair<MorphWidget, Integer>> currentWidgetHeads = new HashMap<>();
for (int i = 0; i < morphList.size(); i++) {
int indexOfMorph = morphList.get(i);
MorphItem item = resolved.getMorphList().getMorphArrayList().get(indexOfMorph);
MorphWidget widget = new MorphWidget(item, resolved.getFavouriteList().containsMorphItem(item), indexOfMorph);
Pair<MorphWidget, Integer> currentWidgetHead = currentWidgetHeads.get(widget.morphItem.getEntityType());
// Check if there is a head.
if (currentWidgetHead != null) {
// There is a head, add to head
MorphWidget head = currentWidgetHead.getA();
head.child = widget;
} else {
// No head, add to widget list
morphWidgets.add(widget);
}
// Set as new entity head
currentWidgetHeads.put(widget.morphItem.getEntityType(), new Pair<>(widget, currentWidgetHead == null ? 0 : currentWidgetHead.getB() + 1));
}
for (int i = 1; i < morphWidgets.size(); i++) {
MorphWidget widget = morphWidgets.get(i);
Pair<MorphWidget, Integer> currentWidgetHead = currentWidgetHeads.get(widget.morphItem.getEntityType());
widget.depth = currentWidgetHead.getB();
}
}
}
use of net.minecraft.entity.EntityType in project minecolonies by ldtteam.
the class AbstractShipRaidEvent method onUpdate.
@Override
public void onUpdate() {
status = EventStatus.PROGRESSING;
colony.getRaiderManager().setNightsSinceLastRaid(0);
if (spawners.size() <= 0 && raiders.size() == 0 && respawns.isEmpty()) {
status = EventStatus.WAITING;
return;
}
updateRaidBar();
if (!respawns.isEmpty()) {
for (final Tuple<EntityType<?>, BlockPos> entry : respawns) {
final BlockPos spawnPos = ShipBasedRaiderUtils.getLoadedPositionTowardsCenter(entry.getB(), colony, MAX_LANDING_DISTANCE, spawnPoint, MIN_CENTER_DISTANCE, 10);
if (spawnPos != null) {
RaiderMobUtils.spawn(entry.getA(), 1, spawnPos, colony.getWorld(), colony, id);
}
}
respawns.clear();
return;
}
spawners.removeIf(spawner -> colony.getWorld() != null && WorldUtil.isBlockLoaded(colony.getWorld(), spawner) && colony.getWorld().getBlockState(spawner).getBlock() != Blocks.SPAWNER);
// Spawns landing troops.
if (raiders.size() < spawners.size() * 2) {
BlockPos spawnPos = ShipBasedRaiderUtils.getLoadedPositionTowardsCenter(spawnPoint, colony, MAX_LANDING_DISTANCE, spawnPoint, MIN_CENTER_DISTANCE, 10);
if (spawnPos != null) {
// Find nice position on the ship
if (spawnPos.distSqr(spawnPoint) < 25) {
spawnPos = ShipBasedRaiderUtils.findSpawnPosOnShip(spawnPos, colony.getWorld(), 3);
}
RaiderMobUtils.spawn(getNormalRaiderType(), shipSize.normal, spawnPos, colony.getWorld(), colony, id);
RaiderMobUtils.spawn(getArcherRaiderType(), shipSize.archer, spawnPos, colony.getWorld(), colony, id);
RaiderMobUtils.spawn(getBossRaiderType(), shipSize.boss, spawnPos, colony.getWorld(), colony, id);
}
}
// Mark entities when spies exist
if (colony.getRaiderManager().areSpiesEnabled()) {
for (final Entity entity : getEntities()) {
if (entity instanceof LivingEntity) {
((LivingEntity) entity).addEffect(new EffectInstance(Effects.GLOWING, 550));
}
}
}
}
Aggregations