Browse Source

Merged with new changes from rebase.

pull/229/head
Brandon Pearce 4 months ago
parent
commit
08e54bb62e
20 changed files with 136 additions and 91 deletions
  1. 1
    1
      lib/orbis-lib
  2. 0
    1
      src/api/java/com/gildedgames/aether/api/registry/IContentRegistry.java
  3. 3
    2
      src/main/java/com/gildedgames/aether/client/gui/container/guidebook/discovery/GuiGuidebookDiscovery.java
  4. 41
    5
      src/main/java/com/gildedgames/aether/client/gui/container/guidebook/discovery/GuiGuidebookDiscoveryBestiary.java
  5. 7
    9
      src/main/java/com/gildedgames/aether/common/ContentRegistry.java
  6. 3
    3
      src/main/java/com/gildedgames/aether/common/cache/EntityStats.java
  7. 11
    1
      src/main/java/com/gildedgames/aether/common/cache/EntityStatsCache.java
  8. 41
    42
      src/main/java/com/gildedgames/aether/common/capabilities/entity/player/PlayerAether.java
  9. 0
    6
      src/main/java/com/gildedgames/aether/common/capabilities/entity/player/modules/PlayerConditionModule.java
  10. 1
    0
      src/main/java/com/gildedgames/aether/common/containers/overlays/tabs/guidebook/TabDiscovery.java
  11. 10
    12
      src/main/java/com/gildedgames/aether/common/network/AetherGuiHandler.java
  12. 2
    1
      src/main/java/com/gildedgames/aether/common/network/packets/PacketDiscoveryTabType.java
  13. 2
    1
      src/main/java/com/gildedgames/aether/common/network/packets/PacketFlagPlayerCondition.java
  14. 2
    1
      src/main/java/com/gildedgames/aether/common/network/packets/PacketPlayerConditionModule.java
  15. 2
    1
      src/main/java/com/gildedgames/aether/common/player_conditions/PlayerConditionTracker.java
  16. 2
    1
      src/main/java/com/gildedgames/aether/common/player_conditions/types/PlayerConditionFeedEntity.java
  17. 2
    1
      src/main/java/com/gildedgames/aether/common/player_conditions/types/PlayerConditionKillEntity.java
  18. 2
    1
      src/main/java/com/gildedgames/aether/common/player_conditions/types/PlayerConditionSeeEntity.java
  19. 2
    1
      src/main/java/com/gildedgames/aether/common/travellers_guidebook/TGEntryBase.java
  20. 2
    1
      src/main/java/com/gildedgames/aether/common/travellers_guidebook/entries/TGEntryBestiaryPage.java

+ 1
- 1
lib/orbis-lib

@@ -1 +1 @@
Subproject commit 699bccc7aa794b9d393ae51de38edc2d076e259d
Subproject commit 20ea91eb142eec7b4f4813f7ad5fc9c6265f0cab

+ 0
- 1
src/api/java/com/gildedgames/aether/api/registry/IContentRegistry.java View File

@@ -12,7 +12,6 @@ import com.gildedgames.aether.api.registry.tab.ITabRegistry;
import com.gildedgames.aether.api.shop.ICurrencyRegistry;
import com.gildedgames.aether.api.shop.IShopManager;
import com.gildedgames.aether.api.travellers_guidebook.ITGManager;
import com.gildedgames.aether.api.world.generation.ITemplateRegistry;
import com.gildedgames.aether.api.world.preparation.IPrepRegistry;
import com.gildedgames.aether.api.world.templates.ITemplateRegistry;


+ 3
- 2
src/main/java/com/gildedgames/aether/client/gui/container/guidebook/discovery/GuiGuidebookDiscovery.java View File

@@ -3,6 +3,7 @@ package com.gildedgames.aether.client.gui.container.guidebook.discovery;
import com.gildedgames.aether.client.gui.container.guidebook.AbstractGuidebookPage;
import com.gildedgames.aether.common.AetherCore;
import com.gildedgames.aether.common.capabilities.entity.player.PlayerAether;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerProgressModule;
import com.gildedgames.aether.common.containers.guidebook.EmptyContainer;
import com.gildedgames.orbis.lib.client.gui.util.GuiTexture;
import com.gildedgames.orbis.lib.client.gui.util.gui_library.IGuiContext;
@@ -39,7 +40,7 @@ public class GuiGuidebookDiscovery extends AbstractGuidebookPage
{
super.build(context);

final DiscoveryTab.DiscoveryTabType openedTab = this.aePlayer.getProgressModule().getOpenedDiscoveryTabType();
final DiscoveryTab.DiscoveryTabType openedTab = this.aePlayer.getModule(PlayerProgressModule.class).getOpenedDiscoveryTabType();

this.bestiaryTab = new DiscoveryTab(Pos2D.build().x(89).y(61).flush(), DiscoveryTab.DiscoveryTabType.BESTIARY, openedTab);
this.structureTab = new DiscoveryTab(Pos2D.build().x(121).y(61).flush(), DiscoveryTab.DiscoveryTabType.STRUCTURES, openedTab);
@@ -61,7 +62,7 @@ public class GuiGuidebookDiscovery extends AbstractGuidebookPage
this.characterTab.setSelected(false);
this.biomeTab.setSelected(false);

this.aePlayer.getProgressModule().setOpenedDiscoveryTabType(tab.getType());
this.aePlayer.getModule(PlayerProgressModule.class).setOpenedDiscoveryTabType(tab.getType());

tab.setSelected(true);


+ 41
- 5
src/main/java/com/gildedgames/aether/client/gui/container/guidebook/discovery/GuiGuidebookDiscoveryBestiary.java View File

@@ -1,5 +1,6 @@
package com.gildedgames.aether.client.gui.container.guidebook.discovery;

import com.gildedgames.aether.api.cache.IEntityStats;
import com.gildedgames.aether.api.travellers_guidebook.ITGManager;
import com.gildedgames.aether.client.gui.container.guidebook.discovery.stats.GuiStat;
import com.gildedgames.aether.common.AetherCore;
@@ -10,9 +11,7 @@ import com.gildedgames.orbis.lib.client.gui.util.GuiText;
import com.gildedgames.orbis.lib.client.gui.util.GuiTextBox;
import com.gildedgames.orbis.lib.client.gui.util.GuiTexture;
import com.gildedgames.orbis.lib.client.gui.util.decorators.GuiScrollable;
import com.gildedgames.orbis.lib.client.gui.util.gui_library.IGuiContext;
import com.gildedgames.orbis.lib.client.gui.util.gui_library.IGuiElement;
import com.gildedgames.orbis.lib.client.gui.util.gui_library.IGuiViewer;
import com.gildedgames.orbis.lib.client.gui.util.gui_library.*;
import com.gildedgames.orbis.lib.client.rect.Dim2D;
import com.gildedgames.orbis.lib.client.rect.Pos2D;
import com.gildedgames.orbis.lib.client.rect.Rect;
@@ -46,6 +45,8 @@ public class GuiGuidebookDiscoveryBestiary extends GuiGuidebookDiscovery

private GuiTextBox beastDescription;

private GuiScrollable statsArea;

public GuiGuidebookDiscoveryBestiary(final IGuiViewer prevViewer, final PlayerAether aePlayer)
{
super(prevViewer, aePlayer);
@@ -90,6 +91,12 @@ public class GuiGuidebookDiscoveryBestiary extends GuiGuidebookDiscovery
0.65F));

this.beastDescription.tryRebuild();

final IGuiElement statsContent = this.buildStats(page);

statsContent.dim().mod().pos(this.statsArea.dim().min()).flush();

this.statsArea.setDecorated(statsContent);
});

this.slots.add(slot);
@@ -99,7 +106,31 @@ public class GuiGuidebookDiscoveryBestiary extends GuiGuidebookDiscovery

private IGuiElement buildStats(final TGEntryBestiaryPage page)
{
return null;
final IEntityStats stats = page.getEntityStats();
final IGuiElement statsElement = new GuiElement(Dim2D.build().width(52).flush(), false);

final GuiStat healthStat = new GuiStat(
new GuiTexture(Dim2D.build().width(14).height(14).flush(), HEALTH_ICON),
new Text(new TextComponentString(String.valueOf(MathHelper.floor(stats.getMaxHealth()))), 1.0F));
final GuiStat slashStat = new GuiStat(
new GuiTexture(Dim2D.build().width(14).height(14).flush(), SLASH_DEFENSE_ICON),
new Text(new TextComponentString(String.valueOf(MathHelper.floor(stats.getSlashDefenseLevel()))), 1.0F));
final GuiStat pierceStat = new GuiStat(
new GuiTexture(Dim2D.build().width(14).height(14).flush(), PIERCE_DEFENSE_ICON),
new Text(new TextComponentString(String.valueOf(MathHelper.floor(stats.getPierceDefenseLevel()))), 1.0F));
final GuiStat impactStat = new GuiStat(
new GuiTexture(Dim2D.build().width(14).height(14).flush(), IMPACT_DEFENSE_ICON),
new Text(new TextComponentString(String.valueOf(MathHelper.floor(stats.getImpactDefenseLevel()))), 1.0F));

statsElement.build(this);

GuiLibHelper.alignVertically(this, Pos2D.flush(5, 5), 5, healthStat, slashStat, pierceStat, impactStat);

statsElement.context().addChildren(healthStat, slashStat, pierceStat, impactStat);

GuiLibHelper.assembleMinMaxArea(statsElement);

return statsElement;
}

