Replaced all spaces with tabs
This commit is contained in:
parent
d259dd923a
commit
1eafbc1955
|
@ -22,8 +22,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
@Mod(modid = Aether.MOD_ID, version = "v1.0.0")
|
||||
public class Aether
|
||||
{
|
||||
public class Aether {
|
||||
|
||||
public static final String MOD_ID = "aether_legacy";
|
||||
|
||||
|
@ -34,16 +33,14 @@ public class Aether
|
|||
public static CommonProxy proxy;
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
AetherRankings.initialization();
|
||||
AetherNetwork.preInitialization();
|
||||
AetherConfig.init(event.getModConfigurationDirectory());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
public void init(FMLInitializationEvent event) {
|
||||
BlocksAether.initialization();
|
||||
ItemsAether.initialization();
|
||||
AetherRegistries.register();
|
||||
|
@ -59,18 +56,15 @@ public class Aether
|
|||
CommonProxy.registerEvent(new AetherEventHandler());
|
||||
}
|
||||
|
||||
public static ResourceLocation locate(String location)
|
||||
{
|
||||
public static ResourceLocation locate(String location) {
|
||||
return new ResourceLocation(MOD_ID, location);
|
||||
}
|
||||
|
||||
public static String find(String location)
|
||||
{
|
||||
public static String find(String location) {
|
||||
return modAddress() + location;
|
||||
}
|
||||
|
||||
public static String modAddress()
|
||||
{
|
||||
public static String modAddress() {
|
||||
return MOD_ID + ":";
|
||||
}
|
||||
}
|
|
@ -5,8 +5,7 @@ import java.io.IOException;
|
|||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
public class AetherConfig
|
||||
{
|
||||
public class AetherConfig {
|
||||
|
||||
private static int max_life_shards;
|
||||
|
||||
|
@ -22,16 +21,12 @@ public class AetherConfig
|
|||
|
||||
private static int travel_dimension;
|
||||
|
||||
public static void init(File location)
|
||||
{
|
||||
public static void init(File location) {
|
||||
File newFile = new File(location + "/aether" + "/AetherI.cfg");
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
newFile.createNewFile();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
} catch (IOException e) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -58,53 +53,43 @@ public class AetherConfig
|
|||
config.save();
|
||||
}
|
||||
|
||||
public static int getAetherDimensionID()
|
||||
{
|
||||
public static int getAetherDimensionID() {
|
||||
return AetherConfig.aether_dimension_id;
|
||||
}
|
||||
|
||||
public static int getAetherBiomeID()
|
||||
{
|
||||
public static int getAetherBiomeID() {
|
||||
return AetherConfig.aether_biome_id;
|
||||
}
|
||||
|
||||
public static int getMaxLifeShards()
|
||||
{
|
||||
public static int getMaxLifeShards() {
|
||||
return AetherConfig.max_life_shards;
|
||||
}
|
||||
|
||||
public static int getTravelDimensionID()
|
||||
{
|
||||
public static int getTravelDimensionID() {
|
||||
return AetherConfig.travel_dimension;
|
||||
}
|
||||
|
||||
public static boolean shouldFloatWithBlock()
|
||||
{
|
||||
public static boolean shouldFloatWithBlock() {
|
||||
return AetherConfig.floating_block_collision;
|
||||
}
|
||||
|
||||
public static boolean triviaDisabled()
|
||||
{
|
||||
public static boolean triviaDisabled() {
|
||||
return AetherConfig.disable_trivia;
|
||||
}
|
||||
|
||||
public static boolean oldMobsEnabled()
|
||||
{
|
||||
public static boolean oldMobsEnabled() {
|
||||
return AetherConfig.old_mobs;
|
||||
}
|
||||
|
||||
public static boolean shouldLoadHolidayContent()
|
||||
{
|
||||
public static boolean shouldLoadHolidayContent() {
|
||||
return AetherConfig.christmas_content;
|
||||
}
|
||||
|
||||
public static boolean tallgrassEnabled()
|
||||
{
|
||||
public static boolean tallgrassEnabled() {
|
||||
return AetherConfig.tallgrass;
|
||||
}
|
||||
|
||||
public static boolean activateOnlyWithSkyroot()
|
||||
{
|
||||
public static boolean activateOnlyWithSkyroot() {
|
||||
return AetherConfig.skyrootBucketOnly;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,70 +34,54 @@ import cpw.mods.fml.common.eventhandler.Event;
|
|||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
|
||||
|
||||
public class AetherEventHandler
|
||||
{
|
||||
public class
|
||||
AetherEventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void checkBlockBannedEvent(PlayerInteractEvent event)
|
||||
{
|
||||
public void checkBlockBannedEvent(PlayerInteractEvent event) {
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
ItemStack currentStack = player.getCurrentEquippedItem();
|
||||
|
||||
if (player.dimension == AetherConfig.getAetherDimensionID())
|
||||
{
|
||||
if (currentStack != null)
|
||||
{
|
||||
if (currentStack.getItem() == Items.flint_and_steel || currentStack.getItem() == Item.getItemFromBlock(Blocks.torch) || currentStack.getItem() == Items.fire_charge)
|
||||
{
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
if (player.dimension == AetherConfig.getAetherDimensionID()) {
|
||||
if (currentStack != null) {
|
||||
if (currentStack.getItem() == Items.flint_and_steel || currentStack.getItem() == Item.getItemFromBlock(Blocks.torch) || currentStack.getItem() == Items.fire_charge) {
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
event.world.spawnParticle("smoke", event.x, event.y, event.z, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
else if (event.world.getBlock(event.x, event.y, event.z) == Blocks.bed)
|
||||
{
|
||||
} else if (event.world.getBlock(event.x, event.y, event.z) == Blocks.bed) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityInteract(EntityInteractEvent event)
|
||||
{
|
||||
if (event.target instanceof EntityAgeable)
|
||||
{
|
||||
public void onEntityInteract(EntityInteractEvent event) {
|
||||
if (event.target instanceof EntityAgeable) {
|
||||
ItemStack itemstack = event.entityPlayer.inventory.getCurrentItem();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() == ItemsAether.aether_spawn_egg)
|
||||
{
|
||||
if (!event.entityPlayer.worldObj.isRemote)
|
||||
{
|
||||
if (itemstack != null && itemstack.getItem() == ItemsAether.aether_spawn_egg) {
|
||||
if (!event.entityPlayer.worldObj.isRemote) {
|
||||
Class<?> oclass = EntitiesAether.getClassFromID(itemstack.getItemDamage());
|
||||
|
||||
if (oclass != null && oclass.isAssignableFrom(this.getClass()))
|
||||
{
|
||||
if (oclass != null && oclass.isAssignableFrom(this.getClass())) {
|
||||
EntityAgeable entityageable = ((EntityAgeable) event.target).createChild((EntityAgeable) event.target);
|
||||
|
||||
if (entityageable != null)
|
||||
{
|
||||
if (entityageable != null) {
|
||||
entityageable.setGrowingAge(-24000);
|
||||
entityageable.setLocationAndAngles(event.target.posX, event.target.posY, event.target.posZ, 0.0F, 0.0F);
|
||||
event.entityPlayer.worldObj.spawnEntityInWorld(entityageable);
|
||||
|
||||
if (itemstack.hasDisplayName())
|
||||
{
|
||||
if (itemstack.hasDisplayName()) {
|
||||
entityageable.setCustomNameTag(itemstack.getDisplayName());
|
||||
}
|
||||
|
||||
if (!event.entityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!event.entityPlayer.capabilities.isCreativeMode) {
|
||||
--itemstack.stackSize;
|
||||
|
||||
if (itemstack.stackSize <= 0)
|
||||
{
|
||||
if (itemstack.stackSize <= 0) {
|
||||
event.entityPlayer.inventory.setInventorySlotContents(event.entityPlayer.inventory.currentItem, (ItemStack) null);
|
||||
}
|
||||
}
|
||||
|
@ -107,24 +91,18 @@ public class AetherEventHandler
|
|||
}
|
||||
}
|
||||
|
||||
if (event.target instanceof EntityCow || event.target instanceof EntityFlyingCow)
|
||||
{
|
||||
if (event.target instanceof EntityCow || event.target instanceof EntityFlyingCow) {
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
ItemStack heldItem = player.getCurrentEquippedItem();
|
||||
|
||||
if (heldItem != null && heldItem.getItem() == ItemsAether.skyroot_bucket && EnumSkyrootBucketType.getType(heldItem.getItemDamage()) == EnumSkyrootBucketType.Empty)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (heldItem != null && heldItem.getItem() == ItemsAether.skyroot_bucket && EnumSkyrootBucketType.getType(heldItem.getItemDamage()) == EnumSkyrootBucketType.Empty) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
--heldItem.stackSize;
|
||||
}
|
||||
|
||||
if (heldItem.stackSize <= 0)
|
||||
{
|
||||
if (heldItem.stackSize <= 0) {
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta));
|
||||
}
|
||||
else if (!player.inventory.addItemStackToInventory(new ItemStack(ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta)))
|
||||
{
|
||||
} else if (!player.inventory.addItemStackToInventory(new ItemStack(ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta))) {
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta), false);
|
||||
}
|
||||
}
|
||||
|
@ -132,8 +110,7 @@ public class AetherEventHandler
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onFillBucket(FillBucketEvent event)
|
||||
{
|
||||
public void onFillBucket(FillBucketEvent event) {
|
||||
World worldObj = event.world;
|
||||
MovingObjectPosition target = event.target;
|
||||
ItemStack stack = event.current;
|
||||
|
@ -144,50 +121,39 @@ public class AetherEventHandler
|
|||
|
||||
boolean validDimension = (player.dimension == AetherConfig.getTravelDimensionID() || player.dimension == AetherConfig.getAetherDimensionID());
|
||||
|
||||
if (target != null && target.typeOfHit == MovingObjectType.BLOCK && validDimension)
|
||||
{
|
||||
if (target != null && target.typeOfHit == MovingObjectType.BLOCK && validDimension) {
|
||||
int i = target.blockX;
|
||||
int j = target.blockY;
|
||||
int k = target.blockZ;
|
||||
|
||||
if (target.sideHit == 0)
|
||||
{
|
||||
if (target.sideHit == 0) {
|
||||
--j;
|
||||
}
|
||||
|
||||
if (target.sideHit == 1)
|
||||
{
|
||||
if (target.sideHit == 1) {
|
||||
++j;
|
||||
}
|
||||
|
||||
if (target.sideHit == 2)
|
||||
{
|
||||
if (target.sideHit == 2) {
|
||||
--k;
|
||||
}
|
||||
|
||||
if (target.sideHit == 3)
|
||||
{
|
||||
if (target.sideHit == 3) {
|
||||
++k;
|
||||
}
|
||||
|
||||
if (target.sideHit == 4)
|
||||
{
|
||||
if (target.sideHit == 4) {
|
||||
--i;
|
||||
}
|
||||
|
||||
if (isWater)
|
||||
{
|
||||
if (((BlockAetherPortal) BlocksAether.aether_portal).trySpawnPortal(worldObj, i, j, k))
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (stack.getItem() == ItemsAether.skyroot_bucket && stack.getItemDamage() == 1)
|
||||
{
|
||||
if (isWater) {
|
||||
if (((BlockAetherPortal) BlocksAether.aether_portal).trySpawnPortal(worldObj, i, j, k)) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
if (stack.getItem() == ItemsAether.skyroot_bucket && stack.getItemDamage() == 1) {
|
||||
event.result = new ItemStack(ItemsAether.skyroot_bucket);
|
||||
}
|
||||
|
||||
if (stack.getItem() == Items.water_bucket)
|
||||
{
|
||||
if (stack.getItem() == Items.water_bucket) {
|
||||
event.result = new ItemStack(Items.bucket);
|
||||
}
|
||||
}
|
||||
|
@ -196,19 +162,15 @@ public class AetherEventHandler
|
|||
}
|
||||
}
|
||||
|
||||
if (isLava && player.dimension == AetherConfig.getAetherDimensionID())
|
||||
{
|
||||
if (player.capabilities.isCreativeMode && player.isSneaking())
|
||||
{
|
||||
if (isLava && player.dimension == AetherConfig.getAetherDimensionID()) {
|
||||
if (player.capabilities.isCreativeMode && player.isSneaking()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (worldObj.isAirBlock(i, j, k))
|
||||
{
|
||||
if (worldObj.isAirBlock(i, j, k)) {
|
||||
worldObj.setBlock(i, j, k, BlocksAether.aerogel);
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
event.result = new ItemStack(Items.bucket);
|
||||
}
|
||||
}
|
||||
|
@ -219,39 +181,29 @@ public class AetherEventHandler
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onCrafting(ItemCraftedEvent event)
|
||||
{
|
||||
if (this.isGravititeTool(event.crafting.getItem()))
|
||||
{
|
||||
public void onCrafting(ItemCraftedEvent event) {
|
||||
if (this.isGravititeTool(event.crafting.getItem())) {
|
||||
event.player.triggerAchievement(AchievementsAether.grav_tools);
|
||||
}
|
||||
else if (event.crafting.getItem() == Item.getItemFromBlock(BlocksAether.enchanter))
|
||||
{
|
||||
} else if (event.crafting.getItem() == Item.getItemFromBlock(BlocksAether.enchanter)) {
|
||||
event.player.triggerAchievement(AchievementsAether.enchanter);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityDropLoot(LivingDropsEvent event)
|
||||
{
|
||||
if (event.source instanceof EntityDamageSource)
|
||||
{
|
||||
public void onEntityDropLoot(LivingDropsEvent event) {
|
||||
if (event.source instanceof EntityDamageSource) {
|
||||
EntityLivingBase entity = event.entityLiving;
|
||||
EntityDamageSource source = (EntityDamageSource) event.source;
|
||||
|
||||
if (source.getEntity() instanceof EntityPlayer)
|
||||
{
|
||||
if (source.getEntity() instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) source.getEntity();
|
||||
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||
|
||||
if (currentItem != null && currentItem.getItem() instanceof ItemSkyrootSword && !(entity instanceof EntityPlayer) && !(entity instanceof EntityWither) && !(entity instanceof EntityValkyrie))
|
||||
{
|
||||
for (EntityItem items : event.drops)
|
||||
{
|
||||
if (currentItem != null && currentItem.getItem() instanceof ItemSkyrootSword && !(entity instanceof EntityPlayer) && !(entity instanceof EntityWither) && !(entity instanceof EntityValkyrie)) {
|
||||
for (EntityItem items : event.drops) {
|
||||
ItemStack stack = items.getEntityItem();
|
||||
|
||||
if (!(stack.getItem() instanceof ItemDungeonKey) && stack.getItem() != ItemsAether.victory_medal && stack.getItem() != Items.skull)
|
||||
{
|
||||
if (!(stack.getItem() instanceof ItemDungeonKey) && stack.getItem() != ItemsAether.victory_medal && stack.getItem() != Items.skull) {
|
||||
EntityItem item = new EntityItem(entity.worldObj, entity.posX, entity.posY, entity.posZ, items.getEntityItem());
|
||||
|
||||
entity.worldObj.spawnEntityInWorld(item);
|
||||
|
@ -262,8 +214,7 @@ public class AetherEventHandler
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isGravititeTool(Item stackID)
|
||||
{
|
||||
public boolean isGravititeTool(Item stackID) {
|
||||
return stackID == ItemsAether.gravitite_shovel || stackID == ItemsAether.gravitite_axe || stackID == ItemsAether.gravitite_pickaxe;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraftforge.common.MinecraftForge;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
public class CommonProxy
|
||||
{
|
||||
public class CommonProxy {
|
||||
|
||||
public static int berryBushRenderID;
|
||||
|
||||
|
@ -13,28 +12,23 @@ public class CommonProxy
|
|||
|
||||
public static int aetherFlowerRenderID;
|
||||
|
||||
public void init()
|
||||
{
|
||||
public void init() {
|
||||
|
||||
}
|
||||
|
||||
public void openSunAltar()
|
||||
{
|
||||
public void openSunAltar() {
|
||||
|
||||
}
|
||||
|
||||
public void sendMessage(EntityPlayer player, String text)
|
||||
{
|
||||
public void sendMessage(EntityPlayer player, String text) {
|
||||
|
||||
}
|
||||
|
||||
public EntityPlayer getPlayer()
|
||||
{
|
||||
public EntityPlayer getPlayer() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void registerEvent(Object event)
|
||||
{
|
||||
public static void registerEvent(Object event) {
|
||||
FMLCommonHandler.instance().bus().register(event);
|
||||
MinecraftForge.EVENT_BUS.register(event);
|
||||
}
|
||||
|
|
|
@ -17,8 +17,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class AetherAPI
|
||||
{
|
||||
public class AetherAPI {
|
||||
|
||||
private static final HashMap<ResourceLocation, AetherAccessory> iAccessoryRegistry = new HashMap<ResourceLocation, AetherAccessory>(4096);
|
||||
private static final HashMap<ResourceLocation, AetherEnchantment> iEnchantmentRegistry = new HashMap<ResourceLocation, AetherEnchantment>(4096);
|
||||
|
@ -29,13 +28,11 @@ public class AetherAPI
|
|||
|
||||
private static final AetherAPI instance = new AetherAPI();
|
||||
|
||||
public static final IPlayerAether get(EntityPlayer playerIn)
|
||||
{
|
||||
public static final IPlayerAether get(EntityPlayer playerIn) {
|
||||
return (IPlayerAether) playerIn.getExtendedProperties("aether_legacy:player_aether");
|
||||
}
|
||||
|
||||
public AetherAccessory register(AetherAccessory type)
|
||||
{
|
||||
public AetherAccessory register(AetherAccessory type) {
|
||||
ItemStack stack = type.getAccessoryStack();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
|
||||
|
@ -44,8 +41,7 @@ public class AetherAPI
|
|||
return type;
|
||||
}
|
||||
|
||||
public AetherEnchantment register(AetherEnchantment type)
|
||||
{
|
||||
public AetherEnchantment register(AetherEnchantment type) {
|
||||
ItemStack stack = type.getInput();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
|
||||
|
@ -54,8 +50,7 @@ public class AetherAPI
|
|||
return type;
|
||||
}
|
||||
|
||||
public AetherEnchantmentFuel register(AetherEnchantmentFuel type)
|
||||
{
|
||||
public AetherEnchantmentFuel register(AetherEnchantmentFuel type) {
|
||||
ItemStack stack = type.getFuelStack();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
|
||||
|
@ -64,8 +59,7 @@ public class AetherAPI
|
|||
return type;
|
||||
}
|
||||
|
||||
public AetherFreezable register(AetherFreezable type)
|
||||
{
|
||||
public AetherFreezable register(AetherFreezable type) {
|
||||
ItemStack stack = type.getInput();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
|
||||
|
@ -74,8 +68,7 @@ public class AetherAPI
|
|||
return type;
|
||||
}
|
||||
|
||||
public AetherFreezableFuel register(AetherFreezableFuel type)
|
||||
{
|
||||
public AetherFreezableFuel register(AetherFreezableFuel type) {
|
||||
ItemStack stack = type.getFuelStack();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
|
||||
|
@ -84,107 +77,87 @@ public class AetherAPI
|
|||
return type;
|
||||
}
|
||||
|
||||
public AetherMoaType register(String modId, String name, AetherMoaType type)
|
||||
{
|
||||
public AetherMoaType register(String modId, String name, AetherMoaType type) {
|
||||
iMoaTypeRegistry.put(new ResourceLocation(modId, name), (AetherMoaType) type.setRegistryName(modId, name));
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
public AetherMoaType register(ResourceLocation registryName, AetherMoaType type)
|
||||
{
|
||||
public AetherMoaType register(ResourceLocation registryName, AetherMoaType type) {
|
||||
iMoaTypeRegistry.put(registryName, (AetherMoaType) type.setRegistryName(registryName));
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
public boolean isAccessory(ItemStack stack)
|
||||
{
|
||||
public boolean isAccessory(ItemStack stack) {
|
||||
return iAccessoryRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
||||
}
|
||||
|
||||
public AetherAccessory getAccessory(ItemStack stack)
|
||||
{
|
||||
public AetherAccessory getAccessory(ItemStack stack) {
|
||||
return iAccessoryRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
||||
}
|
||||
|
||||
public boolean hasEnchantment(ItemStack stack)
|
||||
{
|
||||
public boolean hasEnchantment(ItemStack stack) {
|
||||
return iEnchantmentRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
||||
}
|
||||
|
||||
public AetherEnchantment getEnchantment(ItemStack stack)
|
||||
{
|
||||
public AetherEnchantment getEnchantment(ItemStack stack) {
|
||||
return iEnchantmentRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
||||
}
|
||||
|
||||
public boolean isEnchantmentFuel(ItemStack stack)
|
||||
{
|
||||
public boolean isEnchantmentFuel(ItemStack stack) {
|
||||
return iEnchantmentFuelRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
||||
}
|
||||
|
||||
public AetherEnchantmentFuel getEnchantmentFuel(ItemStack stack)
|
||||
{
|
||||
public AetherEnchantmentFuel getEnchantmentFuel(ItemStack stack) {
|
||||
return iEnchantmentFuelRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
||||
}
|
||||
|
||||
public boolean hasFreezable(ItemStack stack)
|
||||
{
|
||||
public boolean hasFreezable(ItemStack stack) {
|
||||
return iFreezableRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
||||
}
|
||||
|
||||
public AetherFreezable getFreezable(ItemStack stack)
|
||||
{
|
||||
public AetherFreezable getFreezable(ItemStack stack) {
|
||||
return iFreezableRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
||||
}
|
||||
|
||||
public boolean isFreezableFuel(ItemStack stack)
|
||||
{
|
||||
public boolean isFreezableFuel(ItemStack stack) {
|
||||
return iFreezableFuelRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
||||
}
|
||||
|
||||
public AetherFreezableFuel getFreezableFuel(ItemStack stack)
|
||||
{
|
||||
public AetherFreezableFuel getFreezableFuel(ItemStack stack) {
|
||||
return iFreezableFuelRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
||||
}
|
||||
|
||||
public List<AetherEnchantment> getEnchantmentValues()
|
||||
{
|
||||
public List<AetherEnchantment> getEnchantmentValues() {
|
||||
return new ArrayList<AetherEnchantment>(iEnchantmentRegistry.values());
|
||||
}
|
||||
|
||||
public List<AetherFreezable> getFreezableValues()
|
||||
{
|
||||
public List<AetherFreezable> getFreezableValues() {
|
||||
return new ArrayList<AetherFreezable>(iFreezableRegistry.values());
|
||||
}
|
||||
|
||||
public List<AetherMoaType> getMoaTypeValues()
|
||||
{
|
||||
public List<AetherMoaType> getMoaTypeValues() {
|
||||
return new ArrayList<AetherMoaType>(iMoaTypeRegistry.values());
|
||||
}
|
||||
|
||||
public int getMoaTypeId(AetherMoaType type)
|
||||
{
|
||||
public int getMoaTypeId(AetherMoaType type) {
|
||||
return this.getMoaTypeValues().indexOf(type);
|
||||
}
|
||||
|
||||
public AetherMoaType getMoaType(int id)
|
||||
{
|
||||
public AetherMoaType getMoaType(int id) {
|
||||
return this.getMoaTypeValues().get(id);
|
||||
}
|
||||
|
||||
public AetherMoaType getRandomMoaType()
|
||||
{
|
||||
public AetherMoaType getRandomMoaType() {
|
||||
return this.getMoaTypeValues().get(new Random().nextInt(this.getMoaTypeSize()));
|
||||
}
|
||||
|
||||
public int getMoaTypeSize()
|
||||
{
|
||||
public int getMoaTypeSize() {
|
||||
return this.getMoaTypeValues().size();
|
||||
}
|
||||
|
||||
public static AetherAPI instance()
|
||||
{
|
||||
public static AetherAPI instance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,34 +2,29 @@ package com.legacy.aether.api;
|
|||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RegistryEntry
|
||||
{
|
||||
public class RegistryEntry {
|
||||
|
||||
private ResourceLocation location;
|
||||
|
||||
public RegistryEntry setRegistryName(String modid, String location)
|
||||
{
|
||||
public RegistryEntry setRegistryName(String modid, String location) {
|
||||
this.location = new ResourceLocation(modid, location);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public RegistryEntry setRegistryName(String location)
|
||||
{
|
||||
public RegistryEntry setRegistryName(String location) {
|
||||
this.location = new ResourceLocation(location);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public RegistryEntry setRegistryName(ResourceLocation location)
|
||||
{
|
||||
public RegistryEntry setRegistryName(ResourceLocation location) {
|
||||
this.location = location;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResourceLocation getRegistryName()
|
||||
{
|
||||
public ResourceLocation getRegistryName() {
|
||||
return this.location;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,7 @@ package com.legacy.aether.api.accessories;
|
|||
|
||||
import net.minecraft.util.ObjectIntIdentityMap;
|
||||
|
||||
public enum AccessoryType
|
||||
{
|
||||
public enum AccessoryType {
|
||||
RING("ring", 11, 3),
|
||||
EXTRA_RING("ring", 11, 3),
|
||||
PENDANT("pendant", 16, 7),
|
||||
|
@ -17,30 +16,25 @@ public enum AccessoryType
|
|||
|
||||
private String displayName;
|
||||
|
||||
AccessoryType(String displayName, int maxDamage, int damageReduced)
|
||||
{
|
||||
AccessoryType(String displayName, int maxDamage, int damageReduced) {
|
||||
this.displayName = displayName;
|
||||
this.maxDamage = maxDamage;
|
||||
this.damagedReduced = damageReduced;
|
||||
}
|
||||
|
||||
public int getMaxDamage()
|
||||
{
|
||||
public int getMaxDamage() {
|
||||
return this.maxDamage;
|
||||
}
|
||||
|
||||
public int getDamageReduced()
|
||||
{
|
||||
public int getDamageReduced() {
|
||||
return this.damagedReduced;
|
||||
}
|
||||
|
||||
public String getDisplayName()
|
||||
{
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public static ObjectIntIdentityMap createCompleteList()
|
||||
{
|
||||
public static ObjectIntIdentityMap createCompleteList() {
|
||||
ObjectIntIdentityMap identityMap = new ObjectIntIdentityMap();
|
||||
|
||||
identityMap.func_148746_a(PENDANT, 0);
|
||||
|
|
|
@ -6,8 +6,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AetherAccessory extends RegistryEntry
|
||||
{
|
||||
public class AetherAccessory extends RegistryEntry {
|
||||
|
||||
private ItemStack accessoryStack;
|
||||
|
||||
|
@ -15,18 +14,15 @@ public class AetherAccessory extends RegistryEntry
|
|||
|
||||
private AccessoryType extraType;
|
||||
|
||||
public AetherAccessory(Block item, AccessoryType type)
|
||||
{
|
||||
public AetherAccessory(Block item, AccessoryType type) {
|
||||
this(new ItemStack(item), type);
|
||||
}
|
||||
|
||||
public AetherAccessory(Item item, AccessoryType type)
|
||||
{
|
||||
public AetherAccessory(Item item, AccessoryType type) {
|
||||
this(new ItemStack(item), type);
|
||||
}
|
||||
|
||||
public AetherAccessory(ItemStack stack, AccessoryType type)
|
||||
{
|
||||
public AetherAccessory(ItemStack stack, AccessoryType type) {
|
||||
this.accessoryType = type;
|
||||
this.accessoryStack = stack;
|
||||
this.extraType = type == AccessoryType.RING ? AccessoryType.EXTRA_RING : type == AccessoryType.MISC ? AccessoryType.EXTRA_MISC : null;
|
||||
|
@ -34,18 +30,15 @@ public class AetherAccessory extends RegistryEntry
|
|||
this.setRegistryName(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
}
|
||||
|
||||
public AccessoryType getAccessoryType()
|
||||
{
|
||||
public AccessoryType getAccessoryType() {
|
||||
return this.accessoryType;
|
||||
}
|
||||
|
||||
public AccessoryType getExtraType()
|
||||
{
|
||||
public AccessoryType getExtraType() {
|
||||
return this.extraType;
|
||||
}
|
||||
|
||||
public ItemStack getAccessoryStack()
|
||||
{
|
||||
public ItemStack getAccessoryStack() {
|
||||
return this.accessoryStack;
|
||||
}
|
||||
}
|
|
@ -6,60 +6,49 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AetherEnchantment extends RegistryEntry
|
||||
{
|
||||
public class AetherEnchantment extends RegistryEntry {
|
||||
|
||||
public int timeRequired;
|
||||
|
||||
public ItemStack input, output;
|
||||
|
||||
public AetherEnchantment(ItemStack input, Block output, int timeRequired)
|
||||
{
|
||||
public AetherEnchantment(ItemStack input, Block output, int timeRequired) {
|
||||
this(input, new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherEnchantment(Block input, ItemStack output, int timeRequired)
|
||||
{
|
||||
public AetherEnchantment(Block input, ItemStack output, int timeRequired) {
|
||||
this(new ItemStack(input), output, timeRequired);
|
||||
}
|
||||
|
||||
public AetherEnchantment(Block input, Block output, int timeRequired)
|
||||
{
|
||||
public AetherEnchantment(Block input, Block output, int timeRequired) {
|
||||
this(new ItemStack(input), new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherEnchantment(ItemStack input, Item output, int timeRequired)
|
||||
{
|
||||
public AetherEnchantment(ItemStack input, Item output, int timeRequired) {
|
||||
this(input, new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherEnchantment(Item input, ItemStack output, int timeRequired)
|
||||
{
|
||||
public AetherEnchantment(Item input, ItemStack output, int timeRequired) {
|
||||
this(new ItemStack(input), output, timeRequired);
|
||||
}
|
||||
|
||||
public AetherEnchantment(Item input, Item output, int timeRequired)
|
||||
{
|
||||
public AetherEnchantment(Item input, Item output, int timeRequired) {
|
||||
this(new ItemStack(input), new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherEnchantment(Block input, Item output, int timeRequired)
|
||||
{
|
||||
public AetherEnchantment(Block input, Item output, int timeRequired) {
|
||||
this(new ItemStack(input), new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherEnchantment(Item input, Block output, int timeRequired)
|
||||
{
|
||||
public AetherEnchantment(Item input, Block output, int timeRequired) {
|
||||
this(new ItemStack(input), new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherEnchantment(Item result, int timeRequired)
|
||||
{
|
||||
public AetherEnchantment(Item result, int timeRequired) {
|
||||
this(new ItemStack(result), new ItemStack(result), timeRequired);
|
||||
}
|
||||
|
||||
public AetherEnchantment(ItemStack input, ItemStack output, int timeRequired)
|
||||
{
|
||||
public AetherEnchantment(ItemStack input, ItemStack output, int timeRequired) {
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
this.timeRequired = timeRequired;
|
||||
|
@ -67,26 +56,21 @@ public class AetherEnchantment extends RegistryEntry
|
|||
this.setRegistryName(input.getItem().getUnlocalizedName().toString() + "_meta_" + (input.isItemStackDamageable() ? 0 : input.getItemDamage()));
|
||||
}
|
||||
|
||||
public int getTimeRequired()
|
||||
{
|
||||
public int getTimeRequired() {
|
||||
return this.timeRequired;
|
||||
}
|
||||
|
||||
public ItemStack getInput()
|
||||
{
|
||||
public ItemStack getInput() {
|
||||
return this.input;
|
||||
}
|
||||
|
||||
public ItemStack getOutput()
|
||||
{
|
||||
public ItemStack getOutput() {
|
||||
return this.output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj instanceof AetherEnchantment)
|
||||
{
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof AetherEnchantment) {
|
||||
AetherEnchantment freezable = (AetherEnchantment) obj;
|
||||
|
||||
boolean inputCheck = this.getInput().getItem() == freezable.getInput().getItem() && this.getInput().getItemDamage() == freezable.getInput().getItemDamage();
|
||||
|
|
|
@ -6,46 +6,38 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AetherEnchantmentFuel extends RegistryEntry
|
||||
{
|
||||
public class AetherEnchantmentFuel extends RegistryEntry {
|
||||
|
||||
public int timeGiven;
|
||||
|
||||
public ItemStack fuelStack;
|
||||
|
||||
public AetherEnchantmentFuel(Block fuelBlock, int timeGiven)
|
||||
{
|
||||
public AetherEnchantmentFuel(Block fuelBlock, int timeGiven) {
|
||||
this(new ItemStack(fuelBlock), timeGiven);
|
||||
}
|
||||
|
||||
public AetherEnchantmentFuel(Item fuelItem, int timeGiven)
|
||||
{
|
||||
public AetherEnchantmentFuel(Item fuelItem, int timeGiven) {
|
||||
this(new ItemStack(fuelItem), timeGiven);
|
||||
}
|
||||
|
||||
public AetherEnchantmentFuel(ItemStack fuelStack, int timeGiven)
|
||||
{
|
||||
public AetherEnchantmentFuel(ItemStack fuelStack, int timeGiven) {
|
||||
this.timeGiven = timeGiven;
|
||||
this.fuelStack = fuelStack;
|
||||
|
||||
this.setRegistryName(fuelStack.getItem().getUnlocalizedName().toString() + "_meta_" + (fuelStack.isItemStackDamageable() ? 0 : fuelStack.getItemDamage()));
|
||||
}
|
||||
|
||||
public int getTimeGiven()
|
||||
{
|
||||
public int getTimeGiven() {
|
||||
return this.timeGiven;
|
||||
}
|
||||
|
||||
public ItemStack getFuelStack()
|
||||
{
|
||||
public ItemStack getFuelStack() {
|
||||
return this.fuelStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj instanceof AetherEnchantmentFuel)
|
||||
{
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof AetherEnchantmentFuel) {
|
||||
AetherEnchantmentFuel fuel = (AetherEnchantmentFuel) obj;
|
||||
|
||||
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem() && this.getFuelStack().getItemDamage() == fuel.getFuelStack().getItemDamage();
|
||||
|
|
|
@ -13,11 +13,9 @@ import com.legacy.aether.api.events.moas.MoaHatchEvent;
|
|||
import com.legacy.aether.api.freezables.AetherFreezable;
|
||||
import com.legacy.aether.api.moa.AetherMoaType;
|
||||
|
||||
public class AetherHooks
|
||||
{
|
||||
public class AetherHooks {
|
||||
|
||||
public static boolean isValidAccessory(EntityPlayer player, AetherAccessory accessory)
|
||||
{
|
||||
public static boolean isValidAccessory(EntityPlayer player, AetherAccessory accessory) {
|
||||
ValidAccessoryEvent event = new ValidAccessoryEvent(player, accessory);
|
||||
|
||||
if (MinecraftForge.EVENT_BUS.post(event)) return false;
|
||||
|
@ -25,29 +23,25 @@ public class AetherHooks
|
|||
return !event.isCanceled();
|
||||
}
|
||||
|
||||
public static void onMoaHatched(AetherMoaType type, TileEntity incubator)
|
||||
{
|
||||
public static void onMoaHatched(AetherMoaType type, TileEntity incubator) {
|
||||
MoaHatchEvent event = new MoaHatchEvent(type, incubator);
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
}
|
||||
|
||||
public static void onItemEnchant(TileEntity enchanter, AetherEnchantment enchantment)
|
||||
{
|
||||
public static void onItemEnchant(TileEntity enchanter, AetherEnchantment enchantment) {
|
||||
AetherEnchantmentEvent.EnchantEvent event = new AetherEnchantmentEvent.EnchantEvent(enchanter, enchantment);
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
}
|
||||
|
||||
public static void onItemFreeze(TileEntity freezer, AetherFreezable freezable)
|
||||
{
|
||||
public static void onItemFreeze(TileEntity freezer, AetherFreezable freezable) {
|
||||
AetherFreezableEvent.FreezeEvent event = new AetherFreezableEvent.FreezeEvent(freezer, freezable);
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
}
|
||||
|
||||
public static int onSetEnchantmentTime(TileEntity enchanter, AetherEnchantment enchantment, int original)
|
||||
{
|
||||
public static int onSetEnchantmentTime(TileEntity enchanter, AetherEnchantment enchantment, int original) {
|
||||
AetherEnchantmentEvent.SetTimeEvent event = new AetherEnchantmentEvent.SetTimeEvent(enchanter, enchantment, original);
|
||||
|
||||
if (MinecraftForge.EVENT_BUS.post(event)) return original;
|
||||
|
@ -55,8 +49,7 @@ public class AetherHooks
|
|||
return event.getNewTime();
|
||||
}
|
||||
|
||||
public static int onSetFreezableTime(TileEntity freezer, AetherFreezable freezable, int original)
|
||||
{
|
||||
public static int onSetFreezableTime(TileEntity freezer, AetherFreezable freezable, int original) {
|
||||
AetherFreezableEvent.SetTimeEvent event = new AetherFreezableEvent.SetTimeEvent(freezer, freezable, original);
|
||||
|
||||
if (MinecraftForge.EVENT_BUS.post(event)) return original;
|
||||
|
|
|
@ -4,18 +4,15 @@ import com.legacy.aether.api.accessories.AetherAccessory;
|
|||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
public class AetherAccessoryEvent extends Event
|
||||
{
|
||||
public class AetherAccessoryEvent extends Event {
|
||||
|
||||
private AetherAccessory accessory;
|
||||
|
||||
public AetherAccessoryEvent(AetherAccessory accessory)
|
||||
{
|
||||
public AetherAccessoryEvent(AetherAccessory accessory) {
|
||||
this.accessory = accessory;
|
||||
}
|
||||
|
||||
public AetherAccessory getAetherAccessory()
|
||||
{
|
||||
public AetherAccessory getAetherAccessory() {
|
||||
return this.accessory;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,11 +7,9 @@ import com.legacy.aether.api.accessories.AetherAccessory;
|
|||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
|
||||
@Cancelable
|
||||
public class ValidAccessoryEvent extends AetherAccessoryEvent
|
||||
{
|
||||
public class ValidAccessoryEvent extends AetherAccessoryEvent {
|
||||
|
||||
public ValidAccessoryEvent(EntityPlayer player, AetherAccessory accessory)
|
||||
{
|
||||
public ValidAccessoryEvent(EntityPlayer player, AetherAccessory accessory) {
|
||||
super(accessory);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,16 +6,13 @@ import com.legacy.aether.api.enchantments.AetherEnchantment;
|
|||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
public class AetherEnchantmentEvent extends Event
|
||||
{
|
||||
public class AetherEnchantmentEvent extends Event {
|
||||
|
||||
public AetherEnchantmentEvent()
|
||||
{
|
||||
public AetherEnchantmentEvent() {
|
||||
|
||||
}
|
||||
|
||||
public static class SetTimeEvent extends AetherEnchantmentEvent
|
||||
{
|
||||
public static class SetTimeEvent extends AetherEnchantmentEvent {
|
||||
private TileEntity tileEntity;
|
||||
|
||||
private AetherEnchantment enchantment;
|
||||
|
@ -24,8 +21,7 @@ public class AetherEnchantmentEvent extends Event
|
|||
|
||||
private int newTime;
|
||||
|
||||
public SetTimeEvent(TileEntity tileEntity, AetherEnchantment enchantment, int original)
|
||||
{
|
||||
public SetTimeEvent(TileEntity tileEntity, AetherEnchantment enchantment, int original) {
|
||||
this.tileEntity = tileEntity;
|
||||
this.enchantment = enchantment;
|
||||
this.original = original;
|
||||
|
@ -33,51 +29,42 @@ public class AetherEnchantmentEvent extends Event
|
|||
this.setNewTime(original);
|
||||
}
|
||||
|
||||
public TileEntity getTileEntity()
|
||||
{
|
||||
public TileEntity getTileEntity() {
|
||||
return this.tileEntity;
|
||||
}
|
||||
|
||||
public AetherEnchantment getEnchantment()
|
||||
{
|
||||
public AetherEnchantment getEnchantment() {
|
||||
return this.enchantment;
|
||||
}
|
||||
|
||||
public int getOriginal()
|
||||
{
|
||||
public int getOriginal() {
|
||||
return this.original;
|
||||
}
|
||||
|
||||
public int getNewTime()
|
||||
{
|
||||
public int getNewTime() {
|
||||
return this.newTime;
|
||||
}
|
||||
|
||||
public void setNewTime(int newTime)
|
||||
{
|
||||
public void setNewTime(int newTime) {
|
||||
this.newTime = newTime;
|
||||
}
|
||||
}
|
||||
|
||||
public static class EnchantEvent extends AetherEnchantmentEvent
|
||||
{
|
||||
public static class EnchantEvent extends AetherEnchantmentEvent {
|
||||
private TileEntity tileEntity;
|
||||
|
||||
private AetherEnchantment enchantent;
|
||||
|
||||
public EnchantEvent(TileEntity tileEntity, AetherEnchantment enchantment)
|
||||
{
|
||||
public EnchantEvent(TileEntity tileEntity, AetherEnchantment enchantment) {
|
||||
this.tileEntity = tileEntity;
|
||||
this.enchantent = enchantment;
|
||||
}
|
||||
|
||||
public TileEntity getTileEntity()
|
||||
{
|
||||
public TileEntity getTileEntity() {
|
||||
return this.tileEntity;
|
||||
}
|
||||
|
||||
public AetherEnchantment getEnchantment()
|
||||
{
|
||||
public AetherEnchantment getEnchantment() {
|
||||
return this.enchantent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,16 +6,13 @@ import com.legacy.aether.api.freezables.AetherFreezable;
|
|||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
public class AetherFreezableEvent extends Event
|
||||
{
|
||||
public class AetherFreezableEvent extends Event {
|
||||
|
||||
public AetherFreezableEvent()
|
||||
{
|
||||
public AetherFreezableEvent() {
|
||||
|
||||
}
|
||||
|
||||
public static class SetTimeEvent extends AetherFreezableEvent
|
||||
{
|
||||
public static class SetTimeEvent extends AetherFreezableEvent {
|
||||
private TileEntity tileEntity;
|
||||
|
||||
private AetherFreezable freezable;
|
||||
|
@ -24,8 +21,7 @@ public class AetherFreezableEvent extends Event
|
|||
|
||||
private int newTime;
|
||||
|
||||
public SetTimeEvent(TileEntity tileEntity, AetherFreezable freezable, int original)
|
||||
{
|
||||
public SetTimeEvent(TileEntity tileEntity, AetherFreezable freezable, int original) {
|
||||
this.tileEntity = tileEntity;
|
||||
this.freezable = freezable;
|
||||
this.original = original;
|
||||
|
@ -33,51 +29,42 @@ public class AetherFreezableEvent extends Event
|
|||
this.setNewTime(original);
|
||||
}
|
||||
|
||||
public TileEntity getTileEntity()
|
||||
{
|
||||
public TileEntity getTileEntity() {
|
||||
return this.tileEntity;
|
||||
}
|
||||
|
||||
public AetherFreezable getFreezable()
|
||||
{
|
||||
public AetherFreezable getFreezable() {
|
||||
return this.freezable;
|
||||
}
|
||||
|
||||
public int getOriginal()
|
||||
{
|
||||
public int getOriginal() {
|
||||
return this.original;
|
||||
}
|
||||
|
||||
public int getNewTime()
|
||||
{
|
||||
public int getNewTime() {
|
||||
return this.newTime;
|
||||
}
|
||||
|
||||
public void setNewTime(int newTime)
|
||||
{
|
||||
public void setNewTime(int newTime) {
|
||||
this.newTime = newTime;
|
||||
}
|
||||
}
|
||||
|
||||
public static class FreezeEvent extends AetherFreezableEvent
|
||||
{
|
||||
public static class FreezeEvent extends AetherFreezableEvent {
|
||||
private TileEntity tileEntity;
|
||||
|
||||
private AetherFreezable freezable;
|
||||
|
||||
public FreezeEvent(TileEntity tileEntity, AetherFreezable freezable)
|
||||
{
|
||||
public FreezeEvent(TileEntity tileEntity, AetherFreezable freezable) {
|
||||
this.tileEntity = tileEntity;
|
||||
this.freezable = freezable;
|
||||
}
|
||||
|
||||
public TileEntity getTileEntity()
|
||||
{
|
||||
public TileEntity getTileEntity() {
|
||||
return this.tileEntity;
|
||||
}
|
||||
|
||||
public AetherFreezable getFreezable()
|
||||
{
|
||||
public AetherFreezable getFreezable() {
|
||||
return this.freezable;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,18 +4,15 @@ import com.legacy.aether.api.moa.AetherMoaType;
|
|||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
public class MoaEvent extends Event
|
||||
{
|
||||
public class MoaEvent extends Event {
|
||||
|
||||
private AetherMoaType moaType;
|
||||
|
||||
public MoaEvent(AetherMoaType moaType)
|
||||
{
|
||||
public MoaEvent(AetherMoaType moaType) {
|
||||
this.moaType = moaType;
|
||||
}
|
||||
|
||||
public AetherMoaType getMoaType()
|
||||
{
|
||||
public AetherMoaType getMoaType() {
|
||||
return this.moaType;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,20 +4,17 @@ import net.minecraft.tileentity.TileEntity;
|
|||
|
||||
import com.legacy.aether.api.moa.AetherMoaType;
|
||||
|
||||
public class MoaHatchEvent extends MoaEvent
|
||||
{
|
||||
public class MoaHatchEvent extends MoaEvent {
|
||||
|
||||
private TileEntity incubator;
|
||||
|
||||
public MoaHatchEvent(AetherMoaType moaType, TileEntity incubator)
|
||||
{
|
||||
public MoaHatchEvent(AetherMoaType moaType, TileEntity incubator) {
|
||||
super(moaType);
|
||||
|
||||
this.incubator = incubator;
|
||||
}
|
||||
|
||||
public TileEntity getTileEntity()
|
||||
{
|
||||
public TileEntity getTileEntity() {
|
||||
return this.incubator;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,55 +6,45 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AetherFreezable extends RegistryEntry
|
||||
{
|
||||
public class AetherFreezable extends RegistryEntry {
|
||||
|
||||
public int timeRequired;
|
||||
|
||||
public ItemStack input, output;
|
||||
|
||||
public AetherFreezable(ItemStack input, Block output, int timeRequired)
|
||||
{
|
||||
public AetherFreezable(ItemStack input, Block output, int timeRequired) {
|
||||
this(input, new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherFreezable(Block input, ItemStack output, int timeRequired)
|
||||
{
|
||||
public AetherFreezable(Block input, ItemStack output, int timeRequired) {
|
||||
this(new ItemStack(input), output, timeRequired);
|
||||
}
|
||||
|
||||
public AetherFreezable(Block input, Block output, int timeRequired)
|
||||
{
|
||||
public AetherFreezable(Block input, Block output, int timeRequired) {
|
||||
this(new ItemStack(input), new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherFreezable(ItemStack input, Item output, int timeRequired)
|
||||
{
|
||||
public AetherFreezable(ItemStack input, Item output, int timeRequired) {
|
||||
this(input, new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherFreezable(Item input, ItemStack output, int timeRequired)
|
||||
{
|
||||
public AetherFreezable(Item input, ItemStack output, int timeRequired) {
|
||||
this(new ItemStack(input), output, timeRequired);
|
||||
}
|
||||
|
||||
public AetherFreezable(Item input, Item output, int timeRequired)
|
||||
{
|
||||
public AetherFreezable(Item input, Item output, int timeRequired) {
|
||||
this(new ItemStack(input), new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherFreezable(Block input, Item output, int timeRequired)
|
||||
{
|
||||
public AetherFreezable(Block input, Item output, int timeRequired) {
|
||||
this(new ItemStack(input), new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherFreezable(Item input, Block output, int timeRequired)
|
||||
{
|
||||
public AetherFreezable(Item input, Block output, int timeRequired) {
|
||||
this(new ItemStack(input), new ItemStack(output), timeRequired);
|
||||
}
|
||||
|
||||
public AetherFreezable(ItemStack input, ItemStack output, int timeRequired)
|
||||
{
|
||||
public AetherFreezable(ItemStack input, ItemStack output, int timeRequired) {
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
this.timeRequired = timeRequired;
|
||||
|
@ -62,26 +52,21 @@ public class AetherFreezable extends RegistryEntry
|
|||
this.setRegistryName(input.getItem().getUnlocalizedName().toString() + "_meta_" + (input.isItemStackDamageable() ? 0 : input.getItemDamage()));
|
||||
}
|
||||
|
||||
public int getTimeRequired()
|
||||
{
|
||||
public int getTimeRequired() {
|
||||
return this.timeRequired;
|
||||
}
|
||||
|
||||
public ItemStack getInput()
|
||||
{
|
||||
public ItemStack getInput() {
|
||||
return this.input;
|
||||
}
|
||||
|
||||
public ItemStack getOutput()
|
||||
{
|
||||
public ItemStack getOutput() {
|
||||
return this.output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj instanceof AetherFreezable)
|
||||
{
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof AetherFreezable) {
|
||||
AetherFreezable freezable = (AetherFreezable) obj;
|
||||
|
||||
boolean inputCheck = this.getInput().getItem() == freezable.getInput().getItem() && this.getInput().getItemDamage() == freezable.getInput().getItemDamage();
|
||||
|
|
|
@ -6,46 +6,38 @@ import net.minecraft.item.ItemStack;
|
|||
|
||||
import com.legacy.aether.api.RegistryEntry;
|
||||
|
||||
public class AetherFreezableFuel extends RegistryEntry
|
||||
{
|
||||
public class AetherFreezableFuel extends RegistryEntry {
|
||||
|
||||
public int timeGiven;
|
||||
|
||||
public ItemStack fuelStack;
|
||||
|
||||
public AetherFreezableFuel(Block fuelBlock, int timeGiven)
|
||||
{
|
||||
public AetherFreezableFuel(Block fuelBlock, int timeGiven) {
|
||||
this(new ItemStack(fuelBlock), timeGiven);
|
||||
}
|
||||
|
||||
public AetherFreezableFuel(Item fuelItem, int timeGiven)
|
||||
{
|
||||
public AetherFreezableFuel(Item fuelItem, int timeGiven) {
|
||||
this(new ItemStack(fuelItem), timeGiven);
|
||||
}
|
||||
|
||||
public AetherFreezableFuel(ItemStack fuelStack, int timeGiven)
|
||||
{
|
||||
public AetherFreezableFuel(ItemStack fuelStack, int timeGiven) {
|
||||
this.timeGiven = timeGiven;
|
||||
this.fuelStack = fuelStack;
|
||||
|
||||
this.setRegistryName(fuelStack.getItem().getUnlocalizedName().toString() + "_meta_" + (fuelStack.isItemStackDamageable() ? 0 : fuelStack.getItemDamage()));
|
||||
}
|
||||
|
||||
public int getTimeGiven()
|
||||
{
|
||||
public int getTimeGiven() {
|
||||
return this.timeGiven;
|
||||
}
|
||||
|
||||
public ItemStack getFuelStack()
|
||||
{
|
||||
public ItemStack getFuelStack() {
|
||||
return this.fuelStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj instanceof AetherFreezableFuel)
|
||||
{
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof AetherFreezableFuel) {
|
||||
AetherFreezableFuel fuel = (AetherFreezableFuel) obj;
|
||||
|
||||
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem() && this.getFuelStack().getItemDamage() == fuel.getFuelStack().getItemDamage();
|
||||
|
|
|
@ -5,8 +5,7 @@ import com.legacy.aether.api.RegistryEntry;
|
|||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class AetherMoaType extends RegistryEntry
|
||||
{
|
||||
public class AetherMoaType extends RegistryEntry {
|
||||
|
||||
private MoaProperties properties;
|
||||
|
||||
|
@ -14,43 +13,36 @@ public class AetherMoaType extends RegistryEntry
|
|||
|
||||
public CreativeTabs creativeTab;
|
||||
|
||||
public AetherMoaType(int hexColor, MoaProperties properties)
|
||||
{
|
||||
public AetherMoaType(int hexColor, MoaProperties properties) {
|
||||
this.hexColor = hexColor;
|
||||
this.properties = properties;
|
||||
|
||||
this.creativeTab = CreativeTabs.tabMisc;
|
||||
}
|
||||
|
||||
public AetherMoaType(int hexColor, MoaProperties properties, CreativeTabs creativeTab)
|
||||
{
|
||||
public AetherMoaType(int hexColor, MoaProperties properties, CreativeTabs creativeTab) {
|
||||
this(hexColor, properties);
|
||||
|
||||
this.creativeTab = creativeTab;
|
||||
}
|
||||
|
||||
public ResourceLocation getTexture(boolean saddled, boolean isBeingRidden)
|
||||
{
|
||||
if (this.properties.hasCustomTexture())
|
||||
{
|
||||
public ResourceLocation getTexture(boolean saddled, boolean isBeingRidden) {
|
||||
if (this.properties.hasCustomTexture()) {
|
||||
return this.properties.getCustomTexture(saddled, isBeingRidden);
|
||||
}
|
||||
|
||||
return new ResourceLocation("aether_legacy", "textures/entities/moa/" + ("moa_") + this.getRegistryName().getResourcePath().toLowerCase() + ".png");
|
||||
}
|
||||
|
||||
public MoaProperties getMoaProperties()
|
||||
{
|
||||
public MoaProperties getMoaProperties() {
|
||||
return this.properties;
|
||||
}
|
||||
|
||||
public CreativeTabs getCreativeTab()
|
||||
{
|
||||
public CreativeTabs getCreativeTab() {
|
||||
return this.creativeTab;
|
||||
}
|
||||
|
||||
public int getMoaEggColor()
|
||||
{
|
||||
public int getMoaEggColor() {
|
||||
return this.hexColor;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,7 @@ package com.legacy.aether.api.moa;
|
|||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class MoaProperties
|
||||
{
|
||||
public class MoaProperties {
|
||||
|
||||
private int maxJumps;
|
||||
|
||||
|
@ -11,36 +10,30 @@ public class MoaProperties
|
|||
|
||||
private ResourceLocation location = null;
|
||||
|
||||
public MoaProperties(int maxJumps, float moaSpeed)
|
||||
{
|
||||
public MoaProperties(int maxJumps, float moaSpeed) {
|
||||
this.maxJumps = maxJumps;
|
||||
this.moaSpeed = moaSpeed;
|
||||
}
|
||||
|
||||
public MoaProperties(int maxJumps, float moaSpeed, ResourceLocation location)
|
||||
{
|
||||
public MoaProperties(int maxJumps, float moaSpeed, ResourceLocation location) {
|
||||
this(maxJumps, moaSpeed);
|
||||
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public int getMaxJumps()
|
||||
{
|
||||
public int getMaxJumps() {
|
||||
return this.maxJumps;
|
||||
}
|
||||
|
||||
public float getMoaSpeed()
|
||||
{
|
||||
public float getMoaSpeed() {
|
||||
return this.moaSpeed;
|
||||
}
|
||||
|
||||
public boolean hasCustomTexture()
|
||||
{
|
||||
public boolean hasCustomTexture() {
|
||||
return this.location != null;
|
||||
}
|
||||
|
||||
public ResourceLocation getCustomTexture(boolean isSaddled, boolean isBeingRidden)
|
||||
{
|
||||
public ResourceLocation getCustomTexture(boolean isSaddled, boolean isBeingRidden) {
|
||||
return this.location;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,7 @@ import com.legacy.aether.api.player.util.IAccessoryInventory;
|
|||
import com.legacy.aether.api.player.util.IAetherAbility;
|
||||
import com.legacy.aether.api.player.util.IAetherBoss;
|
||||
|
||||
public interface IPlayerAether extends IExtendedEntityProperties
|
||||
{
|
||||
public interface IPlayerAether extends IExtendedEntityProperties {
|
||||
|
||||
public void onUpdate();
|
||||
|
||||
|
|
|
@ -11,8 +11,7 @@ import net.minecraft.nbt.NBTTagList;
|
|||
|
||||
import com.legacy.aether.api.accessories.AccessoryType;
|
||||
|
||||
public interface IAccessoryInventory extends IInventory
|
||||
{
|
||||
public interface IAccessoryInventory extends IInventory {
|
||||
|
||||
public void dropAccessories();
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.legacy.aether.api.player.util;
|
||||
|
||||
public interface IAetherAbility
|
||||
{
|
||||
public interface IAetherAbility {
|
||||
|
||||
public void onUpdate();
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.legacy.aether.api.player.util;
|
||||
|
||||
public interface IAetherBoss
|
||||
{
|
||||
public interface IAetherBoss {
|
||||
|
||||
public String getBossName();
|
||||
|
||||
|
|
|
@ -3,11 +3,9 @@ package com.legacy.aether.blocks;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockAether extends Block
|
||||
{
|
||||
public class BlockAether extends Block {
|
||||
|
||||
public BlockAether(Material material, String texture)
|
||||
{
|
||||
public BlockAether(Material material, String texture) {
|
||||
super(material);
|
||||
|
||||
this.setBlockTextureName(texture);
|
||||
|
|
|
@ -9,13 +9,11 @@ import net.minecraft.world.gen.feature.WorldGenerator;
|
|||
|
||||
import com.legacy.aether.blocks.natural.BlockAetherFlower;
|
||||
|
||||
public class BlockAetherSapling extends BlockAetherFlower implements IGrowable
|
||||
{
|
||||
public class BlockAetherSapling extends BlockAetherFlower implements IGrowable {
|
||||
|
||||
public WorldGenerator treeGenObject = null;
|
||||
|
||||
public BlockAetherSapling(WorldGenerator treeGen)
|
||||
{
|
||||
public BlockAetherSapling(WorldGenerator treeGen) {
|
||||
super();
|
||||
|
||||
float f = 0.4F;
|
||||
|
@ -24,46 +22,37 @@ public class BlockAetherSapling extends BlockAetherFlower implements IGrowable
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
public void updateTick(World world, int x, int y, int z, Random random) {
|
||||
if (!world.isRemote) {
|
||||
super.updateTick(world, x, y, z, random);
|
||||
|
||||
if (world.getBlockLightValue(x, y + 1, z) >= 9 && random.nextInt(30) == 0)
|
||||
{
|
||||
if (world.getBlockLightValue(x, y + 1, z) >= 9 && random.nextInt(30) == 0) {
|
||||
this.growTree(world, x, y, z, random);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void growTree(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
public void growTree(World world, int x, int y, int z, Random rand) {
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
|
||||
if (!this.treeGenObject.generate(world, world.rand, x, y, z))
|
||||
{
|
||||
if (!this.treeGenObject.generate(world, world.rand, x, y, z)) {
|
||||
world.setBlock(x, y, z, this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient)
|
||||
{
|
||||
public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_149852_a(World worldIn, Random rand, int x, int y, int z)
|
||||
{
|
||||
public boolean func_149852_a(World worldIn, Random rand, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_149853_b(World worldIn, Random rand, int x, int y, int z)
|
||||
{
|
||||
if (worldIn.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
public void func_149853_b(World worldIn, Random rand, int x, int y, int z) {
|
||||
if (worldIn.rand.nextFloat() < 0.45D) {
|
||||
this.growTree(worldIn, x, y, z, rand);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,11 +5,9 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockIcestone extends Block
|
||||
{
|
||||
public class BlockIcestone extends Block {
|
||||
|
||||
public BlockIcestone()
|
||||
{
|
||||
public BlockIcestone() {
|
||||
super(Material.ice);
|
||||
|
||||
this.setHardness(3F);
|
||||
|
@ -20,22 +18,15 @@ public class BlockIcestone extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World worldIn, int xIn, int yIn, int zIn)
|
||||
{
|
||||
for (int x = xIn - 3; x <= (xIn + 3); ++x)
|
||||
{
|
||||
for (int y = yIn - 3; y <= (yIn + 3); ++y)
|
||||
{
|
||||
for (int z = zIn - 3; z <= (zIn + 3); ++z)
|
||||
{
|
||||
public void onBlockAdded(World worldIn, int xIn, int yIn, int zIn) {
|
||||
for (int x = xIn - 3; x <= (xIn + 3); ++x) {
|
||||
for (int y = yIn - 3; y <= (yIn + 3); ++y) {
|
||||
for (int z = zIn - 3; z <= (zIn + 3); ++z) {
|
||||
Block block = worldIn.getBlock(x, y, z);
|
||||
|
||||
if (block == Blocks.water || block == Blocks.flowing_water)
|
||||
{
|
||||
if (block == Blocks.water || block == Blocks.flowing_water) {
|
||||
worldIn.setBlock(x, y, z, Blocks.ice);
|
||||
}
|
||||
else if (block == Blocks.lava || block == Blocks.flowing_lava)
|
||||
{
|
||||
} else if (block == Blocks.lava || block == Blocks.flowing_lava) {
|
||||
worldIn.setBlock(x, y, z, Blocks.obsidian);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,8 +48,7 @@ import com.legacy.aether.world.biome.decoration.AetherGenSkyrootTree;
|
|||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlocksAether
|
||||
{
|
||||
public class BlocksAether {
|
||||
|
||||
public static Block aether_grass, enchanted_aether_grass, aether_dirt;
|
||||
|
||||
|
@ -109,8 +108,7 @@ public class BlocksAether
|
|||
|
||||
public static Block skyroot_bookshelf;
|
||||
|
||||
public static void initialization()
|
||||
{
|
||||
public static void initialization() {
|
||||
aether_grass = registerMeta("aether_grass", new BlockAetherGrass());
|
||||
enchanted_aether_grass = register("enchanted_aether_grass", new BlockEnchantedAetherGrass());
|
||||
aether_dirt = registerMeta("aether_dirt", new BlockAetherDirt());
|
||||
|
@ -200,13 +198,11 @@ public class BlocksAether
|
|||
skyroot_bookshelf = register("skyroot_bookshelf", new BlockSkyrootBookshelf());
|
||||
}
|
||||
|
||||
public static boolean isGood(Block block)
|
||||
{
|
||||
public static boolean isGood(Block block) {
|
||||
return block == Blocks.air || block == aercloud;
|
||||
}
|
||||
|
||||
public static Block registerSlab(String name, Block slab1, Block slab2)
|
||||
{
|
||||
public static Block registerSlab(String name, Block slab1, Block slab2) {
|
||||
slab1.setBlockName(name);
|
||||
slab1.setCreativeTab(AetherCreativeTabs.blocks);
|
||||
|
||||
|
@ -215,8 +211,7 @@ public class BlocksAether
|
|||
return slab1;
|
||||
}
|
||||
|
||||
public static Block register(String name, Block block)
|
||||
{
|
||||
public static Block register(String name, Block block) {
|
||||
block.setBlockName(name);
|
||||
block.setCreativeTab(AetherCreativeTabs.blocks);
|
||||
|
||||
|
@ -225,8 +220,7 @@ public class BlocksAether
|
|||
return block;
|
||||
}
|
||||
|
||||
public static Block registerMeta(String name, Block block)
|
||||
{
|
||||
public static Block registerMeta(String name, Block block) {
|
||||
block.setBlockName(name);
|
||||
block.setCreativeTab(AetherCreativeTabs.blocks);
|
||||
|
||||
|
|
|
@ -9,36 +9,29 @@ import net.minecraft.world.World;
|
|||
|
||||
import com.legacy.aether.tileentity.util.AetherTileEntity;
|
||||
|
||||
public abstract class BlockAetherContainer extends BlockContainer
|
||||
{
|
||||
public abstract class BlockAetherContainer extends BlockContainer {
|
||||
|
||||
public BlockAetherContainer(Material materialIn)
|
||||
{
|
||||
public BlockAetherContainer(Material materialIn) {
|
||||
super(materialIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack stack)
|
||||
{
|
||||
if (stack.hasDisplayName())
|
||||
{
|
||||
public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack stack) {
|
||||
if (stack.hasDisplayName()) {
|
||||
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
||||
|
||||
if (tileentity instanceof AetherTileEntity)
|
||||
{
|
||||
if (tileentity instanceof AetherTileEntity) {
|
||||
((AetherTileEntity) tileentity).setCustomName(stack.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void setState(World worldIn, int x, int y, int z, boolean isActive)
|
||||
{
|
||||
public static void setState(World worldIn, int x, int y, int z, boolean isActive) {
|
||||
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
||||
|
||||
worldIn.setBlockMetadataWithNotify(x, y, z, isActive ? 1 : 0, 3);
|
||||
|
||||
if (tileentity != null)
|
||||
{
|
||||
if (tileentity != null) {
|
||||
tileentity.validate();
|
||||
worldIn.setTileEntity(x, y, z, tileentity);
|
||||
}
|
||||
|
|
|
@ -23,8 +23,7 @@ import com.legacy.aether.tileentity.TileEntityEnchanter;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockEnchanter extends BlockAetherContainer
|
||||
{
|
||||
public class BlockEnchanter extends BlockAetherContainer {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
@ -32,8 +31,7 @@ public class BlockEnchanter extends BlockAetherContainer
|
|||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconBottom;
|
||||
|
||||
public BlockEnchanter()
|
||||
{
|
||||
public BlockEnchanter() {
|
||||
super(Material.rock);
|
||||
|
||||
this.setHardness(2.0F);
|
||||
|
@ -41,8 +39,7 @@ public class BlockEnchanter extends BlockAetherContainer
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.blockIcon = registry.registerIcon(Aether.find("enchanter_side"));
|
||||
this.blockIconTop = registry.registerIcon(Aether.find("enchanter_bottom"));
|
||||
this.blockIconBottom = registry.registerIcon(Aether.find("enchanter_bottom"));
|
||||
|
@ -50,21 +47,16 @@ public class BlockEnchanter extends BlockAetherContainer
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if (side == 1) {
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
} else if (side == 0) {
|
||||
return this.blockIconBottom;
|
||||
}
|
||||
|
||||
|
@ -72,23 +64,19 @@ public class BlockEnchanter extends BlockAetherContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileEntityEnchanter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune)
|
||||
{
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(BlocksAether.enchanter);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
if(world.getBlockMetadata(x, y, z) == 1)
|
||||
{
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||
if (world.getBlockMetadata(x, y, z) == 1) {
|
||||
float f = (float) x + 0.5F;
|
||||
float f1 = (float) y + 1.0F + (random.nextFloat() * 6F) / 16F;
|
||||
float f2 = (float) z + 0.5F;
|
||||
|
@ -99,46 +87,38 @@ public class BlockEnchanter extends BlockAetherContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
player.openGui(Aether.instance, AetherGuiHandler.enchanter, world, x, y, z);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta)
|
||||
{
|
||||
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta) {
|
||||
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
||||
|
||||
if (tileentity instanceof TileEntityEnchanter)
|
||||
{
|
||||
if (tileentity instanceof TileEntityEnchanter) {
|
||||
TileEntityEnchanter tile = (TileEntityEnchanter) tileentity;
|
||||
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1)
|
||||
{
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tile.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
if (itemstack != null) {
|
||||
float f = worldIn.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
while (itemstack.stackSize > 0) {
|
||||
int j1 = worldIn.rand.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
if (j1 > itemstack.stackSize) {
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(worldIn, (double) ((float) x + f), (double) ((float) y + f1), (double) ((float) z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
{
|
||||
if (itemstack.hasTagCompound()) {
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@ import com.legacy.aether.tileentity.TileEntityFreezer;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockFreezer extends BlockAetherContainer
|
||||
{
|
||||
public class BlockFreezer extends BlockAetherContainer {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
@ -32,8 +31,7 @@ public class BlockFreezer extends BlockAetherContainer
|
|||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconBottom;
|
||||
|
||||
public BlockFreezer()
|
||||
{
|
||||
public BlockFreezer() {
|
||||
super(Material.rock);
|
||||
|
||||
this.setHardness(2.5F);
|
||||
|
@ -41,8 +39,7 @@ public class BlockFreezer extends BlockAetherContainer
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.blockIcon = registry.registerIcon(Aether.find("freezer_side"));
|
||||
this.blockIconTop = registry.registerIcon(Aether.find("freezer_top"));
|
||||
this.blockIconBottom = registry.registerIcon(Aether.find("enchanter_bottom"));
|
||||
|
@ -50,21 +47,16 @@ public class BlockFreezer extends BlockAetherContainer
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if (side == 1) {
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
} else if (side == 0) {
|
||||
return this.blockIconBottom;
|
||||
}
|
||||
|
||||
|
@ -72,20 +64,17 @@ public class BlockFreezer extends BlockAetherContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileEntityFreezer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune)
|
||||
{
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(BlocksAether.freezer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
player.openGui(Aether.instance, AetherGuiHandler.freezer, world, x, y, z);
|
||||
|
||||
return true;
|
||||
|
@ -93,10 +82,8 @@ public class BlockFreezer extends BlockAetherContainer
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
if(world.getBlockMetadata(x, y, z) == 1)
|
||||
{
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||
if (world.getBlockMetadata(x, y, z) == 1) {
|
||||
float f = (float) x + 0.5F;
|
||||
float f1 = (float) y + 1.0F + (random.nextFloat() * 6F) / 16F;
|
||||
float f2 = (float) z + 0.5F;
|
||||
|
@ -107,38 +94,31 @@ public class BlockFreezer extends BlockAetherContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta)
|
||||
{
|
||||
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta) {
|
||||
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
||||
|
||||
if (tileentity instanceof TileEntityFreezer)
|
||||
{
|
||||
if (tileentity instanceof TileEntityFreezer) {
|
||||
TileEntityFreezer tile = (TileEntityFreezer) tileentity;
|
||||
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1)
|
||||
{
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tile.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
if (itemstack != null) {
|
||||
float f = worldIn.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
while (itemstack.stackSize > 0) {
|
||||
int j1 = worldIn.rand.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
if (j1 > itemstack.stackSize) {
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(worldIn, (double) ((float) x + f), (double) ((float) y + f1), (double) ((float) z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
{
|
||||
if (itemstack.hasTagCompound()) {
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@ import com.legacy.aether.tileentity.TileEntityIncubator;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockIncubator extends BlockAetherContainer
|
||||
{
|
||||
public class BlockIncubator extends BlockAetherContainer {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
@ -32,8 +31,7 @@ public class BlockIncubator extends BlockAetherContainer
|
|||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconBottom;
|
||||
|
||||
public BlockIncubator()
|
||||
{
|
||||
public BlockIncubator() {
|
||||
super(Material.rock);
|
||||
|
||||
this.setHardness(2.0F);
|
||||
|
@ -41,8 +39,7 @@ public class BlockIncubator extends BlockAetherContainer
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.blockIcon = registry.registerIcon(Aether.find("incubator_side"));
|
||||
this.blockIconTop = registry.registerIcon(Aether.find("incubator_top"));
|
||||
this.blockIconBottom = registry.registerIcon(Aether.find("enchanter_bottom"));
|
||||
|
@ -50,21 +47,16 @@ public class BlockIncubator extends BlockAetherContainer
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if (side == 1) {
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
} else if (side == 0) {
|
||||
return this.blockIconBottom;
|
||||
}
|
||||
|
||||
|
@ -72,23 +64,19 @@ public class BlockIncubator extends BlockAetherContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileEntityIncubator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune)
|
||||
{
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(BlocksAether.incubator);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
if(world.getBlockMetadata(x, y, z) == 1)
|
||||
{
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||
if (world.getBlockMetadata(x, y, z) == 1) {
|
||||
float f = (float) x + 0.5F;
|
||||
float f1 = (float) y + 1.0F + (random.nextFloat() * 6F) / 16F;
|
||||
float f2 = (float) z + 0.5F;
|
||||
|
@ -99,46 +87,38 @@ public class BlockIncubator extends BlockAetherContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
player.openGui(Aether.instance, AetherGuiHandler.incubator, world, x, y, z);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta)
|
||||
{
|
||||
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta) {
|
||||
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
||||
|
||||
if (tileentity instanceof TileEntityIncubator)
|
||||
{
|
||||
if (tileentity instanceof TileEntityIncubator) {
|
||||
TileEntityIncubator tile = (TileEntityIncubator) tileentity;
|
||||
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1)
|
||||
{
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tile.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
if (itemstack != null) {
|
||||
float f = worldIn.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
while (itemstack.stackSize > 0) {
|
||||
int j1 = worldIn.rand.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
if (j1 > itemstack.stackSize) {
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(worldIn, (double) ((float) x + f), (double) ((float) y + f1), (double) ((float) z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
{
|
||||
if (itemstack.hasTagCompound()) {
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
|
|
|
@ -17,14 +17,12 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockSunAltar extends Block
|
||||
{
|
||||
public class BlockSunAltar extends Block {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
||||
public BlockSunAltar()
|
||||
{
|
||||
public BlockSunAltar() {
|
||||
super(Material.rock);
|
||||
|
||||
this.setHardness(2.5F);
|
||||
|
@ -33,29 +31,23 @@ public class BlockSunAltar extends Block
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.blockIcon = registry.registerIcon(Aether.find("sun_altar_side"));
|
||||
this.blockIconTop = registry.registerIcon(Aether.find("sun_altar_top"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 1 ? this.blockIconTop : (side == 0 ? BlocksAether.hellfire_stone.getBlockTextureFromSide(side) : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if (side == 1) {
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
} else if (side == 0) {
|
||||
return BlocksAether.hellfire_stone.getBlockTextureFromSide(side);
|
||||
}
|
||||
|
||||
|
@ -63,18 +55,13 @@ public class BlockSunAltar extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
|
||||
if (server != null && ((server.isDedicatedServer() && server.getConfigurationManager().func_152596_g(player.getGameProfile()) && player.capabilities.isCreativeMode) || !server.isDedicatedServer()))
|
||||
{
|
||||
if (server != null && ((server.isDedicatedServer() && server.getConfigurationManager().func_152596_g(player.getGameProfile()) && player.capabilities.isCreativeMode) || !server.isDedicatedServer())) {
|
||||
Aether.proxy.openSunAltar();
|
||||
}
|
||||
else if (world.isRemote)
|
||||
{
|
||||
if (player instanceof EntityPlayerSP && player.capabilities.isCreativeMode)
|
||||
{
|
||||
} else if (world.isRemote) {
|
||||
if (player instanceof EntityPlayerSP && player.capabilities.isCreativeMode) {
|
||||
Aether.proxy.openSunAltar();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,11 +8,9 @@ import com.legacy.aether.Aether;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAerogel extends BlockBreakable
|
||||
{
|
||||
public class BlockAerogel extends BlockBreakable {
|
||||
|
||||
public BlockAerogel()
|
||||
{
|
||||
public BlockAerogel() {
|
||||
super(Aether.find("aerogel"), Material.rock, false);
|
||||
|
||||
this.setHardness(1.0F);
|
||||
|
@ -24,14 +22,12 @@ public class BlockAerogel extends BlockBreakable
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
public boolean renderAsNormalBlock() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,11 +10,9 @@ import net.minecraft.world.World;
|
|||
import com.legacy.aether.Aether;
|
||||
import com.legacy.aether.blocks.BlocksAether;
|
||||
|
||||
public class BlockAetherFence extends BlockFence
|
||||
{
|
||||
public class BlockAetherFence extends BlockFence {
|
||||
|
||||
public BlockAetherFence()
|
||||
{
|
||||
public BlockAetherFence() {
|
||||
super(Aether.find("skyroot_planks"), Material.wood);
|
||||
|
||||
this.setHardness(2.0F);
|
||||
|
@ -23,14 +21,12 @@ public class BlockAetherFence extends BlockFence
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(World world, int x, int y, int z)
|
||||
{
|
||||
public boolean canPlaceTorchOnTop(World world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectFenceTo(IBlockAccess p_149826_1_, int p_149826_2_, int p_149826_3_, int p_149826_4_)
|
||||
{
|
||||
public boolean canConnectFenceTo(IBlockAccess p_149826_1_, int p_149826_2_, int p_149826_3_, int p_149826_4_) {
|
||||
Block block = p_149826_1_.getBlock(p_149826_2_, p_149826_3_, p_149826_4_);
|
||||
return block != this && block != Blocks.fence_gate && block != BlocksAether.skyroot_fence_gate ? (block.getMaterial().isOpaque() && block.renderAsNormalBlock() ? block.getMaterial() != Material.gourd : false) : true;
|
||||
}
|
||||
|
|
|
@ -9,11 +9,9 @@ import com.legacy.aether.blocks.BlocksAether;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAetherFenceGate extends BlockFenceGate
|
||||
{
|
||||
public class BlockAetherFenceGate extends BlockFenceGate {
|
||||
|
||||
public BlockAetherFenceGate()
|
||||
{
|
||||
public BlockAetherFenceGate() {
|
||||
super();
|
||||
|
||||
this.setHardness(2.0F);
|
||||
|
@ -24,8 +22,7 @@ public class BlockAetherFenceGate extends BlockFenceGate
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_)
|
||||
{
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,13 +10,11 @@ import net.minecraft.world.World;
|
|||
|
||||
import com.legacy.aether.blocks.BlocksAether;
|
||||
|
||||
public class BlockAetherSlab extends BlockSlab
|
||||
{
|
||||
public class BlockAetherSlab extends BlockSlab {
|
||||
|
||||
private String name;
|
||||
|
||||
public BlockAetherSlab(String name, boolean double_slab, Material materialIn)
|
||||
{
|
||||
public BlockAetherSlab(String name, boolean double_slab, Material materialIn) {
|
||||
super(double_slab, materialIn);
|
||||
this.name = name;
|
||||
|
||||
|
@ -25,38 +23,42 @@ public class BlockAetherSlab extends BlockSlab
|
|||
}
|
||||
|
||||
@Override
|
||||
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_)
|
||||
{
|
||||
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
|
||||
return Item.getItemFromBlock(this.getDroppedSlab());
|
||||
}
|
||||
|
||||
public Block getDroppedSlab()
|
||||
{
|
||||
if (this == BlocksAether.skyroot_double_slab) { return BlocksAether.skyroot_slab; }
|
||||
else if (this == BlocksAether.carved_double_slab) { return BlocksAether.carved_slab; }
|
||||
else if (this == BlocksAether.angelic_double_slab) { return BlocksAether.angelic_slab; }
|
||||
else if (this == BlocksAether.hellfire_double_slab) { return BlocksAether.hellfire_slab; }
|
||||
else if (this == BlocksAether.holystone_brick_double_slab) { return BlocksAether.holystone_brick_slab; }
|
||||
else if (this == BlocksAether.holystone_double_slab) { return BlocksAether.holystone_slab; }
|
||||
else if (this == BlocksAether.mossy_holystone_double_slab) { return BlocksAether.mossy_holystone_slab; }
|
||||
else { return this; }
|
||||
public Block getDroppedSlab() {
|
||||
if (this == BlocksAether.skyroot_double_slab) {
|
||||
return BlocksAether.skyroot_slab;
|
||||
} else if (this == BlocksAether.carved_double_slab) {
|
||||
return BlocksAether.carved_slab;
|
||||
} else if (this == BlocksAether.angelic_double_slab) {
|
||||
return BlocksAether.angelic_slab;
|
||||
} else if (this == BlocksAether.hellfire_double_slab) {
|
||||
return BlocksAether.hellfire_slab;
|
||||
} else if (this == BlocksAether.holystone_brick_double_slab) {
|
||||
return BlocksAether.holystone_brick_slab;
|
||||
} else if (this == BlocksAether.holystone_double_slab) {
|
||||
return BlocksAether.holystone_slab;
|
||||
} else if (this == BlocksAether.mossy_holystone_double_slab) {
|
||||
return BlocksAether.mossy_holystone_slab;
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune)
|
||||
{
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(this.getDroppedSlab());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
public int damageDropped(int meta) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String func_150002_b(int meta)
|
||||
{
|
||||
public String func_150002_b(int meta) {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,11 +3,9 @@ package com.legacy.aether.blocks.decorative;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
|
||||
public class BlockAetherStairs extends BlockStairs
|
||||
{
|
||||
public class BlockAetherStairs extends BlockStairs {
|
||||
|
||||
public BlockAetherStairs(Block block)
|
||||
{
|
||||
public BlockAetherStairs(Block block) {
|
||||
super(block, 0);
|
||||
|
||||
this.setLightOpacity(0);
|
||||
|
|
|
@ -12,36 +12,31 @@ import net.minecraft.world.World;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAetherWall extends BlockWall
|
||||
{
|
||||
public class BlockAetherWall extends BlockWall {
|
||||
|
||||
private Block block;
|
||||
|
||||
public BlockAetherWall(Block block)
|
||||
{
|
||||
public BlockAetherWall(Block block) {
|
||||
super(block);
|
||||
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(World world, int x, int y, int z)
|
||||
{
|
||||
public boolean canPlaceTorchOnTop(World world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_)
|
||||
{
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
|
||||
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_)
|
||||
{
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return this.block.getBlockTextureFromSide(p_149691_1_);
|
||||
}
|
||||
}
|
|
@ -2,11 +2,9 @@ package com.legacy.aether.blocks.decorative;
|
|||
|
||||
import net.minecraft.block.BlockTorch;
|
||||
|
||||
public class BlockAmbrosiumTorch extends BlockTorch
|
||||
{
|
||||
public class BlockAmbrosiumTorch extends BlockTorch {
|
||||
|
||||
public BlockAmbrosiumTorch()
|
||||
{
|
||||
public BlockAmbrosiumTorch() {
|
||||
super();
|
||||
|
||||
this.setTickRandomly(true);
|
||||
|
|
|
@ -17,14 +17,12 @@ import com.legacy.aether.items.ItemsAether;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockPresent extends Block
|
||||
{
|
||||
public class BlockPresent extends Block {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
||||
public BlockPresent()
|
||||
{
|
||||
public BlockPresent() {
|
||||
super(Material.grass);
|
||||
|
||||
this.setHardness(0.6F);
|
||||
|
@ -34,8 +32,7 @@ public class BlockPresent extends Block
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
super.registerBlockIcons(registry);
|
||||
|
||||
this.blockIconTop = registry.registerIcon(Aether.find("present_top"));
|
||||
|
@ -43,17 +40,14 @@ public class BlockPresent extends Block
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return (side == 1 || side == 0) ? this.blockIconTop : this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
if (side == 1 || side == 0)
|
||||
{
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if (side == 1 || side == 0) {
|
||||
return this.blockIconTop;
|
||||
}
|
||||
|
||||
|
@ -61,41 +55,28 @@ public class BlockPresent extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta)
|
||||
{
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
int randomNumber = (int) (((9 - 6 + 1) * world.rand.nextDouble()) + 6);
|
||||
int crateType = world.rand.nextInt(4);
|
||||
|
||||
if (crateType == 0)
|
||||
{
|
||||
for (int size = 1; size <= randomNumber; ++size)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (crateType == 0) {
|
||||
for (int size = 1; size <= randomNumber; ++size) {
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(new EntityXPOrb(world, x, y, z, size));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (crateType == 1)
|
||||
{
|
||||
if (world.rand.nextInt(9) == 0)
|
||||
{
|
||||
} else if (crateType == 1) {
|
||||
if (world.rand.nextInt(9) == 0) {
|
||||
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.candy_cane_sword));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int size = 1; size <= randomNumber; ++size)
|
||||
{
|
||||
} else {
|
||||
for (int size = 1; size <= randomNumber; ++size) {
|
||||
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.gingerbread_man));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
EntityTNTPresent present = new EntityTNTPresent(world, x, y, z);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(present);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,11 +10,9 @@ import com.legacy.aether.Aether;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockQuicksoilGlass extends BlockBreakable
|
||||
{
|
||||
public class BlockQuicksoilGlass extends BlockBreakable {
|
||||
|
||||
public BlockQuicksoilGlass()
|
||||
{
|
||||
public BlockQuicksoilGlass() {
|
||||
super(Aether.find("quicksoil_glass"), Material.glass, false);
|
||||
|
||||
this.slipperiness = 1.1F;
|
||||
|
@ -26,27 +24,23 @@ public class BlockQuicksoilGlass extends BlockBreakable
|
|||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random random)
|
||||
{
|
||||
public int quantityDropped(Random random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
public boolean renderAsNormalBlock() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,11 +15,9 @@ import com.legacy.aether.blocks.BlocksAether;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockSkyrootBookshelf extends Block
|
||||
{
|
||||
public class BlockSkyrootBookshelf extends Block {
|
||||
|
||||
public BlockSkyrootBookshelf()
|
||||
{
|
||||
public BlockSkyrootBookshelf() {
|
||||
super(Material.wood);
|
||||
|
||||
this.setHardness(2F);
|
||||
|
@ -31,26 +29,22 @@ public class BlockSkyrootBookshelf extends Block
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_)
|
||||
{
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return p_149691_1_ != 1 && p_149691_1_ != 0 ? super.getIcon(p_149691_1_, p_149691_2_) : BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random random)
|
||||
{
|
||||
public int quantityDropped(Random random) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEnchantPowerBonus(World world, int x, int y, int z)
|
||||
{
|
||||
public float getEnchantPowerBonus(World world, int x, int y, int z) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune)
|
||||
{
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return Items.book;
|
||||
}
|
||||
}
|
|
@ -5,11 +5,9 @@ import net.minecraft.block.material.Material;
|
|||
|
||||
import com.legacy.aether.Aether;
|
||||
|
||||
public class BlockSkyrootPlanks extends Block
|
||||
{
|
||||
public class BlockSkyrootPlanks extends Block {
|
||||
|
||||
public BlockSkyrootPlanks()
|
||||
{
|
||||
public BlockSkyrootPlanks() {
|
||||
super(Material.wood);
|
||||
|
||||
this.setHardness(2F);
|
||||
|
|
|
@ -6,11 +6,9 @@ import net.minecraft.world.IBlockAccess;
|
|||
|
||||
import com.legacy.aether.Aether;
|
||||
|
||||
public class BlockZanite extends Block
|
||||
{
|
||||
public class BlockZanite extends Block {
|
||||
|
||||
public BlockZanite()
|
||||
{
|
||||
public BlockZanite() {
|
||||
super(Material.iron);
|
||||
|
||||
this.setHardness(3F);
|
||||
|
@ -20,8 +18,7 @@ public class BlockZanite extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
|
||||
{
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,24 +10,20 @@ import net.minecraft.world.World;
|
|||
|
||||
import com.legacy.aether.registry.creative_tabs.AetherCreativeTabs;
|
||||
|
||||
public class BlockDungeonBase extends Block
|
||||
{
|
||||
public class BlockDungeonBase extends Block {
|
||||
|
||||
private Block pickBlock;
|
||||
|
||||
private boolean isLit;
|
||||
|
||||
public BlockDungeonBase(boolean isLit)
|
||||
{
|
||||
public BlockDungeonBase(boolean isLit) {
|
||||
this(null, isLit);
|
||||
}
|
||||
|
||||
public BlockDungeonBase(Block pickBlock, boolean isLit)
|
||||
{
|
||||
public BlockDungeonBase(Block pickBlock, boolean isLit) {
|
||||
super(Material.rock);
|
||||
|
||||
if (pickBlock != null)
|
||||
{
|
||||
if (pickBlock != null) {
|
||||
this.pickBlock = pickBlock;
|
||||
this.setResistance(6000000.0F);
|
||||
}
|
||||
|
@ -39,17 +35,14 @@ public class BlockDungeonBase extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
public int getLightValue(IBlockAccess world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
if (block != this)
|
||||
{
|
||||
if (block != this) {
|
||||
return block.getLightValue(world, x, y, z);
|
||||
}
|
||||
|
||||
if (this.isLit)
|
||||
{
|
||||
if (this.isLit) {
|
||||
return (int) (15.0F * 0.75f);
|
||||
}
|
||||
|
||||
|
@ -57,18 +50,15 @@ public class BlockDungeonBase extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
if (this.pickBlock != null)
|
||||
{
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
if (this.pickBlock != null) {
|
||||
return new ItemStack(this.pickBlock);
|
||||
}
|
||||
|
||||
return super.getPickBlock(target, world, x, y, z, player);
|
||||
}
|
||||
|
||||
public Block getUnlockedBlock()
|
||||
{
|
||||
public Block getUnlockedBlock() {
|
||||
return this.pickBlock == null ? this : this.pickBlock;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,11 @@ import com.legacy.aether.entities.bosses.EntityFireMinion;
|
|||
import com.legacy.aether.entities.bosses.EntityValkyrie;
|
||||
import com.legacy.aether.entities.hostile.EntitySentry;
|
||||
|
||||
public class BlockDungeonTrap extends Block
|
||||
{
|
||||
public class BlockDungeonTrap extends Block {
|
||||
|
||||
private Block pickBlock;
|
||||
|
||||
public BlockDungeonTrap(Block pickBlock)
|
||||
{
|
||||
public BlockDungeonTrap(Block pickBlock) {
|
||||
super(Material.rock);
|
||||
|
||||
this.pickBlock = pickBlock;
|
||||
|
@ -25,38 +23,28 @@ public class BlockDungeonTrap extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity entityIn)
|
||||
{
|
||||
if (entityIn instanceof EntityPlayer)
|
||||
{
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity entityIn) {
|
||||
if (entityIn instanceof EntityPlayer) {
|
||||
world.setBlock(x, y, z, this.pickBlock);
|
||||
|
||||
if (this == BlocksAether.carved_trap)
|
||||
{
|
||||
if (this == BlocksAether.carved_trap) {
|
||||
EntitySentry sentry = new EntitySentry(world, x + 2D, y + 1D, z + 2D);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(sentry);
|
||||
}
|
||||
}
|
||||
else if (this == BlocksAether.angelic_trap)
|
||||
{
|
||||
} else if (this == BlocksAether.angelic_trap) {
|
||||
EntityValkyrie valkyrie = new EntityValkyrie(world);
|
||||
valkyrie.setPosition(x + 0.5D, y + 1D, z + 0.5D);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(valkyrie);
|
||||
}
|
||||
}
|
||||
else if (this == BlocksAether.hellfire_trap)
|
||||
{
|
||||
} else if (this == BlocksAether.hellfire_trap) {
|
||||
EntityFireMinion minion = new EntityFireMinion(world);
|
||||
minion.setPosition(x + 0.5D, y + 1D, z + 0.5D);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(minion);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,25 +11,21 @@ import net.minecraft.world.World;
|
|||
import com.legacy.aether.entities.hostile.EntityMimic;
|
||||
import com.legacy.aether.tileentity.TileEntityChestMimic;
|
||||
|
||||
public class BlockMimicChest extends BlockChest
|
||||
{
|
||||
public class BlockMimicChest extends BlockChest {
|
||||
|
||||
public BlockMimicChest()
|
||||
{
|
||||
public BlockMimicChest() {
|
||||
super(13);
|
||||
|
||||
this.setHardness(2.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileEntityChestMimic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer playerIn, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer playerIn, int side, float hitX, float hitY, float hitZ) {
|
||||
this.spawnMimic(worldIn, playerIn, x, y, z);
|
||||
|
||||
worldIn.playSoundEffect((double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "random.chestopen", 0.5F, worldIn.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
@ -38,24 +34,19 @@ public class BlockMimicChest extends BlockChest
|
|||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta)
|
||||
{
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
this.spawnMimic(worldIn, player, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return new ItemStack(Blocks.chest);
|
||||
}
|
||||
|
||||
private void spawnMimic(World world, EntityPlayer player, int x, int y, int z)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
private void spawnMimic(World world, EntityPlayer player, int x, int y, int z) {
|
||||
if (!world.isRemote) {
|
||||
EntityMimic mimic = new EntityMimic(world);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
mimic.setAttackTarget(player);
|
||||
}
|
||||
mimic.setPosition((double) x + 0.5D, (double) y + 1.5D, (double) z + 0.5D);
|
||||
|
|
|
@ -9,8 +9,7 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockPillar extends BlockRotatedPillar
|
||||
{
|
||||
public class BlockPillar extends BlockRotatedPillar {
|
||||
|
||||
private String topTexture;
|
||||
|
||||
|
@ -19,8 +18,7 @@ public class BlockPillar extends BlockRotatedPillar
|
|||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon sideIcon;
|
||||
|
||||
public BlockPillar(String topIcon, String sideTexture)
|
||||
{
|
||||
public BlockPillar(String topIcon, String sideTexture) {
|
||||
super(Material.rock);
|
||||
|
||||
this.topTexture = topIcon;
|
||||
|
@ -33,15 +31,13 @@ public class BlockPillar extends BlockRotatedPillar
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon getSideIcon(int meta)
|
||||
{
|
||||
protected IIcon getSideIcon(int meta) {
|
||||
return this.sideIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.field_150164_N = registry.registerIcon(Aether.find(this.topTexture));
|
||||
this.sideIcon = registry.registerIcon(Aether.find(this.sideTexture));
|
||||
}
|
||||
|
|
|
@ -18,11 +18,9 @@ import com.legacy.aether.tileentity.TileEntityTreasureChest;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockTreasureChest extends BlockChest
|
||||
{
|
||||
public class BlockTreasureChest extends BlockChest {
|
||||
|
||||
public BlockTreasureChest()
|
||||
{
|
||||
public BlockTreasureChest() {
|
||||
super(56);
|
||||
|
||||
this.setBlockUnbreakable();
|
||||
|
@ -30,22 +28,18 @@ public class BlockTreasureChest extends BlockChest
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister p_149651_1_)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister p_149651_1_) {
|
||||
this.blockIcon = p_149651_1_.registerIcon(Aether.find("carved_stone"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileEntityTreasureChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer playerIn, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.isRemote)
|
||||
{
|
||||
public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer playerIn, int side, float hitX, float hitY, float hitZ) {
|
||||
if (worldIn.isRemote) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -53,19 +47,15 @@ public class BlockTreasureChest extends BlockChest
|
|||
|
||||
ItemStack guiID = playerIn.getCurrentEquippedItem();
|
||||
|
||||
if (treasurechest.isLocked())
|
||||
{
|
||||
if (guiID == null || guiID != null && guiID.getItem() != ItemsAether.dungeon_key)
|
||||
{
|
||||
if (treasurechest.isLocked()) {
|
||||
if (guiID == null || guiID != null && guiID.getItem() != ItemsAether.dungeon_key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
treasurechest.unlock(guiID.getItemDamage());
|
||||
|
||||
--guiID.stackSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
playerIn.openGui(Aether.instance, AetherGuiHandler.treasure_chest, worldIn, x, y, z);
|
||||
}
|
||||
|
||||
|
@ -73,14 +63,12 @@ public class BlockTreasureChest extends BlockChest
|
|||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random random)
|
||||
{
|
||||
public int quantityDropped(Random random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
public int getRenderType() {
|
||||
return CommonProxy.treasureChestRenderID;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,11 +21,9 @@ import com.legacy.aether.registry.achievements.AchievementsAether;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAercloud extends Block implements IColoredBlock, INamedBlock
|
||||
{
|
||||
public class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
|
||||
|
||||
public BlockAercloud()
|
||||
{
|
||||
public BlockAercloud() {
|
||||
super(Material.ice);
|
||||
|
||||
this.setHardness(0.2F);
|
||||
|
@ -35,30 +33,24 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_)
|
||||
{
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
|
||||
p_149666_3_.add(new ItemStack(this, 1, 0));
|
||||
p_149666_3_.add(new ItemStack(this, 1, 1));
|
||||
p_149666_3_.add(new ItemStack(this, 1, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
entity.fallDistance = 0;
|
||||
|
||||
if (world.getBlockMetadata(x, y, z) == 1)
|
||||
{
|
||||
if (entity instanceof EntityPlayer)
|
||||
{
|
||||
if (world.getBlockMetadata(x, y, z) == 1) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
|
||||
player.triggerAchievement(AchievementsAether.blue_cloud);
|
||||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
if (entity.motionY < 0)
|
||||
{
|
||||
if (player.isSneaking()) {
|
||||
if (entity.motionY < 0) {
|
||||
entity.motionY *= 0.005D;
|
||||
}
|
||||
|
||||
|
@ -66,18 +58,13 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock
|
|||
}
|
||||
|
||||
entity.motionY = 2.0D;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
entity.motionY = 2.0D;
|
||||
}
|
||||
|
||||
if (world.isRemote)
|
||||
{
|
||||
if (!(entity instanceof net.minecraft.client.particle.EntityFX))
|
||||
{
|
||||
for (int count = 0; count < 50; count++)
|
||||
{
|
||||
if (world.isRemote) {
|
||||
if (!(entity instanceof net.minecraft.client.particle.EntityFX)) {
|
||||
for (int count = 0; count < 50; count++) {
|
||||
double xOffset = x + world.rand.nextDouble();
|
||||
double yOffset = y + world.rand.nextDouble();
|
||||
double zOffset = z + world.rand.nextDouble();
|
||||
|
@ -86,48 +73,38 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (entity.motionY < 0)
|
||||
{
|
||||
} else if (entity.motionY < 0) {
|
||||
entity.motionY *= 0.005D;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
public boolean renderAsNormalBlock() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int meta)
|
||||
{
|
||||
if (meta == 1)
|
||||
{
|
||||
public int getRenderColor(int meta) {
|
||||
if (meta == 1) {
|
||||
return 0xCCFFFF;
|
||||
}
|
||||
else if (meta == 2)
|
||||
{
|
||||
} else if (meta == 2) {
|
||||
return 0xFFFF80;
|
||||
}
|
||||
|
||||
|
@ -136,28 +113,22 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
return this.getRenderColor(meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack)
|
||||
{
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return stack.getItemDamage() == 1 ? "blue_aercloud" : stack.getItemDamage() == 2 ? "golden_aercloud" : "cold_aercloud";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||
{
|
||||
if (stack.getItemDamage() == 1)
|
||||
{
|
||||
public int getColorFromItemStack(ItemStack stack, int pass) {
|
||||
if (stack.getItemDamage() == 1) {
|
||||
return 0xCCFFFF;
|
||||
}
|
||||
else if (stack.getItemDamage() == 2)
|
||||
{
|
||||
} else if (stack.getItemDamage() == 2) {
|
||||
return 0xFFFF80;
|
||||
}
|
||||
|
||||
|
@ -166,17 +137,14 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_)
|
||||
{
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
|
||||
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
|
||||
|
||||
if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_) != p_149646_1_.getBlockMetadata(p_149646_2_ - Facing.offsetsXForSide[p_149646_5_], p_149646_3_ - Facing.offsetsYForSide[p_149646_5_], p_149646_4_ - Facing.offsetsZForSide[p_149646_5_]))
|
||||
{
|
||||
if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_) != p_149646_1_.getBlockMetadata(p_149646_2_ - Facing.offsetsXForSide[p_149646_5_], p_149646_3_ - Facing.offsetsYForSide[p_149646_5_], p_149646_4_ - Facing.offsetsZForSide[p_149646_5_])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (block == this)
|
||||
{
|
||||
if (block == this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -184,8 +152,7 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
||||
{
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return world.getBlockMetadata(x, y, z) != 1 ? AxisAlignedBB.getBoundingBox(x, y, z, x + 1.0D, y + 0.01D, z + 1.0D) : AxisAlignedBB.getBoundingBox(x, y, z, x, y, z);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,11 +7,9 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockAetherDirt extends Block
|
||||
{
|
||||
public class BlockAetherDirt extends Block {
|
||||
|
||||
public BlockAetherDirt()
|
||||
{
|
||||
public BlockAetherDirt() {
|
||||
super(Material.ground);
|
||||
|
||||
this.setHardness(0.2F);
|
||||
|
@ -21,14 +19,12 @@ public class BlockAetherDirt extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta)
|
||||
{
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
public int damageDropped(int meta) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,13 +8,11 @@ import net.minecraft.world.World;
|
|||
import com.legacy.aether.CommonProxy;
|
||||
import com.legacy.aether.blocks.BlocksAether;
|
||||
|
||||
public class BlockAetherFlower extends BlockBush
|
||||
{
|
||||
public class BlockAetherFlower extends BlockBush {
|
||||
|
||||
public AxisAlignedBB FLOWER_AABB = AxisAlignedBB.getBoundingBox(0.30000001192092896D, 0.0D, 0.30000001192092896D, 0.699999988079071D, 0.6000000238418579D, 0.699999988079071D);
|
||||
|
||||
public BlockAetherFlower()
|
||||
{
|
||||
public BlockAetherFlower() {
|
||||
this.setHardness(0.0F);
|
||||
this.setTickRandomly(true);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
|
@ -22,22 +20,19 @@ public class BlockAetherFlower extends BlockBush
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z)
|
||||
{
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
|
||||
Block soil = world.getBlock(x, y - 1, z);
|
||||
return soil == BlocksAether.aether_grass || soil == BlocksAether.aether_dirt || soil == BlocksAether.enchanted_aether_grass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockStay(World world, int x, int y, int z)
|
||||
{
|
||||
public boolean canBlockStay(World world, int x, int y, int z) {
|
||||
Block soil = world.getBlock(x, y - 1, z);
|
||||
return (soil != null && this.canPlaceBlockAt(world, x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
public int getRenderType() {
|
||||
return CommonProxy.aetherFlowerRenderID;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,14 +23,12 @@ import com.legacy.aether.world.AetherWorld;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAetherGrass extends Block implements IGrowable
|
||||
{
|
||||
public class BlockAetherGrass extends Block implements IGrowable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
||||
public BlockAetherGrass()
|
||||
{
|
||||
public BlockAetherGrass() {
|
||||
super(Material.grass);
|
||||
|
||||
this.setHardness(0.2F);
|
||||
|
@ -40,24 +38,17 @@ public class BlockAetherGrass extends Block implements IGrowable
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World worldIn, int x, int y, int z, Random rand)
|
||||
{
|
||||
if (!worldIn.isRemote)
|
||||
{
|
||||
if (worldIn.getBlockLightValue(x, y + 1, z) < 4 && worldIn.getBlockLightOpacity(x, y + 1, z) > 2)
|
||||
{
|
||||
public void updateTick(World worldIn, int x, int y, int z, Random rand) {
|
||||
if (!worldIn.isRemote) {
|
||||
if (worldIn.getBlockLightValue(x, y + 1, z) < 4 && worldIn.getBlockLightOpacity(x, y + 1, z) > 2) {
|
||||
worldIn.setBlock(x, y, z, BlocksAether.aether_dirt);
|
||||
}
|
||||
else if (worldIn.getBlockLightValue(x, y + 1, z) >= 9)
|
||||
{
|
||||
for (int l = 0; l < 4; ++l)
|
||||
{
|
||||
} else if (worldIn.getBlockLightValue(x, y + 1, z) >= 9) {
|
||||
for (int l = 0; l < 4; ++l) {
|
||||
int i1 = x + rand.nextInt(3) - 1;
|
||||
int j1 = y + rand.nextInt(5) - 3;
|
||||
int k1 = z + rand.nextInt(3) - 1;
|
||||
|
||||
if (worldIn.getBlock(i1, j1, k1) == BlocksAether.aether_dirt && worldIn.getBlockMetadata(i1, j1, k1) == 0 && worldIn.getBlockLightValue(i1, j1 + 1, k1) >= 4 && worldIn.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
|
||||
{
|
||||
if (worldIn.getBlock(i1, j1, k1) == BlocksAether.aether_dirt && worldIn.getBlockMetadata(i1, j1, k1) == 0 && worldIn.getBlockLightValue(i1, j1 + 1, k1) >= 4 && worldIn.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) {
|
||||
worldIn.setBlock(i1, j1, k1, BlocksAether.aether_grass);
|
||||
}
|
||||
}
|
||||
|
@ -66,48 +57,39 @@ public class BlockAetherGrass extends Block implements IGrowable
|
|||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random random, int fortune)
|
||||
{
|
||||
public Item getItemDropped(int meta, Random random, int fortune) {
|
||||
return Item.getItemFromBlock(BlocksAether.aether_dirt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta)
|
||||
{
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
public int damageDropped(int meta) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.blockIcon = registry.registerIcon("aether_legacy:aether_grass_side");
|
||||
this.blockIconTop = registry.registerIcon("aether_legacy:aether_grass_top");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 1 ? this.blockIconTop : (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side) : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if (side == 1) {
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
} else if (side == 0) {
|
||||
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
|
||||
}
|
||||
|
||||
|
@ -115,69 +97,52 @@ public class BlockAetherGrass extends Block implements IGrowable
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable)
|
||||
{
|
||||
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
|
||||
EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);
|
||||
|
||||
return plantType == EnumPlantType.Plains;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_)
|
||||
{
|
||||
public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_)
|
||||
{
|
||||
public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_)
|
||||
{
|
||||
public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) {
|
||||
int l = 0;
|
||||
|
||||
while (l < 128)
|
||||
{
|
||||
while (l < 128) {
|
||||
int i1 = p_149853_3_;
|
||||
int j1 = p_149853_4_ + 1;
|
||||
int k1 = p_149853_5_;
|
||||
int l1 = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (l1 < l / 16)
|
||||
{
|
||||
while (true) {
|
||||
if (l1 < l / 16) {
|
||||
i1 += p_149853_2_.nextInt(3) - 1;
|
||||
j1 += (p_149853_2_.nextInt(3) - 1) * p_149853_2_.nextInt(3) / 2;
|
||||
k1 += p_149853_2_.nextInt(3) - 1;
|
||||
|
||||
if (p_149853_1_.getBlock(i1, j1 - 1, k1) == BlocksAether.aether_grass && !p_149853_1_.getBlock(i1, j1, k1).isNormalCube())
|
||||
{
|
||||
if (p_149853_1_.getBlock(i1, j1 - 1, k1) == BlocksAether.aether_grass && !p_149853_1_.getBlock(i1, j1, k1).isNormalCube()) {
|
||||
++l1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (p_149853_1_.isAirBlock(i1, j1, k1))
|
||||
{
|
||||
if (p_149853_2_.nextInt(8) != 0)
|
||||
{
|
||||
if (Blocks.tallgrass.canBlockStay(p_149853_1_, i1, j1, k1))
|
||||
{
|
||||
} else if (p_149853_1_.isAirBlock(i1, j1, k1)) {
|
||||
if (p_149853_2_.nextInt(8) != 0) {
|
||||
if (Blocks.tallgrass.canBlockStay(p_149853_1_, i1, j1, k1)) {
|
||||
p_149853_1_.setBlock(i1, j1, k1, Blocks.tallgrass, 1, 3);
|
||||
}
|
||||
}
|
||||
else if (p_149853_2_.nextInt(12) == 0)
|
||||
{
|
||||
if (BlocksAether.berry_bush_stem.canBlockStay(p_149853_1_, i1, j1, k1))
|
||||
{
|
||||
} else if (p_149853_2_.nextInt(12) == 0) {
|
||||
if (BlocksAether.berry_bush_stem.canBlockStay(p_149853_1_, i1, j1, k1)) {
|
||||
p_149853_1_.setBlock(i1, j1, k1, BlocksAether.berry_bush_stem, 0, 3);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
AetherWorld.aether_biome.plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,62 +20,51 @@ import cpw.mods.fml.client.FMLClientHandler;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAetherLeaves extends BlockLeaves
|
||||
{
|
||||
public class BlockAetherLeaves extends BlockLeaves {
|
||||
|
||||
public BlockAetherLeaves()
|
||||
{
|
||||
public BlockAetherLeaves() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBlockColor()
|
||||
{
|
||||
public int getBlockColor() {
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int meta)
|
||||
{
|
||||
public int getRenderColor(int meta) {
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
super.randomDisplayTick(world, x, y, z, rand);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (!world.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (net.minecraft.client.Minecraft.getMinecraft().gameSettings.particleSetting == 2)
|
||||
{
|
||||
if (net.minecraft.client.Minecraft.getMinecraft().gameSettings.particleSetting == 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this == BlocksAether.golden_oak_leaves)
|
||||
{
|
||||
for (int ammount = 0; ammount < 2; ammount++)
|
||||
{
|
||||
if (this == BlocksAether.golden_oak_leaves) {
|
||||
for (int ammount = 0; ammount < 2; ammount++) {
|
||||
double d = x + (rand.nextFloat() - 0.5D) * 10;
|
||||
double d1 = y + (rand.nextFloat() - 0.5D) * 10;
|
||||
double d2 = z + (rand.nextFloat() - 0.5D) * 10;
|
||||
|
@ -88,12 +77,9 @@ public class BlockAetherLeaves extends BlockLeaves
|
|||
}
|
||||
}
|
||||
|
||||
if (this == BlocksAether.holiday_leaves || this == BlocksAether.decorated_holiday_leaves)
|
||||
{
|
||||
if (rand.nextInt(5) == 0)
|
||||
{
|
||||
for (int l = 0; l < 6; ++l)
|
||||
{
|
||||
if (this == BlocksAether.holiday_leaves || this == BlocksAether.decorated_holiday_leaves) {
|
||||
if (rand.nextInt(5) == 0) {
|
||||
for (int l = 0; l < 6; ++l) {
|
||||
double d = (double) x + ((double) rand.nextFloat() - 0.5D) * 8.0D;
|
||||
double d1 = (double) y + ((double) rand.nextFloat() - 0.5D) * 8.0D;
|
||||
double d2 = (double) z + ((double) rand.nextFloat() - 0.5D) * 8.0D;
|
||||
|
@ -107,12 +93,9 @@ public class BlockAetherLeaves extends BlockLeaves
|
|||
}
|
||||
}
|
||||
|
||||
if (this == BlocksAether.crystal_leaves || this == BlocksAether.crystal_fruit_leaves)
|
||||
{
|
||||
if (rand.nextInt(5) == 0)
|
||||
{
|
||||
for (int l = 0; l < 6; ++l)
|
||||
{
|
||||
if (this == BlocksAether.crystal_leaves || this == BlocksAether.crystal_fruit_leaves) {
|
||||
if (rand.nextInt(5) == 0) {
|
||||
for (int l = 0; l < 6; ++l) {
|
||||
double d = (double) x + ((double) rand.nextFloat() - 0.5D) * 6.0D;
|
||||
double d1 = (double) y + ((double) rand.nextFloat() - 0.5D) * 6.0D;
|
||||
double d2 = (double) z + ((double) rand.nextFloat() - 0.5D) * 6.0D;
|
||||
|
@ -128,18 +111,15 @@ public class BlockAetherLeaves extends BlockLeaves
|
|||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random random, int fortune)
|
||||
{
|
||||
public Item getItemDropped(int meta, Random random, int fortune) {
|
||||
return this == BlocksAether.skyroot_leaves ? Item.getItemFromBlock(BlocksAether.skyroot_sapling) : this == BlocksAether.golden_oak_leaves ? Item.getItemFromBlock(BlocksAether.golden_oak_leaves) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
{
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> drops = super.getDrops(world, x, y, z, metadata, fortune);
|
||||
|
||||
if (this == BlocksAether.crystal_fruit_leaves)
|
||||
{
|
||||
if (this == BlocksAether.crystal_fruit_leaves) {
|
||||
drops.add(new ItemStack(ItemsAether.white_apple));
|
||||
}
|
||||
|
||||
|
@ -148,21 +128,18 @@ public class BlockAetherLeaves extends BlockLeaves
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return super.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_)
|
||||
{
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] func_150125_e()
|
||||
{
|
||||
public String[] func_150125_e() {
|
||||
return new String[]{this.getUnlocalizedName()};
|
||||
}
|
||||
|
||||
|
|
|
@ -25,17 +25,14 @@ import com.legacy.aether.items.util.EnumAetherToolType;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAetherLog extends BlockLog
|
||||
{
|
||||
public class BlockAetherLog extends BlockLog {
|
||||
|
||||
public BlockAetherLog()
|
||||
{
|
||||
public BlockAetherLog() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta)
|
||||
{
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
||||
player.addExhaustion(0.025F);
|
||||
|
||||
|
@ -43,56 +40,42 @@ public class BlockAetherLog extends BlockLog
|
|||
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
|
||||
if (stack != null && ((stack.getItem() instanceof ItemAetherTool && ((ItemAetherTool)stack.getItem()).toolType == EnumAetherToolType.AXE) || stack.getItem() == Items.diamond_axe))
|
||||
{
|
||||
if (stack.getItem() instanceof ItemGravititeTool || stack.getItem() instanceof ItemValkyrieTool || stack.getItem() == Items.diamond_axe)
|
||||
{
|
||||
if (this == BlocksAether.golden_oak_log)
|
||||
{
|
||||
if (stack != null && ((stack.getItem() instanceof ItemAetherTool && ((ItemAetherTool) stack.getItem()).toolType == EnumAetherToolType.AXE) || stack.getItem() == Items.diamond_axe)) {
|
||||
if (stack.getItem() instanceof ItemGravititeTool || stack.getItem() instanceof ItemValkyrieTool || stack.getItem() == Items.diamond_axe) {
|
||||
if (this == BlocksAether.golden_oak_log) {
|
||||
this.dropBlockAsItem(worldIn, x, y, z, new ItemStack(ItemsAether.golden_amber, 1 + worldIn.rand.nextInt(2)));
|
||||
}
|
||||
|
||||
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
||||
}
|
||||
else if (stack.getItem() instanceof ItemSkyrootTool)
|
||||
{
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
} else if (stack.getItem() instanceof ItemSkyrootTool) {
|
||||
for (int i = 0; i < size; ++i) {
|
||||
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random random, int fortune)
|
||||
{
|
||||
public Item getItemDropped(int meta, Random random, int fortune) {
|
||||
return Item.getItemFromBlock(BlocksAether.skyroot_log);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
public int damageDropped(int meta) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.field_150167_a = new IIcon[1];
|
||||
this.field_150166_b = new IIcon[1];
|
||||
|
||||
for (int i = 0; i < this.field_150167_a.length; ++i)
|
||||
{
|
||||
for (int i = 0; i < this.field_150167_a.length; ++i) {
|
||||
this.field_150167_a[i] = registry.registerIcon(this.getTextureName() + "_side");
|
||||
this.field_150166_b[i] = registry.registerIcon(this.getTextureName() + "_top");
|
||||
}
|
||||
|
|
|
@ -20,11 +20,9 @@ import com.legacy.aether.items.tools.ItemAetherTool;
|
|||
import com.legacy.aether.items.tools.ItemSkyrootTool;
|
||||
import com.legacy.aether.items.util.EnumAetherToolType;
|
||||
|
||||
public class BlockAetherOre extends Block
|
||||
{
|
||||
public class BlockAetherOre extends Block {
|
||||
|
||||
public BlockAetherOre(int level)
|
||||
{
|
||||
public BlockAetherOre(int level) {
|
||||
super(Material.rock);
|
||||
|
||||
this.setHardness(3.0F);
|
||||
|
@ -34,74 +32,57 @@ public class BlockAetherOre extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta)
|
||||
{
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
||||
player.addExhaustion(0.025F);
|
||||
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
|
||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0)
|
||||
{
|
||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0) {
|
||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (stack != null && stack.getItem() instanceof ItemSkyrootTool && ((ItemAetherTool)stack.getItem()).toolType == EnumAetherToolType.PICKAXE)
|
||||
{
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
if (stack != null && stack.getItem() instanceof ItemSkyrootTool && ((ItemAetherTool) stack.getItem()).toolType == EnumAetherToolType.PICKAXE) {
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
this.dropBlockAsItem(worldIn, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random random, int fortune)
|
||||
{
|
||||
public Item getItemDropped(int meta, Random random, int fortune) {
|
||||
return this == BlocksAether.zanite_ore ? ItemsAether.zanite_gemstone : ItemsAether.ambrosium_shard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDroppedWithBonus(int fortune, Random random)
|
||||
{
|
||||
if (fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped(0, random, fortune))
|
||||
{
|
||||
public int quantityDroppedWithBonus(int fortune, Random random) {
|
||||
if (fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped(0, random, fortune)) {
|
||||
int j = random.nextInt(fortune + 2) - 1;
|
||||
|
||||
if (j < 0)
|
||||
{
|
||||
if (j < 0) {
|
||||
j = 0;
|
||||
}
|
||||
|
||||
return this.quantityDropped(random) * (j + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return this.quantityDropped(random);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_)
|
||||
{
|
||||
public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) {
|
||||
Random random = new Random();
|
||||
|
||||
if (this.getItemDropped(p_149690_5_, random, p_149690_7_) != Item.getItemFromBlock(this))
|
||||
{
|
||||
if (this.getItemDropped(p_149690_5_, random, p_149690_7_) != Item.getItemFromBlock(this)) {
|
||||
int amount = 0;
|
||||
|
||||
if (this == BlocksAether.ambrosium_ore)
|
||||
{
|
||||
if (this == BlocksAether.ambrosium_ore) {
|
||||
amount = MathHelper.getRandomIntegerInRange(random, 0, 2);
|
||||
}
|
||||
else if (this == BlocksAether.zanite_ore)
|
||||
{
|
||||
} else if (this == BlocksAether.zanite_ore) {
|
||||
amount = MathHelper.getRandomIntegerInRange(random, 2, 5);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,11 +19,9 @@ import com.legacy.aether.items.ItemsAether;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockBerryBush extends BlockAetherFlower
|
||||
{
|
||||
public class BlockBerryBush extends BlockAetherFlower {
|
||||
|
||||
public BlockBerryBush()
|
||||
{
|
||||
public BlockBerryBush() {
|
||||
this.setHardness(0.2F);
|
||||
this.setHarvestLevel("axe", 0);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
|
@ -32,29 +30,23 @@ public class BlockBerryBush extends BlockAetherFlower
|
|||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune)
|
||||
{
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(BlocksAether.berry_bush_stem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer entityplayer, int x, int y, int z, int meta)
|
||||
{
|
||||
public void harvestBlock(World world, EntityPlayer entityplayer, int x, int y, int z, int meta) {
|
||||
int min, max;
|
||||
|
||||
if (world.getBlock(x, y, z) == BlocksAether.enchanted_aether_grass)
|
||||
{
|
||||
if (world.getBlock(x, y, z) == BlocksAether.enchanted_aether_grass) {
|
||||
min = 1;
|
||||
max = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
min = 1;
|
||||
max = 3;
|
||||
}
|
||||
|
@ -65,26 +57,20 @@ public class BlockBerryBush extends BlockAetherFlower
|
|||
|
||||
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
|
||||
|
||||
if (randomNum != 0)
|
||||
{
|
||||
if (randomNum != 0) {
|
||||
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkAndDropBlock(World world, int x, int y, int z)
|
||||
{
|
||||
if(!this.canBlockStay(world, x, y, z))
|
||||
{
|
||||
protected void checkAndDropBlock(World world, int x, int y, int z) {
|
||||
if (!this.canBlockStay(world, x, y, z)) {
|
||||
int min, max;
|
||||
|
||||
if (world.getBlock(x, y, z) == BlocksAether.enchanted_aether_grass)
|
||||
{
|
||||
if (world.getBlock(x, y, z) == BlocksAether.enchanted_aether_grass) {
|
||||
min = 1;
|
||||
max = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
min = 1;
|
||||
max = 3;
|
||||
}
|
||||
|
@ -96,21 +82,18 @@ public class BlockBerryBush extends BlockAetherFlower
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
|
||||
{
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) {
|
||||
return AxisAlignedBB.getBoundingBox((double) p_149668_2_ + this.minX, (double) p_149668_3_ + this.minY, (double) p_149668_4_ + this.minZ, (double) p_149668_2_ + this.maxX, (double) p_149668_3_ + this.maxY, (double) p_149668_4_ + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side)
|
||||
{
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
public int getRenderType() {
|
||||
return CommonProxy.berryBushRenderID;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,11 +13,9 @@ import com.legacy.aether.blocks.BlocksAether;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockBerryBushStem extends BlockAetherFlower implements IGrowable
|
||||
{
|
||||
public class BlockBerryBushStem extends BlockAetherFlower implements IGrowable {
|
||||
|
||||
public BlockBerryBushStem()
|
||||
{
|
||||
public BlockBerryBushStem() {
|
||||
this.setHardness(0.2F);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
this.setBlockTextureName(Aether.find("berry_bush_stem"));
|
||||
|
@ -25,48 +23,40 @@ public class BlockBerryBushStem extends BlockAetherFlower implements IGrowable
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
public void updateTick(World world, int x, int y, int z, Random random) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
super.updateTick(world, x, y, z, random);
|
||||
|
||||
if (world.getBlockLightValue(x, y + 1, z) >= 9 && random.nextInt(60) == 0)
|
||||
{
|
||||
if (world.getBlockLightValue(x, y + 1, z) >= 9 && random.nextInt(60) == 0) {
|
||||
world.setBlock(x, y, z, BlocksAether.berry_bush);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
||||
{
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side)
|
||||
{
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_149851_a(World world, int x, int y, int z, boolean isClient)
|
||||
{
|
||||
public boolean func_149851_a(World world, int x, int y, int z, boolean isClient) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_149852_a(World world, Random random, int x, int y, int z)
|
||||
{
|
||||
public boolean func_149852_a(World world, Random random, int x, int y, int z) {
|
||||
return (double) random.nextFloat() < 0.45D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_149853_b(World world, Random random, int x, int y, int z)
|
||||
{
|
||||
public void func_149853_b(World world, Random random, int x, int y, int z) {
|
||||
world.setBlock(x, y, z, BlocksAether.berry_bush);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,11 @@ import com.legacy.aether.blocks.BlocksAether;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockEnchantedAetherGrass extends Block
|
||||
{
|
||||
public class BlockEnchantedAetherGrass extends Block {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
||||
public BlockEnchantedAetherGrass()
|
||||
{
|
||||
public BlockEnchantedAetherGrass() {
|
||||
super(Material.grass);
|
||||
|
||||
this.setHardness(0.2F);
|
||||
|
@ -27,29 +25,23 @@ public class BlockEnchantedAetherGrass extends Block
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.blockIcon = registry.registerIcon("aether_legacy:enchanted_aether_grass_side");
|
||||
this.blockIconTop = registry.registerIcon("aether_legacy:enchanted_aether_grass_top");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 1 ? this.blockIconTop : (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side) : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if (side == 1) {
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
} else if (side == 0) {
|
||||
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,11 +7,9 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockHolystone extends Block
|
||||
{
|
||||
public class BlockHolystone extends Block {
|
||||
|
||||
public BlockHolystone()
|
||||
{
|
||||
public BlockHolystone() {
|
||||
super(Material.rock);
|
||||
|
||||
this.setHardness(0.5F);
|
||||
|
@ -21,14 +19,12 @@ public class BlockHolystone extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta)
|
||||
{
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
public int damageDropped(int meta) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,11 +7,9 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockQuicksoil extends Block
|
||||
{
|
||||
public class BlockQuicksoil extends Block {
|
||||
|
||||
public BlockQuicksoil()
|
||||
{
|
||||
public BlockQuicksoil() {
|
||||
super(Material.sand);
|
||||
|
||||
this.slipperiness = 1.1F;
|
||||
|
@ -23,14 +21,12 @@ public class BlockQuicksoil extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta)
|
||||
{
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
public int damageDropped(int meta) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,8 +10,7 @@ import net.minecraft.world.World;
|
|||
|
||||
import com.legacy.aether.blocks.BlocksAether;
|
||||
|
||||
public class AetherPortalSize
|
||||
{
|
||||
public class AetherPortalSize {
|
||||
|
||||
private final World world;
|
||||
private final int axis;
|
||||
|
@ -22,59 +21,50 @@ public class AetherPortalSize
|
|||
public int height;
|
||||
public int width;
|
||||
|
||||
public AetherPortalSize(World worldIn, int x, int y, int z, int axis)
|
||||
{
|
||||
public AetherPortalSize(World worldIn, int x, int y, int z, int axis) {
|
||||
this.world = worldIn;
|
||||
this.axis = axis;
|
||||
|
||||
this.leftDir = BlockPortal.field_150001_a[axis][0];
|
||||
this.rightDir = BlockPortal.field_150001_a[axis][1];
|
||||
|
||||
for (int i1 = y; y > i1 - 21 && y > 0 && this.isEmptyBlock(worldIn.getBlock(x, y - 1, z)); --y)
|
||||
{
|
||||
for (int i1 = y; y > i1 - 21 && y > 0 && this.isEmptyBlock(worldIn.getBlock(x, y - 1, z)); --y) {
|
||||
;
|
||||
}
|
||||
|
||||
int i = this.getDistanceUntilEdge(x, y, z, this.leftDir) - 1;
|
||||
|
||||
if (i >= 0)
|
||||
{
|
||||
if (i >= 0) {
|
||||
this.bottomLeft = new ChunkCoordinates(x + i * Direction.offsetX[this.leftDir], y, z + i * Direction.offsetZ[this.leftDir]);
|
||||
this.width = this.getDistanceUntilEdge(this.bottomLeft.posX, this.bottomLeft.posY, this.bottomLeft.posZ, this.rightDir);
|
||||
|
||||
if (this.width < 2 || this.width > 21)
|
||||
{
|
||||
if (this.width < 2 || this.width > 21) {
|
||||
this.bottomLeft = null;
|
||||
this.width = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bottomLeft != null)
|
||||
{
|
||||
if (this.bottomLeft != null) {
|
||||
this.height = this.calculatePortalHeight();
|
||||
}
|
||||
}
|
||||
|
||||
protected int getDistanceUntilEdge(int x, int y, int z, int leftDir)
|
||||
{
|
||||
protected int getDistanceUntilEdge(int x, int y, int z, int leftDir) {
|
||||
int j1 = Direction.offsetX[leftDir];
|
||||
int k1 = Direction.offsetZ[leftDir];
|
||||
int i1;
|
||||
Block block;
|
||||
|
||||
for (i1 = 0; i1 < 22; ++i1)
|
||||
{
|
||||
for (i1 = 0; i1 < 22; ++i1) {
|
||||
block = this.world.getBlock(x + j1 * i1, y, z + k1 * i1);
|
||||
|
||||
if (!this.isEmptyBlock(block))
|
||||
{
|
||||
if (!this.isEmptyBlock(block)) {
|
||||
break;
|
||||
}
|
||||
|
||||
Block block1 = this.world.getBlock(x + j1 * i1, y - 1, z + k1 * i1);
|
||||
|
||||
if (block1 != Blocks.glowstone)
|
||||
{
|
||||
if (block1 != Blocks.glowstone) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -83,78 +73,61 @@ public class AetherPortalSize
|
|||
return block == Blocks.glowstone ? i1 : 0;
|
||||
}
|
||||
|
||||
public int getHeight()
|
||||
{
|
||||
public int getHeight() {
|
||||
return this.height;
|
||||
}
|
||||
|
||||
public int getWidth()
|
||||
{
|
||||
public int getWidth() {
|
||||
return this.width;
|
||||
}
|
||||
|
||||
protected int calculatePortalHeight()
|
||||
{
|
||||
protected int calculatePortalHeight() {
|
||||
label24:
|
||||
|
||||
for (this.height = 0; this.height < 21; ++this.height)
|
||||
{
|
||||
for (int i = 0; i < this.width; ++i)
|
||||
{
|
||||
for (this.height = 0; this.height < 21; ++this.height) {
|
||||
for (int i = 0; i < this.width; ++i) {
|
||||
int k = this.bottomLeft.posX + i * Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]];
|
||||
int l = this.bottomLeft.posZ + i * Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]];
|
||||
Block block = this.world.getBlock(k, this.bottomLeft.posY + this.height, l);
|
||||
|
||||
if (!this.isEmptyBlock(block))
|
||||
{
|
||||
if (!this.isEmptyBlock(block)) {
|
||||
break label24;
|
||||
}
|
||||
|
||||
if (block == BlocksAether.aether_portal)
|
||||
{
|
||||
if (block == BlocksAether.aether_portal) {
|
||||
++this.portalBlockCount;
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
if (i == 0) {
|
||||
block = this.world.getBlock(k + Direction.offsetX[BlockPortal.field_150001_a[this.axis][0]], this.bottomLeft.posY + this.height, l + Direction.offsetZ[BlockPortal.field_150001_a[this.axis][0]]);
|
||||
|
||||
if (block != Blocks.glowstone)
|
||||
{
|
||||
if (block != Blocks.glowstone) {
|
||||
break label24;
|
||||
}
|
||||
}
|
||||
else if (i == this.width - 1)
|
||||
{
|
||||
} else if (i == this.width - 1) {
|
||||
block = this.world.getBlock(k + Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]], this.bottomLeft.posY + this.height, l + Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]]);
|
||||
|
||||
if (block != Blocks.glowstone)
|
||||
{
|
||||
if (block != Blocks.glowstone) {
|
||||
break label24;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < this.width; ++j)
|
||||
{
|
||||
for (int j = 0; j < this.width; ++j) {
|
||||
int i = this.bottomLeft.posX + j * Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]];
|
||||
int k = this.bottomLeft.posY + this.height;
|
||||
int l = this.bottomLeft.posZ + j * Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]];
|
||||
|
||||
if (this.world.getBlock(i, k, l) != Blocks.glowstone)
|
||||
{
|
||||
if (this.world.getBlock(i, k, l) != Blocks.glowstone) {
|
||||
this.height = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.height <= 21 && this.height >= 3)
|
||||
{
|
||||
if (this.height <= 21 && this.height >= 3) {
|
||||
return this.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.bottomLeft = null;
|
||||
this.width = 0;
|
||||
this.height = 0;
|
||||
|
@ -162,25 +135,20 @@ public class AetherPortalSize
|
|||
}
|
||||
}
|
||||
|
||||
protected boolean isEmptyBlock(Block blockIn)
|
||||
{
|
||||
protected boolean isEmptyBlock(Block blockIn) {
|
||||
return blockIn.getMaterial() == Material.air || blockIn == Blocks.fire || blockIn == BlocksAether.aether_portal;
|
||||
}
|
||||
|
||||
public boolean isValid()
|
||||
{
|
||||
public boolean isValid() {
|
||||
return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
||||
}
|
||||
|
||||
public void placePortalBlocks()
|
||||
{
|
||||
for (int i = 0; i < this.width; ++i)
|
||||
{
|
||||
public void placePortalBlocks() {
|
||||
for (int i = 0; i < this.width; ++i) {
|
||||
int j = this.bottomLeft.posX + Direction.offsetX[this.rightDir] * i;
|
||||
int k = this.bottomLeft.posZ + Direction.offsetZ[this.rightDir] * i;
|
||||
|
||||
for (int l = 0; l < this.height; ++l)
|
||||
{
|
||||
for (int l = 0; l < this.height; ++l) {
|
||||
int i1 = this.bottomLeft.posY + l;
|
||||
this.world.setBlock(j, i1, k, BlocksAether.aether_portal, this.axis, 2);
|
||||
}
|
||||
|
|
|
@ -20,11 +20,9 @@ import cpw.mods.fml.client.FMLClientHandler;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAetherPortal extends BlockPortal
|
||||
{
|
||||
public class BlockAetherPortal extends BlockPortal {
|
||||
|
||||
public BlockAetherPortal()
|
||||
{
|
||||
public BlockAetherPortal() {
|
||||
super();
|
||||
|
||||
this.setHardness(-1);
|
||||
|
@ -33,71 +31,53 @@ public class BlockAetherPortal extends BlockPortal
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.blockIcon = registry.registerIcon(Aether.find("aether_portal"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity entity)
|
||||
{
|
||||
if (entity instanceof EntityPlayer)
|
||||
{
|
||||
public void onEntityCollidedWithBlock(World world, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity entity) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
PlayerAether.get((EntityPlayer) entity).setInPortal();
|
||||
}
|
||||
else if ((entity instanceof EntityLivingBase) && entity.ridingEntity == null && entity.riddenByEntity == null)
|
||||
{
|
||||
} else if ((entity instanceof EntityLivingBase) && entity.ridingEntity == null && entity.riddenByEntity == null) {
|
||||
((EntityHook) entity.getExtendedProperties("aether_legacy:entity_hook")).setInPortal();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean trySpawnPortal(World worldIn, int x, int y, int z)
|
||||
{
|
||||
public boolean trySpawnPortal(World worldIn, int x, int y, int z) {
|
||||
AetherPortalSize aetherportal$size = new AetherPortalSize(worldIn, x, y, z, 1);
|
||||
|
||||
if (aetherportal$size.isValid() && aetherportal$size.portalBlockCount == 0)
|
||||
{
|
||||
if (aetherportal$size.isValid() && aetherportal$size.portalBlockCount == 0) {
|
||||
aetherportal$size.placePortalBlocks();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
AetherPortalSize aetherportal$size1 = new AetherPortalSize(worldIn, x, y, z, 2);
|
||||
|
||||
if (aetherportal$size1.isValid() && aetherportal$size1.portalBlockCount == 0)
|
||||
{
|
||||
if (aetherportal$size1.isValid() && aetherportal$size1.portalBlockCount == 0) {
|
||||
aetherportal$size1.placePortalBlocks();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block blockIn)
|
||||
{
|
||||
public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block blockIn) {
|
||||
int l = func_149999_b(worldIn.getBlockMetadata(x, y, z));
|
||||
|
||||
if (l == 1)
|
||||
{
|
||||
if (l == 1) {
|
||||
AetherPortalSize blockportal$size = new AetherPortalSize(worldIn, x, y, z, 1);
|
||||
|
||||
if (!blockportal$size.isValid() || blockportal$size.portalBlockCount < blockportal$size.width * blockportal$size.height)
|
||||
{
|
||||
if (!blockportal$size.isValid() || blockportal$size.portalBlockCount < blockportal$size.width * blockportal$size.height) {
|
||||
worldIn.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
else if (l == 2)
|
||||
{
|
||||
} else if (l == 2) {
|
||||
AetherPortalSize blockportal$size1 = new AetherPortalSize(worldIn, x, y, z, 2);
|
||||
|
||||
if (!blockportal$size1.isValid() || blockportal$size1.portalBlockCount < blockportal$size1.width * blockportal$size1.height)
|
||||
{
|
||||
if (!blockportal$size1.isValid() || blockportal$size1.portalBlockCount < blockportal$size1.width * blockportal$size1.height) {
|
||||
worldIn.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
|
@ -105,15 +85,12 @@ public class BlockAetherPortal extends BlockPortal
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
if (rand.nextInt(100) == 0)
|
||||
{
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
if (rand.nextInt(100) == 0) {
|
||||
world.playSound((double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "portal.portal", 0.5F, rand.nextFloat() * 0.4F + 0.8F, false);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
double d0 = (double) ((float) x + rand.nextFloat());
|
||||
double d1 = (double) ((float) y + rand.nextFloat());
|
||||
double d2 = (double) ((float) z + rand.nextFloat());
|
||||
|
@ -122,13 +99,10 @@ public class BlockAetherPortal extends BlockPortal
|
|||
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||
int j = rand.nextInt(2) * 2 - 1;
|
||||
|
||||
if (world.getBlock(x - 1, y, z) != this && world.getBlock(x + 1, y, z) != this)
|
||||
{
|
||||
if (world.getBlock(x - 1, y, z) != this && world.getBlock(x + 1, y, z) != this) {
|
||||
d0 = (double) x + 0.5D + 0.25D * (double) j;
|
||||
d3 = (double) (rand.nextFloat() * 2.0F * (float) j);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
d2 = (double) z + 0.5D + 0.25D * (double) j;
|
||||
d5 = (double) (rand.nextFloat() * 2.0F * (float) j);
|
||||
}
|
||||
|
@ -139,8 +113,7 @@ public class BlockAetherPortal extends BlockPortal
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,11 @@ import net.minecraft.world.World;
|
|||
import com.legacy.aether.blocks.BlocksAether;
|
||||
import com.legacy.aether.entities.block.EntityFloatingBlock;
|
||||
|
||||
public class BlockFloating extends Block
|
||||
{
|
||||
public class BlockFloating extends Block {
|
||||
|
||||
private boolean leveled;
|
||||
|
||||
public BlockFloating(Material material, boolean leveled)
|
||||
{
|
||||
public BlockFloating(Material material, boolean leveled) {
|
||||
super(material);
|
||||
|
||||
this.leveled = leveled;
|
||||
|
@ -27,40 +25,32 @@ public class BlockFloating extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
|
||||
{
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
return this == BlocksAether.enchanted_gravitite;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z)
|
||||
{
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
world.scheduleBlockUpdate(x, y, z, this, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighborBlock)
|
||||
{
|
||||
public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighborBlock) {
|
||||
worldIn.scheduleBlockUpdate(x, y, z, this, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
if (!this.leveled || this.leveled && world.isBlockIndirectlyGettingPowered(x, y, z))
|
||||
{
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
if (!this.leveled || this.leveled && world.isBlockIndirectlyGettingPowered(x, y, z)) {
|
||||
this.floatBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
private void floatBlock(World world, int x, int y, int z)
|
||||
{
|
||||
if (canContinue(world, x, y + 1, z) && y < world.getHeight())
|
||||
{
|
||||
private void floatBlock(World world, int x, int y, int z) {
|
||||
if (canContinue(world, x, y + 1, z) && y < world.getHeight()) {
|
||||
EntityFloatingBlock floating = new EntityFloatingBlock(world, x, y, z, world.getBlock(x, y, z), world.getBlockMetadata(x, y, z));
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(floating);
|
||||
}
|
||||
|
||||
|
@ -68,18 +58,15 @@ public class BlockFloating extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean canContinue(World world, int x, int y, int z)
|
||||
{
|
||||
public static boolean canContinue(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
Material material = block.getMaterial();
|
||||
|
||||
if (block == Blocks.air || block == Blocks.fire)
|
||||
{
|
||||
if (block == Blocks.air || block == Blocks.fire) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (material == Material.water || material == Material.lava)
|
||||
{
|
||||
if (material == Material.water || material == Material.lava) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,45 +40,33 @@ import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
|||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
|
||||
public class AetherClientEvents
|
||||
{
|
||||
public class AetherClientEvents {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClientTick(TickEvent.ClientTickEvent event) throws Exception
|
||||
{
|
||||
public void onClientTick(TickEvent.ClientTickEvent event) throws Exception {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
TickEvent.Phase phase = event.phase;
|
||||
TickEvent.Type type = event.type;
|
||||
|
||||
if (phase == TickEvent.Phase.END)
|
||||
{
|
||||
if (type.equals(TickEvent.Type.CLIENT))
|
||||
{
|
||||
if (!AetherConfig.triviaDisabled())
|
||||
{
|
||||
if (!(mc.loadingScreen instanceof AetherLoadingScreen))
|
||||
{
|
||||
if (phase == TickEvent.Phase.END) {
|
||||
if (type.equals(TickEvent.Type.CLIENT)) {
|
||||
if (!AetherConfig.triviaDisabled()) {
|
||||
if (!(mc.loadingScreen instanceof AetherLoadingScreen)) {
|
||||
mc.loadingScreen = new AetherLoadingScreen(mc);
|
||||
}
|
||||
}
|
||||
|
||||
if (mc.thePlayer != null && !(mc.thePlayer.movementInput instanceof AetherMovementInput))
|
||||
{
|
||||
if (mc.thePlayer != null && !(mc.thePlayer.movementInput instanceof AetherMovementInput)) {
|
||||
mc.thePlayer.movementInput = new AetherMovementInput(mc, mc.gameSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (phase == TickEvent.Phase.START)
|
||||
{
|
||||
if (type.equals(TickEvent.Type.CLIENT))
|
||||
{
|
||||
if (mc.currentScreen == null || mc.currentScreen.allowUserInput)
|
||||
{
|
||||
if (!mc.thePlayer.isUsingItem())
|
||||
{
|
||||
if (GameSettings.isKeyDown(mc.gameSettings.keyBindPickBlock))
|
||||
{
|
||||
if (phase == TickEvent.Phase.START) {
|
||||
if (type.equals(TickEvent.Type.CLIENT)) {
|
||||
if (mc.currentScreen == null || mc.currentScreen.allowUserInput) {
|
||||
if (!mc.thePlayer.isUsingItem()) {
|
||||
if (GameSettings.isKeyDown(mc.gameSettings.keyBindPickBlock)) {
|
||||
this.sendPickupPacket(mc);
|
||||
}
|
||||
}
|
||||
|
@ -87,17 +75,13 @@ public class AetherClientEvents
|
|||
}
|
||||
}
|
||||
|
||||
private void sendPickupPacket(Minecraft mc)
|
||||
{
|
||||
if (mc.objectMouseOver != null)
|
||||
{
|
||||
if (!this.onPickEntity(mc.objectMouseOver, mc.thePlayer, mc.theWorld))
|
||||
{
|
||||
private void sendPickupPacket(Minecraft mc) {
|
||||
if (mc.objectMouseOver != null) {
|
||||
if (!this.onPickEntity(mc.objectMouseOver, mc.thePlayer, mc.theWorld)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mc.thePlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (mc.thePlayer.capabilities.isCreativeMode) {
|
||||
int index = mc.thePlayer.inventoryContainer.inventorySlots.size() - 9 + mc.thePlayer.inventory.currentItem;
|
||||
|
||||
mc.playerController.sendSlotPacket(mc.thePlayer.inventory.getStackInSlot(mc.thePlayer.inventory.currentItem), index);
|
||||
|
@ -105,37 +89,30 @@ public class AetherClientEvents
|
|||
}
|
||||
}
|
||||
|
||||
private boolean onPickEntity(MovingObjectPosition target, EntityPlayer player, World world)
|
||||
{
|
||||
private boolean onPickEntity(MovingObjectPosition target, EntityPlayer player, World world) {
|
||||
ItemStack result = null;
|
||||
boolean isCreative = player.capabilities.isCreativeMode;
|
||||
|
||||
if (!isCreative)
|
||||
{
|
||||
if (!isCreative) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target.entityHit != null)
|
||||
{
|
||||
if (target.entityHit != null) {
|
||||
int id = EntitiesAether.getEntityID(target.entityHit);
|
||||
|
||||
if (id >= 0 && ItemAetherSpawnEgg.entityEggs.containsKey(id))
|
||||
{
|
||||
if (id >= 0 && ItemAetherSpawnEgg.entityEggs.containsKey(id)) {
|
||||
result = new ItemStack(ItemsAether.aether_spawn_egg, 1, id);
|
||||
}
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
if (result == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int x = 0; x < 9; x++)
|
||||
{
|
||||
for (int x = 0; x < 9; x++) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(x);
|
||||
|
||||
if (stack != null && stack.isItemEqual(result) && ItemStack.areItemStackTagsEqual(stack, result))
|
||||
{
|
||||
if (stack != null && stack.isItemEqual(result) && ItemStack.areItemStackTagsEqual(stack, result)) {
|
||||
player.inventory.currentItem = x;
|
||||
|
||||
return true;
|
||||
|
@ -144,8 +121,7 @@ public class AetherClientEvents
|
|||
|
||||
int slot = player.inventory.getFirstEmptyStack();
|
||||
|
||||
if (slot < 0 || slot >= 9)
|
||||
{
|
||||
if (slot < 0 || slot >= 9) {
|
||||
slot = player.inventory.currentItem;
|
||||
}
|
||||
|
||||
|
@ -156,28 +132,22 @@ public class AetherClientEvents
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBowPulled(FOVUpdateEvent event)
|
||||
{
|
||||
public void onBowPulled(FOVUpdateEvent event) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
if (player == null || (player != null && player.getCurrentEquippedItem() == null))
|
||||
{
|
||||
if (player == null || (player != null && player.getCurrentEquippedItem() == null)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Item item = player.getCurrentEquippedItem().getItem();
|
||||
|
||||
if (item == ItemsAether.phoenix_bow)
|
||||
{
|
||||
if (item == ItemsAether.phoenix_bow) {
|
||||
int i = player.getItemInUseDuration();
|
||||
float f1 = (float) i / 20.0F;
|
||||
|
||||
if (f1 > 1.0F)
|
||||
{
|
||||
if (f1 > 1.0F) {
|
||||
f1 = 1.0F;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
f1 = f1 * f1;
|
||||
}
|
||||
|
||||
|
@ -195,54 +165,41 @@ public class AetherClientEvents
|
|||
|
||||
@SubscribeEvent
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onGuiOpened(GuiScreenEvent.InitGuiEvent.Post event)
|
||||
{
|
||||
if (event.gui instanceof GuiContainer)
|
||||
{
|
||||
public void onGuiOpened(GuiScreenEvent.InitGuiEvent.Post event) {
|
||||
if (event.gui instanceof GuiContainer) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
Class<?> clazz = event.gui.getClass();
|
||||
|
||||
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) event.gui, "guiLeft", "field_147003_i");
|
||||
int guiTop = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) event.gui, "guiTop", "field_147009_r");
|
||||
|
||||
if (player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (event.gui instanceof GuiContainerCreative)
|
||||
{
|
||||
if (((GuiContainerCreative)event.gui).func_147056_g() == CreativeTabs.tabInventory.getTabIndex())
|
||||
{
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
if (event.gui instanceof GuiContainerCreative) {
|
||||
if (((GuiContainerCreative) event.gui).func_147056_g() == CreativeTabs.tabInventory.getTabIndex()) {
|
||||
event.buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 28, guiTop + 38));
|
||||
previousSelectedTabIndex = CreativeTabs.tabInventory.getTabIndex();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (clazz == GuiInventory.class)
|
||||
{
|
||||
} else if (clazz == GuiInventory.class) {
|
||||
event.buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 26, guiTop + 65));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMouseClicked(DrawScreenEvent.Post event)
|
||||
{
|
||||
if (Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative)
|
||||
{
|
||||
public void onMouseClicked(DrawScreenEvent.Post event) {
|
||||
if (Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) {
|
||||
GuiContainerCreative guiScreen = (GuiContainerCreative) Minecraft.getMinecraft().currentScreen;
|
||||
|
||||
if (previousSelectedTabIndex != guiScreen.func_147056_g())
|
||||
{
|
||||
if (previousSelectedTabIndex != guiScreen.func_147056_g()) {
|
||||
List<GuiButton> buttonList = ObfuscationReflectionHelper.getPrivateValue(GuiScreen.class, (GuiScreen) guiScreen, 4);
|
||||
|
||||
if (guiScreen.func_147056_g() == CreativeTabs.tabInventory.getTabIndex() && !buttonList.contains(ACCESSORY_BUTTON))
|
||||
{
|
||||
if (guiScreen.func_147056_g() == CreativeTabs.tabInventory.getTabIndex() && !buttonList.contains(ACCESSORY_BUTTON)) {
|
||||
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) guiScreen, "guiLeft", "field_147003_i");
|
||||
int guiTop = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) guiScreen, "guiTop", "field_147009_r");
|
||||
|
||||
buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 28, guiTop + 38));
|
||||
}
|
||||
else if (previousSelectedTabIndex == CreativeTabs.tabInventory.getTabIndex())
|
||||
{
|
||||
} else if (previousSelectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) {
|
||||
buttonList.remove(ACCESSORY_BUTTON);
|
||||
}
|
||||
|
||||
|
@ -252,26 +209,21 @@ public class AetherClientEvents
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onButtonPressed(GuiScreenEvent.ActionPerformedEvent.Pre event)
|
||||
{
|
||||
public void onButtonPressed(GuiScreenEvent.ActionPerformedEvent.Pre event) {
|
||||
Class<?> clazz = event.gui.getClass();
|
||||
|
||||
if ((clazz == GuiInventory.class || clazz == GuiContainerCreative.class) && event.button.id == 18067)
|
||||
{
|
||||
if ((clazz == GuiInventory.class || clazz == GuiContainerCreative.class) && event.button.id == 18067) {
|
||||
AetherNetwork.sendToServer(new PacketOpenContainer(AetherGuiHandler.accessories));
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderInvisibility(RenderPlayerEvent.Pre event)
|
||||
{
|
||||
public void onRenderInvisibility(RenderPlayerEvent.Pre event) {
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
PlayerAether playerAether = PlayerAether.get(player);
|
||||
|
||||
if (playerAether != null)
|
||||
{
|
||||
if (playerAether.getAccessoryInventory().wearingAccessory(new ItemStack(ItemsAether.invisibility_cape)))
|
||||
{
|
||||
if (playerAether != null) {
|
||||
if (playerAether.getAccessoryInventory().wearingAccessory(new ItemStack(ItemsAether.invisibility_cape))) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
@ -280,25 +232,20 @@ public class AetherClientEvents
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderAetherCape(RenderPlayerEvent.Specials.Pre event)
|
||||
{
|
||||
public void onRenderAetherCape(RenderPlayerEvent.Specials.Pre event) {
|
||||
event.renderCape = !PlayerAetherRenderer.instance().isCapeRendering();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderAetherArmor(SetArmorModel event)
|
||||
{
|
||||
if (event.stack != null && event.stack.getItem() instanceof ItemAetherArmor)
|
||||
{
|
||||
public void onRenderAetherArmor(SetArmorModel event) {
|
||||
if (event.stack != null && event.stack.getItem() instanceof ItemAetherArmor) {
|
||||
event.result = PlayerAetherRenderer.instance().renderAetherArmor(PlayerAether.get(event.entityPlayer), event.renderer, event.stack, 3 - event.slot);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderAccessories(RenderLivingEvent.Post event)
|
||||
{
|
||||
if (event.entity instanceof EntityPlayer)
|
||||
{
|
||||
public void onRenderAccessories(RenderLivingEvent.Post event) {
|
||||
if (event.entity instanceof EntityPlayer) {
|
||||
PlayerAether playerAether = PlayerAether.get((EntityPlayer) event.entity);
|
||||
|
||||
PlayerAetherRenderer.instance().renderAccessories(playerAether, (RenderPlayer) event.renderer, event.x, event.y, event.z, PlayerAetherRenderer.instance().getPartialTicks());
|
||||
|
|
|
@ -10,8 +10,7 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.util.MovementInputFromOptions;
|
||||
|
||||
public class AetherMovementInput extends MovementInputFromOptions
|
||||
{
|
||||
public class AetherMovementInput extends MovementInputFromOptions {
|
||||
|
||||
private Minecraft mc;
|
||||
|
||||
|
@ -21,8 +20,7 @@ public class AetherMovementInput extends MovementInputFromOptions
|
|||
|
||||
private boolean previousSneak;
|
||||
|
||||
public AetherMovementInput(Minecraft mc, GameSettings gameSettings)
|
||||
{
|
||||
public AetherMovementInput(Minecraft mc, GameSettings gameSettings) {
|
||||
super(gameSettings);
|
||||
|
||||
this.mc = mc;
|
||||
|
@ -30,8 +28,7 @@ public class AetherMovementInput extends MovementInputFromOptions
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updatePlayerMoveState()
|
||||
{
|
||||
public void updatePlayerMoveState() {
|
||||
super.updatePlayerMoveState();
|
||||
|
||||
this.jump = this.gameSettings.keyBindJump.getIsKeyPressed();
|
||||
|
@ -40,32 +37,25 @@ public class AetherMovementInput extends MovementInputFromOptions
|
|||
|
||||
this.sneak = isSneaking;
|
||||
|
||||
if (this.mc.thePlayer == null)
|
||||
{
|
||||
if (this.mc.thePlayer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.mc.thePlayer.ridingEntity instanceof EntitySaddleMount)
|
||||
{
|
||||
if (this.mc.thePlayer.ridingEntity instanceof EntitySaddleMount)
|
||||
{
|
||||
if (this.mc.thePlayer.ridingEntity instanceof EntitySaddleMount) {
|
||||
if (this.mc.thePlayer.ridingEntity instanceof EntitySaddleMount) {
|
||||
this.sneak = false;
|
||||
this.currentSneak = isSneaking;
|
||||
|
||||
if (this.previousSneak != this.currentSneak)
|
||||
{
|
||||
if (this.previousSneak != this.currentSneak) {
|
||||
AetherNetwork.sendToServer(new PacketSendSneaking(this.mc.thePlayer.getEntityId(), this.currentSneak));
|
||||
this.previousSneak = this.currentSneak;
|
||||
}
|
||||
|
||||
if (((EntityMountable) this.mc.thePlayer.ridingEntity).isOnGround())
|
||||
{
|
||||
if (((EntityMountable) this.mc.thePlayer.ridingEntity).isOnGround()) {
|
||||
this.sneak = isSneaking;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this.mc.thePlayer.ridingEntity instanceof EntitySwet && !((EntitySwet)this.mc.thePlayer.ridingEntity).isFriendly())
|
||||
{
|
||||
} else if (this.mc.thePlayer.ridingEntity instanceof EntitySwet && !((EntitySwet) this.mc.thePlayer.ridingEntity).isFriendly()) {
|
||||
this.sneak = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,14 +17,12 @@ import com.legacy.aether.client.renders.RendersAether;
|
|||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
public static final IIcon[] ACCESSORY_ICONS = new IIcon[8];
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
public void init() {
|
||||
berryBushRenderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
treasureChestRenderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
aetherFlowerRenderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
@ -43,20 +41,17 @@ public class ClientProxy extends CommonProxy
|
|||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(EntityPlayer player, String text)
|
||||
{
|
||||
public void sendMessage(EntityPlayer player, String text) {
|
||||
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(text));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openSunAltar()
|
||||
{
|
||||
public void openSunAltar() {
|
||||
FMLClientHandler.instance().getClient().displayGuiScreen(new GuiSunAltar());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityPlayer getPlayer()
|
||||
{
|
||||
public EntityPlayer getPlayer() {
|
||||
return Minecraft.getMinecraft().thePlayer;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,25 +16,20 @@ import cpw.mods.fml.common.gameevent.TickEvent;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class AetherMusicHandler
|
||||
{
|
||||
public class AetherMusicHandler {
|
||||
|
||||
private Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
private final AetherMusicTicker musicTicker = new AetherMusicTicker(this.mc);
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClientTick(TickEvent.ClientTickEvent event) throws Exception
|
||||
{
|
||||
public void onClientTick(TickEvent.ClientTickEvent event) throws Exception {
|
||||
TickEvent.Phase phase = event.phase;
|
||||
TickEvent.Type type = event.type;
|
||||
|
||||
if (phase == TickEvent.Phase.END)
|
||||
{
|
||||
if (type.equals(TickEvent.Type.CLIENT))
|
||||
{
|
||||
if (!this.mc.isGamePaused())
|
||||
{
|
||||
if (phase == TickEvent.Phase.END) {
|
||||
if (type.equals(TickEvent.Type.CLIENT)) {
|
||||
if (!this.mc.isGamePaused()) {
|
||||
this.musicTicker.update();
|
||||
}
|
||||
}
|
||||
|
@ -42,31 +37,24 @@ public class AetherMusicHandler
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMusicControl(PlaySoundEvent17 event)
|
||||
{
|
||||
public void onMusicControl(PlaySoundEvent17 event) {
|
||||
ISound sound = event.result;
|
||||
|
||||
if (sound == null)
|
||||
{
|
||||
if (sound == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
SoundCategory category = event.category;
|
||||
|
||||
if (category == SoundCategory.MUSIC)
|
||||
{
|
||||
if (this.mc.thePlayer != null && this.mc.thePlayer.dimension == AetherConfig.getAetherDimensionID())
|
||||
{
|
||||
if (!sound.getPositionedSoundLocation().toString().contains("aether_legacy") && (this.musicTicker.playingMusic() || !this.musicTicker.playingMusic()))
|
||||
{
|
||||
if (category == SoundCategory.MUSIC) {
|
||||
if (this.mc.thePlayer != null && this.mc.thePlayer.dimension == AetherConfig.getAetherDimensionID()) {
|
||||
if (!sound.getPositionedSoundLocation().toString().contains("aether_legacy") && (this.musicTicker.playingMusic() || !this.musicTicker.playingMusic())) {
|
||||
event.result = null;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (category == SoundCategory.RECORDS)
|
||||
{
|
||||
} else if (category == SoundCategory.RECORDS) {
|
||||
this.musicTicker.stopMusic();
|
||||
this.mc.getSoundHandler().stopSounds();
|
||||
|
||||
|
@ -75,8 +63,7 @@ public class AetherMusicHandler
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static ISound getAchievementSound(int number)
|
||||
{
|
||||
public static ISound getAchievementSound(int number) {
|
||||
ResourceLocation sound = number == 1 ? Aether.locate("achievement_bronze") : number == 2 ? Aether.locate("achievement_silver") : Aether.locate("achievement");
|
||||
|
||||
return PositionedSoundRecord.func_147673_a(sound);
|
||||
|
|
|
@ -17,29 +17,23 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class AetherMusicTicker implements IUpdatePlayerListBox
|
||||
{
|
||||
public class AetherMusicTicker implements IUpdatePlayerListBox {
|
||||
|
||||
private final Random rand = new Random();
|
||||
private final Minecraft mc;
|
||||
private ISound currentMusic;
|
||||
private int timeUntilNextMusic = 100;
|
||||
|
||||
public AetherMusicTicker(Minecraft mcIn)
|
||||
{
|
||||
public AetherMusicTicker(Minecraft mcIn) {
|
||||
this.mc = mcIn;
|
||||
}
|
||||
|
||||
public void update()
|
||||
{
|
||||
public void update() {
|
||||
TrackType tracktype = this.getRandomTrack();
|
||||
|
||||
if (this.mc.thePlayer != null)
|
||||
{
|
||||
if (this.mc.gameSettings.getSoundLevel(SoundCategory.MUSIC) == 0.0F)
|
||||
{
|
||||
if (this.currentMusic != null)
|
||||
{
|
||||
if (this.mc.thePlayer != null) {
|
||||
if (this.mc.gameSettings.getSoundLevel(SoundCategory.MUSIC) == 0.0F) {
|
||||
if (this.currentMusic != null) {
|
||||
this.stopMusic();
|
||||
this.currentMusic = null;
|
||||
}
|
||||
|
@ -47,16 +41,11 @@ public class AetherMusicTicker implements IUpdatePlayerListBox
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.mc.thePlayer.dimension != AetherConfig.getAetherDimensionID())
|
||||
{
|
||||
if (this.mc.thePlayer.dimension != AetherConfig.getAetherDimensionID()) {
|
||||
this.stopMusic();
|
||||
}
|
||||
else if (this.mc.thePlayer.dimension == AetherConfig.getAetherDimensionID())
|
||||
{
|
||||
if (this.currentMusic != null)
|
||||
{
|
||||
if (!this.mc.getSoundHandler().isSoundPlaying(this.currentMusic))
|
||||
{
|
||||
} else if (this.mc.thePlayer.dimension == AetherConfig.getAetherDimensionID()) {
|
||||
if (this.currentMusic != null) {
|
||||
if (!this.mc.getSoundHandler().isSoundPlaying(this.currentMusic)) {
|
||||
this.currentMusic = null;
|
||||
this.timeUntilNextMusic = Math.min(MathHelper.getRandomIntegerInRange(this.rand, tracktype.getMinDelay(), tracktype.getMaxDelay()), this.timeUntilNextMusic);
|
||||
}
|
||||
|
@ -64,37 +53,31 @@ public class AetherMusicTicker implements IUpdatePlayerListBox
|
|||
|
||||
this.timeUntilNextMusic = Math.min(this.timeUntilNextMusic, tracktype.getMaxDelay());
|
||||
|
||||
if (this.currentMusic == null && this.timeUntilNextMusic-- <= 0)
|
||||
{
|
||||
if (this.currentMusic == null && this.timeUntilNextMusic-- <= 0) {
|
||||
this.playMusic(tracktype);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean playingMusic()
|
||||
{
|
||||
public boolean playingMusic() {
|
||||
return this.currentMusic != null;
|
||||
}
|
||||
|
||||
public AetherMusicTicker.TrackType getRandomTrack()
|
||||
{
|
||||
public AetherMusicTicker.TrackType getRandomTrack() {
|
||||
int num = this.rand.nextInt(4);
|
||||
|
||||
return num == 0 ? TrackType.TRACK_ONE : num == 1 ? TrackType.TRACK_TWO : num == 2 ? TrackType.TRACK_THREE : TrackType.TRACK_FOUR;
|
||||
}
|
||||
|
||||
public void playMusic(TrackType requestedMusicType)
|
||||
{
|
||||
public void playMusic(TrackType requestedMusicType) {
|
||||
this.currentMusic = PositionedSoundRecord.func_147673_a(requestedMusicType.getMusicLocation());
|
||||
this.mc.getSoundHandler().playSound(this.currentMusic);
|
||||
this.timeUntilNextMusic = Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
public void stopMusic()
|
||||
{
|
||||
if (this.currentMusic != null)
|
||||
{
|
||||
public void stopMusic() {
|
||||
if (this.currentMusic != null) {
|
||||
this.mc.getSoundHandler().stopSound(this.currentMusic);
|
||||
this.currentMusic = null;
|
||||
this.timeUntilNextMusic = 0;
|
||||
|
@ -102,8 +85,7 @@ public class AetherMusicTicker implements IUpdatePlayerListBox
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static enum TrackType
|
||||
{
|
||||
public static enum TrackType {
|
||||
TRACK_ONE(Aether.locate("music.aether1"), 1200, 1500),
|
||||
TRACK_TWO(Aether.locate("music.aether2"), 1200, 1500),
|
||||
TRACK_THREE(Aether.locate("music.aether3"), 1200, 1500),
|
||||
|
@ -113,25 +95,21 @@ public class AetherMusicTicker implements IUpdatePlayerListBox
|
|||
private final int minDelay;
|
||||
private final int maxDelay;
|
||||
|
||||
private TrackType(ResourceLocation musicLocationIn, int minDelayIn, int maxDelayIn)
|
||||
{
|
||||
private TrackType(ResourceLocation musicLocationIn, int minDelayIn, int maxDelayIn) {
|
||||
this.musicLocation = musicLocationIn;
|
||||
this.minDelay = minDelayIn;
|
||||
this.maxDelay = maxDelayIn;
|
||||
}
|
||||
|
||||
public ResourceLocation getMusicLocation()
|
||||
{
|
||||
public ResourceLocation getMusicLocation() {
|
||||
return this.musicLocation;
|
||||
}
|
||||
|
||||
public int getMinDelay()
|
||||
{
|
||||
public int getMinDelay() {
|
||||
return this.minDelay;
|
||||
}
|
||||
|
||||
public int getMaxDelay()
|
||||
{
|
||||
public int getMaxDelay() {
|
||||
return this.maxDelay;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@ import com.legacy.aether.client.gui.trivia.AetherTrivia;
|
|||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class AetherLoadingScreen extends LoadingScreenRenderer
|
||||
{
|
||||
public class AetherLoadingScreen extends LoadingScreenRenderer {
|
||||
|
||||
private String message = "";
|
||||
|
||||
|
@ -29,8 +28,7 @@ public class AetherLoadingScreen extends LoadingScreenRenderer
|
|||
|
||||
private Framebuffer framebuffer;
|
||||
|
||||
public AetherLoadingScreen(Minecraft mcIn)
|
||||
{
|
||||
public AetherLoadingScreen(Minecraft mcIn) {
|
||||
super(mcIn);
|
||||
|
||||
this.mc = mcIn;
|
||||
|
@ -40,16 +38,14 @@ public class AetherLoadingScreen extends LoadingScreenRenderer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void resetProgressAndMessage(String message)
|
||||
{
|
||||
public void resetProgressAndMessage(String message) {
|
||||
super.resetProgressAndMessage(message);
|
||||
|
||||
this.currentDisplayedTrivia = AetherTrivia.getNewTrivia();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayProgressMessage(String message)
|
||||
{
|
||||
public void displayProgressMessage(String message) {
|
||||
this.systemTime = 0L;
|
||||
this.message = message;
|
||||
this.setLoadingProgress(-1);
|
||||
|
@ -57,24 +53,19 @@ public class AetherLoadingScreen extends LoadingScreenRenderer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setLoadingProgress(int progress)
|
||||
{
|
||||
public void setLoadingProgress(int progress) {
|
||||
long j = Minecraft.getSystemTime();
|
||||
|
||||
if (j - this.systemTime >= 100L)
|
||||
{
|
||||
if (j - this.systemTime >= 100L) {
|
||||
this.systemTime = j;
|
||||
ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
|
||||
int k = scaledresolution.getScaleFactor();
|
||||
int l = scaledresolution.getScaledWidth();
|
||||
int i1 = scaledresolution.getScaledHeight();
|
||||
|
||||
if (OpenGlHelper.isFramebufferEnabled())
|
||||
{
|
||||
if (OpenGlHelper.isFramebufferEnabled()) {
|
||||
this.framebuffer.framebufferClear();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
|
@ -86,13 +77,11 @@ public class AetherLoadingScreen extends LoadingScreenRenderer
|
|||
GL11.glLoadIdentity();
|
||||
GL11.glTranslatef(0.0F, 0.0F, -200.0F);
|
||||
|
||||
if (!OpenGlHelper.isFramebufferEnabled())
|
||||
{
|
||||
if (!OpenGlHelper.isFramebufferEnabled()) {
|
||||
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
if (!FMLClientHandler.instance().handleLoadingScreen(scaledresolution))
|
||||
{
|
||||
if (!FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
|
||||
float f = 32.0F;
|
||||
|
@ -104,8 +93,7 @@ public class AetherLoadingScreen extends LoadingScreenRenderer
|
|||
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
|
||||
if (progress >= 0)
|
||||
{
|
||||
if (progress >= 0) {
|
||||
byte b0 = 100;
|
||||
byte b1 = 2;
|
||||
int j1 = l / 2 - b0 / 2;
|
||||
|
@ -135,19 +123,15 @@ public class AetherLoadingScreen extends LoadingScreenRenderer
|
|||
|
||||
this.framebuffer.unbindFramebuffer();
|
||||
|
||||
if (OpenGlHelper.isFramebufferEnabled())
|
||||
{
|
||||
if (OpenGlHelper.isFramebufferEnabled()) {
|
||||
this.framebuffer.framebufferRender(l * k, i1 * k);
|
||||
}
|
||||
|
||||
this.mc.func_147120_f();
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
Thread.yield();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
} catch (Exception exception) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,43 +13,35 @@ import com.legacy.aether.player.PlayerAether;
|
|||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class GuiAetherInGame extends Gui
|
||||
{
|
||||
public class GuiAetherInGame extends Gui {
|
||||
|
||||
private Minecraft mc;
|
||||
|
||||
public GuiAetherInGame(Minecraft mc)
|
||||
{
|
||||
public GuiAetherInGame(Minecraft mc) {
|
||||
super();
|
||||
this.mc = mc;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderBlockOverlay(RenderBlockOverlayEvent event)
|
||||
{
|
||||
if (this.mc.thePlayer != null)
|
||||
{
|
||||
public void onRenderBlockOverlay(RenderBlockOverlayEvent event) {
|
||||
if (this.mc.thePlayer != null) {
|
||||
PlayerAether player = PlayerAether.get(this.mc.thePlayer);
|
||||
|
||||
if (player.getAccessoryInventory().isWearingPhoenixSet() && event.overlayType == OverlayType.FIRE)
|
||||
{
|
||||
if (player.getAccessoryInventory().isWearingPhoenixSet() && event.overlayType == OverlayType.FIRE) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderGui(RenderGameOverlayEvent event)
|
||||
{
|
||||
if (event.isCancelable() || event.type != ElementType.TEXT)
|
||||
{
|
||||
public void onRenderGui(RenderGameOverlayEvent event) {
|
||||
if (event.isCancelable() || event.type != ElementType.TEXT) {
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerAether player = PlayerAether.get(this.mc.thePlayer);
|
||||
|
||||
if (player.getEntity() != null)
|
||||
{
|
||||
if (player.getEntity() != null) {
|
||||
AetherOverlay.renderCure(this.mc);
|
||||
AetherOverlay.renderPoison(this.mc);
|
||||
AetherOverlay.renderIronBubble(this.mc);
|
||||
|
@ -60,8 +52,7 @@ public class GuiAetherInGame extends Gui
|
|||
|
||||
float portalTime = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * event.partialTicks;//player.portalAnimTime * 1.2F + (player.prevPortalAnimTime - player.portalAnimTime);
|
||||
|
||||
if(portalTime > 0.0F)
|
||||
{
|
||||
if (portalTime > 0.0F) {
|
||||
AetherOverlay.renderAetherPortal(portalTime, new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,22 +15,19 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiEnchanter extends GuiContainer
|
||||
{
|
||||
public class GuiEnchanter extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = Aether.locate("textures/gui/altar.png");
|
||||
|
||||
private TileEntityEnchanter enchanter;
|
||||
|
||||
public GuiEnchanter(InventoryPlayer inventory, TileEntityEnchanter tileEntity)
|
||||
{
|
||||
public GuiEnchanter(InventoryPlayer inventory, TileEntityEnchanter tileEntity) {
|
||||
super(new ContainerEnchanter(inventory, tileEntity));
|
||||
this.enchanter = tileEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
String enchanterName = this.enchanter.getInventoryName();
|
||||
|
||||
this.fontRendererObj.drawString(enchanterName, this.xSize / 2 - this.fontRendererObj.getStringWidth(enchanterName) / 2, 6, 4210752);
|
||||
|
@ -38,8 +35,7 @@ public class GuiEnchanter extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(TEXTURE);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -47,8 +43,7 @@ public class GuiEnchanter extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
int i1;
|
||||
|
||||
if (this.enchanter.isEnchanting())
|
||||
{
|
||||
if (this.enchanter.isEnchanting()) {
|
||||
i1 = this.enchanter.getEnchantmentTimeRemaining(12);
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2);
|
||||
}
|
||||
|
|
|
@ -15,22 +15,19 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiFreezer extends GuiContainer
|
||||
{
|
||||
public class GuiFreezer extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = Aether.locate("textures/gui/altar.png");
|
||||
|
||||
private TileEntityFreezer freezer;
|
||||
|
||||
public GuiFreezer(InventoryPlayer inventory, TileEntityFreezer tileEntity)
|
||||
{
|
||||
public GuiFreezer(InventoryPlayer inventory, TileEntityFreezer tileEntity) {
|
||||
super(new ContainerFreezer(inventory, tileEntity));
|
||||
this.freezer = tileEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
String freezerName = this.freezer.getInventoryName();
|
||||
|
||||
this.fontRendererObj.drawString(freezerName, this.xSize / 2 - this.fontRendererObj.getStringWidth(freezerName) / 2, 6, 4210752);
|
||||
|
@ -38,8 +35,7 @@ public class GuiFreezer extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(TEXTURE);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -47,8 +43,7 @@ public class GuiFreezer extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
int i1;
|
||||
|
||||
if (this.freezer.isFreezing())
|
||||
{
|
||||
if (this.freezer.isFreezing()) {
|
||||
i1 = this.freezer.getFreezingTimeRemaining(12);
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2);
|
||||
}
|
||||
|
|
|
@ -12,23 +12,20 @@ import com.legacy.aether.Aether;
|
|||
import com.legacy.aether.inventory.ContainerIncubator;
|
||||
import com.legacy.aether.tileentity.TileEntityIncubator;
|
||||
|
||||
public class GuiIncubator extends GuiContainer
|
||||
{
|
||||
public class GuiIncubator extends GuiContainer {
|
||||
|
||||
private TileEntityIncubator incubatorInventory;
|
||||
|
||||
private static final ResourceLocation TEXTURE_INCUBATOR = Aether.locate("textures/gui/incubator.png");
|
||||
|
||||
public GuiIncubator(EntityPlayer player, InventoryPlayer inventoryplayer, TileEntityIncubator tileentityIncubator)
|
||||
{
|
||||
public GuiIncubator(EntityPlayer player, InventoryPlayer inventoryplayer, TileEntityIncubator tileentityIncubator) {
|
||||
super(new ContainerIncubator(player, inventoryplayer, tileentityIncubator));
|
||||
|
||||
this.incubatorInventory = (TileEntityIncubator) tileentityIncubator;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
String incubatorName = this.incubatorInventory.getInventoryName();
|
||||
|
||||
this.fontRendererObj.drawString(incubatorName, this.xSize / 2 - this.fontRendererObj.getStringWidth(incubatorName) / 2, 6, 4210752);
|
||||
|
@ -36,8 +33,7 @@ public class GuiIncubator extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int ia, int ib)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int ia, int ib) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
this.mc.renderEngine.bindTexture(TEXTURE_INCUBATOR);
|
||||
|
@ -47,8 +43,7 @@ public class GuiIncubator extends GuiContainer
|
|||
|
||||
this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if (this.incubatorInventory.isIncubating())
|
||||
{
|
||||
if (this.incubatorInventory.isIncubating()) {
|
||||
int l = this.incubatorInventory.getPowerTimeRemainingScaled(12);
|
||||
|
||||
this.drawTexturedModalRect(j + 74, (k + 47) - l, 176, 12 - l, 14, l + 2);
|
||||
|
|
|
@ -16,8 +16,7 @@ import com.legacy.aether.client.gui.button.GuiLoreButton;
|
|||
import com.legacy.aether.inventory.ContainerLore;
|
||||
import com.legacy.aether.registry.AetherLore;
|
||||
|
||||
public class GuiLore extends GuiContainer
|
||||
{
|
||||
public class GuiLore extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE_LORE = Aether.locate("textures/gui/lore.png");
|
||||
|
||||
|
@ -31,16 +30,15 @@ public class GuiLore extends GuiContainer
|
|||
|
||||
private int pageNumber;
|
||||
|
||||
public GuiLore(InventoryPlayer inventoryplayer)
|
||||
{
|
||||
public GuiLore(InventoryPlayer inventoryplayer) {
|
||||
super(new ContainerLore(inventoryplayer));
|
||||
|
||||
this.xSize = 256; this.ySize = 195;
|
||||
this.xSize = 256;
|
||||
this.ySize = 195;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
this.previousPage = new GuiLoreButton(19, this.width / 2 - 110, this.height / 2 + 72, 20, 20, "<");
|
||||
|
@ -51,22 +49,17 @@ public class GuiLore extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button)
|
||||
{
|
||||
if (this.previousPage == button)
|
||||
{
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
if (this.previousPage == button) {
|
||||
--this.pageNumber;
|
||||
}
|
||||
else if (this.nextPage == button)
|
||||
{
|
||||
} else if (this.nextPage == button) {
|
||||
++this.pageNumber;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
this.fontRendererObj.drawString("Prev.", 16, 160, 4210752);
|
||||
this.fontRendererObj.drawString("Next", 218, 160, 4210752);
|
||||
|
||||
|
@ -77,10 +70,8 @@ public class GuiLore extends GuiContainer
|
|||
|
||||
ItemStack searchedStack = ((ContainerLore) this.inventorySlots).loreSlot.getStackInSlot(0);
|
||||
|
||||
if (searchedStack != null)
|
||||
{
|
||||
if (this.currentItem == null || (searchedStack.getItem() != this.currentItem.getItem() || (!searchedStack.isItemStackDamageable() && searchedStack.getItemDamage() != this.currentItem.getItemDamage())))
|
||||
{
|
||||
if (searchedStack != null) {
|
||||
if (this.currentItem == null || (searchedStack.getItem() != this.currentItem.getItem() || (!searchedStack.isItemStackDamageable() && searchedStack.getItemDamage() != this.currentItem.getItemDamage()))) {
|
||||
this.pageNumber = 0;
|
||||
this.stringToLoad = AetherLore.getLoreEntry(searchedStack);
|
||||
this.currentItem = searchedStack;
|
||||
|
@ -88,8 +79,7 @@ public class GuiLore extends GuiContainer
|
|||
|
||||
int nameSize = 0;
|
||||
|
||||
for (String name : ((List<String>) this.fontRendererObj.listFormattedStringToWidth(searchedStack.getItem().getItemStackDisplayName(searchedStack), 109)))
|
||||
{
|
||||
for (String name : ((List<String>) this.fontRendererObj.listFormattedStringToWidth(searchedStack.getItem().getItemStackDisplayName(searchedStack), 109))) {
|
||||
this.drawCenteredString(this.fontRendererObj, searchedStack.getRarity().rarityColor.toString() + name, 71, 18 + (10 * nameSize), 4210752);
|
||||
|
||||
++nameSize;
|
||||
|
@ -97,10 +87,8 @@ public class GuiLore extends GuiContainer
|
|||
|
||||
int size = 0;
|
||||
|
||||
for (String lore : ((List<String>) this.fontRendererObj.listFormattedStringToWidth(this.stringToLoad, 109)))
|
||||
{
|
||||
if (size >= 15 * this.pageNumber && size + (nameSize - 1) <= 15 * (this.pageNumber + 1))
|
||||
{
|
||||
for (String lore : ((List<String>) this.fontRendererObj.listFormattedStringToWidth(this.stringToLoad, 109))) {
|
||||
if (size >= 15 * this.pageNumber && size + (nameSize - 1) <= 15 * (this.pageNumber + 1)) {
|
||||
int actualSize = this.pageNumber >= 1 ? size - ((15 - (nameSize - 1)) * this.pageNumber) : size + (nameSize - 1);
|
||||
|
||||
this.fontRendererObj.drawString(lore, (((actualSize >= 6 ? 184 : 71)) - this.fontRendererObj.getStringWidth(lore) / 2), (actualSize >= 6 ? -68 : 28) + (10 * actualSize), 4210752);
|
||||
|
@ -111,9 +99,7 @@ public class GuiLore extends GuiContainer
|
|||
|
||||
this.previousPage.enabled = this.pageNumber != 0;
|
||||
this.nextPage.enabled = size > (15 * (this.pageNumber + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.pageNumber = 0;
|
||||
this.stringToLoad = "";
|
||||
this.currentItem = null;
|
||||
|
@ -121,8 +107,7 @@ public class GuiLore extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i1, int i2)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i1, int i2) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
int j = (this.width - this.xSize) / 2;
|
||||
|
|
|
@ -9,22 +9,19 @@ import net.minecraft.world.World;
|
|||
import com.legacy.aether.Aether;
|
||||
import com.legacy.aether.client.gui.button.GuiSunAltarSlider;
|
||||
|
||||
public class GuiSunAltar extends GuiScreen
|
||||
{
|
||||
public class GuiSunAltar extends GuiScreen {
|
||||
|
||||
private static final ResourceLocation TEXTURE = Aether.locate("textures/gui/sun_altar.png");
|
||||
|
||||
private World world;
|
||||
|
||||
public GuiSunAltar()
|
||||
{
|
||||
public GuiSunAltar() {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
this.world = this.mc.theWorld;
|
||||
|
@ -33,8 +30,7 @@ public class GuiSunAltar extends GuiScreen
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
this.drawDefaultBackground();
|
||||
this.mc.renderEngine.bindTexture(TEXTURE);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
@ -51,8 +47,7 @@ public class GuiSunAltar extends GuiScreen
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
public boolean doesGuiPauseGame() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,16 +13,14 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiTreasureChest extends GuiContainer
|
||||
{
|
||||
public class GuiTreasureChest extends GuiContainer {
|
||||
private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("textures/gui/container/generic_54.png");
|
||||
|
||||
private final int inventoryRows;
|
||||
|
||||
private String chestType;
|
||||
|
||||
public GuiTreasureChest(InventoryPlayer playerInventory, TileEntityTreasureChest chestInventory)
|
||||
{
|
||||
public GuiTreasureChest(InventoryPlayer playerInventory, TileEntityTreasureChest chestInventory) {
|
||||
super(new ContainerChest(playerInventory, chestInventory));
|
||||
|
||||
this.allowUserInput = false;
|
||||
|
@ -31,20 +29,13 @@ public class GuiTreasureChest extends GuiContainer
|
|||
|
||||
this.ySize = 114 + this.inventoryRows * 18;
|
||||
|
||||
if (chestInventory.getKind() == 0)
|
||||
{
|
||||
if (chestInventory.getKind() == 0) {
|
||||
this.chestType = "Bronze Treasure Chest";
|
||||
}
|
||||
else if (chestInventory.getKind() == 1)
|
||||
{
|
||||
} else if (chestInventory.getKind() == 1) {
|
||||
this.chestType = "Silver Treasure Chest";
|
||||
}
|
||||
else if (chestInventory.getKind() == 2)
|
||||
{
|
||||
} else if (chestInventory.getKind() == 2) {
|
||||
this.chestType = "Gold Treasure Chest";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.chestType = "Platinum Treasure Chest";
|
||||
}
|
||||
}
|
||||
|
@ -52,16 +43,14 @@ public class GuiTreasureChest extends GuiContainer
|
|||
/**
|
||||
* Draw the foreground layer for the GuiContainer (everything in front of the items)
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
this.fontRendererObj.drawString(this.chestType, 8, 6, 4210752);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the background layer of this container (behind the items).
|
||||
*/
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
|
||||
int i = (this.width - this.xSize) / 2;
|
||||
|
|
|
@ -8,20 +8,17 @@ import org.lwjgl.opengl.GL11;
|
|||
|
||||
import com.legacy.aether.Aether;
|
||||
|
||||
public class GuiAccessoryButton extends GuiButton
|
||||
{
|
||||
public class GuiAccessoryButton extends GuiButton {
|
||||
|
||||
protected static final ResourceLocation BUTTON_TEXTURE = Aether.locate("textures/gui/inventory/button/cloud.png");
|
||||
|
||||
protected static final ResourceLocation BUTTON_HOVERED_TEXTURE = Aether.locate("textures/gui/inventory/button/cloud_hover.png");
|
||||
|
||||
public GuiAccessoryButton(int x, int y)
|
||||
{
|
||||
public GuiAccessoryButton(int x, int y) {
|
||||
super(18067, x, y, 12, 12, "");
|
||||
}
|
||||
|
||||
public GuiAccessoryButton setPosition(int x, int y)
|
||||
{
|
||||
public GuiAccessoryButton setPosition(int x, int y) {
|
||||
this.xPosition = x;
|
||||
this.yPosition = y;
|
||||
|
||||
|
@ -29,12 +26,10 @@ public class GuiAccessoryButton extends GuiButton
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY)
|
||||
{
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
|
||||
if (this.visible)
|
||||
{
|
||||
if (this.visible) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glPushMatrix();
|
||||
int i = this.getHoverState(this.field_146123_n);
|
||||
|
|
|
@ -13,8 +13,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiAetherButton extends GuiButton
|
||||
{
|
||||
public class GuiAetherButton extends GuiButton {
|
||||
|
||||
protected static final ResourceLocation buttonTextures = Aether.locate("textures/gui/buttons.png");
|
||||
|
||||
|
@ -30,47 +29,34 @@ public class GuiAetherButton extends GuiButton
|
|||
|
||||
public boolean retracting = false;
|
||||
|
||||
public GuiAetherButton(int i, int j, int k, String s)
|
||||
{
|
||||
public GuiAetherButton(int i, int j, int k, String s) {
|
||||
super(i, j, k, s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHoverState(boolean flag)
|
||||
{
|
||||
public int getHoverState(boolean flag) {
|
||||
byte byte0 = 1;
|
||||
|
||||
if (!this.enabled)
|
||||
{
|
||||
if (!this.enabled) {
|
||||
byte0 = 0;
|
||||
}
|
||||
else if (flag)
|
||||
{
|
||||
if (byte0 < 2)
|
||||
{
|
||||
} else if (flag) {
|
||||
if (byte0 < 2) {
|
||||
byte0++;
|
||||
}
|
||||
if (this.scrollCrop < this.scrollCropMax)
|
||||
{
|
||||
if (this.scrollCrop < this.scrollCropMax) {
|
||||
this.scrollCrop += 4;
|
||||
}
|
||||
if (this.scrollHeight < this.scrollMin)
|
||||
{
|
||||
if (this.scrollHeight < this.scrollMin) {
|
||||
this.scrollHeight += 4;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.scrollCrop > this.scrollCropMax)
|
||||
{
|
||||
} else {
|
||||
if (this.scrollCrop > this.scrollCropMax) {
|
||||
this.scrollCrop -= 4;
|
||||
}
|
||||
if (this.scrollHeight > this.scrollMax)
|
||||
{
|
||||
if (this.scrollHeight > this.scrollMax) {
|
||||
this.scrollHeight -= 4;
|
||||
}
|
||||
if (this.scrollHeight == this.scrollMax)
|
||||
{
|
||||
if (this.scrollHeight == this.scrollMax) {
|
||||
this.retracting = false;
|
||||
}
|
||||
}
|
||||
|
@ -79,10 +65,8 @@ public class GuiAetherButton extends GuiButton
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft minecraft, int i, int j)
|
||||
{
|
||||
if (!this.visible)
|
||||
{
|
||||
public void drawButton(Minecraft minecraft, int i, int j) {
|
||||
if (!this.visible) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -100,33 +84,25 @@ public class GuiAetherButton extends GuiButton
|
|||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
if (!this.enabled)
|
||||
{
|
||||
if (!this.enabled) {
|
||||
this.drawString(fontrenderer, this.displayString, this.xPosition + this.width / 10 + this.scrollHeight - 80, this.yPosition + (this.height - 8) / 2, -6250336);
|
||||
}
|
||||
else if (flag)
|
||||
{
|
||||
} else if (flag) {
|
||||
this.drawString(fontrenderer, this.displayString, this.xPosition + this.width / 10 + this.scrollHeight - 80, this.yPosition + (this.height - 8) / 2, 0x77cccc);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.drawString(fontrenderer, this.displayString, this.xPosition + this.width / 10 + this.scrollHeight - 80, this.yPosition + (this.height - 8) / 2, 14737632);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseDragged(Minecraft var1, int var2, int var3)
|
||||
{
|
||||
protected void mouseDragged(Minecraft var1, int var2, int var3) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(int var1, int var2)
|
||||
{
|
||||
public void mouseReleased(int var1, int var2) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mousePressed(Minecraft var1, int var2, int var3)
|
||||
{
|
||||
public boolean mousePressed(Minecraft var1, int var2, int var3) {
|
||||
return this.enabled && this.visible && var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,11 +2,9 @@ package com.legacy.aether.client.gui.button;
|
|||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
public class GuiButtonPerks extends GuiButton
|
||||
{
|
||||
public class GuiButtonPerks extends GuiButton {
|
||||
|
||||
public GuiButtonPerks(int xPos, int yPos)
|
||||
{
|
||||
public GuiButtonPerks(int xPos, int yPos) {
|
||||
super(24, xPos, yPos, 20, 20, "?");
|
||||
}
|
||||
|
||||
|
|
|
@ -4,35 +4,26 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
public class GuiDescButton extends GuiButton
|
||||
{
|
||||
public class GuiDescButton extends GuiButton {
|
||||
|
||||
public String descText;
|
||||
|
||||
public GuiDescButton(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText, String descText)
|
||||
{
|
||||
public GuiDescButton(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText, String descText) {
|
||||
super(buttonId, x, y, widthIn, heightIn, buttonText);
|
||||
this.descText = descText;
|
||||
}
|
||||
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY)
|
||||
{
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
|
||||
super.drawButton(mc, mouseX, mouseY);
|
||||
|
||||
FontRenderer fontrenderer = mc.fontRenderer;
|
||||
|
||||
if (this.visible && this.field_146123_n)
|
||||
{
|
||||
if (this.displayString == "Q")
|
||||
{
|
||||
if (this.visible && this.field_146123_n) {
|
||||
if (this.displayString == "Q") {
|
||||
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + (this.width + 50) / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
|
||||
}
|
||||
else if (this.displayString == "W")
|
||||
{
|
||||
} else if (this.displayString == "W") {
|
||||
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + (this.width - 50) / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + this.width / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,21 +10,17 @@ import org.lwjgl.opengl.GL11;
|
|||
|
||||
import com.legacy.aether.Aether;
|
||||
|
||||
public class GuiLoreButton extends GuiButton
|
||||
{
|
||||
public class GuiLoreButton extends GuiButton {
|
||||
|
||||
protected static final ResourceLocation BUTTON_TEXTURES = Aether.locate("textures/gui/lore_widgets.png");
|
||||
|
||||
public GuiLoreButton(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText)
|
||||
{
|
||||
public GuiLoreButton(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText) {
|
||||
super(buttonId, x, y, widthIn, heightIn, buttonText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY)
|
||||
{
|
||||
if (this.visible)
|
||||
{
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
|
||||
if (this.visible) {
|
||||
FontRenderer fontrenderer = mc.fontRenderer;
|
||||
mc.getTextureManager().bindTexture(BUTTON_TEXTURES);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
@ -38,17 +34,11 @@ public class GuiLoreButton extends GuiButton
|
|||
this.mouseDragged(mc, mouseX, mouseY);
|
||||
int j = 14737632;
|
||||
|
||||
if (this.packedFGColour != 0)
|
||||
{
|
||||
if (this.packedFGColour != 0) {
|
||||
j = this.packedFGColour;
|
||||
}
|
||||
else
|
||||
if (!this.enabled)
|
||||
{
|
||||
} else if (!this.enabled) {
|
||||
j = 10526880;
|
||||
}
|
||||
else if (this.field_146123_n)
|
||||
{
|
||||
} else if (this.field_146123_n) {
|
||||
j = 16777120;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,7 @@ import org.lwjgl.opengl.GL11;
|
|||
import com.legacy.aether.network.AetherNetwork;
|
||||
import com.legacy.aether.network.packets.PacketSetTime;
|
||||
|
||||
public class GuiSunAltarSlider extends GuiButton
|
||||
{
|
||||
public class GuiSunAltarSlider extends GuiButton {
|
||||
|
||||
public float sliderValue;
|
||||
|
||||
|
@ -18,8 +17,7 @@ public class GuiSunAltarSlider extends GuiButton
|
|||
|
||||
private World world;
|
||||
|
||||
public GuiSunAltarSlider(World world, int par2, int par3, String par5Str)
|
||||
{
|
||||
public GuiSunAltarSlider(World world, int par2, int par3, String par5Str) {
|
||||
super(1, par2, par3, 150, 20, par5Str);
|
||||
|
||||
this.world = world;
|
||||
|
@ -29,18 +27,14 @@ public class GuiSunAltarSlider extends GuiButton
|
|||
* Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over
|
||||
* this button.
|
||||
*/
|
||||
public int getHoverState(boolean par1)
|
||||
{
|
||||
public int getHoverState(boolean par1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseDragged(Minecraft mc, int mouseX, int mouseY)
|
||||
{
|
||||
if (this.visible)
|
||||
{
|
||||
if (this.dragging)
|
||||
{
|
||||
protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) {
|
||||
if (this.visible) {
|
||||
if (this.dragging) {
|
||||
this.sliderValue = (float) (mouseX - (this.xPosition + 4)) / (float) (this.width - 8);
|
||||
|
||||
long shouldTime = (long) (24000L * sliderValue);
|
||||
|
@ -49,13 +43,11 @@ public class GuiSunAltarSlider extends GuiButton
|
|||
long add = shouldTime > remainder ? shouldTime - remainder : shouldTime + 24000 - remainder;
|
||||
|
||||
world.getWorldInfo().setWorldTime(worldTime + add);
|
||||
if (this.sliderValue < 0.0F)
|
||||
{
|
||||
if (this.sliderValue < 0.0F) {
|
||||
this.sliderValue = 0.0F;
|
||||
}
|
||||
|
||||
if (this.sliderValue > 1.0F)
|
||||
{
|
||||
if (this.sliderValue > 1.0F) {
|
||||
this.sliderValue = 1.0F;
|
||||
}
|
||||
|
||||
|
@ -68,42 +60,34 @@ public class GuiSunAltarSlider extends GuiButton
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int mouseX, int mouseY)
|
||||
{
|
||||
public void drawButton(Minecraft par1Minecraft, int mouseX, int mouseY) {
|
||||
this.sliderValue = (this.world.getWorldInfo().getWorldTime() % 24000) / 24000.0F;
|
||||
|
||||
super.drawButton(par1Minecraft, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3)
|
||||
{
|
||||
if (super.mousePressed(par1Minecraft, par2, par3))
|
||||
{
|
||||
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) {
|
||||
if (super.mousePressed(par1Minecraft, par2, par3)) {
|
||||
this.sliderValue = (float) (par2 - (this.xPosition + 4)) / (float) (this.width - 8);
|
||||
|
||||
if (this.sliderValue < 0.0F)
|
||||
{
|
||||
if (this.sliderValue < 0.0F) {
|
||||
this.sliderValue = 0.0F;
|
||||
}
|
||||
|
||||
if (this.sliderValue > 1.0F)
|
||||
{
|
||||
if (this.sliderValue > 1.0F) {
|
||||
this.sliderValue = 1.0F;
|
||||
}
|
||||
|
||||
this.dragging = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(int mouseX, int mouseY)
|
||||
{
|
||||
public void mouseReleased(int mouseX, int mouseY) {
|
||||
this.dragging = false;
|
||||
|
||||
AetherNetwork.sendToServer(new PacketSetTime(this.sliderValue, Minecraft.getMinecraft().thePlayer.dimension));
|
||||
|
|
|
@ -7,8 +7,7 @@ import net.minecraft.client.gui.Gui;
|
|||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class DialogueOption extends Gui
|
||||
{
|
||||
public class DialogueOption extends Gui {
|
||||
|
||||
private int dialogueId;
|
||||
|
||||
|
@ -20,67 +19,55 @@ public class DialogueOption extends Gui
|
|||
|
||||
private Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
public DialogueOption(String dialogueText)
|
||||
{
|
||||
public DialogueOption(String dialogueText) {
|
||||
this.dialogueText = "[" + dialogueText + "]";
|
||||
this.height = 12;
|
||||
this.width = this.mc.fontRenderer.getStringWidth(this.dialogueText) + 2;
|
||||
}
|
||||
|
||||
public void renderDialogue(int mouseX, int mouseY)
|
||||
{
|
||||
public void renderDialogue(int mouseX, int mouseY) {
|
||||
this.drawGradientRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 0x66000000, 0x66000000);
|
||||
this.drawString(this.mc.fontRenderer, this.isMouseOver(mouseX, mouseY) ? EnumChatFormatting.YELLOW.toString() + this.getDialogueText() : this.getDialogueText(), this.xPosition + 2, this.yPosition + 2, 0xffffff);
|
||||
}
|
||||
|
||||
public boolean isMouseOver(int mouseX, int mouseY)
|
||||
{
|
||||
public boolean isMouseOver(int mouseX, int mouseY) {
|
||||
return mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
}
|
||||
|
||||
public void playPressSound(SoundHandler soundHandlerIn)
|
||||
{
|
||||
public void playPressSound(SoundHandler soundHandlerIn) {
|
||||
soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
}
|
||||
|
||||
public void setDialogueText(String dialogueText)
|
||||
{
|
||||
public void setDialogueText(String dialogueText) {
|
||||
this.dialogueText = "[" + dialogueText + "]";
|
||||
this.width = this.mc.fontRenderer.getStringWidth(this.dialogueText) + 2;
|
||||
}
|
||||
|
||||
public void setXPosition(int xPosition)
|
||||
{
|
||||
public void setXPosition(int xPosition) {
|
||||
this.xPosition = xPosition;
|
||||
}
|
||||
|
||||
public void setYPosition(int yPosition)
|
||||
{
|
||||
public void setYPosition(int yPosition) {
|
||||
this.yPosition = yPosition;
|
||||
}
|
||||
|
||||
public void setDialogueId(int id)
|
||||
{
|
||||
public void setDialogueId(int id) {
|
||||
this.dialogueId = id;
|
||||
}
|
||||
|
||||
public int getDialogueId()
|
||||
{
|
||||
public int getDialogueId() {
|
||||
return this.dialogueId;
|
||||
}
|
||||
|
||||
public int getHeight()
|
||||
{
|
||||
public int getHeight() {
|
||||
return this.height;
|
||||
}
|
||||
|
||||
public int getWidth()
|
||||
{
|
||||
public int getWidth() {
|
||||
return this.width;
|
||||
}
|
||||
|
||||
public String getDialogueText()
|
||||
{
|
||||
public String getDialogueText() {
|
||||
return this.dialogueText;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,27 +8,23 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class GuiDialogue extends GuiScreen
|
||||
{
|
||||
public class GuiDialogue extends GuiScreen {
|
||||
|
||||
private ArrayList<DialogueOption> dialogueOptions = new ArrayList<DialogueOption>();
|
||||
|
||||
private String dialogue;
|
||||
|
||||
public GuiDialogue(String dialogue)
|
||||
{
|
||||
public GuiDialogue(String dialogue) {
|
||||
this.dialogue = dialogue;
|
||||
}
|
||||
|
||||
public GuiDialogue(String dialogue, DialogueOption... options)
|
||||
{
|
||||
public GuiDialogue(String dialogue, DialogueOption... options) {
|
||||
this(dialogue);
|
||||
|
||||
this.addDialogueOptions(options);
|
||||
}
|
||||
|
||||
public void addDialogueWithOptions(String dialogue, DialogueOption... options)
|
||||
{
|
||||
public void addDialogueWithOptions(String dialogue, DialogueOption... options) {
|
||||
this.dialogue = dialogue;
|
||||
|
||||
this.dialogueOptions.clear();
|
||||
|
@ -37,17 +33,14 @@ public class GuiDialogue extends GuiScreen
|
|||
this.positionDialogueOptions(this.getDialogueOptions());
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
this.positionDialogueOptions(this.getDialogueOptions());
|
||||
}
|
||||
|
||||
private void positionDialogueOptions(ArrayList<DialogueOption> options)
|
||||
{
|
||||
private void positionDialogueOptions(ArrayList<DialogueOption> options) {
|
||||
int lineNumber = 0;
|
||||
|
||||
for (DialogueOption option : options)
|
||||
{
|
||||
for (DialogueOption option : options) {
|
||||
option.setDialogueId(lineNumber);
|
||||
option.setXPosition((this.width / 2) - (option.getWidth() / 2));
|
||||
option.setYPosition((this.height / 2) + this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300).size() * 12 + 12 * lineNumber);
|
||||
|
@ -56,40 +49,33 @@ public class GuiDialogue extends GuiScreen
|
|||
}
|
||||
}
|
||||
|
||||
public void addDialogueOptions(DialogueOption... options)
|
||||
{
|
||||
for (DialogueOption option : options)
|
||||
{
|
||||
public void addDialogueOptions(DialogueOption... options) {
|
||||
for (DialogueOption option : options) {
|
||||
this.dialogueOptions.add(option);
|
||||
}
|
||||
}
|
||||
|
||||
public void addDialogueMessage(String dialogueMessage)
|
||||
{
|
||||
public void addDialogueMessage(String dialogueMessage) {
|
||||
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(dialogueMessage));
|
||||
}
|
||||
|
||||
public void dialogueTreeCompleted()
|
||||
{
|
||||
public void dialogueTreeCompleted() {
|
||||
this.mc.displayGuiScreen(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
public boolean doesGuiPauseGame() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
|
||||
int optionWidth = 0;
|
||||
|
||||
for (String theDialogue : ((List<String>) this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300)))
|
||||
{
|
||||
for (String theDialogue : ((List<String>) this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300))) {
|
||||
int stringWidth = this.fontRendererObj.getStringWidth(theDialogue);
|
||||
|
||||
this.drawGradientRect(this.width / 2 - stringWidth / 2 - 2, this.height / 2 + optionWidth * 12 - 2, this.width / 2 + stringWidth / 2 + 2, this.height / 2 + optionWidth * 10 + 10, 0x66000000, 0x66000000);
|
||||
|
@ -97,29 +83,21 @@ public class GuiDialogue extends GuiScreen
|
|||
++optionWidth;
|
||||
}
|
||||
|
||||
for (DialogueOption dialogue : this.dialogueOptions)
|
||||
{
|
||||
for (DialogueOption dialogue : this.dialogueOptions) {
|
||||
dialogue.renderDialogue(mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int mouseX, int mouseY, int mouseButton)
|
||||
{
|
||||
if (mouseButton == 0)
|
||||
{
|
||||
for (DialogueOption dialogue : this.dialogueOptions)
|
||||
{
|
||||
if (dialogue.isMouseOver(mouseX, mouseY))
|
||||
{
|
||||
public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
|
||||
if (mouseButton == 0) {
|
||||
for (DialogueOption dialogue : this.dialogueOptions) {
|
||||
if (dialogue.isMouseOver(mouseX, mouseY)) {
|
||||
dialogue.playPressSound(this.mc.getSoundHandler());
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
this.dialogueClicked(dialogue);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -129,18 +107,15 @@ public class GuiDialogue extends GuiScreen
|
|||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
}
|
||||
|
||||
public void dialogueClicked(DialogueOption dialogue) throws IOException
|
||||
{
|
||||
public void dialogueClicked(DialogueOption dialogue) throws IOException {
|
||||
|
||||
}
|
||||
|
||||
public ArrayList<DialogueOption> getDialogueOptions()
|
||||
{
|
||||
public ArrayList<DialogueOption> getDialogueOptions() {
|
||||
return this.dialogueOptions;
|
||||
}
|
||||
|
||||
public String getDialogue()
|
||||
{
|
||||
public String getDialogue() {
|
||||
return this.dialogue;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,8 +10,7 @@ import com.legacy.aether.items.ItemsAether;
|
|||
import com.legacy.aether.network.AetherNetwork;
|
||||
import com.legacy.aether.network.packets.PacketInitiateValkyrieFight;
|
||||
|
||||
public class GuiValkyrieDialogue extends GuiDialogue
|
||||
{
|
||||
public class GuiValkyrieDialogue extends GuiDialogue {
|
||||
|
||||
private EntityValkyrieQueen valkyrieQueen;
|
||||
|
||||
|
@ -19,8 +18,7 @@ public class GuiValkyrieDialogue extends GuiDialogue
|
|||
|
||||
private int medalSlotId = -1;
|
||||
|
||||
public GuiValkyrieDialogue(EntityValkyrieQueen valkyrieQueen)
|
||||
{
|
||||
public GuiValkyrieDialogue(EntityValkyrieQueen valkyrieQueen) {
|
||||
super("[\247e" + valkyrieQueen.getName() + ", the Valkyrie Queen\247r]", new DialogueOption[]{new DialogueOption("What can you tell me about this place?"), new DialogueOption("I wish to fight you!"), new DialogueOption("Nevermind")});
|
||||
|
||||
this.title = this.getDialogue();
|
||||
|
@ -28,76 +26,54 @@ public class GuiValkyrieDialogue extends GuiDialogue
|
|||
}
|
||||
|
||||
@Override
|
||||
public void dialogueClicked(DialogueOption dialogue)
|
||||
{
|
||||
if (this.getDialogueOptions().size() == 3)
|
||||
{
|
||||
if (dialogue.getDialogueId() == 0)
|
||||
{
|
||||
public void dialogueClicked(DialogueOption dialogue) {
|
||||
if (this.getDialogueOptions().size() == 3) {
|
||||
if (dialogue.getDialogueId() == 0) {
|
||||
this.addDialogueMessage(this.title + ": This is a sanctuary for us Valkyries who seek rest.");
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
else if (dialogue.getDialogueId() == 1)
|
||||
{
|
||||
} else if (dialogue.getDialogueId() == 1) {
|
||||
DialogueOption medalDialogue = new DialogueOption(this.getMedalDiaulogue());
|
||||
|
||||
this.addDialogueWithOptions(this.title + ": Very well then. Bring me ten medals from my subordinates to prove your worth, then we'll see.", medalDialogue, new DialogueOption("On second thought, i'd rather not."));
|
||||
}
|
||||
else if (dialogue.getDialogueId() == 2)
|
||||
{
|
||||
} else if (dialogue.getDialogueId() == 2) {
|
||||
this.addDialogueMessage(this.title + ": Goodbye adventurer.");
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dialogue.getDialogueId() == 0)
|
||||
{
|
||||
if (this.mc.theWorld.difficultySetting == EnumDifficulty.PEACEFUL)
|
||||
{
|
||||
} else {
|
||||
if (dialogue.getDialogueId() == 0) {
|
||||
if (this.mc.theWorld.difficultySetting == EnumDifficulty.PEACEFUL) {
|
||||
this.addDialogueMessage(this.title + ": Sorry, I don't fight with weaklings.");
|
||||
this.dialogueTreeCompleted();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.medalSlotId != -1)
|
||||
{
|
||||
if (this.medalSlotId != -1) {
|
||||
AetherNetwork.sendToServer(new PacketInitiateValkyrieFight(this.medalSlotId, this.valkyrieQueen.getEntityId()));
|
||||
|
||||
this.valkyrieQueen.setBossReady(true);
|
||||
this.addDialogueMessage(this.title + ": Now then, let's begin!");
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.addDialogueMessage(this.title + ": Take your time.");
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
}
|
||||
else if (dialogue.getDialogueId() == 1)
|
||||
{
|
||||
} else if (dialogue.getDialogueId() == 1) {
|
||||
this.addDialogueMessage(this.title + ": So be it then. Goodbye adventurer.");
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getMedalDiaulogue()
|
||||
{
|
||||
for (int slotId = 0; slotId < this.mc.thePlayer.inventory.mainInventory.length; ++slotId)
|
||||
{
|
||||
private String getMedalDiaulogue() {
|
||||
for (int slotId = 0; slotId < this.mc.thePlayer.inventory.mainInventory.length; ++slotId) {
|
||||
ItemStack stack = this.mc.thePlayer.inventory.mainInventory[slotId];
|
||||
|
||||
if (stack != null && stack.getItem() == ItemsAether.victory_medal)
|
||||
{
|
||||
if (stack.stackSize >= 10)
|
||||
{
|
||||
if (stack != null && stack.getItem() == ItemsAether.victory_medal) {
|
||||
if (stack.stackSize >= 10) {
|
||||
this.medalSlotId = slotId;
|
||||
return "I'm ready, I have the medals right here!";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return "I'll return when I have them. (" + stack.stackSize + "/10)";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,21 +8,18 @@ import com.legacy.aether.client.gui.dialogue.GuiDialogue;
|
|||
import com.legacy.aether.network.AetherNetwork;
|
||||
import com.legacy.aether.network.packets.PacketDialogueClicked;
|
||||
|
||||
public class GuiServerDialogue extends GuiDialogue
|
||||
{
|
||||
public class GuiServerDialogue extends GuiDialogue {
|
||||
|
||||
private String dialogueName;
|
||||
|
||||
public GuiServerDialogue(String dialogueName, String dialogue, ArrayList<String> dialogueText)
|
||||
{
|
||||
public GuiServerDialogue(String dialogueName, String dialogue, ArrayList<String> dialogueText) {
|
||||
super(dialogue);
|
||||
|
||||
this.dialogueName = dialogueName;
|
||||
|
||||
ArrayList<DialogueOption> dialogueOptions = Lists.newArrayList();
|
||||
|
||||
for (String dialogueForOption : dialogueText)
|
||||
{
|
||||
for (String dialogueForOption : dialogueText) {
|
||||
dialogueOptions.add(new DialogueOption(dialogueForOption));
|
||||
}
|
||||
|
||||
|
@ -30,8 +27,7 @@ public class GuiServerDialogue extends GuiDialogue
|
|||
}
|
||||
|
||||
@Override
|
||||
public void dialogueClicked(DialogueOption dialogue)
|
||||
{
|
||||
public void dialogueClicked(DialogueOption dialogue) {
|
||||
AetherNetwork.sendToServer(new PacketDialogueClicked(this.dialogueName, dialogue.getDialogueId()));
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
|
|
|
@ -18,15 +18,13 @@ import com.legacy.aether.network.packets.PacketOpenContainer;
|
|||
import com.legacy.aether.player.PlayerAether;
|
||||
import com.legacy.aether.player.perks.AetherRankings;
|
||||
|
||||
public class GuiAccessories extends GuiContainer
|
||||
{
|
||||
public class GuiAccessories extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation ACCESSORIES = Aether.locate("textures/gui/inventory/accessories.png");
|
||||
|
||||
private PlayerAether playerAether;
|
||||
|
||||
public GuiAccessories(PlayerAether player)
|
||||
{
|
||||
public GuiAccessories(PlayerAether player) {
|
||||
super(new ContainerAccessories(player.getAccessoryInventory(), player.getEntity()));
|
||||
|
||||
this.playerAether = player;
|
||||
|
@ -35,12 +33,10 @@ public class GuiAccessories extends GuiContainer
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
if (AetherRankings.isRankedPlayer(this.playerAether.getEntity().getUniqueID()) || this.playerAether.isDonator())
|
||||
{
|
||||
if (AetherRankings.isRankedPlayer(this.playerAether.getEntity().getUniqueID()) || this.playerAether.isDonator()) {
|
||||
this.buttonList.add(new GuiButtonPerks(this.width / 2 - 108, this.height / 2 - 83));
|
||||
}
|
||||
|
||||
|
@ -48,52 +44,44 @@ public class GuiAccessories extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setWorldAndResolution(Minecraft mc, int width, int height)
|
||||
{
|
||||
public void setWorldAndResolution(Minecraft mc, int width, int height) {
|
||||
super.setWorldAndResolution(mc, width, height);
|
||||
|
||||
for (int size = 0; size < this.buttonList.size(); ++size)
|
||||
{
|
||||
for (int size = 0; size < this.buttonList.size(); ++size) {
|
||||
GuiButton button = (GuiButton) this.buttonList.get(size);
|
||||
int id = button.id;
|
||||
|
||||
if (id == 13211)
|
||||
{
|
||||
if (id == 13211) {
|
||||
this.setButtonPosition(button, this.width / 2 + 65, this.height / 2 - 23);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setButtonPosition(GuiButton button, int xPosition, int yPosition)
|
||||
{
|
||||
private void setButtonPosition(GuiButton button, int xPosition, int yPosition) {
|
||||
button.xPosition = xPosition;
|
||||
button.yPosition = yPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button)
|
||||
{
|
||||
if (button.id == 24)
|
||||
{
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
if (button.id == 24) {
|
||||
this.mc.displayGuiScreen(new GuiAetherPerks());
|
||||
}
|
||||
|
||||
if (button.id == 18067)
|
||||
{
|
||||
if (button.id == 18067) {
|
||||
this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer));
|
||||
AetherNetwork.sendToServer(new PacketOpenContainer(-1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 115, 8, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
|
||||
{;
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
;
|
||||
GL11.glColor3d(1.0D, 1.0D, 1.0D);
|
||||
|
||||
this.mc.renderEngine.bindTexture(ACCESSORIES);
|
||||
|
|
|
@ -17,8 +17,7 @@ import com.legacy.aether.player.perks.AetherRankings;
|
|||
import com.legacy.aether.player.perks.util.DonatorMoaSkin;
|
||||
import com.legacy.aether.player.perks.util.EnumAetherPerkType;
|
||||
|
||||
public class GuiAetherPerks extends GuiScreen
|
||||
{
|
||||
public class GuiAetherPerks extends GuiScreen {
|
||||
|
||||
private boolean enableMoaEditor, enableHaloEditor;
|
||||
|
||||
|
@ -38,8 +37,7 @@ public class GuiAetherPerks extends GuiScreen
|
|||
|
||||
protected int guiTop;
|
||||
|
||||
public GuiAetherPerks()
|
||||
{
|
||||
public GuiAetherPerks() {
|
||||
super();
|
||||
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
|
@ -50,8 +48,7 @@ public class GuiAetherPerks extends GuiScreen
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen()
|
||||
{
|
||||
public void updateScreen() {
|
||||
this.moaWingMarking.updateCursorCounter();
|
||||
this.moaWing.updateCursorCounter();
|
||||
this.moaBody.updateCursorCounter();
|
||||
|
@ -59,45 +56,37 @@ public class GuiAetherPerks extends GuiScreen
|
|||
this.moaEye.updateCursorCounter();
|
||||
this.moaOutside.updateCursorCounter();
|
||||
|
||||
if (!this.moaWingMarking.getText().isEmpty())
|
||||
{
|
||||
if (!this.moaWingMarking.getText().isEmpty()) {
|
||||
this.moaSkin.setWingMarkingColor(Integer.decode("0x" + this.moaWingMarking.getText()));
|
||||
}
|
||||
|
||||
if (!this.moaWing.getText().isEmpty())
|
||||
{
|
||||
if (!this.moaWing.getText().isEmpty()) {
|
||||
this.moaSkin.setWingColor(Integer.decode("0x" + this.moaWing.getText()));
|
||||
}
|
||||
|
||||
if (!this.moaBody.getText().isEmpty())
|
||||
{
|
||||
if (!this.moaBody.getText().isEmpty()) {
|
||||
this.moaSkin.setBodyColor(Integer.decode("0x" + this.moaBody.getText()));
|
||||
}
|
||||
|
||||
if (!this.moaBodyMarking.getText().isEmpty())
|
||||
{
|
||||
if (!this.moaBodyMarking.getText().isEmpty()) {
|
||||
this.moaSkin.setMarkingColor(Integer.decode("0x" + this.moaBodyMarking.getText()));
|
||||
}
|
||||
|
||||
if (!this.moaEye.getText().isEmpty())
|
||||
{
|
||||
if (!this.moaEye.getText().isEmpty()) {
|
||||
this.moaSkin.setEyeColor(Integer.decode("0x" + this.moaEye.getText()));
|
||||
}
|
||||
|
||||
if (!this.moaOutside.getText().isEmpty())
|
||||
{
|
||||
if (!this.moaOutside.getText().isEmpty()) {
|
||||
this.moaSkin.setOutsideColor(Integer.decode("0x" + this.moaOutside.getText()));
|
||||
}
|
||||
|
||||
this.moaSkin.shouldUseDefualt(this.defualtSkin.displayString.contains("true"));
|
||||
|
||||
if (!this.enableHaloEditor)
|
||||
{
|
||||
if (!this.enableHaloEditor) {
|
||||
this.enableHalo.visible = false;
|
||||
}
|
||||
|
||||
if (!this.enableMoaEditor)
|
||||
{
|
||||
if (!this.enableMoaEditor) {
|
||||
this.defualtSkin.visible = false;
|
||||
this.confirmPreference.visible = false;
|
||||
}
|
||||
|
@ -105,8 +94,7 @@ public class GuiAetherPerks extends GuiScreen
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
|
||||
this.guiLeft = (this.width - 176) / 2;
|
||||
|
@ -119,8 +107,7 @@ public class GuiAetherPerks extends GuiScreen
|
|||
this.buttonList.add(this.defualtSkin = new GuiButton(2, this.width / 2 - 100, this.height - 20, 100, 20, "Default skin: " + this.player.donatorMoaSkin.shouldUseDefualt()));
|
||||
this.buttonList.add(this.confirmPreference = new GuiButton(4, this.width / 2, this.height - 20, 100, 20, "Confirm Skin"));
|
||||
|
||||
if (!AetherRankings.isRankedPlayer(this.player.getEntity().getUniqueID()))
|
||||
{
|
||||
if (!AetherRankings.isRankedPlayer(this.player.getEntity().getUniqueID())) {
|
||||
this.perkHalo.visible = false;
|
||||
}
|
||||
|
||||
|
@ -152,14 +139,11 @@ public class GuiAetherPerks extends GuiScreen
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char typedChar, int keyCode)
|
||||
{
|
||||
protected void keyTyped(char typedChar, int keyCode) {
|
||||
super.keyTyped(typedChar, keyCode);
|
||||
|
||||
if (this.enableMoaEditor)
|
||||
{
|
||||
if (keyCode > 1 && keyCode < 12 || keyCode == 14 || keyCode == 30 || keyCode == 48 || keyCode == 46 || keyCode == 32 || keyCode == 18 || keyCode == 33)
|
||||
{
|
||||
if (this.enableMoaEditor) {
|
||||
if (keyCode > 1 && keyCode < 12 || keyCode == 14 || keyCode == 30 || keyCode == 48 || keyCode == 46 || keyCode == 32 || keyCode == 18 || keyCode == 33) {
|
||||
this.moaWingMarking.textboxKeyTyped(typedChar, keyCode);
|
||||
this.moaWing.textboxKeyTyped(typedChar, keyCode);
|
||||
this.moaBody.textboxKeyTyped(typedChar, keyCode);
|
||||
|
@ -171,12 +155,10 @@ public class GuiAetherPerks extends GuiScreen
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton)
|
||||
{
|
||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
|
||||
if (this.enableMoaEditor)
|
||||
{
|
||||
if (this.enableMoaEditor) {
|
||||
this.moaWingMarking.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaWing.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaBody.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
|
@ -187,17 +169,14 @@ public class GuiAetherPerks extends GuiScreen
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed()
|
||||
{
|
||||
public void onGuiClosed() {
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
AetherNetwork.sendToServer(new PacketPerkChanged(this.player.getEntity().getEntityId(), EnumAetherPerkType.Moa, this.moaSkin));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button)
|
||||
{
|
||||
if (button.id == 1)
|
||||
{
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
if (button.id == 1) {
|
||||
boolean shouldEnable = this.enableMoaEditor ? false : true;
|
||||
|
||||
this.enableMoaEditor = shouldEnable;
|
||||
|
@ -205,28 +184,20 @@ public class GuiAetherPerks extends GuiScreen
|
|||
this.enableHalo.visible = false;
|
||||
this.confirmPreference.visible = true;
|
||||
this.defualtSkin.visible = true;
|
||||
}
|
||||
else if (button.id == 2)
|
||||
{
|
||||
} else if (button.id == 2) {
|
||||
boolean enableDefualt = this.player.donatorMoaSkin.shouldUseDefualt() ? false : true;
|
||||
|
||||
this.defualtSkin.displayString = "Use Default: " + Boolean.toString(enableDefualt);
|
||||
this.player.donatorMoaSkin.shouldUseDefualt(enableDefualt);
|
||||
}
|
||||
else if (button.id == 4)
|
||||
{
|
||||
} else if (button.id == 4) {
|
||||
AetherNetwork.sendToServer(new PacketPerkChanged(this.player.getEntity().getEntityId(), EnumAetherPerkType.Moa, this.moaSkin));
|
||||
}
|
||||
else if (button.id == 5)
|
||||
{
|
||||
} else if (button.id == 5) {
|
||||
boolean shouldEnable = this.enableHaloEditor ? false : true;
|
||||
|
||||
this.enableHaloEditor = shouldEnable;
|
||||
this.enableMoaEditor = false;
|
||||
this.enableHalo.visible = true;
|
||||
}
|
||||
else if (button.id == 6)
|
||||
{
|
||||
} else if (button.id == 6) {
|
||||
boolean enableHalo = this.player.shouldRenderHalo ? false : true;
|
||||
|
||||
this.player.shouldRenderHalo = enableHalo;
|
||||
|
@ -236,14 +207,12 @@ public class GuiAetherPerks extends GuiScreen
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
this.drawDefaultBackground();
|
||||
|
||||
this.drawCenteredString(this.fontRendererObj, "Donator Options", 45, 4, 16777215);
|
||||
|
||||
if (this.enableMoaEditor)
|
||||
{
|
||||
if (this.enableMoaEditor) {
|
||||
GuiInventory.func_147046_a(this.width / 2, this.height / 2 + (this.height / 2) - 30, (this.height / 3) - 20, (float) (this.guiLeft + 51) - (float) mouseX, (float) (75 - 50) - (float) mouseY, this.moa);
|
||||
|
||||
/* Left Side*/
|
||||
|
@ -270,8 +239,7 @@ public class GuiAetherPerks extends GuiScreen
|
|||
this.moaOutside.drawTextBox();
|
||||
}
|
||||
|
||||
if (this.enableHaloEditor)
|
||||
{
|
||||
if (this.enableHaloEditor) {
|
||||
GuiInventory.func_147046_a(this.width / 2, this.height / 2 + (this.height / 2) - 30, (this.height / 3) - 20, (float) (this.guiLeft + 51) - (float) mouseX, (float) (75 - 50) - (float) mouseY, this.player.getEntity());
|
||||
}
|
||||
|
||||
|
@ -279,16 +247,12 @@ public class GuiAetherPerks extends GuiScreen
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawWorldBackground(int tint)
|
||||
{
|
||||
public void drawWorldBackground(int tint) {
|
||||
this.drawGradientRect(0, 0, this.width, 50, -1072689136, -804253680);
|
||||
|
||||
if (this.mc.theWorld != null)
|
||||
{
|
||||
if (this.mc.theWorld != null) {
|
||||
this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.drawBackground(tint);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,55 +12,40 @@ import net.minecraft.client.Minecraft;
|
|||
import com.google.common.collect.Lists;
|
||||
import com.legacy.aether.Aether;
|
||||
|
||||
public class AetherTrivia
|
||||
{
|
||||
public class AetherTrivia {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
public AetherTrivia()
|
||||
{
|
||||
public AetherTrivia() {
|
||||
|
||||
}
|
||||
|
||||
public static String getNewTrivia()
|
||||
{
|
||||
public static String getNewTrivia() {
|
||||
BufferedReader bufferedreader = null;
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
List<String> list = Lists.<String>newArrayList();
|
||||
bufferedreader = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(Aether.locate("texts/trivia.txt")).getInputStream(), StandardCharsets.UTF_8));
|
||||
String s;
|
||||
|
||||
while ((s = bufferedreader.readLine()) != null)
|
||||
{
|
||||
while ((s = bufferedreader.readLine()) != null) {
|
||||
s = s.trim();
|
||||
|
||||
if (!s.isEmpty())
|
||||
{
|
||||
if (!s.isEmpty()) {
|
||||
list.add(s);
|
||||
}
|
||||
}
|
||||
|
||||
if (!list.isEmpty())
|
||||
{
|
||||
if (!list.isEmpty()) {
|
||||
return "Pro Tip: " + (String) list.get(random.nextInt(list.size()));
|
||||
}
|
||||
}
|
||||
catch (IOException var8)
|
||||
{
|
||||
} catch (IOException var8) {
|
||||
;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (bufferedreader != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
} finally {
|
||||
if (bufferedreader != null) {
|
||||
try {
|
||||
bufferedreader.close();
|
||||
}
|
||||
catch (IOException ioexception)
|
||||
{
|
||||
} catch (IOException ioexception) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,7 @@ import net.minecraft.client.model.ModelBiped;
|
|||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelAetherWings extends ModelBiped
|
||||
{
|
||||
public class ModelAetherWings extends ModelBiped {
|
||||
|
||||
public ModelRenderer wingLeft;
|
||||
|
||||
|
@ -15,18 +14,15 @@ public class ModelAetherWings extends ModelBiped
|
|||
|
||||
public boolean gonRound;
|
||||
|
||||
public ModelAetherWings()
|
||||
{
|
||||
public ModelAetherWings() {
|
||||
this(0.0F);
|
||||
}
|
||||
|
||||
public ModelAetherWings(float f)
|
||||
{
|
||||
public ModelAetherWings(float f) {
|
||||
this(f, 0.0F);
|
||||
}
|
||||
|
||||
public ModelAetherWings(float f, float f1)
|
||||
{
|
||||
public ModelAetherWings(float f, float f1) {
|
||||
this.isSneak = false;
|
||||
|
||||
this.wingLeft = new ModelRenderer(this, 24, 31);
|
||||
|
@ -40,22 +36,19 @@ public class ModelAetherWings extends ModelBiped
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity e, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
public void render(Entity e, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, e);
|
||||
|
||||
this.wingLeft.renderWithRotation(f5);
|
||||
this.wingRight.renderWithRotation(f5);
|
||||
}
|
||||
|
||||
public void setWingSinage(float sinage)
|
||||
{
|
||||
public void setWingSinage(float sinage) {
|
||||
this.sinage = sinage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
|
||||
{
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
|
||||
this.gonRound = entity.onGround;
|
||||
|
||||
this.wingLeft.rotateAngleY = -0.4F;
|
||||
|
@ -63,17 +56,14 @@ public class ModelAetherWings extends ModelBiped
|
|||
this.wingLeft.rotateAngleZ = -0.125F;
|
||||
this.wingRight.rotateAngleZ = 0.125F;
|
||||
|
||||
if (entity.isSneaking())
|
||||
{
|
||||
if (entity.isSneaking()) {
|
||||
this.wingLeft.rotateAngleX = 0.45F;
|
||||
this.wingRight.rotateAngleX = 0.45F;
|
||||
this.wingLeft.offsetY = -0.17F;
|
||||
this.wingRight.offsetY = -0.17F;
|
||||
this.wingLeft.offsetZ = 0.112F;
|
||||
this.wingRight.offsetZ = 0.112F;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.wingLeft.rotateAngleX = this.wingLeft.offsetZ = this.wingLeft.offsetY =
|
||||
this.wingRight.rotateAngleX = this.wingRight.offsetZ = this.wingRight.offsetY = 0.0F;
|
||||
}
|
||||
|
|
|
@ -3,13 +3,11 @@ package com.legacy.aether.client.models.attachments;
|
|||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
public class ModelHalo extends ModelBiped
|
||||
{
|
||||
public class ModelHalo extends ModelBiped {
|
||||
|
||||
public ModelRenderer halo1, halo2, halo3, halo4;
|
||||
|
||||
public ModelHalo()
|
||||
{
|
||||
public ModelHalo() {
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 32;
|
||||
|
||||
|
@ -29,8 +27,7 @@ public class ModelHalo extends ModelBiped
|
|||
this.halo4.setRotationPoint(0.0F, 0F, 0.0F);
|
||||
}
|
||||
|
||||
public void renderHalo(float scale)
|
||||
{
|
||||
public void renderHalo(float scale) {
|
||||
this.halo1.rotateAngleY = this.halo2.rotateAngleY = this.halo3.rotateAngleY = this.halo4.rotateAngleY = this.bipedHead.rotateAngleY;
|
||||
this.halo1.rotateAngleX = this.halo2.rotateAngleX = this.halo3.rotateAngleX = this.halo4.rotateAngleX = this.bipedHead.rotateAngleX;
|
||||
this.halo1.rotationPointX = this.halo2.rotationPointX = this.halo3.rotationPointX = this.halo4.rotationPointX = 0.0F;
|
||||
|
|
|
@ -6,8 +6,7 @@ import net.minecraft.client.model.ModelBase;
|
|||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class AechorPlantModel extends ModelBase
|
||||
{
|
||||
public class AechorPlantModel extends ModelBase {
|
||||
|
||||
private ModelRenderer petal[];
|
||||
|
||||
|
@ -29,18 +28,15 @@ public class AechorPlantModel extends ModelBase
|
|||
|
||||
public float size;
|
||||
|
||||
public AechorPlantModel()
|
||||
{
|
||||
public AechorPlantModel() {
|
||||
this(0.0F);
|
||||
}
|
||||
|
||||
public AechorPlantModel(float modelSize)
|
||||
{
|
||||
public AechorPlantModel(float modelSize) {
|
||||
this(modelSize, 0.0F);
|
||||
}
|
||||
|
||||
public AechorPlantModel(float modelSize, float rotationPointY)
|
||||
{
|
||||
public AechorPlantModel(float modelSize, float rotationPointY) {
|
||||
this.size = 1.0F;
|
||||
|
||||
this.petal = new ModelRenderer[10];
|
||||
|
@ -49,18 +45,14 @@ public class AechorPlantModel extends ModelBase
|
|||
this.stamen2 = new ModelRenderer[3];
|
||||
this.thorn = new ModelRenderer[4];
|
||||
|
||||
for(int i = 0; i < 10; i++)
|
||||
{
|
||||
for (int i = 0; i < 10; i++) {
|
||||
this.petal[i] = new ModelRenderer(this, 0, 0);
|
||||
|
||||
if(i % 2 == 0)
|
||||
{
|
||||
if (i % 2 == 0) {
|
||||
this.petal[i] = new ModelRenderer(this, 29, 3);
|
||||
this.petal[i].addBox(-4F, -1F, -12F, 8, 1, 9, modelSize - 0.25F);
|
||||
this.petal[i].setRotationPoint(0.0F, 1.0F + rotationPointY, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.petal[i].addBox(-4F, -1F, -13F, 8, 1, 10, modelSize - 0.125F);
|
||||
this.petal[i].setRotationPoint(0.0F, 1.0F + rotationPointY, 0.0F);
|
||||
}
|
||||
|
@ -70,15 +62,13 @@ public class AechorPlantModel extends ModelBase
|
|||
this.leaf[i].setRotationPoint(0.0F, 1.0F + rotationPointY, 0.0F);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for (int i = 0; i < 3; i++) {
|
||||
this.stamen[i] = new ModelRenderer(this, 36, 13);
|
||||
this.stamen[i].addBox(0F, -9F, -1.5F, 1, 6, 1, modelSize - 0.25F);
|
||||
this.stamen[i].setRotationPoint(0.0F, 1.0F + rotationPointY, 0.0F);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for (int i = 0; i < 3; i++) {
|
||||
this.stamen2[i] = new ModelRenderer(this, 32, 15);
|
||||
this.stamen2[i].addBox(0F, -10F, -1.5F, 1, 1, 1, modelSize + 0.125F);
|
||||
this.stamen2[i].setRotationPoint(0.0F, 1.0F + rotationPointY, 0.0F);
|
||||
|
@ -92,8 +82,7 @@ public class AechorPlantModel extends ModelBase
|
|||
this.stem.addBox(-1F, 0F, -1F, 2, 6, 2, modelSize);
|
||||
this.stem.setRotationPoint(0.0F, 1.0F + rotationPointY, 0.0F);
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
for (int i = 0; i < 4; i++) {
|
||||
this.thorn[i] = new ModelRenderer(this, 32, 13);
|
||||
this.thorn[i].setRotationPoint(0.0F, 1.0F + rotationPointY, 0.0F);
|
||||
}
|
||||
|
@ -105,22 +94,19 @@ public class AechorPlantModel extends ModelBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, 1.2F, 0.0F);
|
||||
GL11.glScalef(this.size, this.size, this.size);
|
||||
|
||||
for(int i = 0; i < 10; i++)
|
||||
{
|
||||
for (int i = 0; i < 10; i++) {
|
||||
this.petal[i].render(scale);
|
||||
this.leaf[i].render(scale);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for (int i = 0; i < 3; i++) {
|
||||
this.stamen[i].render(scale);
|
||||
this.stamen2[i].render(scale);
|
||||
}
|
||||
|
@ -128,8 +114,7 @@ public class AechorPlantModel extends ModelBase
|
|||
this.head.render(scale);
|
||||
this.stem.render(scale);
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
for (int i = 0; i < 4; i++) {
|
||||
this.thorn[i].render(scale);
|
||||
}
|
||||
|
||||
|
@ -137,8 +122,7 @@ public class AechorPlantModel extends ModelBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
||||
{
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
this.head.rotateAngleX = 0.0F;
|
||||
this.head.rotateAngleY = headPitch / 57.29578F;
|
||||
|
||||
|
@ -147,10 +131,8 @@ public class AechorPlantModel extends ModelBase
|
|||
this.stem.rotateAngleY = head.rotateAngleY;
|
||||
this.stem.rotationPointY = boff * 0.5F;
|
||||
|
||||
for(int i = 0; i < 10; i++)
|
||||
{
|
||||
if (i < 3)
|
||||
{
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (i < 3) {
|
||||
this.stamen[i].rotateAngleX = 0.2F + ((float) i / 15F);
|
||||
this.stamen[i].rotateAngleY = head.rotateAngleY + 0.1F;
|
||||
this.stamen[i].rotateAngleY += ((Math.PI * 2) / (float) 3) * (float) i;
|
||||
|
@ -165,8 +147,7 @@ public class AechorPlantModel extends ModelBase
|
|||
this.stamen2[i].rotationPointY = boff + ((sinage) * 2F);
|
||||
}
|
||||
|
||||
if (i < 4)
|
||||
{
|
||||
if (i < 4) {
|
||||
this.thorn[i].rotateAngleY = head.rotateAngleY;
|
||||
this.thorn[i].rotationPointY = boff * 0.5F;
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ import net.minecraft.util.MathHelper;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class AerbunnyModel extends ModelBase
|
||||
{
|
||||
public class AerbunnyModel extends ModelBase {
|
||||
|
||||
public ModelRenderer a;
|
||||
public ModelRenderer b;
|
||||
|
@ -24,8 +23,7 @@ public class AerbunnyModel extends ModelBase
|
|||
public ModelRenderer h2;
|
||||
public float puffiness;
|
||||
|
||||
public AerbunnyModel()
|
||||
{
|
||||
public AerbunnyModel() {
|
||||
byte byte0 = 16;
|
||||
this.a = new ModelRenderer(this, 0, 0);
|
||||
this.a.addBox(-2.0F, -1.0F, -4.0F, 4, 4, 6, 0.0F);
|
||||
|
@ -65,13 +63,11 @@ public class AerbunnyModel extends ModelBase
|
|||
this.ff2.setRotationPoint(-3.0F, (float) (3 + byte0), 4.0F);
|
||||
}
|
||||
|
||||
public void render(Entity e, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
public void render(Entity e, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
float a;
|
||||
|
||||
if (this.isChild)
|
||||
{
|
||||
if (this.isChild) {
|
||||
a = 2.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, f5, f5);
|
||||
|
@ -93,9 +89,7 @@ public class AerbunnyModel extends ModelBase
|
|||
GL11.glTranslatef(0.0F, 1.0F, 0.0F);
|
||||
GL11.glScalef(a1, a1, a1);
|
||||
this.b3.render(f5);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.a.render(f5);
|
||||
this.g.render(f5);
|
||||
this.g2.render(f5);
|
||||
|
@ -116,8 +110,7 @@ public class AerbunnyModel extends ModelBase
|
|||
}
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
this.a.rotateAngleX = -(f4 / (180F / (float) Math.PI));
|
||||
this.a.rotateAngleY = f3 / (180F / (float) Math.PI);
|
||||
this.g.rotateAngleX = this.a.rotateAngleX;
|
||||
|
|
|
@ -4,8 +4,7 @@ import net.minecraft.client.model.ModelBase;
|
|||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class AerwhaleModel extends ModelBase
|
||||
{
|
||||
public class AerwhaleModel extends ModelBase {
|
||||
|
||||
public ModelRenderer FrontBody;
|
||||
public ModelRenderer RightFin;
|
||||
|
@ -19,8 +18,7 @@ public class AerwhaleModel extends ModelBase
|
|||
public ModelRenderer BackfinLeft;
|
||||
public ModelRenderer Middlebody;
|
||||
|
||||
public AerwhaleModel()
|
||||
{
|
||||
public AerwhaleModel() {
|
||||
this.textureWidth = 512;
|
||||
this.textureHeight = 64;
|
||||
|
||||
|
@ -105,8 +103,7 @@ public class AerwhaleModel extends ModelBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
|
||||
this.FrontBody.render(scale);
|
||||
this.RightFin.render(scale);
|
||||
|
@ -121,8 +118,7 @@ public class AerwhaleModel extends ModelBase
|
|||
this.Middlebody.render(scale);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
|
|
|
@ -5,8 +5,7 @@ import net.minecraft.client.model.ModelRenderer;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class CockatriceModel extends ModelBase
|
||||
{
|
||||
public class CockatriceModel extends ModelBase {
|
||||
|
||||
public ModelRenderer head, body;
|
||||
|
||||
|
@ -18,8 +17,7 @@ public class CockatriceModel extends ModelBase
|
|||
|
||||
public ModelRenderer feather1, feather2, feather3;
|
||||
|
||||
public CockatriceModel()
|
||||
{
|
||||
public CockatriceModel() {
|
||||
this.head = new ModelRenderer(this, 0, 13);
|
||||
this.head.addBox(-2.0F, -4.0F, -6.0F, 4, 4, 8, 0.0F);
|
||||
this.head.setRotationPoint(0.0F, (float) (-8 + 16), -4.0F);
|
||||
|
@ -67,8 +65,7 @@ public class CockatriceModel extends ModelBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
|
||||
this.head.render(scale);
|
||||
this.jaw.render(scale);
|
||||
|
@ -83,8 +80,7 @@ public class CockatriceModel extends ModelBase
|
|||
this.feather3.render(scale);
|
||||
}
|
||||
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
||||
{
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
this.head.rotateAngleX = headPitch / 57.29578F;
|
||||
this.head.rotateAngleY = netHeadYaw / 57.29578F;
|
||||
|
||||
|
@ -96,8 +92,7 @@ public class CockatriceModel extends ModelBase
|
|||
this.legs.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
|
||||
this.legs2.rotateAngleX = MathHelper.cos((float) (limbSwing * 0.6662F + Math.PI)) * 1.4F * limbSwingAmount;
|
||||
|
||||
if(ageInTicks > 0.001F)
|
||||
{
|
||||
if (ageInTicks > 0.001F) {
|
||||
this.wings.rotationPointZ = -1F;
|
||||
this.wings2.rotationPointZ = -1F;
|
||||
this.wings.rotationPointY = 12F;
|
||||
|
@ -108,9 +103,7 @@ public class CockatriceModel extends ModelBase
|
|||
this.wings2.rotateAngleZ = -ageInTicks;
|
||||
this.legs.rotateAngleX = 0.6F;
|
||||
this.legs2.rotateAngleX = 0.6F;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.wings.rotationPointZ = -3F;
|
||||
this.wings2.rotationPointZ = -3F;
|
||||
this.wings.rotationPointY = 14F;
|
||||
|
|
|
@ -6,8 +6,7 @@ import net.minecraft.entity.Entity;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class CrystalModel extends ModelBase
|
||||
{
|
||||
public class CrystalModel extends ModelBase {
|
||||
|
||||
public ModelRenderer head[];
|
||||
|
||||
|
@ -15,34 +14,29 @@ public class CrystalModel extends ModelBase
|
|||
|
||||
private static final float sponge = (180F / 3.141593F);
|
||||
|
||||
public CrystalModel()
|
||||
{
|
||||
public CrystalModel() {
|
||||
this(0.0F);
|
||||
}
|
||||
|
||||
public CrystalModel(float f)
|
||||
{
|
||||
public CrystalModel(float f) {
|
||||
this(f, 0.0F);
|
||||
}
|
||||
|
||||
public CrystalModel(float f, float f1)
|
||||
{
|
||||
public CrystalModel(float f, float f1) {
|
||||
this.sinage = new float[3];
|
||||
this.head = new ModelRenderer[3];
|
||||
this.head[0] = new ModelRenderer(this, 0, 0);
|
||||
this.head[1] = new ModelRenderer(this, 32, 0);
|
||||
this.head[2] = new ModelRenderer(this, 0, 16);
|
||||
|
||||
for(int i = 0; i < 3; i ++)
|
||||
{
|
||||
for (int i = 0; i < 3; i++) {
|
||||
this.head[i].addBox(-4F, -4F, -4F, 8, 8, 8, f);
|
||||
this.head[i].setRotationPoint(0.0F, 0.0F + f1, 0.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
GL11.glTranslatef(0F, 0.75F, 0F);
|
||||
|
||||
GL11.glEnable(2977 /*GL_NORMALIZE*/);
|
||||
|
@ -71,10 +65,8 @@ public class CrystalModel extends ModelBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
||||
{
|
||||
for(int i = 0; i < 3; i ++)
|
||||
{
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
this.head[i].rotateAngleY = netHeadYaw / 57.29578F;
|
||||
this.head[i].rotateAngleX = headPitch / 57.29578F;
|
||||
}
|
||||
|
|
|
@ -5,15 +5,13 @@ import net.minecraft.client.model.ModelRenderer;
|
|||
import net.minecraft.entity.Entity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class FlyingCowModel extends ModelQuadruped
|
||||
{
|
||||
public class FlyingCowModel extends ModelQuadruped {
|
||||
|
||||
ModelRenderer udders;
|
||||
ModelRenderer horn1;
|
||||
ModelRenderer horn2;
|
||||
|
||||
public FlyingCowModel(float scale)
|
||||
{
|
||||
public FlyingCowModel(float scale) {
|
||||
super(12, scale);
|
||||
this.head = new ModelRenderer(this, 0, 0);
|
||||
this.head.addBox(-4.0F, -4.0F, -6.0F, 8, 8, 6, 0.0F);
|
||||
|
@ -42,12 +40,10 @@ public class FlyingCowModel extends ModelQuadruped
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
|
||||
{
|
||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||
super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
||||
|
||||
if (this.isChild)
|
||||
{
|
||||
if (this.isChild) {
|
||||
float f6 = 2.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
@ -56,9 +52,7 @@ public class FlyingCowModel extends ModelQuadruped
|
|||
this.horn1.render(scale);
|
||||
this.horn2.render(scale);
|
||||
this.udders.render(scale);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.horn1.render(scale);
|
||||
this.horn2.render(scale);
|
||||
this.udders.render(scale);
|
||||
|
@ -66,8 +60,7 @@ public class FlyingCowModel extends ModelQuadruped
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
||||
{
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
||||
|
||||
this.horn1.rotateAngleY = this.head.rotateAngleY;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue