use of micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats in project MorePlanets by SteveKunG.
the class WorldProviderNibiru method setup.
@Override
public void setup(EntityPlayerMP player) {
GCPlayerStats stats = GCPlayerStats.get(player);
// Knows how to build T2 rocket
SchematicRegistry.unlockNewPage(player, new ItemStack(GCItems.schematic, 1, 1));
// Knows how to build T3 rocket
SchematicRegistry.unlockNewPage(player, new ItemStack(MarsItems.schematic, 1, 0));
// Knows how to build T4 rocket
SchematicRegistry.unlockNewPage(player, new ItemStack(DionaItems.TIER_5_ROCKET_SCHEMATIC, 1, 0));
// Knows how to build T5 rocket
SchematicRegistry.unlockNewPage(player, new ItemStack(DionaItems.TIER_5_ROCKET_SCHEMATIC, 1, 1));
player.addPotionEffect(new PotionEffect(MPPotions.INFECTED_SPORE_PROTECTION, 36020, 0, true, true));
stats.getExtendedInventory().setInventorySlotContents(0, new ItemStack(GCItems.oxMask, 1, 0));
stats.getExtendedInventory().setInventorySlotContents(1, new ItemStack(GCItems.oxygenGear, 1, 0));
stats.getExtendedInventory().setInventorySlotContents(2, new ItemStack(GCItems.oxTankHeavy, 1, 0));
stats.getExtendedInventory().setInventorySlotContents(3, new ItemStack(GCItems.oxTankHeavy, 1, 0));
stats.getExtendedInventory().setInventorySlotContents(5, new ItemStack(GCItems.basicItem, 1, 19));
stats.getExtendedInventory().setInventorySlotContents(6, new ItemStack(VenusItems.thermalPaddingTier2, 1, 0));
stats.getExtendedInventory().setInventorySlotContents(7, new ItemStack(VenusItems.thermalPaddingTier2, 1, 1));
stats.getExtendedInventory().setInventorySlotContents(8, new ItemStack(VenusItems.thermalPaddingTier2, 1, 2));
stats.getExtendedInventory().setInventorySlotContents(9, new ItemStack(VenusItems.thermalPaddingTier2, 1, 3));
stats.getExtendedInventory().setInventorySlotContents(10, new ItemStack(VenusItems.basicItem, 1, 0));
player.inventory.addItemStackToInventory(CapsuleType.getInfectedProtectionCapsule());
player.inventory.addItemStackToInventory(new ItemStack(AsteroidsItems.canisterLOX));
player.inventory.addItemStackToInventory(new ItemStack(AsteroidsItems.canisterLOX));
}
use of micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats in project MorePlanets by SteveKunG.
the class EntityTieredRocketMP method onTeleport.
@Override
public void onTeleport(EntityPlayerMP player) {
EntityPlayerMP playerBase = PlayerUtil.getPlayerBaseServerFromPlayer(player, false);
if (playerBase != null) {
GCPlayerStats stats = GCPlayerStats.get(playerBase);
if (this.stacks == null || this.stacks.isEmpty()) {
stats.setRocketStacks(NonNullList.withSize(2, ItemStack.EMPTY));
} else {
stats.setRocketStacks(this.stacks);
}
stats.setRocketType(this.rocketType.getIndex());
stats.setRocketItem(this.getRocketItem());
stats.setFuelLevel(this.fuelTank.getFluidAmount());
}
}
use of micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats in project MorePlanets by SteveKunG.
the class WorldProviderMP method setup.
@Override
public void setup(EntityPlayerMP player) {
GCPlayerStats stats = GCPlayerStats.get(player);
// Knows how to build T2 rocket
SchematicRegistry.unlockNewPage(player, new ItemStack(GCItems.schematic, 1, 1));
// Knows how to build T3 rocket
SchematicRegistry.unlockNewPage(player, new ItemStack(MarsItems.schematic, 1, 0));
stats.getExtendedInventory().setInventorySlotContents(0, new ItemStack(GCItems.oxMask, 1, 0));
stats.getExtendedInventory().setInventorySlotContents(1, new ItemStack(GCItems.oxygenGear, 1, 0));
stats.getExtendedInventory().setInventorySlotContents(2, new ItemStack(GCItems.oxTankHeavy, 1, 0));
stats.getExtendedInventory().setInventorySlotContents(3, new ItemStack(GCItems.oxTankHeavy, 1, 0));
stats.getExtendedInventory().setInventorySlotContents(5, new ItemStack(GCItems.basicItem, 1, 19));
stats.getExtendedInventory().setInventorySlotContents(6, new ItemStack(AsteroidsItems.thermalPadding, 1, 0));
stats.getExtendedInventory().setInventorySlotContents(7, new ItemStack(AsteroidsItems.thermalPadding, 1, 1));
stats.getExtendedInventory().setInventorySlotContents(8, new ItemStack(AsteroidsItems.thermalPadding, 1, 2));
stats.getExtendedInventory().setInventorySlotContents(9, new ItemStack(AsteroidsItems.thermalPadding, 1, 3));
player.inventory.addItemStackToInventory(new ItemStack(AsteroidsItems.canisterLOX));
player.inventory.addItemStackToInventory(new ItemStack(AsteroidsItems.canisterLOX));
player.inventory.addItemStackToInventory(new ItemStack(AsteroidsItems.canisterLOX));
}
use of micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats in project Galacticraft by micdoodle8.
the class ItemThermalPadding method onItemRightClick.
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
if (player instanceof EntityPlayerMP) {
GCPlayerStats stats = GCPlayerStats.get(player);
ItemStack gear = stats.getExtendedInventory().getStackInSlot(6);
ItemStack gear1 = stats.getExtendedInventory().getStackInSlot(7);
ItemStack gear2 = stats.getExtendedInventory().getStackInSlot(8);
ItemStack gear3 = stats.getExtendedInventory().getStackInSlot(9);
if (itemStack.getItemDamage() == 0) {
if (gear == null) {
stats.getExtendedInventory().setInventorySlotContents(6, itemStack.copy());
itemStack.stackSize = 0;
}
} else if (itemStack.getItemDamage() == 1) {
if (gear1 == null) {
stats.getExtendedInventory().setInventorySlotContents(7, itemStack.copy());
itemStack.stackSize = 0;
}
} else if (itemStack.getItemDamage() == 2) {
if (gear2 == null) {
stats.getExtendedInventory().setInventorySlotContents(8, itemStack.copy());
itemStack.stackSize = 0;
}
} else if (itemStack.getItemDamage() == 3) {
if (gear3 == null) {
stats.getExtendedInventory().setInventorySlotContents(9, itemStack.copy());
itemStack.stackSize = 0;
}
}
}
return itemStack;
}
use of micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats in project Galacticraft by micdoodle8.
the class AsteroidsTickHandlerServer method onServerTick.
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
// Prevent issues when clients switch to LAN servers
if (server == null) {
return;
}
if (event.phase == TickEvent.Phase.START) {
TileEntityMinerBase.checkNewMinerBases();
if (AsteroidsTickHandlerServer.spaceRaceData == null) {
World world = server.worldServerForDimension(0);
AsteroidsTickHandlerServer.spaceRaceData = (ShortRangeTelepadHandler) world.getMapStorage().loadData(ShortRangeTelepadHandler.class, ShortRangeTelepadHandler.saveDataID);
if (AsteroidsTickHandlerServer.spaceRaceData == null) {
AsteroidsTickHandlerServer.spaceRaceData = new ShortRangeTelepadHandler(ShortRangeTelepadHandler.saveDataID);
world.getMapStorage().setData(ShortRangeTelepadHandler.saveDataID, AsteroidsTickHandlerServer.spaceRaceData);
}
}
int index = -1;
for (EntityAstroMiner miner : activeMiners) {
index++;
if (miner.isDead) {
// minerIt.remove(); Don't remove it, we want the index number to be static for the others
continue;
}
if (miner.playerMP != null) {
GCPlayerStats stats = GCPlayerStats.get(miner.playerMP);
if (stats != null) {
List<BlockVec3> list = stats.getActiveAstroMinerChunks();
boolean inListAlready = false;
Iterator<BlockVec3> it = list.iterator();
while (it.hasNext()) {
BlockVec3 data = it.next();
if (// SideDoneBits won't be saved to NBT, but during an active server session we can use it as a cross-reference to the index here - it's a 4th data int hidden inside a BlockVec3
data.sideDoneBits == index) {
if (miner.isDead) {
// Player stats should not save position of dead AstroMiner entity (probably broken by player deliberately breaking it)
it.remove();
} else {
data.x = miner.chunkCoordX;
data.z = miner.chunkCoordZ;
}
inListAlready = true;
break;
}
}
if (!inListAlready && !miner.isDead) {
BlockVec3 data = new BlockVec3(miner.chunkCoordX, miner.dimension, miner.chunkCoordZ);
data.sideDoneBits = index;
list.add(data);
}
}
}
}
}
}
Aggregations