@Override
@@ -115,6 +146,10 @@ public class GuiGuidebookDiscoveryBestiary extends GuiGuidebookDiscovery
new Text(new TextComponentString(""),
0.65F));

// Empty stats scroll until click on entry
this.statsArea = new GuiScrollable(new GuiElement(Dim2D.build().x(screenX + 25).y(screenY + 114).flush(), false),
Dim2D.build().width(52 + 15).height(56).flush(), true);

final Rect beastDescriptionScrollArea = Dim2D.build().width(52 + 15).height(73).flush();

final GuiTexture rightPage = new GuiTexture(Dim2D.build().width(this.PAGE_WIDTH).height(this.PAGE_HEIGHT).x(screenX).y(screenY).flush(),
@@ -130,6 +165,7 @@ public class GuiGuidebookDiscoveryBestiary extends GuiGuidebookDiscovery
this.beastTitle,
new GuiScrollable(this.beastDescription, beastDescriptionScrollArea, true),
stats,
moves);
moves,
this.statsArea);
}
}

+ 7
- 9
src/main/java/com/gildedgames/aether/common/ContentRegistry.java View File

@@ -6,9 +6,8 @@ import com.gildedgames.aether.api.player.conditions.IPlayerConditionTracker;
import com.gildedgames.aether.api.player.conditions.events.SeeEntityEvents;
import com.gildedgames.aether.api.registrar.*;
import com.gildedgames.aether.api.registry.IContentRegistry;
import com.gildedgames.aether.api.world.preparation.IPrepRegistry;
import com.gildedgames.aether.api.travellers_guidebook.ITGManager;
import com.gildedgames.aether.common.AetherCore;
import com.gildedgames.aether.api.world.preparation.IPrepRegistry;
import com.gildedgames.aether.common.cache.EntityStatsCache;
import com.gildedgames.aether.common.capabilities.CapabilityManagerAether;
import com.gildedgames.aether.common.capabilities.item.EffectRegistry;
@@ -19,16 +18,15 @@ import com.gildedgames.aether.common.init.*;
import com.gildedgames.aether.common.items.properties.ItemPropertiesRegistry;
import com.gildedgames.aether.common.network.NetworkingAether;
import com.gildedgames.aether.common.patron.PatronRewards;
import com.gildedgames.aether.common.recipes.altar.AltarRecipeRegistry;
import com.gildedgames.aether.common.player_conditions.PlayerConditionTracker;
import com.gildedgames.aether.common.recipes.altar.AltarRecipeRegistry;
import com.gildedgames.aether.common.recipes.simple.RecipeIndexRegistry;
import com.gildedgames.aether.common.recipes.simple.RecipeWrapper;
import com.gildedgames.aether.common.recipes.simple.SimpleCraftingRegistry;
import com.gildedgames.aether.common.shop.CurrencyRegistry;
import com.gildedgames.aether.common.shop.ShopManager;
import com.gildedgames.aether.common.util.ObjectHolderHelper;
import com.gildedgames.aether.common.tab.guidebook.TabGuidebook;
import com.gildedgames.aether.common.travellers_guidebook.TGManager;
import com.gildedgames.aether.common.util.ObjectHolderHelper;
import com.gildedgames.aether.common.util.helpers.PerfHelper;
import com.gildedgames.aether.common.world.aether.PrepAether;
import com.gildedgames.aether.common.world.preparation.PrepRegistry;
@@ -40,9 +38,9 @@ import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.registry.ForgeRegistries;

