Skip to content

Commit

Permalink
Mostly finished Armor Set overhaul
Browse files Browse the repository at this point in the history
Started on new Pharaoh render with new model
Various other things
  • Loading branch information
GirafiStudios committed Jan 10, 2021
1 parent caffb40 commit dde1c94
Show file tree
Hide file tree
Showing 25 changed files with 431 additions and 420 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/teammetallurgy/atum/api/God.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.google.common.collect.Maps;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.text.Color;
import net.minecraft.util.text.TextFormatting;

import javax.annotation.Nonnull;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.block.material.MaterialColor;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.item.ItemStack;
import net.minecraft.state.properties.ChestType;
import net.minecraft.tileentity.TileEntity;
Expand All @@ -27,6 +28,7 @@
import net.minecraftforge.fml.common.Mod;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

@Mod.EventBusSubscriber(modid = Atum.MOD_ID)
public class SarcophagusBlock extends ChestBaseBlock {
Expand Down Expand Up @@ -93,6 +95,13 @@ public ActionResultType onBlockActivated(BlockState state, World world, @Nonnull
return super.onBlockActivated(state, world, pos, player, hand, hit);
}

@Nullable
@Override
public INamedContainerProvider getContainer(@Nonnull BlockState state, @Nonnull World world, @Nonnull BlockPos pos) { //Workaround so you can't see loot before pharaoh is beaten
TileEntity tileEntity = world.getTileEntity(pos);
return tileEntity instanceof SarcophagusTileEntity && ((SarcophagusTileEntity) tileEntity).isOpenable ? super.getContainer(state, world, pos) : null;
}

@Override
public void onBlockPlacedBy(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull LivingEntity placer, @Nonnull ItemStack stack) {
super.onBlockPlacedBy(world, pos, state, placer, stack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
import net.minecraft.state.properties.ChestType;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.util.text.*;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.IServerWorld;
import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.CapabilityItemHandler;
import org.apache.commons.lang3.StringUtils;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -116,8 +116,10 @@ public void spawn(PlayerEntity player, DifficultyInstance difficulty, @Nullable

if (this.world instanceof ServerWorld) {
ServerWorld serverWorld = (ServerWorld) this.world;
God godVariant = God.getGod(pharaoh.getVariant());
Style pharaohStyle = pharaoh.getName().getStyle();
for (ServerPlayerEntity playerMP : serverWorld.getServer().getPlayerList().getPlayers()) {
playerMP.sendMessage(pharaoh.getName().deepCopy().appendString(" ").append(new TranslationTextComponent("chat.atum.summon_pharaoh")).appendString(" " + player.getGameProfile().getName()).setStyle(pharaoh.getName().getStyle().setColor(God.getGod(pharaoh.getVariant()).getColor())), Util.DUMMY_UUID);
playerMP.sendMessage(pharaoh.getName().deepCopy().setStyle(pharaohStyle.setColor(godVariant.getColor())).append(new TranslationTextComponent("chat.atum.pharaoh_worshiper").mergeStyle(TextFormatting.WHITE)).append(new StringTextComponent(StringUtils.capitalize(godVariant.getName())).setStyle(pharaohStyle.setColor(godVariant.getColor()))).append(new TranslationTextComponent("chat.atum.pharaoh_awakened").mergeStyle(TextFormatting.WHITE)).append(player.getName().deepCopy().mergeStyle(TextFormatting.YELLOW)), Util.DUMMY_UUID);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.teammetallurgy.atum.Atum;
import com.teammetallurgy.atum.init.AtumBiomes;
import com.teammetallurgy.atum.init.AtumItems;
import com.teammetallurgy.atum.items.artifacts.atem.EyesOfAtemItem;
import com.teammetallurgy.atum.items.artifacts.ArtifactArmor;
import com.teammetallurgy.atum.items.artifacts.nuit.NuitsVanishingItem;
import com.teammetallurgy.atum.misc.AtumConfig;
import com.teammetallurgy.atum.world.DimensionHelper;
Expand All @@ -18,6 +18,7 @@
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.RegistryKey;
import net.minecraft.util.ResourceLocation;
Expand Down Expand Up @@ -53,18 +54,18 @@ public static void renderFog(EntityViewRenderEvent.RenderFogEvent event) {

if (entity instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity) entity;
ItemStack helmet = player.getItemStackFromSlot(EquipmentSlotType.HEAD);
Item helmet = player.getItemStackFromSlot(EquipmentSlotType.HEAD).getItem();
if (player.getPosition().getY() <= 60) {
fogDensity += (float) (62 - player.getPosition().getY()) * 0.00333F;
}
Optional<RegistryKey<Biome>> biome = world.func_242406_i(entity.getPosition());
if (biome.isPresent() && biome.get() == AtumBiomes.OASIS) {
fogDensity = fogDensity / 2.0F;
}
if (helmet.getItem() instanceof EyesOfAtemItem) {
if (helmet instanceof ArtifactArmor) {
fogDensity = fogDensity / 3.25F;
}
if (helmet.getItem() == AtumItems.WANDERER_HELMET || helmet.getItem() == AtumItems.DESERT_HELMET_IRON || helmet.getItem() == AtumItems.DESERT_HELMET_GOLD || helmet.getItem() == AtumItems.DESERT_HELMET_DIAMOND) {
if (helmet == AtumItems.WANDERER_HELMET || helmet == AtumItems.DESERT_HELMET_IRON || helmet == AtumItems.DESERT_HELMET_GOLD || helmet == AtumItems.DESERT_HELMET_DIAMOND) {
fogDensity = fogDensity / 2.0F;
}
if (player.getPosY() >= DimensionHelper.GROUND_LEVEL - 8) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import com.teammetallurgy.atum.client.gui.block.TrapScreen;
import com.teammetallurgy.atum.client.gui.entity.AlphaDesertWolfScreen;
import com.teammetallurgy.atum.client.gui.entity.CamelScreen;
import com.teammetallurgy.atum.client.model.entity.BonestormModel;
import com.teammetallurgy.atum.client.model.entity.ForsakenModel;
import com.teammetallurgy.atum.client.model.entity.MonsterModel;
import com.teammetallurgy.atum.client.model.entity.NomadModel;
import com.teammetallurgy.atum.client.model.entity.*;
import com.teammetallurgy.atum.client.render.entity.HeartOfRaRender;
import com.teammetallurgy.atum.client.render.entity.TefnutsCallRender;
import com.teammetallurgy.atum.client.render.entity.mobs.*;
Expand Down Expand Up @@ -267,7 +264,7 @@ public static void registerModels(ModelRegistryEvent event) {
RenderingRegistry.registerEntityRenderingHandler(AtumEntities.BARBARIAN, AtumBipedRender::new);
RenderingRegistry.registerEntityRenderingHandler(AtumEntities.NOMAD, manager -> new AtumBipedRender<>(manager, new NomadModel<>(), new NomadModel<>(0.5F), new NomadModel<>(1.0F)));
RenderingRegistry.registerEntityRenderingHandler(AtumEntities.BANDIT_WARLORD, AtumBipedRender::new);
RenderingRegistry.registerEntityRenderingHandler(AtumEntities.PHARAOH, AtumBipedRender::new);
RenderingRegistry.registerEntityRenderingHandler(AtumEntities.PHARAOH, manager -> new AtumBipedRender<>(manager, new PharaohModel<>(0.0F), new PharaohModel<>(0.5F), new PharaohModel<>(1.0F)));
RenderingRegistry.registerEntityRenderingHandler(AtumEntities.MUMMY, manager -> new AtumBipedRender<>(manager, new MonsterModel<>(0.0F, false), new MonsterModel<>(0.5F, false), new MonsterModel<>(1.0F, false)));
RenderingRegistry.registerEntityRenderingHandler(AtumEntities.FORSAKEN, manager -> new AtumBipedRender<>(manager, new ForsakenModel(), new ForsakenModel(0.5F), new ForsakenModel(1.0F)));
RenderingRegistry.registerEntityRenderingHandler(AtumEntities.WRAITH, manager -> new AtumBipedRender<>(manager, new MonsterModel<>(0.0F, false), new MonsterModel<>(0.5F, false), new MonsterModel<>(1.0F, false)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.mojang.blaze3d.systems.RenderSystem;
import com.teammetallurgy.atum.Atum;
import com.teammetallurgy.atum.init.AtumBiomes;
import com.teammetallurgy.atum.items.artifacts.atem.EyesOfAtemItem;
import com.teammetallurgy.atum.items.artifacts.ArtifactArmor;
import com.teammetallurgy.atum.misc.AtumConfig;
import com.teammetallurgy.atum.world.SandstormHandler;
import net.minecraft.client.Minecraft;
Expand Down Expand Up @@ -115,7 +115,7 @@ private static void renderSand(float partialTicks, int... layers) {

// Make it easier to see
ItemStack helmet = player.getItemStackFromSlot(EquipmentSlotType.HEAD);
if (helmet.getItem() instanceof EyesOfAtemItem) {
if (helmet.getItem() instanceof ArtifactArmor) {
alpha *= eyesOfAtumAlpha;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package com.teammetallurgy.atum.client.model.entity;

import com.teammetallurgy.atum.entity.undead.PharaohEntity;
import net.minecraft.client.renderer.entity.model.BipedModel;
import net.minecraft.client.renderer.model.ModelRenderer;

public class PharaohModel<T extends PharaohEntity> extends BipedModel<T> {
private final ModelRenderer waist;
private final ModelRenderer hat;
private final ModelRenderer beard;
private final ModelRenderer rightItem;
private final ModelRenderer leftItem;

public PharaohModel(float modelSize) {
super(modelSize);
textureWidth = 64;
textureHeight = 96;

waist = new ModelRenderer(this);
waist.setRotationPoint(0.0F, 12.0F, 0.0F);

bipedBody = new ModelRenderer(this);
bipedBody.setRotationPoint(0.0F, -12.0F, 0.0F);
bipedBody.addChild(waist);
bipedBody.setTextureOffset(16, 16).addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, 0.0F, false);
bipedBody.setTextureOffset(0, 75).addBox(-6.0F, 3.0F, -1.5F, 12.0F, 18.0F, 3.0F, 0.9F, false);
bipedBody.setTextureOffset(16, 32).addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, 0.1F, false);
bipedBody.setTextureOffset(16, 48).addBox(-4.0F, 9.0F, -2.0F, 8.0F, 12.0F, 4.0F, 0.1F, false);
bipedBody.setTextureOffset(16, 64).addBox(-4.0F, 9.0F, -2.0F, 8.0F, 4.0F, 4.0F, 0.25F, false);

bipedHead = new ModelRenderer(this);
bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F);
bipedHead.setTextureOffset(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.0F, false);

hat = new ModelRenderer(this);
hat.setRotationPoint(0.0F, 0.0F, 0.0F);
bipedHead.addChild(hat);
hat.setTextureOffset(32, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.25F, false);
hat.setTextureOffset(34, 83).addBox(-6.0F, -10.0F, -2.0F, 12.0F, 10.0F, 3.0F, 0.0F, false);

beard = new ModelRenderer(this);
beard.setRotationPoint(0.0F, 0.0F, 2.0F);
hat.addChild(beard);
setRotationAngle(beard, 1.2217F, 0.0F, 0.0F);
beard.setTextureOffset(50, 76).addBox(-1.0F, -5.7071F, -7.2929F, 2.0F, 0.0F, 5.0F, 0.0F, false);

bipedRightArm = new ModelRenderer(this);
bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F);
bipedRightArm.setTextureOffset(48, 16).addBox(-1.0F, -2.0F, -1.0F, 2.0F, 12.0F, 2.0F, 0.0F, false);
bipedRightArm.setTextureOffset(48, 57).addBox(-2.0F, -2.0F, -2.0F, 4.0F, 3.0F, 4.0F, 0.25F, false);
bipedRightArm.setTextureOffset(48, 70).addBox(-2.0F, -1.0F, -2.0F, 4.0F, 2.0F, 4.0F, 0.5F, false);
bipedRightArm.setTextureOffset(48, 44).addBox(-2.0F, 1.0F, -2.0F, 4.0F, 2.0F, 4.0F, 0.1F, false);

rightItem = new ModelRenderer(this);
rightItem.setRotationPoint(-1.0F, 7.0F, 1.0F);
bipedRightArm.addChild(rightItem);


bipedLeftArm = new ModelRenderer(this);
bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);
bipedLeftArm.setTextureOffset(40, 16).addBox(-1.0F, -2.0F, -1.0F, 2.0F, 12.0F, 2.0F, 0.0F, true);
bipedLeftArm.setTextureOffset(48, 50).addBox(-2.0F, -2.0F, -2.0F, 4.0F, 3.0F, 4.0F, 0.25F, false);
bipedLeftArm.setTextureOffset(48, 64).addBox(-2.0F, -1.0F, -2.0F, 4.0F, 2.0F, 4.0F, 0.5F, false);
bipedLeftArm.setTextureOffset(48, 38).addBox(-2.0F, 1.0F, -2.0F, 4.0F, 2.0F, 4.0F, 0.1F, false);

leftItem = new ModelRenderer(this);
leftItem.setRotationPoint(1.0F, 7.0F, 1.0F);
bipedLeftArm.addChild(leftItem);


bipedRightLeg = new ModelRenderer(this);
bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
bipedRightLeg.setTextureOffset(0, 16).addBox(-1.0F, 0.0F, -1.0F, 2.0F, 12.0F, 2.0F, 0.0F, false);

bipedLeftLeg = new ModelRenderer(this);
bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F);
bipedLeftLeg.setTextureOffset(0, 16).addBox(-1.0F, 0.0F, -1.0F, 2.0F, 12.0F, 2.0F, 0.0F, true);
}

public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class MummyEntity extends UndeadBaseEntity {

public MummyEntity(EntityType<? extends UndeadBaseEntity> entityType, World world) {
super(entityType, world);
this.setCanPickUpLoot(false);
this.experienceValue = 8;
}

Expand Down
19 changes: 10 additions & 9 deletions src/main/java/com/teammetallurgy/atum/init/AtumItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import com.teammetallurgy.atum.items.artifacts.nuit.NuitsVanishingItem;
import com.teammetallurgy.atum.items.artifacts.ptah.PtahsDecadenceItem;
import com.teammetallurgy.atum.items.artifacts.ptah.PtahsUndoingItem;
import com.teammetallurgy.atum.items.artifacts.ra.*;
import com.teammetallurgy.atum.items.artifacts.ra.RaArmor;
import com.teammetallurgy.atum.items.artifacts.ra.RasFuryItem;
import com.teammetallurgy.atum.items.artifacts.seth.SethsStingItem;
import com.teammetallurgy.atum.items.artifacts.seth.SethsVenomItem;
import com.teammetallurgy.atum.items.artifacts.shu.ShusBreathItem;
Expand Down Expand Up @@ -113,18 +114,18 @@ public class AtumItems {
public static final Item SCEPTER_SETH = registerScepter(God.SETH);
public static final Item SCEPTER_SHU = registerScepter(God.SHU);
public static final Item SCEPTER_TEFNUT = registerScepter(God.TEFNUT);
public static final Item EYES_OF_ATEM = registerItem(new EyesOfAtemItem(), "eyes_of_atem");
public static final Item BODY_OF_ATEM = registerItem(new BodyOfAtemItem(), "body_of_atem");
public static final Item LEGS_OF_ATEM = registerItem(new LegsOfAtemItem(), "legs_of_atem");
public static final Item FEET_OF_ATEM = registerItem(new FeetOfAtemItem(), "feet_of_atem");
public static final Item EYES_OF_ATEM = registerItem(new AtemArmor(EquipmentSlotType.HEAD), "eyes_of_atem");
public static final Item BODY_OF_ATEM = registerItem(new AtemArmor(EquipmentSlotType.CHEST), "body_of_atem");
public static final Item LEGS_OF_ATEM = registerItem(new AtemArmor(EquipmentSlotType.LEGS), "legs_of_atem");
public static final Item FEET_OF_ATEM = registerItem(new AtemArmor(EquipmentSlotType.FEET), "feet_of_atem");
public static final Item ATEMS_WILL = registerItem(new AtemsWillItem(), "atems_will");
public static final Item ATEMS_PROTECTION = registerItem(new AtemsProtectionItem(), "atems_protection");
public static final Item ATEMS_BOUNTY = registerItem(new AtemsBountyItem(), "atems_bounty");
public static final Item ATEMS_HOMECOMING = registerItem(new AtemsHomecomingItem(), "atems_homecoming");
public static final Item HALO_OF_RA = registerItem(new HaloOfRaItem(), "halo_of_ra");
public static final Item BODY_OF_RA = registerItem(new BodyOfRaItem(), "body_of_ra");
public static final Item LEGS_OF_RA = registerItem(new LegsOfRaItem(), "legs_of_ra");
public static final Item FEET_OF_RA = registerItem(new FeetOfRaItem(), "feet_of_ra");
public static final Item HALO_OF_RA = registerItem(new RaArmor(EquipmentSlotType.HEAD), "halo_of_ra");
public static final Item BODY_OF_RA = registerItem(new RaArmor(EquipmentSlotType.CHEST), "body_of_ra");
public static final Item LEGS_OF_RA = registerItem(new RaArmor(EquipmentSlotType.LEGS), "legs_of_ra");
public static final Item FEET_OF_RA = registerItem(new RaArmor(EquipmentSlotType.FEET), "feet_of_ra");
public static final RasFuryItem RAS_FURY = (RasFuryItem) registerItem(new RasFuryItem(), "ras_fury");
public static final Item PTAHS_DECADENCE = registerItem(new PtahsDecadenceItem(), "ptahs_decadence");
public static final Item PTAHS_UNDOING = registerItem(new PtahsUndoingItem(), "ptahs_undoing");
Expand Down

0 comments on commit dde1c94

Please sign in to comment.