use of com.mraof.minestuck.world.WorldProviderLands in project Minestuck by mraof.
the class MessageType method createMessage.
private static ITextComponent createMessage(EntityConsort consort, EntityPlayer player, String unlocalizedMessage, String[] args, boolean consortPrefix) {
String s = EntityList.getEntityString(consort);
if (s == null) {
s = "generic";
}
Object[] obj = new Object[args.length];
SburbConnection c = SburbHandler.getConnectionForDimension(consort.homeDimension);
Title title = c == null ? null : MinestuckPlayerData.getData(c.getClientIdentifier()).title;
for (int i = 0; i < args.length; i++) {
if (args[i].equals("playerNameLand")) {
if (c != null)
obj[i] = c.getClientIdentifier().getUsername();
else
obj[i] = "Player name";
} else if (args[i].equals("playerName")) {
obj[i] = player.getName();
} else if (args[i].equals("landName")) {
World world = consort.getServer().getWorld(consort.homeDimension);
if (world != null && consort.world.provider instanceof WorldProviderLands) {
ChunkProviderLands chunkProvider = (ChunkProviderLands) world.provider.createChunkGenerator();
ITextComponent aspect1 = new TextComponentTranslation("land." + chunkProvider.aspect1.getNames()[chunkProvider.nameIndex1]);
ITextComponent aspect2 = new TextComponentTranslation("land." + chunkProvider.aspect2.getNames()[chunkProvider.nameIndex2]);
if (chunkProvider.nameOrder)
obj[i] = new TextComponentTranslation("land.format", aspect1, aspect2);
else
obj[i] = new TextComponentTranslation("land.format", aspect2, aspect1);
} else
obj[i] = "Land name";
} else if (args[i].equals("playerTitleLand")) {
if (title != null)
obj[i] = title.asTextComponent();
else
obj[i] = "Player title";
} else if (args[i].equals("playerClassLand")) {
if (title != null)
obj[i] = title.getHeroClass().asTextComponent();
else
obj[i] = "Player class";
} else if (args[i].equals("playerAspectLand")) {
if (title != null)
obj[i] = title.getHeroAspect().asTextComponent();
else
obj[i] = "Player aspect";
} else if (args[i].equals("consortSound")) {
obj[i] = new TextComponentTranslation("consort.sound." + s);
} else if (args[i].equals("consortType")) {
obj[i] = new TextComponentTranslation("entity." + s + ".name");
} else if (args[i].equals("consortTypes")) {
obj[i] = new TextComponentTranslation("entity." + s + ".plural.name");
} else if (args[i].equals("playerTitle")) {
PlayerIdentifier identifier = IdentifierHandler.encode(player);
if (MinestuckPlayerData.getTitle(identifier) != null)
obj[i] = MinestuckPlayerData.getTitle(identifier).asTextComponent();
else
obj[i] = player.getName();
} else if (args[i].equals("denizen")) {
if (title != null)
obj[i] = new TextComponentTranslation("denizen." + MinestuckPlayerData.getData(c.getClientIdentifier()).title.getHeroAspect().toString() + ".name");
else
obj[i] = "Denizen";
} else if (args[i].startsWith("nbtItem:")) {
NBTTagCompound nbt = consort.getMessageTagForPlayer(player);
ItemStack stack = new ItemStack(nbt.getCompoundTag(args[i].substring(8)));
if (!stack.isEmpty())
obj[i] = new TextComponentTranslation(stack.getUnlocalizedName() + ".name");
else
obj[i] = "Item";
}
}
TextComponentTranslation message = new TextComponentTranslation("consort." + unlocalizedMessage, obj);
if (consortPrefix) {
message.getStyle().setColor(consort.getConsortType().getColor());
TextComponentTranslation entity = new TextComponentTranslation("entity." + s + ".name");
return new TextComponentTranslation("chat.type.text", entity, message);
} else
return message;
}
use of com.mraof.minestuck.world.WorldProviderLands in project Minestuck by mraof.
the class OreHandler method addOreSpawn.
public void addOreSpawn(IBlockState block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int chancesToSpawn, int minY, int maxY) {
// int maxPossY = minY + (maxY - 1);
int diffBtwnMinMaxY = maxY - minY;
IBlockState groundType = Blocks.STONE.getDefaultState();
if (world.provider instanceof WorldProviderLands)
groundType = ((ChunkProviderLands) world.provider.createChunkGenerator()).getGroundBlock();
if (block.getBlock() == MinestuckBlocks.oreCruxite)
block = BlockCruxiteOre.getBlockState(groundType);
if (block.getBlock() == MinestuckBlocks.oreUranium)
block = MinestuckBlocks.oreUranium.getBlockState(groundType);
for (int x = 0; x < chancesToSpawn; x++) {
int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(diffBtwnMinMaxY);
int posZ = blockZPos + random.nextInt(maxZ);
(new WorldGenMinable(block, maxVeinSize, new BlockStatePredicate(groundType))).generate(world, random, new BlockPos(posX, posY, posZ));
}
}
use of com.mraof.minestuck.world.WorldProviderLands in project Minestuck by mraof.
the class ChunkProviderLands method createBiomeGen.
public void createBiomeGen() {
BiomeProperties properties = new BiomeProperties(((WorldProviderLands) this.landWorld.provider).getDimensionName()).setTemperature(temperature).setRainfall(rainfall).setBaseBiome("medium");
if (temperature <= 0.1)
properties.setSnowEnabled();
biomeLands = new BiomeMinestuck(properties).setRegistryName("minestuck", "medium");
}
Aggregations