@@ -150,9 +148,9 @@ public class ContentRegistry implements IContentRegistry, IOrbisServicesListener
{
this.craftableItemsIndex.clearRegistrations();

for (IRecipe recipe : ForgeRegistries.RECIPES)
for (final IRecipe recipe : ForgeRegistries.RECIPES)
{
ResourceLocation loc = Item.REGISTRY.getNameForObject(recipe.getRecipeOutput().getItem());
final ResourceLocation loc = Item.REGISTRY.getNameForObject(recipe.getRecipeOutput().getItem());

if (loc != null && loc.getNamespace().equals(AetherCore.MOD_ID))
{
@@ -258,7 +256,7 @@ public class ContentRegistry implements IContentRegistry, IOrbisServicesListener
}

@Override
public void onStartProjectManager(IProjectManager projectManager)
public void onStartProjectManager(final IProjectManager projectManager)
{
BlueprintsAether.load(projectManager);
}

+ 3
- 3
src/main/java/com/gildedgames/aether/common/cache/EntityStats.java View File

@@ -63,21 +63,21 @@ public class EntityStats implements IEntityStats
return this;
}

public EntityStatsFactory slashDefenseLevel(final float value)
public EntityStatsFactory slashDefenseLevel(final double value)
{
this.slashDefenseLevel = value;

return this;
}

public EntityStatsFactory pierceDefenseLevel(final float value)
public EntityStatsFactory pierceDefenseLevel(final double value)
{
this.pierceDefenseLevel = value;

return this;
}

public EntityStatsFactory impactDefenseLevel(final float value)
public EntityStatsFactory impactDefenseLevel(final double value)
{
this.impactDefenseLevel = value;


+ 11
- 1
src/main/java/com/gildedgames/aether/common/cache/EntityStatsCache.java View File

@@ -2,6 +2,7 @@ package com.gildedgames.aether.common.cache;

import com.gildedgames.aether.api.cache.IEntityStats;
import com.gildedgames.aether.api.cache.IEntityStatsCache;
import com.gildedgames.aether.api.entity.damage.DamageTypeAttributes;
import com.google.common.collect.Maps;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -39,7 +40,16 @@ public class EntityStatsCache implements IEntityStatsCache
{
final EntityLivingBase living = (EntityLivingBase) entity;

final EntityStats stats = EntityStats.build().maxHealth(living.getMaxHealth()).flush();
final double slashDefenseLevel = living.getEntityAttribute(DamageTypeAttributes.SLASH_DEFENSE_LEVEL).getAttributeValue();
final double pierceDefenseLevel = living.getEntityAttribute(DamageTypeAttributes.PIERCE_DEFENSE_LEVEL).getAttributeValue();
final double impactDefenseLevel = living.getEntityAttribute(DamageTypeAttributes.IMPACT_DEFENSE_LEVEL).getAttributeValue();

final EntityStats stats = EntityStats.build()
.maxHealth(living.getMaxHealth())
.slashDefenseLevel(slashDefenseLevel)
.pierceDefenseLevel(pierceDefenseLevel)
.impactDefenseLevel(impactDefenseLevel)
.flush();

this.entityIdToStats.put(entityId, stats);
}

+ 41
- 42
src/main/java/com/gildedgames/aether/common/capabilities/entity/player/PlayerAether.java View File

@@ -3,10 +3,8 @@ package com.gildedgames.aether.common.capabilities.entity.player;
import com.gildedgames.aether.api.player.IPlayerAether;
import com.gildedgames.aether.api.player.IPlayerAetherModule;
import com.gildedgames.aether.api.registrar.CapabilitiesAether;
import com.gildedgames.aether.api.player.IPlayerConditionModule;
import com.gildedgames.aether.common.AetherCore;
import com.gildedgames.aether.common.capabilities.entity.player.modules.*;
import com.gildedgames.aether.common.capabilities.entity.player.modules.guidebook.PlayerTGModule;
import com.gildedgames.aether.common.network.NetworkingAether;
import com.gildedgames.aether.common.network.packets.*;
import com.gildedgames.aether.common.world.instances.necromancer_tower.NecromancerTowerInstance;
@@ -43,15 +41,16 @@ public class PlayerAether implements IPlayerAether
{
private final EntityPlayer entity;

private NecromancerTowerInstance towerInstance;

private ItemStack lastDestroyedStack;

private final IdentityHashMap<Class<? extends IPlayerAetherModule>, IPlayerAetherModule> modulesKeyed = new IdentityHashMap<>();

private final List<IPlayerAetherModule> modules = new ArrayList<>();

private final List<IPlayerAetherModule.Serializable> modulesSerializable = new ArrayList<>();

private NecromancerTowerInstance towerInstance;

private ItemStack lastDestroyedStack;

private int ticksWithEggnogEffect;

private boolean isTrading;
@@ -82,13 +81,36 @@ public class PlayerAether implements IPlayerAether
this.registerModule(new PlayerSectorModule(this));
this.registerModule(new PlayerTradeModule(this));
this.registerModule(new PlayerCaveSpawnModule(this));
this.registerModule(new PlayerTGModule(this));
this.registerModule(new PlayerConditionModule(this));
}

@Nonnull
public static PlayerAether getPlayer(final EntityPlayer player)
{
if (player == null)
{
throw new NullPointerException("Player entity is null");
}

final PlayerAether ret = (PlayerAether) player.getCapability(CapabilitiesAether.PLAYER_DATA, null);

if (ret == null)
{
throw new NullPointerException("Player does not contain capability");
}

return ret;
}

public static boolean hasCapability(final Entity entity)
{
return entity.hasCapability(CapabilitiesAether.PLAYER_DATA, null);
}

@Override
public void registerModule(IPlayerAetherModule module)
public void registerModule(final IPlayerAetherModule module)
{
Class<? extends IPlayerAetherModule> clazz = module.getClass();
final Class<? extends IPlayerAetherModule> clazz = module.getClass();

if (this.modulesKeyed.containsKey(clazz))
{
@@ -106,9 +128,9 @@ public class PlayerAether implements IPlayerAether

@Override
@SuppressWarnings("unchecked")
public <T extends IPlayerAetherModule> T getModule(Class<T> clazz)
public <T extends IPlayerAetherModule> T getModule(final Class<T> clazz)
{
T ret = (T) this.modulesKeyed.get(clazz);
final T ret = (T) this.modulesKeyed.get(clazz);

if (ret == null)
{
@@ -118,29 +140,6 @@ public class PlayerAether implements IPlayerAether
return ret;
}

@Nonnull
public static PlayerAether getPlayer(final EntityPlayer player)
{
if (player == null)
{
throw new NullPointerException("Player entity is null");
}

PlayerAether ret = (PlayerAether) player.getCapability(CapabilitiesAether.PLAYER_DATA, null);

if (ret == null)
{
throw new NullPointerException("Player does not contain capability");
}

return ret;
}

public static boolean hasCapability(final Entity entity)
{
return entity.hasCapability(CapabilitiesAether.PLAYER_DATA, null);
}

public ItemStack getLastDestroyedStack()
{
return this.lastDestroyedStack;
@@ -171,7 +170,7 @@ public class PlayerAether implements IPlayerAether
*/
public void sendFullUpdate()
{
EntityPlayerMP player = (EntityPlayerMP) this.getEntity();
final EntityPlayerMP player = (EntityPlayerMP) this.getEntity();

NetworkingAether.sendPacketToPlayer(new PacketCurrencyModule(this.getModule(PlayerCurrencyModule.class)), player);
NetworkingAether.sendPacketToPlayer(new PacketProgressModule(this.getModule(PlayerProgressModule.class)), player);
@@ -212,7 +211,7 @@ public class PlayerAether implements IPlayerAether
{
this.sendFullUpdate();

for (IPlayerAetherModule module : this.modules)
for (final IPlayerAetherModule module : this.modules)
{
module.onRespawn(event);
}
@@ -224,7 +223,7 @@ public class PlayerAether implements IPlayerAether

public void onDeath(final LivingDeathEvent event)
{
for (IPlayerAetherModule module : this.modules)
for (final IPlayerAetherModule module : this.modules)
{
module.onDeath(event);
}
@@ -232,7 +231,7 @@ public class PlayerAether implements IPlayerAether

public void onDrops(final PlayerDropsEvent event)
{
for (IPlayerAetherModule module : this.modules)
for (final IPlayerAetherModule module : this.modules)
{
module.onDrops(event);
}
@@ -240,7 +239,7 @@ public class PlayerAether implements IPlayerAether

public void onHurt(final LivingHurtEvent event)
{
PlayerEquipmentModule equipmentModule = this.getModule(PlayerEquipmentModule.class);
final PlayerEquipmentModule equipmentModule = this.getModule(PlayerEquipmentModule.class);

if (equipmentModule.getEffectPool(new ResourceLocation(AetherCore.MOD_ID, "fire_immunity")).isPresent())
{
@@ -250,7 +249,7 @@ public class PlayerAether implements IPlayerAether
}
}

PlayerRollMovementModule movementModule = this.getModule(PlayerRollMovementModule.class);
final PlayerRollMovementModule movementModule = this.getModule(PlayerRollMovementModule.class);

if (movementModule.isRolling())
{
@@ -313,11 +312,11 @@ public class PlayerAether implements IPlayerAether
{
final NBTFunnel funnel = new NBTFunnel(tag);

NBTTagCompound modules = tag.getCompoundTag("Modules");
final NBTTagCompound modules = tag.getCompoundTag("Modules");

for (final IPlayerAetherModule.Serializable module : this.modulesSerializable)
{
String key = module.getIdentifier().toString();
final String key = module.getIdentifier().toString();

if (modules.hasKey(key))
{

+ 0
- 6
src/main/java/com/gildedgames/aether/common/capabilities/entity/player/modules/PlayerConditionModule.java View File

@@ -72,12 +72,6 @@ public class PlayerConditionModule extends PlayerAetherModule implements IPlayer

}

@Override
public void onUpdate()
{

}

@Override
public void write(final NBTTagCompound tag)
{

+ 1
- 0
src/main/java/com/gildedgames/aether/common/containers/overlays/tabs/guidebook/TabDiscovery.java View File

@@ -5,6 +5,7 @@ import com.gildedgames.aether.api.registry.tab.ITabClient;
import com.gildedgames.aether.client.gui.container.guidebook.AbstractGuidebookPage;
import com.gildedgames.aether.common.AetherCore;
import com.gildedgames.aether.common.network.AetherGuiHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.entity.player.EntityPlayer;

+ 10
- 12
src/main/java/com/gildedgames/aether/common/network/AetherGuiHandler.java View File

@@ -6,18 +6,15 @@ import com.gildedgames.aether.api.shop.IShopInstance;
import com.gildedgames.aether.api.shop.IShopInstanceGroup;
import com.gildedgames.aether.client.gui.container.GuiIcestoneCooler;
import com.gildedgames.aether.client.gui.container.GuiIncubator;
import com.gildedgames.aether.client.gui.container.guidebook.GuiGuidebookDiscovery;
import com.gildedgames.aether.client.gui.container.guidebook.GuiGuidebookInventory;
import com.gildedgames.aether.client.gui.container.guidebook.GuiGuidebookInventory;
import com.gildedgames.aether.client.gui.container.guidebook.GuiGuidebookLoreTome;
import com.gildedgames.aether.client.gui.container.guidebook.GuiGuidebookStatus;
import com.gildedgames.aether.client.gui.container.simple_crafting.ContainerMasonryBench;
import com.gildedgames.aether.client.gui.dialog.ContainerShop;
import com.gildedgames.aether.client.gui.container.guidebook.discovery.GuiGuidebookDiscoveryBestiary;
import com.gildedgames.aether.client.gui.container.guidebook.discovery.GuiGuidebookDiscoveryBiomes;
import com.gildedgames.aether.client.gui.container.guidebook.discovery.GuiGuidebookDiscoveryCharacters;
import com.gildedgames.aether.client.gui.container.guidebook.discovery.GuiGuidebookDiscoveryStructures;
import com.gildedgames.aether.client.gui.container.simple_crafting.GuiMasonryBench;
import com.gildedgames.aether.client.gui.container.simple_crafting.ContainerMasonryBench;
import com.gildedgames.aether.client.gui.dialog.ContainerShop;
import com.gildedgames.aether.client.gui.dialog.GuiDialogViewer;
import com.gildedgames.aether.client.gui.dialog.GuiTrade;
import com.gildedgames.aether.client.gui.misc.GuiAetherLoading;
@@ -25,6 +22,7 @@ import com.gildedgames.aether.client.gui.misc.GuiAetherTeleporterNotice;
import com.gildedgames.aether.client.gui.misc.GuiPatronRewards;
import com.gildedgames.aether.common.capabilities.entity.player.PlayerAether;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerDialogModule;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerProgressModule;
import com.gildedgames.aether.common.containers.ContainerCustomWorkbench;
import com.gildedgames.aether.common.containers.ContainerDialogController;
import com.gildedgames.aether.common.containers.ContainerLoadingScreen;
@@ -106,14 +104,14 @@ public class AetherGuiHandler implements IGuiHandler
return new ContainerLoadingScreen();
case DIALOG_SHOP_ID:
{
PlayerDialogModule dialogModule = playerAether.getModule(PlayerDialogModule.class);
final PlayerDialogModule dialogModule = playerAether.getModule(PlayerDialogModule.class);

if (dialogModule.getTalkingCharacter() == null)
{
return null;
}

IShopInstanceGroup group = dialogModule.getTalkingCharacter().getShopInstanceGroup();
final IShopInstanceGroup group = dialogModule.getTalkingCharacter().getShopInstanceGroup();

if (group == null)
{
@@ -158,7 +156,7 @@ public class AetherGuiHandler implements IGuiHandler
case LORE_TOME_ID:
return new GuiGuidebookLoreTome(null, playerAether);
case DISCOVERY_ID:
switch (playerAether.getProgressModule().getOpenedDiscoveryTabType())
switch (playerAether.getModule(PlayerProgressModule.class).getOpenedDiscoveryTabType())
{
case BESTIARY:
{
@@ -192,16 +190,16 @@ public class AetherGuiHandler implements IGuiHandler
return new GuiAetherTeleporterNotice();
case DIALOG_SHOP_ID:
{
PlayerDialogModule dialogModule = playerAether.getModule(PlayerDialogModule.class);
final PlayerDialogModule dialogModule = playerAether.getModule(PlayerDialogModule.class);

if (dialogModule.getTalkingCharacter() == null)
{
return null;
}

IDialogSlide slide = DialogUtil.getSlide(dialogModule);
final IDialogSlide slide = DialogUtil.getSlide(dialogModule);

IShopInstanceGroup group = dialogModule.getTalkingCharacter().getShopInstanceGroup();
final IShopInstanceGroup group = dialogModule.getTalkingCharacter().getShopInstanceGroup();

if (group == null)
{
@@ -238,7 +236,7 @@ public class AetherGuiHandler implements IGuiHandler
}
}
case DIALOG_VIEWER_ID:
PlayerDialogModule dialogModule = playerAether.getModule(PlayerDialogModule.class);
final PlayerDialogModule dialogModule = playerAether.getModule(PlayerDialogModule.class);

return new GuiDialogViewer(player, dialogModule, dialogModule.getCurrentSceneInstance());
case TRADE_ID:

+ 2
- 1
src/main/java/com/gildedgames/aether/common/network/packets/PacketDiscoveryTabType.java View File

@@ -2,6 +2,7 @@ package com.gildedgames.aether.common.network.packets;

import com.gildedgames.aether.client.gui.container.guidebook.discovery.DiscoveryTab;
import com.gildedgames.aether.common.capabilities.entity.player.PlayerAether;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerProgressModule;
import com.gildedgames.aether.common.network.MessageHandlerServer;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
@@ -49,7 +50,7 @@ public class PacketDiscoveryTabType implements IMessage

final PlayerAether playerAether = PlayerAether.getPlayer(player);

playerAether.getProgressModule().setOpenedDiscoveryTabType(message.type);
playerAether.getModule(PlayerProgressModule.class).setOpenedDiscoveryTabType(message.type);

return null;
}

+ 2
- 1
src/main/java/com/gildedgames/aether/common/network/packets/PacketFlagPlayerCondition.java View File

@@ -1,6 +1,7 @@
package com.gildedgames.aether.common.network.packets;

import com.gildedgames.aether.common.capabilities.entity.player.PlayerAether;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerConditionModule;
import com.gildedgames.aether.common.network.MessageHandlerClient;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
@@ -49,7 +50,7 @@ public class PacketFlagPlayerCondition implements IMessage

final PlayerAether playerAether = PlayerAether.getPlayer(player);

playerAether.getPlayerConditionModule().flagCondition(message.conditionUniqueId);
playerAether.getModule(PlayerConditionModule.class).flagCondition(message.conditionUniqueId);

return null;
}

+ 2
- 1
src/main/java/com/gildedgames/aether/common/network/packets/PacketPlayerConditionModule.java View File

@@ -2,6 +2,7 @@ package com.gildedgames.aether.common.network.packets;

import com.gildedgames.aether.api.player.IPlayerConditionModule;
import com.gildedgames.aether.common.capabilities.entity.player.PlayerAether;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerConditionModule;
import com.gildedgames.aether.common.network.MessageHandlerClient;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
@@ -54,7 +55,7 @@ public class PacketPlayerConditionModule implements IMessage

final PlayerAether playerAether = PlayerAether.getPlayer(player);

playerAether.getPlayerConditionModule().read(message.tag);
playerAether.getModule(PlayerConditionModule.class).read(message.tag);

return null;
}

+ 2
- 1
src/main/java/com/gildedgames/aether/common/player_conditions/PlayerConditionTracker.java View File

@@ -5,6 +5,7 @@ import com.gildedgames.aether.api.player.conditions.IPlayerCondition;
import com.gildedgames.aether.api.player.conditions.IPlayerConditionTracker;
import com.gildedgames.aether.api.player.conditions.types.IPlayerConditionListener;
import com.gildedgames.aether.common.capabilities.entity.player.PlayerAether;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerConditionModule;
import com.google.common.collect.Sets;
import net.minecraft.entity.player.EntityPlayer;

@@ -45,7 +46,7 @@ public class PlayerConditionTracker implements IPlayerConditionTracker, IPlayerC
public void onTriggered(final IPlayerCondition condition, final EntityPlayer player)
{
final PlayerAether playerAether = PlayerAether.getPlayer(player);
final IPlayerConditionModule module = playerAether.getPlayerConditionModule();
final IPlayerConditionModule module = playerAether.getModule(PlayerConditionModule.class);

module.flagCondition(condition.getUniqueIdentifier());
}

+ 2
- 1
src/main/java/com/gildedgames/aether/common/player_conditions/types/PlayerConditionFeedEntity.java View File

@@ -4,6 +4,7 @@ import com.gildedgames.aether.api.player.IPlayerConditionModule;
import com.gildedgames.aether.api.player.conditions.types.IPlayerConditionEntity;
import com.gildedgames.aether.common.AetherCore;
import com.gildedgames.aether.common.capabilities.entity.player.PlayerAether;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerConditionModule;
import com.gildedgames.aether.common.player_conditions.PlayerConditionBase;
import com.gildedgames.aether.common.util.helpers.EntityUtil;
import com.google.gson.JsonDeserializationContext;
@@ -110,7 +111,7 @@ public class PlayerConditionFeedEntity extends PlayerConditionBase implements IP
final EntityPlayer player = event.getEntityPlayer();

final PlayerAether playerAether = PlayerAether.getPlayer(player);
final IPlayerConditionModule module = playerAether.getPlayerConditionModule();
final IPlayerConditionModule module = playerAether.getModule(PlayerConditionModule.class);

// If already flagged condition, stop
if (module.isConditionFlagged(this.getUniqueIdentifier()))

+ 2
- 1
src/main/java/com/gildedgames/aether/common/player_conditions/types/PlayerConditionKillEntity.java View File

@@ -4,6 +4,7 @@ import com.gildedgames.aether.api.player.IPlayerConditionModule;
import com.gildedgames.aether.api.player.conditions.types.IPlayerConditionEntity;
import com.gildedgames.aether.common.AetherCore;
import com.gildedgames.aether.common.capabilities.entity.player.PlayerAether;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerConditionModule;
import com.gildedgames.aether.common.player_conditions.PlayerConditionBase;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
@@ -94,7 +95,7 @@ public class PlayerConditionKillEntity extends PlayerConditionBase implements IP
final EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();

final PlayerAether playerAether = PlayerAether.getPlayer(player);
final IPlayerConditionModule module = playerAether.getPlayerConditionModule();
final IPlayerConditionModule module = playerAether.getModule(PlayerConditionModule.class);

if (module.isConditionFlagged(this.getUniqueIdentifier()))
{

+ 2
- 1
src/main/java/com/gildedgames/aether/common/player_conditions/types/PlayerConditionSeeEntity.java View File

@@ -5,6 +5,7 @@ import com.gildedgames.aether.api.player.conditions.events.ISeeEntityEventsListe
import com.gildedgames.aether.api.player.conditions.types.IPlayerConditionEntity;
import com.gildedgames.aether.common.AetherCore;
import com.gildedgames.aether.common.capabilities.entity.player.PlayerAether;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerConditionModule;
import com.gildedgames.aether.common.player_conditions.PlayerConditionBase;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
@@ -88,7 +89,7 @@ public class PlayerConditionSeeEntity extends PlayerConditionBase implements IPl
}

final PlayerAether playerAether = PlayerAether.getPlayer(player);
final IPlayerConditionModule module = playerAether.getPlayerConditionModule();
final IPlayerConditionModule module = playerAether.getModule(PlayerConditionModule.class);

if (module.isConditionFlagged(this.getUniqueIdentifier()))
{

+ 2
- 1
src/main/java/com/gildedgames/aether/common/travellers_guidebook/TGEntryBase.java View File

@@ -4,6 +4,7 @@ import com.gildedgames.aether.api.player.IPlayerAether;
import com.gildedgames.aether.api.player.conditions.IConditionResolution;
import com.gildedgames.aether.api.player.conditions.IPlayerCondition;
import com.gildedgames.aether.api.travellers_guidebook.ITGEntry;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerConditionModule;
import net.minecraft.util.ResourceLocation;

import java.util.Collection;
@@ -53,6 +54,6 @@ public abstract class TGEntryBase implements ITGEntry
@Override
public boolean isUnlocked(final IPlayerAether playerAether)
{
return playerAether.getPlayerConditionModule().isEntryUnlocked(this);
return playerAether.getModule(PlayerConditionModule.class).isEntryUnlocked(this);
}
}

+ 2
- 1
src/main/java/com/gildedgames/aether/common/travellers_guidebook/entries/TGEntryBestiaryPage.java View File

@@ -6,6 +6,7 @@ import com.gildedgames.aether.api.player.conditions.IConditionResolution;
import com.gildedgames.aether.api.player.conditions.IPlayerCondition;
import com.gildedgames.aether.api.travellers_guidebook.entries.ITGEntryBestiaryPage;
import com.gildedgames.aether.common.AetherCore;
import com.gildedgames.aether.common.capabilities.entity.player.modules.PlayerConditionModule;
import com.gildedgames.aether.common.player_conditions.types.PlayerConditionFeedEntity;
import com.gildedgames.aether.common.player_conditions.types.PlayerConditionKillEntity;
import com.gildedgames.aether.common.travellers_guidebook.TGEntryBase;
@@ -105,7 +106,7 @@ public class TGEntryBestiaryPage extends TGEntryBase implements ITGEntryBestiary
@Override
public boolean isUnderstood(final IPlayerAether playerAether)
{
return playerAether.getPlayerConditionModule().areConditionsFlagged(IConditionResolution.REQUIRE_ANY,
return playerAether.getModule(PlayerConditionModule.class).areConditionsFlagged(IConditionResolution.REQUIRE_ANY,
AetherCore.getResource("feedEntity:" + this.entityId),
AetherCore.getResource("killEntity:" + this.entityId));
}

Loading…
Cancel
Save