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";
|
||||
|
||||
|
@ -33,44 +32,39 @@ public class Aether
|
|||
@SidedProxy(clientSide = "com.legacy.aether.client.ClientProxy", serverSide = "com.legacy.aether.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
AetherRankings.initialization();
|
||||
AetherNetwork.preInitialization();
|
||||
AetherConfig.init(event.getModConfigurationDirectory());
|
||||
}
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
AetherRankings.initialization();
|
||||
AetherNetwork.preInitialization();
|
||||
AetherConfig.init(event.getModConfigurationDirectory());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
BlocksAether.initialization();
|
||||
ItemsAether.initialization();
|
||||
AetherRegistries.register();
|
||||
EntitiesAether.initialization();
|
||||
AetherCreativeTabs.initialization();
|
||||
AetherTileEntities.initialization();
|
||||
AetherWorld.initialization();
|
||||
AchievementsAether.initialization();
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
BlocksAether.initialization();
|
||||
ItemsAether.initialization();
|
||||
AetherRegistries.register();
|
||||
EntitiesAether.initialization();
|
||||
AetherCreativeTabs.initialization();
|
||||
AetherTileEntities.initialization();
|
||||
AetherWorld.initialization();
|
||||
AchievementsAether.initialization();
|
||||
|
||||
proxy.init();
|
||||
proxy.init();
|
||||
|
||||
CommonProxy.registerEvent(new PlayerAetherEvents());
|
||||
CommonProxy.registerEvent(new AetherEventHandler());
|
||||
}
|
||||
CommonProxy.registerEvent(new PlayerAetherEvents());
|
||||
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,106 +34,83 @@ 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)
|
||||
{
|
||||
ItemStack itemstack = event.entityPlayer.inventory.getCurrentItem();
|
||||
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)
|
||||
{
|
||||
Class<?> oclass = EntitiesAether.getClassFromID(itemstack.getItemDamage());
|
||||
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()))
|
||||
{
|
||||
EntityAgeable entityageable = ((EntityAgeable)event.target).createChild((EntityAgeable) event.target);
|
||||
if (oclass != null && oclass.isAssignableFrom(this.getClass())) {
|
||||
EntityAgeable entityageable = ((EntityAgeable) event.target).createChild((EntityAgeable) event.target);
|
||||
|
||||
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 (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())
|
||||
{
|
||||
entityageable.setCustomNameTag(itemstack.getDisplayName());
|
||||
}
|
||||
if (itemstack.hasDisplayName()) {
|
||||
entityageable.setCustomNameTag(itemstack.getDisplayName());
|
||||
}
|
||||
|
||||
if (!event.entityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
--itemstack.stackSize;
|
||||
if (!event.entityPlayer.capabilities.isCreativeMode) {
|
||||
--itemstack.stackSize;
|
||||
|
||||
if (itemstack.stackSize <= 0)
|
||||
{
|
||||
event.entityPlayer.inventory.setInventorySlotContents(event.entityPlayer.inventory.currentItem, (ItemStack)null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (itemstack.stackSize <= 0) {
|
||||
event.entityPlayer.inventory.setInventorySlotContents(event.entityPlayer.inventory.currentItem, (ItemStack) null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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)))
|
||||
{
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta), false);
|
||||
}
|
||||
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))) {
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
int i = target.blockX;
|
||||
int j = target.blockY;
|
||||
int k = target.blockZ;
|
||||
if (target != null && target.typeOfHit == MovingObjectType.BLOCK && validDimension) {
|
||||
int i = target.blockX;
|
||||
int j = target.blockY;
|
||||
int k = target.blockZ;
|
||||
|
||||
if (target.sideHit == 0)
|
||||
{
|
||||
--j;
|
||||
}
|
||||
if (target.sideHit == 0) {
|
||||
--j;
|
||||
}
|
||||
|
||||
if (target.sideHit == 1)
|
||||
{
|
||||
++j;
|
||||
}
|
||||
if (target.sideHit == 1) {
|
||||
++j;
|
||||
}
|
||||
|
||||
if (target.sideHit == 2)
|
||||
{
|
||||
--k;
|
||||
}
|
||||
if (target.sideHit == 2) {
|
||||
--k;
|
||||
}
|
||||
|
||||
if (target.sideHit == 3)
|
||||
{
|
||||
++k;
|
||||
}
|
||||
if (target.sideHit == 3) {
|
||||
++k;
|
||||
}
|
||||
|
||||
if (target.sideHit == 4)
|
||||
{
|
||||
--i;
|
||||
}
|
||||
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,175 +17,148 @@ 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);
|
||||
private static final HashMap<ResourceLocation, AetherEnchantmentFuel> iEnchantmentFuelRegistry = new HashMap<ResourceLocation, AetherEnchantmentFuel>(4096);
|
||||
private static final HashMap<ResourceLocation, AetherFreezable> iFreezableRegistry = new HashMap<ResourceLocation, AetherFreezable>(4096);
|
||||
private static final HashMap<ResourceLocation, AetherFreezableFuel> iFreezableFuelRegistry = new HashMap<ResourceLocation, AetherFreezableFuel>(4096);
|
||||
private static final HashMap<ResourceLocation, AetherMoaType> iMoaTypeRegistry = new HashMap<ResourceLocation, AetherMoaType>(4096);
|
||||
private static final HashMap<ResourceLocation, AetherAccessory> iAccessoryRegistry = new HashMap<ResourceLocation, AetherAccessory>(4096);
|
||||
private static final HashMap<ResourceLocation, AetherEnchantment> iEnchantmentRegistry = new HashMap<ResourceLocation, AetherEnchantment>(4096);
|
||||
private static final HashMap<ResourceLocation, AetherEnchantmentFuel> iEnchantmentFuelRegistry = new HashMap<ResourceLocation, AetherEnchantmentFuel>(4096);
|
||||
private static final HashMap<ResourceLocation, AetherFreezable> iFreezableRegistry = new HashMap<ResourceLocation, AetherFreezable>(4096);
|
||||
private static final HashMap<ResourceLocation, AetherFreezableFuel> iFreezableFuelRegistry = new HashMap<ResourceLocation, AetherFreezableFuel>(4096);
|
||||
private static final HashMap<ResourceLocation, AetherMoaType> iMoaTypeRegistry = new HashMap<ResourceLocation, AetherMoaType>(4096);
|
||||
|
||||
private static final AetherAPI instance = new 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)
|
||||
{
|
||||
ItemStack stack = type.getAccessoryStack();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
public AetherAccessory register(AetherAccessory type) {
|
||||
ItemStack stack = type.getAccessoryStack();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
|
||||
iAccessoryRegistry.put(registryName, (AetherAccessory) type.setRegistryName(registryName));
|
||||
iAccessoryRegistry.put(registryName, (AetherAccessory) type.setRegistryName(registryName));
|
||||
|
||||
return type;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public AetherEnchantment register(AetherEnchantment type)
|
||||
{
|
||||
ItemStack stack = type.getInput();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
public AetherEnchantment register(AetherEnchantment type) {
|
||||
ItemStack stack = type.getInput();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
|
||||
iEnchantmentRegistry.put(registryName, (AetherEnchantment) type.setRegistryName(registryName));
|
||||
iEnchantmentRegistry.put(registryName, (AetherEnchantment) type.setRegistryName(registryName));
|
||||
|
||||
return type;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public AetherEnchantmentFuel register(AetherEnchantmentFuel type)
|
||||
{
|
||||
ItemStack stack = type.getFuelStack();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
public AetherEnchantmentFuel register(AetherEnchantmentFuel type) {
|
||||
ItemStack stack = type.getFuelStack();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
|
||||
iEnchantmentFuelRegistry.put(registryName, (AetherEnchantmentFuel) type.setRegistryName(registryName));
|
||||
iEnchantmentFuelRegistry.put(registryName, (AetherEnchantmentFuel) type.setRegistryName(registryName));
|
||||
|
||||
return type;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public AetherFreezable register(AetherFreezable type)
|
||||
{
|
||||
ItemStack stack = type.getInput();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
public AetherFreezable register(AetherFreezable type) {
|
||||
ItemStack stack = type.getInput();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
|
||||
iFreezableRegistry.put(registryName, (AetherFreezable) type.setRegistryName(registryName));
|
||||
iFreezableRegistry.put(registryName, (AetherFreezable) type.setRegistryName(registryName));
|
||||
|
||||
return type;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public AetherFreezableFuel register(AetherFreezableFuel type)
|
||||
{
|
||||
ItemStack stack = type.getFuelStack();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
public AetherFreezableFuel register(AetherFreezableFuel type) {
|
||||
ItemStack stack = type.getFuelStack();
|
||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
||||
|
||||
iFreezableFuelRegistry.put(registryName, (AetherFreezableFuel) type.setRegistryName(registryName));
|
||||
iFreezableFuelRegistry.put(registryName, (AetherFreezableFuel) type.setRegistryName(registryName));
|
||||
|
||||
return type;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public AetherMoaType register(String modId, String name, AetherMoaType type)
|
||||
{
|
||||
iMoaTypeRegistry.put(new ResourceLocation(modId, name), (AetherMoaType) type.setRegistryName(modId, name));
|
||||
public AetherMoaType register(String modId, String name, AetherMoaType type) {
|
||||
iMoaTypeRegistry.put(new ResourceLocation(modId, name), (AetherMoaType) type.setRegistryName(modId, name));
|
||||
|
||||
return type;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public AetherMoaType register(ResourceLocation registryName, AetherMoaType type)
|
||||
{
|
||||
iMoaTypeRegistry.put(registryName, (AetherMoaType) type.setRegistryName(registryName));
|
||||
public AetherMoaType register(ResourceLocation registryName, AetherMoaType type) {
|
||||
iMoaTypeRegistry.put(registryName, (AetherMoaType) type.setRegistryName(registryName));
|
||||
|
||||
return type;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public boolean isAccessory(ItemStack stack)
|
||||
{
|
||||
return iAccessoryRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
||||
}
|
||||
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()
|
||||
{
|
||||
return new ArrayList<AetherEnchantment>(iEnchantmentRegistry.values());
|
||||
}
|
||||
public List<AetherEnchantment> getEnchantmentValues() {
|
||||
return new ArrayList<AetherEnchantment>(iEnchantmentRegistry.values());
|
||||
}
|
||||
|
||||
public List<AetherFreezable> getFreezableValues()
|
||||
{
|
||||
return new ArrayList<AetherFreezable>(iFreezableRegistry.values());
|
||||
}
|
||||
public List<AetherFreezable> getFreezableValues() {
|
||||
return new ArrayList<AetherFreezable>(iFreezableRegistry.values());
|
||||
}
|
||||
|
||||
public List<AetherMoaType> getMoaTypeValues()
|
||||
{
|
||||
return new ArrayList<AetherMoaType>(iMoaTypeRegistry.values());
|
||||
}
|
||||
public List<AetherMoaType> getMoaTypeValues() {
|
||||
return new ArrayList<AetherMoaType>(iMoaTypeRegistry.values());
|
||||
}
|
||||
|
||||
public int getMoaTypeId(AetherMoaType type)
|
||||
{
|
||||
return this.getMoaTypeValues().indexOf(type);
|
||||
}
|
||||
public int getMoaTypeId(AetherMoaType type) {
|
||||
return this.getMoaTypeValues().indexOf(type);
|
||||
}
|
||||
|
||||
public AetherMoaType getMoaType(int id)
|
||||
{
|
||||
return this.getMoaTypeValues().get(id);
|
||||
}
|
||||
public AetherMoaType getMoaType(int id) {
|
||||
return this.getMoaTypeValues().get(id);
|
||||
}
|
||||
|
||||
public AetherMoaType getRandomMoaType()
|
||||
{
|
||||
return this.getMoaTypeValues().get(new Random().nextInt(this.getMoaTypeSize()));
|
||||
}
|
||||
public AetherMoaType getRandomMoaType() {
|
||||
return this.getMoaTypeValues().get(new Random().nextInt(this.getMoaTypeSize()));
|
||||
}
|
||||
|
||||
public int getMoaTypeSize()
|
||||
{
|
||||
return this.getMoaTypeValues().size();
|
||||
}
|
||||
public int getMoaTypeSize() {
|
||||
return this.getMoaTypeValues().size();
|
||||
}
|
||||
|
||||
public static AetherAPI instance()
|
||||
{
|
||||
return 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);
|
||||
|
@ -53,7 +47,7 @@ public enum AccessoryType
|
|||
identityMap.func_148746_a(EXTRA_MISC, 7);
|
||||
|
||||
return identityMap;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -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,41 +13,35 @@ 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;
|
||||
if (MinecraftForge.EVENT_BUS.post(event)) return false;
|
||||
|
||||
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,49 +22,40 @@ 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)
|
||||
{
|
||||
this.growTree(worldIn, x, y, z, rand);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
@ -106,11 +105,10 @@ public class BlocksAether
|
|||
public static Block holiday_leaves, decorated_holiday_leaves, present;
|
||||
|
||||
public static Block sun_altar;
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
return block == Blocks.air || block == aercloud;
|
||||
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,39 +9,32 @@ 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())
|
||||
{
|
||||
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
||||
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)
|
||||
{
|
||||
((AetherTileEntity)tileentity).setCustomName(stack.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tileentity instanceof AetherTileEntity) {
|
||||
((AetherTileEntity) tileentity).setCustomName(stack.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void setState(World worldIn, int x, int y, int z, boolean isActive)
|
||||
{
|
||||
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
||||
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);
|
||||
worldIn.setBlockMetadataWithNotify(x, y, z, isActive ? 1 : 0, 3);
|
||||
|
||||
if (tileentity != null)
|
||||
{
|
||||
tileentity.validate();
|
||||
worldIn.setTileEntity(x, y, z, tileentity);
|
||||
}
|
||||
if (tileentity != null) {
|
||||
tileentity.validate();
|
||||
worldIn.setTileEntity(x, y, z, tileentity);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -23,138 +23,118 @@ 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;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconBottom;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconBottom;
|
||||
|
||||
public BlockEnchanter()
|
||||
{
|
||||
public BlockEnchanter() {
|
||||
super(Material.rock);
|
||||
|
||||
this.setHardness(2.0F);
|
||||
this.setHardness(2.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
return this.blockIconBottom;
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
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) {
|
||||
return this.blockIconTop;
|
||||
} else if (side == 0) {
|
||||
return this.blockIconBottom;
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileEntityEnchanter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune)
|
||||
{
|
||||
return Item.getItemFromBlock(BlocksAether.enchanter);
|
||||
}
|
||||
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)
|
||||
{
|
||||
float f = (float)x + 0.5F;
|
||||
float f1 = (float)y + 1.0F + (random.nextFloat() * 6F) / 16F;
|
||||
float f2 = (float)z + 0.5F;
|
||||
@SideOnly(Side.CLIENT)
|
||||
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;
|
||||
|
||||
world.spawnParticle("smoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
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;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta)
|
||||
{
|
||||
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
||||
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)
|
||||
{
|
||||
TileEntityEnchanter tile = (TileEntityEnchanter) tileentity;
|
||||
if (tileentity instanceof TileEntityEnchanter) {
|
||||
TileEntityEnchanter tile = (TileEntityEnchanter) tileentity;
|
||||
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tile.getStackInSlot(i1);
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tile.getStackInSlot(i1);
|
||||
|
||||
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;
|
||||
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)
|
||||
{
|
||||
int j1 = worldIn.rand.nextInt(21) + 10;
|
||||
while (itemstack.stackSize > 0) {
|
||||
int j1 = worldIn.rand.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
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()));
|
||||
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())
|
||||
{
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||
}
|
||||
if (itemstack.hasTagCompound()) {
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (double)((float)worldIn.rand.nextGaussian() * f3);
|
||||
entityitem.motionY = (double)((float)worldIn.rand.nextGaussian() * f3 + 0.2F);
|
||||
entityitem.motionZ = (double)((float)worldIn.rand.nextGaussian() * f3);
|
||||
worldIn.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (double) ((float) worldIn.rand.nextGaussian() * f3);
|
||||
entityitem.motionY = (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
|
||||
entityitem.motionZ = (double) ((float) worldIn.rand.nextGaussian() * f3);
|
||||
worldIn.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
worldIn.func_147453_f(x, y, z, this);
|
||||
}
|
||||
worldIn.func_147453_f(x, y, z, this);
|
||||
}
|
||||
|
||||
super.breakBlock(worldIn, x, y, z, block, meta);
|
||||
}
|
||||
super.breakBlock(worldIn, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
}
|
|
@ -23,138 +23,118 @@ 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;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconBottom;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconBottom;
|
||||
|
||||
public BlockFreezer()
|
||||
{
|
||||
public BlockFreezer() {
|
||||
super(Material.rock);
|
||||
|
||||
this.setHardness(2.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
return this.blockIconBottom;
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
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) {
|
||||
return this.blockIconTop;
|
||||
} else if (side == 0) {
|
||||
return this.blockIconBottom;
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileEntityFreezer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune)
|
||||
{
|
||||
return Item.getItemFromBlock(BlocksAether.freezer);
|
||||
}
|
||||
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)
|
||||
{
|
||||
player.openGui(Aether.instance, AetherGuiHandler.freezer, world, x, y, z);
|
||||
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;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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;
|
||||
@SideOnly(Side.CLIENT)
|
||||
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;
|
||||
|
||||
world.spawnParticle("smoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("snowshovel", f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta)
|
||||
{
|
||||
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
||||
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)
|
||||
{
|
||||
TileEntityFreezer tile = (TileEntityFreezer) tileentity;
|
||||
if (tileentity instanceof TileEntityFreezer) {
|
||||
TileEntityFreezer tile = (TileEntityFreezer) tileentity;
|
||||
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tile.getStackInSlot(i1);
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tile.getStackInSlot(i1);
|
||||
|
||||
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;
|
||||
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)
|
||||
{
|
||||
int j1 = worldIn.rand.nextInt(21) + 10;
|
||||
while (itemstack.stackSize > 0) {
|
||||
int j1 = worldIn.rand.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
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()));
|
||||
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())
|
||||
{
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||
}
|
||||
if (itemstack.hasTagCompound()) {
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (double)((float)worldIn.rand.nextGaussian() * f3);
|
||||
entityitem.motionY = (double)((float)worldIn.rand.nextGaussian() * f3 + 0.2F);
|
||||
entityitem.motionZ = (double)((float)worldIn.rand.nextGaussian() * f3);
|
||||
worldIn.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (double) ((float) worldIn.rand.nextGaussian() * f3);
|
||||
entityitem.motionY = (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
|
||||
entityitem.motionZ = (double) ((float) worldIn.rand.nextGaussian() * f3);
|
||||
worldIn.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
worldIn.func_147453_f(x, y, z, this);
|
||||
}
|
||||
worldIn.func_147453_f(x, y, z, this);
|
||||
}
|
||||
|
||||
super.breakBlock(worldIn, x, y, z, block, meta);
|
||||
}
|
||||
super.breakBlock(worldIn, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
}
|
|
@ -23,138 +23,118 @@ 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;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconBottom;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconBottom;
|
||||
|
||||
public BlockIncubator()
|
||||
{
|
||||
public BlockIncubator() {
|
||||
super(Material.rock);
|
||||
|
||||
this.setHardness(2.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
return this.blockIconBottom;
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
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) {
|
||||
return this.blockIconTop;
|
||||
} else if (side == 0) {
|
||||
return this.blockIconBottom;
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileEntityIncubator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune)
|
||||
{
|
||||
return Item.getItemFromBlock(BlocksAether.incubator);
|
||||
}
|
||||
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)
|
||||
{
|
||||
float f = (float)x + 0.5F;
|
||||
float f1 = (float)y + 1.0F + (random.nextFloat() * 6F) / 16F;
|
||||
float f2 = (float)z + 0.5F;
|
||||
@SideOnly(Side.CLIENT)
|
||||
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;
|
||||
|
||||
world.spawnParticle("smoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
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;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta)
|
||||
{
|
||||
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
||||
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)
|
||||
{
|
||||
TileEntityIncubator tile = (TileEntityIncubator) tileentity;
|
||||
if (tileentity instanceof TileEntityIncubator) {
|
||||
TileEntityIncubator tile = (TileEntityIncubator) tileentity;
|
||||
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tile.getStackInSlot(i1);
|
||||
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tile.getStackInSlot(i1);
|
||||
|
||||
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;
|
||||
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)
|
||||
{
|
||||
int j1 = worldIn.rand.nextInt(21) + 10;
|
||||
while (itemstack.stackSize > 0) {
|
||||
int j1 = worldIn.rand.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
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()));
|
||||
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())
|
||||
{
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||
}
|
||||
if (itemstack.hasTagCompound()) {
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (double)((float)worldIn.rand.nextGaussian() * f3);
|
||||
entityitem.motionY = (double)((float)worldIn.rand.nextGaussian() * f3 + 0.2F);
|
||||
entityitem.motionZ = (double)((float)worldIn.rand.nextGaussian() * f3);
|
||||
worldIn.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (double) ((float) worldIn.rand.nextGaussian() * f3);
|
||||
entityitem.motionY = (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
|
||||
entityitem.motionZ = (double) ((float) worldIn.rand.nextGaussian() * f3);
|
||||
worldIn.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
worldIn.func_147453_f(x, y, z, this);
|
||||
}
|
||||
worldIn.func_147453_f(x, y, z, this);
|
||||
}
|
||||
|
||||
super.breakBlock(worldIn, x, y, z, block, meta);
|
||||
}
|
||||
super.breakBlock(worldIn, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
}
|
|
@ -17,69 +17,56 @@ 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;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
||||
public BlockSunAltar()
|
||||
{
|
||||
public BlockSunAltar() {
|
||||
super(Material.rock);
|
||||
|
||||
this.setHardness(2.5F);
|
||||
this.setStepSound(soundTypeMetal);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
return BlocksAether.hellfire_stone.getBlockTextureFromSide(side);
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.blockIcon = registry.registerIcon(Aether.find("sun_altar_side"));
|
||||
this.blockIconTop = registry.registerIcon(Aether.find("sun_altar_top"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
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) {
|
||||
return this.blockIconTop;
|
||||
} else if (side == 0) {
|
||||
return BlocksAether.hellfire_stone.getBlockTextureFromSide(side);
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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);
|
||||
|
@ -23,16 +21,14 @@ public class BlockAerogel extends BlockBreakable
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
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,16 +21,14 @@ public class BlockAetherFence extends BlockFence
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(World world, int x, int y, int z)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
}
|
||||
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);
|
||||
|
@ -23,10 +21,9 @@ public class BlockAetherFenceGate extends BlockFenceGate
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_)
|
||||
{
|
||||
return BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
|
||||
}
|
||||
|
||||
}
|
|
@ -10,53 +10,55 @@ 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;
|
||||
|
||||
this.setLightOpacity(0);
|
||||
this.setLightOpacity(0);
|
||||
this.setStepSound(materialIn == Material.wood ? soundTypeWood : soundTypeStone);
|
||||
}
|
||||
|
||||
@Override
|
||||
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 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)
|
||||
{
|
||||
return Item.getItemFromBlock(this.getDroppedSlab());
|
||||
}
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(this.getDroppedSlab());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
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_)
|
||||
{
|
||||
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0));
|
||||
}
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
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_)
|
||||
{
|
||||
return this.block.getBlockTextureFromSide(p_149691_1_);
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return this.block.getBlockTextureFromSide(p_149691_1_);
|
||||
}
|
||||
}
|
|
@ -2,16 +2,14 @@ package com.legacy.aether.blocks.decorative;
|
|||
|
||||
import net.minecraft.block.BlockTorch;
|
||||
|
||||
public class BlockAmbrosiumTorch extends BlockTorch
|
||||
{
|
||||
public class BlockAmbrosiumTorch extends BlockTorch {
|
||||
|
||||
public BlockAmbrosiumTorch()
|
||||
{
|
||||
super();
|
||||
public BlockAmbrosiumTorch() {
|
||||
super();
|
||||
|
||||
this.setTickRandomly(true);
|
||||
this.setLightLevel(0.9375F);
|
||||
this.setStepSound(soundTypeWood);
|
||||
}
|
||||
this.setTickRandomly(true);
|
||||
this.setLightLevel(0.9375F);
|
||||
this.setStepSound(soundTypeWood);
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
||||
public BlockPresent()
|
||||
{
|
||||
public BlockPresent() {
|
||||
super(Material.grass);
|
||||
|
||||
this.setHardness(0.6F);
|
||||
|
@ -32,75 +30,58 @@ public class BlockPresent extends Block
|
|||
this.setBlockTextureName(Aether.find("present_side"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
super.registerBlockIcons(registry);
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
super.registerBlockIcons(registry);
|
||||
|
||||
this.blockIconTop = registry.registerIcon(Aether.find("present_top"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
return this.blockIconTop;
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
this.blockIconTop = registry.registerIcon(Aether.find("present_top"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta)
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
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) {
|
||||
return this.blockIconTop;
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(present, "game.tnt.primed", 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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,28 +24,24 @@ public class BlockQuicksoilGlass extends BlockBreakable
|
|||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public int quantityDropped(Random random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public boolean renderAsNormalBlock() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -15,42 +15,36 @@ 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()
|
||||
{
|
||||
super(Material.wood);
|
||||
|
||||
this.setHardness(2F);
|
||||
public BlockSkyrootBookshelf() {
|
||||
super(Material.wood);
|
||||
|
||||
this.setHardness(2F);
|
||||
this.setResistance(5F);
|
||||
this.setHarvestLevel("axe", 0);
|
||||
this.setStepSound(soundTypeWood);
|
||||
this.setBlockTextureName(Aether.find("skyroot_bookshelf"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEnchantPowerBonus(World world, int x, int y, int z)
|
||||
{
|
||||
@Override
|
||||
public int quantityDropped(Random random) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEnchantPowerBonus(World world, int x, int y, int z) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune)
|
||||
{
|
||||
return Items.book;
|
||||
}
|
||||
@Override
|
||||
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,9 +18,8 @@ public class BlockZanite extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
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,36 +35,30 @@ public class BlockDungeonBase extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
if (block != this)
|
||||
{
|
||||
return block.getLightValue(world, x, y, z);
|
||||
}
|
||||
public int getLightValue(IBlockAccess world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
if (this.isLit)
|
||||
{
|
||||
return (int)(15.0F * 0.75f);
|
||||
}
|
||||
if (block != this) {
|
||||
return block.getLightValue(world, x, y, z);
|
||||
}
|
||||
|
||||
return super.getLightValue(world, x, y, z);
|
||||
}
|
||||
if (this.isLit) {
|
||||
return (int) (15.0F * 0.75f);
|
||||
}
|
||||
|
||||
return super.getLightValue(world, x, y, z);
|
||||
}
|
||||
|
||||
@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,44 +23,34 @@ public class BlockDungeonTrap extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity entityIn)
|
||||
{
|
||||
if (entityIn instanceof EntityPlayer)
|
||||
{
|
||||
world.setBlock(x, y, z, this.pickBlock);
|
||||
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)
|
||||
{
|
||||
EntitySentry sentry = new EntitySentry(world, x + 2D, y + 1D, z + 2D);
|
||||
if (this == BlocksAether.carved_trap) {
|
||||
EntitySentry sentry = new EntitySentry(world, x + 2D, y + 1D, z + 2D);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(sentry);
|
||||
}
|
||||
}
|
||||
else if (this == BlocksAether.angelic_trap)
|
||||
{
|
||||
EntityValkyrie valkyrie = new EntityValkyrie(world);
|
||||
valkyrie.setPosition(x + 0.5D, y + 1D, z + 0.5D);
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(sentry);
|
||||
}
|
||||
} else if (this == BlocksAether.angelic_trap) {
|
||||
EntityValkyrie valkyrie = new EntityValkyrie(world);
|
||||
valkyrie.setPosition(x + 0.5D, y + 1D, z + 0.5D);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(valkyrie);
|
||||
}
|
||||
}
|
||||
else if (this == BlocksAether.hellfire_trap)
|
||||
{
|
||||
EntityFireMinion minion = new EntityFireMinion(world);
|
||||
minion.setPosition(x + 0.5D, y + 1D, z + 0.5D);
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(valkyrie);
|
||||
}
|
||||
} else if (this == BlocksAether.hellfire_trap) {
|
||||
EntityFireMinion minion = new EntityFireMinion(world);
|
||||
minion.setPosition(x + 0.5D, y + 1D, z + 0.5D);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(minion);
|
||||
}
|
||||
}
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(minion);
|
||||
}
|
||||
}
|
||||
|
||||
world.playSoundEffect(x, y, z, "random.door_close", 2.0F, world.rand.nextFloat() - world.rand.nextFloat() * 0.2F + 1.2F);
|
||||
}
|
||||
}
|
||||
world.playSoundEffect(x, y, z, "random.door_close", 2.0F, world.rand.nextFloat() - world.rand.nextFloat() * 0.2F + 1.2F);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -11,54 +11,45 @@ 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)
|
||||
{
|
||||
return new TileEntityChestMimic();
|
||||
}
|
||||
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);
|
||||
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);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta)
|
||||
{
|
||||
this.spawnMimic(worldIn, player, x, y, z);
|
||||
}
|
||||
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)
|
||||
{
|
||||
return new ItemStack(Blocks.chest);
|
||||
}
|
||||
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);
|
||||
mimic.setPosition((double) x + 0.5D, (double) y + 1.5D, (double) z + 0.5D);
|
||||
world.spawnEntityInWorld(mimic);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,18 +9,16 @@ 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;
|
||||
|
||||
private String sideTexture;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon sideIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon sideIcon;
|
||||
|
||||
public BlockPillar(String topIcon, String sideTexture)
|
||||
{
|
||||
public BlockPillar(String topIcon, String sideTexture) {
|
||||
super(Material.rock);
|
||||
|
||||
this.topTexture = topIcon;
|
||||
|
@ -32,18 +30,16 @@ public class BlockPillar extends BlockRotatedPillar
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon getSideIcon(int meta)
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon getSideIcon(int meta) {
|
||||
return this.sideIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
this.field_150164_N = registry.registerIcon(Aether.find(this.topTexture));
|
||||
this.sideIcon = registry.registerIcon(Aether.find(this.sideTexture));
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.field_150164_N = registry.registerIcon(Aether.find(this.topTexture));
|
||||
this.sideIcon = registry.registerIcon(Aether.find(this.sideTexture));
|
||||
}
|
||||
|
||||
}
|
|
@ -18,70 +18,58 @@ 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();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister p_149651_1_)
|
||||
{
|
||||
this.blockIcon = p_149651_1_.registerIcon(Aether.find("carved_stone"));
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
return new TileEntityTreasureChest();
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
TileEntityTreasureChest treasurechest = (TileEntityTreasureChest)worldIn.getTileEntity(x, y, z);
|
||||
TileEntityTreasureChest treasurechest = (TileEntityTreasureChest) worldIn.getTileEntity(x, y, z);
|
||||
|
||||
ItemStack guiID = playerIn.getCurrentEquippedItem();
|
||||
ItemStack guiID = playerIn.getCurrentEquippedItem();
|
||||
|
||||
if (treasurechest.isLocked())
|
||||
{
|
||||
if (guiID == null || guiID != null && guiID.getItem() != ItemsAether.dungeon_key)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (treasurechest.isLocked()) {
|
||||
if (guiID == null || guiID != null && guiID.getItem() != ItemsAether.dungeon_key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
treasurechest.unlock(guiID.getItemDamage());
|
||||
treasurechest.unlock(guiID.getItemDamage());
|
||||
|
||||
--guiID.stackSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
playerIn.openGui(Aether.instance, AetherGuiHandler.treasure_chest, worldIn, x, y, z);
|
||||
}
|
||||
--guiID.stackSize;
|
||||
} else {
|
||||
playerIn.openGui(Aether.instance, AetherGuiHandler.treasure_chest, worldIn, x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public int quantityDropped(Random random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return CommonProxy.treasureChestRenderID;
|
||||
}
|
||||
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);
|
||||
|
@ -34,50 +32,39 @@ 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_)
|
||||
{
|
||||
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));
|
||||
}
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
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)
|
||||
{
|
||||
entity.fallDistance = 0;
|
||||
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)
|
||||
{
|
||||
entity.motionY *= 0.005D;
|
||||
}
|
||||
if (player.isSneaking()) {
|
||||
if (entity.motionY < 0) {
|
||||
entity.motionY *= 0.005D;
|
||||
}
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
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,106 +73,86 @@ 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()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public boolean renderAsNormalBlock() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int meta)
|
||||
{
|
||||
if (meta == 1)
|
||||
{
|
||||
return 0xCCFFFF;
|
||||
}
|
||||
else if (meta == 2)
|
||||
{
|
||||
return 0xFFFF80;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int meta) {
|
||||
if (meta == 1) {
|
||||
return 0xCCFFFF;
|
||||
} else if (meta == 2) {
|
||||
return 0xFFFF80;
|
||||
}
|
||||
|
||||
return this.getBlockColor();
|
||||
}
|
||||
return this.getBlockColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
return this.getRenderColor(meta);
|
||||
}
|
||||
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)
|
||||
{
|
||||
return 0xCCFFFF;
|
||||
}
|
||||
else if (stack.getItemDamage() == 2)
|
||||
{
|
||||
return 0xFFFF80;
|
||||
}
|
||||
public int getColorFromItemStack(ItemStack stack, int pass) {
|
||||
if (stack.getItemDamage() == 1) {
|
||||
return 0xCCFFFF;
|
||||
} else if (stack.getItemDamage() == 2) {
|
||||
return 0xFFFF80;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@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_)
|
||||
{
|
||||
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
|
||||
@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_) {
|
||||
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_]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
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)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (block == this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
|
||||
}
|
||||
return super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
|
||||
}
|
||||
|
||||
@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,15 +19,13 @@ 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)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
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 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,23 +20,20 @@ public class BlockAetherFlower extends BlockBush
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z)
|
||||
{
|
||||
Block soil = world.getBlock(x, y - 1, 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()
|
||||
{
|
||||
return CommonProxy.aetherFlowerRenderID;
|
||||
}
|
||||
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;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
||||
public BlockAetherGrass()
|
||||
{
|
||||
public BlockAetherGrass() {
|
||||
super(Material.grass);
|
||||
|
||||
this.setHardness(0.2F);
|
||||
|
@ -40,152 +38,119 @@ 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)
|
||||
{
|
||||
worldIn.setBlock(x, y, z, BlocksAether.aether_dirt);
|
||||
}
|
||||
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;
|
||||
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) {
|
||||
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)
|
||||
{
|
||||
worldIn.setBlock(i1, j1, k1, BlocksAether.aether_grass);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random random, int fortune)
|
||||
{
|
||||
return Item.getItemFromBlock(BlocksAether.aether_dirt);
|
||||
}
|
||||
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)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
public int damageDropped(int meta) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@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_)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry) {
|
||||
this.blockIcon = registry.registerIcon("aether_legacy:aether_grass_side");
|
||||
this.blockIconTop = registry.registerIcon("aether_legacy:aether_grass_top");
|
||||
}
|
||||
|
||||
@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_)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 1 ? this.blockIconTop : (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side) : this.blockIcon);
|
||||
}
|
||||
|
||||
@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_)
|
||||
{
|
||||
int l = 0;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if (side == 1) {
|
||||
return this.blockIconTop;
|
||||
} else if (side == 0) {
|
||||
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
|
||||
}
|
||||
|
||||
while (l < 128)
|
||||
{
|
||||
int i1 = p_149853_3_;
|
||||
int j1 = p_149853_4_ + 1;
|
||||
int k1 = p_149853_5_;
|
||||
int l1 = 0;
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
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;
|
||||
@Override
|
||||
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
|
||||
EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);
|
||||
|
||||
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))
|
||||
{
|
||||
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))
|
||||
{
|
||||
p_149853_1_.setBlock(i1, j1, k1, BlocksAether.berry_bush_stem, 0, 3);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AetherWorld.aether_biome.plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1);
|
||||
}
|
||||
}
|
||||
return plantType == EnumPlantType.Plains;
|
||||
}
|
||||
|
||||
++l;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@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_) {
|
||||
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_) {
|
||||
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_) {
|
||||
int l = 0;
|
||||
|
||||
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) {
|
||||
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()) {
|
||||
++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)) {
|
||||
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)) {
|
||||
p_149853_1_.setBlock(i1, j1, k1, BlocksAether.berry_bush_stem, 0, 3);
|
||||
}
|
||||
} else {
|
||||
AetherWorld.aether_biome.plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1);
|
||||
}
|
||||
}
|
||||
|
||||
++l;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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()
|
||||
{
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int meta)
|
||||
{
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBlockColor() {
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int meta) {
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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,82 +77,70 @@ 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)
|
||||
{
|
||||
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;
|
||||
double d3 = ((double)rand.nextFloat() - 0.5D) * 0.5D;
|
||||
double d4 = ((double)rand.nextFloat() - 0.5D) * 0.5D;
|
||||
double d5 = ((double)rand.nextFloat() - 0.5D) * 0.5D;
|
||||
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;
|
||||
double d3 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||
|
||||
ParticleHolidayLeaves particle = new ParticleHolidayLeaves(world, d, d1, d2, d3, d4, d5);
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
||||
}
|
||||
}
|
||||
ParticleHolidayLeaves particle = new ParticleHolidayLeaves(world, d, d1, d2, d3, d4, d5);
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
double d3 = ((double)rand.nextFloat() - 0.5D) * 0.5D;
|
||||
double d4 = ((double)rand.nextFloat() - 0.5D) * 0.5D;
|
||||
double d5 = ((double)rand.nextFloat() - 0.5D) * 0.5D;
|
||||
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;
|
||||
double d3 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||
|
||||
ParticleCrystalLeaves particle = new ParticleCrystalLeaves(world, d, d1, d2, d3, d4, d5);
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
||||
}
|
||||
}
|
||||
ParticleCrystalLeaves particle = new ParticleCrystalLeaves(world, d, d1, d2, d3, d4, d5);
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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)
|
||||
{
|
||||
ArrayList<ItemStack> drops = super.getDrops(world, x, y, z, metadata, fortune);
|
||||
|
||||
if (this == BlocksAether.crystal_fruit_leaves)
|
||||
{
|
||||
drops.add(new ItemStack(ItemsAether.white_apple));
|
||||
}
|
||||
|
||||
return drops;
|
||||
}
|
||||
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
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
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) {
|
||||
drops.add(new ItemStack(ItemsAether.white_apple));
|
||||
}
|
||||
|
||||
return drops;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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_)
|
||||
{
|
||||
@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_) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] func_150125_e()
|
||||
{
|
||||
return new String[] { this.getUnlocalizedName() };
|
||||
public String[] func_150125_e() {
|
||||
return new String[]{this.getUnlocalizedName()};
|
||||
}
|
||||
|
||||
}
|
|
@ -25,77 +25,60 @@ 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);
|
||||
player.addExhaustion(0.025F);
|
||||
|
||||
int size = meta == 0 ? 2 : 1;
|
||||
int size = meta == 0 ? 2 : 1;
|
||||
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
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)
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, x, y, z, new ItemStack(ItemsAether.golden_amber, 1 + worldIn.rand.nextInt(2)));
|
||||
}
|
||||
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)
|
||||
{
|
||||
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||
}
|
||||
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) {
|
||||
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
||||
}
|
||||
} else {
|
||||
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
||||
}
|
||||
} else {
|
||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random random, int fortune)
|
||||
{
|
||||
return Item.getItemFromBlock(BlocksAether.skyroot_log);
|
||||
}
|
||||
public Item getItemDropped(int meta, Random random, int fortune) {
|
||||
return Item.getItemFromBlock(BlocksAether.skyroot_log);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
public int damageDropped(int meta) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
this.field_150167_a = new IIcon[1];
|
||||
this.field_150166_b = new IIcon[1];
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
this.field_150167_a[i] = registry.registerIcon(this.getTextureName() + "_side");
|
||||
this.field_150166_b[i] = registry.registerIcon(this.getTextureName() + "_top");
|
||||
}
|
||||
}
|
||||
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,81 +32,64 @@ 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);
|
||||
player.addExhaustion(0.025F);
|
||||
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
|
||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0)
|
||||
{
|
||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0) {
|
||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||
}
|
||||
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 {
|
||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random random, int fortune)
|
||||
{
|
||||
return this == BlocksAether.zanite_ore ? ItemsAether.zanite_gemstone : ItemsAether.ambrosium_shard;
|
||||
}
|
||||
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))
|
||||
{
|
||||
int j = random.nextInt(fortune + 2) - 1;
|
||||
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)
|
||||
{
|
||||
j = 0;
|
||||
}
|
||||
if (j < 0) {
|
||||
j = 0;
|
||||
}
|
||||
|
||||
return this.quantityDropped(random) * (j + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.quantityDropped(random);
|
||||
}
|
||||
}
|
||||
return this.quantityDropped(random) * (j + 1);
|
||||
} else {
|
||||
return this.quantityDropped(random);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_)
|
||||
{
|
||||
Random random = new Random();
|
||||
@Override
|
||||
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))
|
||||
{
|
||||
int amount = 0;
|
||||
if (this.getItemDropped(p_149690_5_, random, p_149690_7_) != Item.getItemFromBlock(this)) {
|
||||
int amount = 0;
|
||||
|
||||
if (this == BlocksAether.ambrosium_ore)
|
||||
{
|
||||
amount = MathHelper.getRandomIntegerInRange(random, 0, 2);
|
||||
}
|
||||
else if (this == BlocksAether.zanite_ore)
|
||||
{
|
||||
amount = MathHelper.getRandomIntegerInRange(random, 2, 5);
|
||||
}
|
||||
if (this == BlocksAether.ambrosium_ore) {
|
||||
amount = MathHelper.getRandomIntegerInRange(random, 0, 2);
|
||||
} else if (this == BlocksAether.zanite_ore) {
|
||||
amount = MathHelper.getRandomIntegerInRange(random, 2, 5);
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -19,12 +19,10 @@ 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()
|
||||
{
|
||||
this.setHardness(0.2F);
|
||||
public BlockBerryBush() {
|
||||
this.setHardness(0.2F);
|
||||
this.setHarvestLevel("axe", 0);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
this.setBlockTextureName(Aether.find("berry_bush"));
|
||||
|
@ -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,53 +57,44 @@ 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))
|
||||
{
|
||||
int min, max;
|
||||
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)
|
||||
{
|
||||
min = 1;
|
||||
max = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
min = 1;
|
||||
max = 3;
|
||||
}
|
||||
if (world.getBlock(x, y, z) == BlocksAether.enchanted_aether_grass) {
|
||||
min = 1;
|
||||
max = 4;
|
||||
} else {
|
||||
min = 1;
|
||||
max = 3;
|
||||
}
|
||||
|
||||
int randomNum = world.rand.nextInt(max - min + 1) + min;
|
||||
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0));
|
||||
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
|
||||
}
|
||||
}
|
||||
int randomNum = world.rand.nextInt(max - min + 1) + min;
|
||||
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0));
|
||||
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return CommonProxy.berryBushRenderID;
|
||||
}
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_149851_a(World world, int x, int y, int z, boolean isClient)
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_149852_a(World world, Random random, int x, int y, int z)
|
||||
{
|
||||
return (double)random.nextFloat() < 0.45D;
|
||||
public boolean func_149851_a(World world, int x, int y, int z, boolean isClient) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_149853_b(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) {
|
||||
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
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
public class BlockEnchantedAetherGrass extends Block {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon blockIconTop;
|
||||
|
||||
public BlockEnchantedAetherGrass()
|
||||
{
|
||||
public BlockEnchantedAetherGrass() {
|
||||
super(Material.grass);
|
||||
|
||||
this.setHardness(0.2F);
|
||||
|
@ -25,35 +23,29 @@ public class BlockEnchantedAetherGrass extends Block
|
|||
this.setHarvestLevel("shovel", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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 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)
|
||||
{
|
||||
return side == 1 ? this.blockIconTop : (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side) : this.blockIcon);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
return this.blockIconTop;
|
||||
}
|
||||
else if (side == 0)
|
||||
{
|
||||
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if (side == 1) {
|
||||
return this.blockIconTop;
|
||||
} else if (side == 0) {
|
||||
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
}
|
|
@ -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,15 +19,13 @@ 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)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
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,15 +21,13 @@ 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)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
public int damageDropped(int meta) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
|
@ -10,181 +10,149 @@ 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;
|
||||
public final int rightDir;
|
||||
public final int leftDir;
|
||||
public int portalBlockCount = 0;
|
||||
public ChunkCoordinates bottomLeft;
|
||||
public int height;
|
||||
public int width;
|
||||
private final World world;
|
||||
private final int axis;
|
||||
public final int rightDir;
|
||||
public final int leftDir;
|
||||
public int portalBlockCount = 0;
|
||||
public ChunkCoordinates bottomLeft;
|
||||
public int height;
|
||||
public int width;
|
||||
|
||||
public AetherPortalSize(World worldIn, int x, int y, int z, int axis)
|
||||
{
|
||||
this.world = worldIn;
|
||||
this.axis = 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];
|
||||
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;
|
||||
int i = this.getDistanceUntilEdge(x, y, z, this.leftDir) - 1;
|
||||
|
||||
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 (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)
|
||||
{
|
||||
this.bottomLeft = null;
|
||||
this.width = 0;
|
||||
}
|
||||
}
|
||||
if (this.width < 2 || this.width > 21) {
|
||||
this.bottomLeft = null;
|
||||
this.width = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bottomLeft != null)
|
||||
{
|
||||
this.height = this.calculatePortalHeight();
|
||||
}
|
||||
}
|
||||
if (this.bottomLeft != null) {
|
||||
this.height = this.calculatePortalHeight();
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
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)
|
||||
{
|
||||
block = this.world.getBlock(x + j1 * i1, y, z + k1 * i1);
|
||||
for (i1 = 0; i1 < 22; ++i1) {
|
||||
block = this.world.getBlock(x + j1 * i1, y, z + k1 * i1);
|
||||
|
||||
if (!this.isEmptyBlock(block))
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (!this.isEmptyBlock(block)) {
|
||||
break;
|
||||
}
|
||||
|
||||
Block block1 = this.world.getBlock(x + j1 * i1, y - 1, z + k1 * i1);
|
||||
Block block1 = this.world.getBlock(x + j1 * i1, y - 1, z + k1 * i1);
|
||||
|
||||
if (block1 != Blocks.glowstone)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (block1 != Blocks.glowstone) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
block = this.world.getBlock(x + j1 * i1, y, z + k1 * i1);
|
||||
return block == Blocks.glowstone ? i1 : 0;
|
||||
}
|
||||
block = this.world.getBlock(x + j1 * i1, y, z + k1 * i1);
|
||||
return block == Blocks.glowstone ? i1 : 0;
|
||||
}
|
||||
|
||||
public int getHeight()
|
||||
{
|
||||
return this.height;
|
||||
}
|
||||
public int getHeight() {
|
||||
return this.height;
|
||||
}
|
||||
|
||||
public int getWidth()
|
||||
{
|
||||
return this.width;
|
||||
}
|
||||
public int getWidth() {
|
||||
return this.width;
|
||||
}
|
||||
|
||||
protected int calculatePortalHeight()
|
||||
{
|
||||
label24:
|
||||
protected int calculatePortalHeight() {
|
||||
label24:
|
||||
|
||||
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);
|
||||
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))
|
||||
{
|
||||
break label24;
|
||||
}
|
||||
if (!this.isEmptyBlock(block)) {
|
||||
break label24;
|
||||
}
|
||||
|
||||
if (block == BlocksAether.aether_portal)
|
||||
{
|
||||
++this.portalBlockCount;
|
||||
}
|
||||
if (block == BlocksAether.aether_portal) {
|
||||
++this.portalBlockCount;
|
||||
}
|
||||
|
||||
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 (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)
|
||||
{
|
||||
break label24;
|
||||
}
|
||||
}
|
||||
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) {
|
||||
break label24;
|
||||
}
|
||||
} 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)
|
||||
{
|
||||
break label24;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (block != Blocks.glowstone) {
|
||||
break label24;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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]];
|
||||
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)
|
||||
{
|
||||
this.height = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this.world.getBlock(i, k, l) != Blocks.glowstone) {
|
||||
this.height = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.height <= 21 && this.height >= 3)
|
||||
{
|
||||
return this.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.bottomLeft = null;
|
||||
this.width = 0;
|
||||
this.height = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (this.height <= 21 && this.height >= 3) {
|
||||
return this.height;
|
||||
} else {
|
||||
this.bottomLeft = null;
|
||||
this.width = 0;
|
||||
this.height = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isEmptyBlock(Block blockIn)
|
||||
{
|
||||
return blockIn.getMaterial() == Material.air || blockIn == Blocks.fire || blockIn == BlocksAether.aether_portal;
|
||||
}
|
||||
protected boolean isEmptyBlock(Block blockIn) {
|
||||
return blockIn.getMaterial() == Material.air || blockIn == Blocks.fire || blockIn == BlocksAether.aether_portal;
|
||||
}
|
||||
|
||||
public boolean isValid()
|
||||
{
|
||||
return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
||||
}
|
||||
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)
|
||||
{
|
||||
int j = this.bottomLeft.posX + Direction.offsetX[this.rightDir] * i;
|
||||
int k = this.bottomLeft.posZ + Direction.offsetZ[this.rightDir] * 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)
|
||||
{
|
||||
int i1 = this.bottomLeft.posY + l;
|
||||
this.world.setBlock(j, i1, k, BlocksAether.aether_portal, this.axis, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -32,115 +30,90 @@ public class BlockAetherPortal extends BlockPortal
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister registry)
|
||||
{
|
||||
this.blockIcon = registry.registerIcon(Aether.find("aether_portal"));
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
PlayerAether.get((EntityPlayer)entity).setInPortal();
|
||||
}
|
||||
else if ((entity instanceof EntityLivingBase) && entity.ridingEntity == null && entity.riddenByEntity == null)
|
||||
{
|
||||
((EntityHook)entity.getExtendedProperties("aether_legacy:entity_hook")).setInPortal();
|
||||
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) {
|
||||
((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)
|
||||
{
|
||||
aetherportal$size.placePortalBlocks();
|
||||
if (aetherportal$size.isValid() && aetherportal$size.portalBlockCount == 0) {
|
||||
aetherportal$size.placePortalBlocks();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
AetherPortalSize aetherportal$size1 = new AetherPortalSize(worldIn, x, y, z, 2);
|
||||
return true;
|
||||
} else {
|
||||
AetherPortalSize aetherportal$size1 = new AetherPortalSize(worldIn, x, y, z, 2);
|
||||
|
||||
if (aetherportal$size1.isValid() && aetherportal$size1.portalBlockCount == 0)
|
||||
{
|
||||
aetherportal$size1.placePortalBlocks();
|
||||
if (aetherportal$size1.isValid() && aetherportal$size1.portalBlockCount == 0) {
|
||||
aetherportal$size1.placePortalBlocks();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block blockIn)
|
||||
{
|
||||
int l = func_149999_b(worldIn.getBlockMetadata(x, y, z));
|
||||
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)
|
||||
{
|
||||
AetherPortalSize blockportal$size = new AetherPortalSize(worldIn, x, y, z, 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)
|
||||
{
|
||||
worldIn.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
else if (l == 2)
|
||||
{
|
||||
AetherPortalSize blockportal$size1 = new AetherPortalSize(worldIn, x, y, z, 2);
|
||||
if (!blockportal$size.isValid() || blockportal$size.portalBlockCount < blockportal$size.width * blockportal$size.height) {
|
||||
worldIn.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
} 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)
|
||||
{
|
||||
worldIn.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
double d0 = (double)((float)x + rand.nextFloat());
|
||||
double d1 = (double)((float)y + rand.nextFloat());
|
||||
double d2 = (double)((float)z + rand.nextFloat());
|
||||
double d3 = ((double)rand.nextFloat() - 0.5D) * 0.5D;
|
||||
double d4 = ((double)rand.nextFloat() - 0.5D) * 0.5D;
|
||||
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)
|
||||
{
|
||||
d0 = (double)x + 0.5D + 0.25D * (double)j;
|
||||
d3 = (double)(rand.nextFloat() * 2.0F * (float)j);
|
||||
}
|
||||
else
|
||||
{
|
||||
d2 = (double)z + 0.5D + 0.25D * (double)j;
|
||||
d5 = (double)(rand.nextFloat() * 2.0F * (float)j);
|
||||
}
|
||||
|
||||
ParticleAetherPortal particle = new ParticleAetherPortal(world, d0, d1, d2, d3, d4, d5);
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
||||
}
|
||||
if (!blockportal$size1.isValid() || blockportal$size1.portalBlockCount < blockportal$size1.width * blockportal$size1.height) {
|
||||
worldIn.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
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) {
|
||||
double d0 = (double) ((float) x + rand.nextFloat());
|
||||
double d1 = (double) ((float) y + rand.nextFloat());
|
||||
double d2 = (double) ((float) z + rand.nextFloat());
|
||||
double d3 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||
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) {
|
||||
d0 = (double) x + 0.5D + 0.25D * (double) j;
|
||||
d3 = (double) (rand.nextFloat() * 2.0F * (float) j);
|
||||
} else {
|
||||
d2 = (double) z + 0.5D + 0.25D * (double) j;
|
||||
d5 = (double) (rand.nextFloat() * 2.0F * (float) j);
|
||||
}
|
||||
|
||||
ParticleAetherPortal particle = new ParticleAetherPortal(world, d0, d1, d2, d3, d4, d5);
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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)
|
||||
{
|
||||
return this == BlocksAether.enchanted_gravitite;
|
||||
}
|
||||
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,22 +58,19 @@ 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;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -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,105 +75,87 @@ public class AetherClientEvents
|
|||
}
|
||||
}
|
||||
|
||||
private void sendPickupPacket(Minecraft mc)
|
||||
{
|
||||
if (mc.objectMouseOver != null)
|
||||
{
|
||||
if (!this.onPickEntity(mc.objectMouseOver, mc.thePlayer, mc.theWorld))
|
||||
{
|
||||
return;
|
||||
}
|
||||
private void sendPickupPacket(Minecraft mc) {
|
||||
if (mc.objectMouseOver != null) {
|
||||
if (!this.onPickEntity(mc.objectMouseOver, mc.thePlayer, mc.theWorld)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mc.thePlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
int index = mc.thePlayer.inventoryContainer.inventorySlots.size() - 9 + mc.thePlayer.inventory.currentItem;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
mc.playerController.sendSlotPacket(mc.thePlayer.inventory.getStackInSlot(mc.thePlayer.inventory.currentItem), index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean onPickEntity(MovingObjectPosition target, EntityPlayer player, World world)
|
||||
{
|
||||
ItemStack result = null;
|
||||
boolean isCreative = player.capabilities.isCreativeMode;
|
||||
private boolean onPickEntity(MovingObjectPosition target, EntityPlayer player, World world) {
|
||||
ItemStack result = null;
|
||||
boolean isCreative = player.capabilities.isCreativeMode;
|
||||
|
||||
if (!isCreative)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!isCreative) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target.entityHit != null)
|
||||
{
|
||||
int id = EntitiesAether.getEntityID(target.entityHit);
|
||||
if (target.entityHit != null) {
|
||||
int id = EntitiesAether.getEntityID(target.entityHit);
|
||||
|
||||
if (id >= 0 && ItemAetherSpawnEgg.entityEggs.containsKey(id))
|
||||
{
|
||||
result = new ItemStack(ItemsAether.aether_spawn_egg, 1, id);
|
||||
}
|
||||
}
|
||||
if (id >= 0 && ItemAetherSpawnEgg.entityEggs.containsKey(id)) {
|
||||
result = new ItemStack(ItemsAether.aether_spawn_egg, 1, id);
|
||||
}
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (result == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int x = 0; x < 9; x++)
|
||||
{
|
||||
ItemStack stack = player.inventory.getStackInSlot(x);
|
||||
for (int x = 0; x < 9; x++) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(x);
|
||||
|
||||
if (stack != null && stack.isItemEqual(result) && ItemStack.areItemStackTagsEqual(stack, result))
|
||||
{
|
||||
player.inventory.currentItem = x;
|
||||
if (stack != null && stack.isItemEqual(result) && ItemStack.areItemStackTagsEqual(stack, result)) {
|
||||
player.inventory.currentItem = x;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
int slot = player.inventory.getFirstEmptyStack();
|
||||
int slot = player.inventory.getFirstEmptyStack();
|
||||
|
||||
if (slot < 0 || slot >= 9)
|
||||
{
|
||||
slot = player.inventory.currentItem;
|
||||
}
|
||||
if (slot < 0 || slot >= 9) {
|
||||
slot = player.inventory.currentItem;
|
||||
}
|
||||
|
||||
player.inventory.setInventorySlotContents(slot, result);
|
||||
player.inventory.currentItem = slot;
|
||||
player.inventory.setInventorySlotContents(slot, result);
|
||||
player.inventory.currentItem = slot;
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
int i = player.getItemInUseDuration();
|
||||
float f1 = (float)i / 20.0F;
|
||||
if (item == ItemsAether.phoenix_bow) {
|
||||
int i = player.getItemInUseDuration();
|
||||
float f1 = (float) i / 20.0F;
|
||||
|
||||
if (f1 > 1.0F)
|
||||
{
|
||||
f1 = 1.0F;
|
||||
}
|
||||
else
|
||||
{
|
||||
f1 = f1 * f1;
|
||||
}
|
||||
if (f1 > 1.0F) {
|
||||
f1 = 1.0F;
|
||||
} else {
|
||||
f1 = f1 * f1;
|
||||
}
|
||||
|
||||
float original = event.fov;
|
||||
float original = event.fov;
|
||||
|
||||
original *= 1.0F - f1 * 0.15F;
|
||||
original *= 1.0F - f1 * 0.15F;
|
||||
|
||||
event.newfov = original;
|
||||
event.newfov = original;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
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))
|
||||
{
|
||||
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer)guiScreen, "guiLeft", "field_147003_i");
|
||||
int guiTop = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer)guiScreen, "guiTop", "field_147009_r");
|
||||
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)
|
||||
{
|
||||
event.result = PlayerAetherRenderer.instance().renderAetherArmor(PlayerAether.get(event.entityPlayer), event.renderer, event.stack, 3- event.slot);
|
||||
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,19 +10,17 @@ 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;
|
||||
|
||||
private GameSettings gameSettings;
|
||||
private GameSettings gameSettings;
|
||||
|
||||
private boolean currentSneak;
|
||||
private boolean currentSneak;
|
||||
|
||||
private boolean previousSneak;
|
||||
|
||||
public AetherMovementInput(Minecraft mc, GameSettings gameSettings)
|
||||
{
|
||||
private boolean previousSneak;
|
||||
|
||||
public AetherMovementInput(Minecraft mc, GameSettings gameSettings) {
|
||||
super(gameSettings);
|
||||
|
||||
this.mc = mc;
|
||||
|
@ -30,44 +28,36 @@ public class AetherMovementInput extends MovementInputFromOptions
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updatePlayerMoveState()
|
||||
{
|
||||
public void updatePlayerMoveState() {
|
||||
super.updatePlayerMoveState();
|
||||
|
||||
this.jump = this.gameSettings.keyBindJump.getIsKeyPressed();
|
||||
this.jump = this.gameSettings.keyBindJump.getIsKeyPressed();
|
||||
|
||||
boolean isSneaking = this.gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
boolean isSneaking = this.gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
|
||||
this.sneak = isSneaking;
|
||||
this.sneak = isSneaking;
|
||||
|
||||
if (this.mc.thePlayer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this.mc.thePlayer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.mc.thePlayer.ridingEntity instanceof EntitySaddleMount)
|
||||
{
|
||||
if (this.mc.thePlayer.ridingEntity instanceof EntitySaddleMount)
|
||||
{
|
||||
this.sneak = false;
|
||||
this.currentSneak = isSneaking;
|
||||
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)
|
||||
{
|
||||
AetherNetwork.sendToServer(new PacketSendSneaking(this.mc.thePlayer.getEntityId(), this.currentSneak));
|
||||
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())
|
||||
{
|
||||
this.sneak = isSneaking;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this.mc.thePlayer.ridingEntity instanceof EntitySwet && !((EntitySwet)this.mc.thePlayer.ridingEntity).isFriendly())
|
||||
{
|
||||
this.sneak = false;
|
||||
}
|
||||
}
|
||||
if (((EntityMountable) this.mc.thePlayer.ridingEntity).isOnGround()) {
|
||||
this.sneak = isSneaking;
|
||||
}
|
||||
}
|
||||
} 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,123 +17,101 @@ 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;
|
||||
private final Random rand = new Random();
|
||||
private final Minecraft mc;
|
||||
private ISound currentMusic;
|
||||
private int timeUntilNextMusic = 100;
|
||||
|
||||
public AetherMusicTicker(Minecraft mcIn)
|
||||
{
|
||||
this.mc = mcIn;
|
||||
}
|
||||
public AetherMusicTicker(Minecraft mcIn) {
|
||||
this.mc = mcIn;
|
||||
}
|
||||
|
||||
public void update()
|
||||
{
|
||||
TrackType tracktype = this.getRandomTrack();
|
||||
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)
|
||||
{
|
||||
this.stopMusic();
|
||||
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;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
this.currentMusic = null;
|
||||
this.timeUntilNextMusic = Math.min(MathHelper.getRandomIntegerInRange(this.rand, tracktype.getMinDelay(), tracktype.getMaxDelay()), this.timeUntilNextMusic);
|
||||
}
|
||||
}
|
||||
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)) {
|
||||
this.currentMusic = null;
|
||||
this.timeUntilNextMusic = Math.min(MathHelper.getRandomIntegerInRange(this.rand, tracktype.getMinDelay(), tracktype.getMaxDelay()), this.timeUntilNextMusic);
|
||||
}
|
||||
}
|
||||
|
||||
this.timeUntilNextMusic = Math.min(this.timeUntilNextMusic, tracktype.getMaxDelay());
|
||||
this.timeUntilNextMusic = Math.min(this.timeUntilNextMusic, tracktype.getMaxDelay());
|
||||
|
||||
if (this.currentMusic == null && this.timeUntilNextMusic-- <= 0)
|
||||
{
|
||||
this.playMusic(tracktype);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.currentMusic == null && this.timeUntilNextMusic-- <= 0) {
|
||||
this.playMusic(tracktype);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean playingMusic()
|
||||
{
|
||||
return this.currentMusic != null;
|
||||
}
|
||||
public boolean playingMusic() {
|
||||
return this.currentMusic != null;
|
||||
}
|
||||
|
||||
public AetherMusicTicker.TrackType getRandomTrack()
|
||||
{
|
||||
int num = this.rand.nextInt(4);
|
||||
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;
|
||||
}
|
||||
return num == 0 ? TrackType.TRACK_ONE : num == 1 ? TrackType.TRACK_TWO : num == 2 ? TrackType.TRACK_THREE : TrackType.TRACK_FOUR;
|
||||
}
|
||||
|
||||
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 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)
|
||||
{
|
||||
this.mc.getSoundHandler().stopSound(this.currentMusic);
|
||||
this.currentMusic = null;
|
||||
this.timeUntilNextMusic = 0;
|
||||
}
|
||||
}
|
||||
public void stopMusic() {
|
||||
if (this.currentMusic != null) {
|
||||
this.mc.getSoundHandler().stopSound(this.currentMusic);
|
||||
this.currentMusic = null;
|
||||
this.timeUntilNextMusic = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
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),
|
||||
TRACK_FOUR(Aether.locate("music.aether4"), 1200, 1500);
|
||||
@SideOnly(Side.CLIENT)
|
||||
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),
|
||||
TRACK_FOUR(Aether.locate("music.aether4"), 1200, 1500);
|
||||
|
||||
private final ResourceLocation musicLocation;
|
||||
private final int minDelay;
|
||||
private final int maxDelay;
|
||||
private final ResourceLocation musicLocation;
|
||||
private final int minDelay;
|
||||
private final int maxDelay;
|
||||
|
||||
private TrackType(ResourceLocation musicLocationIn, int minDelayIn, int maxDelayIn)
|
||||
{
|
||||
this.musicLocation = musicLocationIn;
|
||||
this.minDelay = minDelayIn;
|
||||
this.maxDelay = maxDelayIn;
|
||||
}
|
||||
private TrackType(ResourceLocation musicLocationIn, int minDelayIn, int maxDelayIn) {
|
||||
this.musicLocation = musicLocationIn;
|
||||
this.minDelay = minDelayIn;
|
||||
this.maxDelay = maxDelayIn;
|
||||
}
|
||||
|
||||
public ResourceLocation getMusicLocation()
|
||||
{
|
||||
return this.musicLocation;
|
||||
}
|
||||
public ResourceLocation getMusicLocation() {
|
||||
return this.musicLocation;
|
||||
}
|
||||
|
||||
public int getMinDelay()
|
||||
{
|
||||
return this.minDelay;
|
||||
}
|
||||
public int getMinDelay() {
|
||||
return this.minDelay;
|
||||
}
|
||||
|
||||
public int getMaxDelay()
|
||||
{
|
||||
return this.maxDelay;
|
||||
}
|
||||
}
|
||||
public int getMaxDelay() {
|
||||
return this.maxDelay;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -14,143 +14,127 @@ 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 = "";
|
||||
private String message = "";
|
||||
|
||||
private Minecraft mc;
|
||||
private Minecraft mc;
|
||||
|
||||
private String currentlyDisplayedText = "";
|
||||
private String currentlyDisplayedText = "";
|
||||
|
||||
private String currentDisplayedTrivia = "";
|
||||
private String currentDisplayedTrivia = "";
|
||||
|
||||
private long systemTime = Minecraft.getSystemTime();
|
||||
private long systemTime = Minecraft.getSystemTime();
|
||||
|
||||
private Framebuffer framebuffer;
|
||||
private Framebuffer framebuffer;
|
||||
|
||||
public AetherLoadingScreen(Minecraft mcIn)
|
||||
{
|
||||
public AetherLoadingScreen(Minecraft mcIn) {
|
||||
super(mcIn);
|
||||
|
||||
this.mc = mcIn;
|
||||
this.mc = mcIn;
|
||||
|
||||
this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false);
|
||||
this.framebuffer.setFramebufferFilter(9728);
|
||||
this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false);
|
||||
this.framebuffer.setFramebufferFilter(9728);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetProgressAndMessage(String message)
|
||||
{
|
||||
super.resetProgressAndMessage(message);
|
||||
@Override
|
||||
public void resetProgressAndMessage(String message) {
|
||||
super.resetProgressAndMessage(message);
|
||||
|
||||
this.currentDisplayedTrivia = AetherTrivia.getNewTrivia();
|
||||
}
|
||||
this.currentDisplayedTrivia = AetherTrivia.getNewTrivia();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayProgressMessage(String message)
|
||||
{
|
||||
this.systemTime = 0L;
|
||||
this.message = message;
|
||||
this.setLoadingProgress(-1);
|
||||
this.systemTime = 0L;
|
||||
}
|
||||
@Override
|
||||
public void displayProgressMessage(String message) {
|
||||
this.systemTime = 0L;
|
||||
this.message = message;
|
||||
this.setLoadingProgress(-1);
|
||||
this.systemTime = 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLoadingProgress(int progress)
|
||||
{
|
||||
long j = Minecraft.getSystemTime();
|
||||
@Override
|
||||
public void setLoadingProgress(int progress) {
|
||||
long j = Minecraft.getSystemTime();
|
||||
|
||||
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 (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())
|
||||
{
|
||||
this.framebuffer.framebufferClear();
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
if (OpenGlHelper.isFramebufferEnabled()) {
|
||||
this.framebuffer.framebufferClear();
|
||||
} else {
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
this.framebuffer.bindFramebuffer(false);
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glOrtho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glTranslatef(0.0F, 0.0F, -200.0F);
|
||||
this.framebuffer.bindFramebuffer(false);
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glOrtho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glTranslatef(0.0F, 0.0F, -200.0F);
|
||||
|
||||
if (!OpenGlHelper.isFramebufferEnabled())
|
||||
{
|
||||
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
if (!OpenGlHelper.isFramebufferEnabled()) {
|
||||
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
if (!FMLClientHandler.instance().handleLoadingScreen(scaledresolution))
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
|
||||
float f = 32.0F;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorOpaque_I(4210752);
|
||||
tessellator.addVertexWithUV(0.0D, (double)i1, 0.0D, 0.0D, (double)((float)i1 / f));
|
||||
tessellator.addVertexWithUV((double)l, (double)i1, 0.0D, (double)((float)l / f), (double)((float)i1 / f));
|
||||
tessellator.addVertexWithUV((double)l, 0.0D, 0.0D, (double)((float)l / f), 0.0D);
|
||||
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
if (!FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
|
||||
float f = 32.0F;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorOpaque_I(4210752);
|
||||
tessellator.addVertexWithUV(0.0D, (double) i1, 0.0D, 0.0D, (double) ((float) i1 / f));
|
||||
tessellator.addVertexWithUV((double) l, (double) i1, 0.0D, (double) ((float) l / f), (double) ((float) i1 / f));
|
||||
tessellator.addVertexWithUV((double) l, 0.0D, 0.0D, (double) ((float) l / f), 0.0D);
|
||||
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
|
||||
if (progress >= 0)
|
||||
{
|
||||
byte b0 = 100;
|
||||
byte b1 = 2;
|
||||
int j1 = l / 2 - b0 / 2;
|
||||
int k1 = i1 / 2 + 16;
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorOpaque_I(8421504);
|
||||
tessellator.addVertex((double)j1, (double)k1, 0.0D);
|
||||
tessellator.addVertex((double)j1, (double)(k1 + b1), 0.0D);
|
||||
tessellator.addVertex((double)(j1 + b0), (double)(k1 + b1), 0.0D);
|
||||
tessellator.addVertex((double)(j1 + b0), (double)k1, 0.0D);
|
||||
tessellator.setColorOpaque_I(8454016);
|
||||
tessellator.addVertex((double)j1, (double)k1, 0.0D);
|
||||
tessellator.addVertex((double)j1, (double)(k1 + b1), 0.0D);
|
||||
tessellator.addVertex((double)(j1 + progress), (double)(k1 + b1), 0.0D);
|
||||
tessellator.addVertex((double)(j1 + progress), (double)k1, 0.0D);
|
||||
tessellator.draw();
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
if (progress >= 0) {
|
||||
byte b0 = 100;
|
||||
byte b1 = 2;
|
||||
int j1 = l / 2 - b0 / 2;
|
||||
int k1 = i1 / 2 + 16;
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorOpaque_I(8421504);
|
||||
tessellator.addVertex((double) j1, (double) k1, 0.0D);
|
||||
tessellator.addVertex((double) j1, (double) (k1 + b1), 0.0D);
|
||||
tessellator.addVertex((double) (j1 + b0), (double) (k1 + b1), 0.0D);
|
||||
tessellator.addVertex((double) (j1 + b0), (double) k1, 0.0D);
|
||||
tessellator.setColorOpaque_I(8454016);
|
||||
tessellator.addVertex((double) j1, (double) k1, 0.0D);
|
||||
tessellator.addVertex((double) j1, (double) (k1 + b1), 0.0D);
|
||||
tessellator.addVertex((double) (j1 + progress), (double) (k1 + b1), 0.0D);
|
||||
tessellator.addVertex((double) (j1 + progress), (double) k1, 0.0D);
|
||||
tessellator.draw();
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
this.mc.fontRenderer.drawStringWithShadow(this.currentlyDisplayedText, (l - this.mc.fontRenderer.getStringWidth(this.currentlyDisplayedText)) / 2, i1 / 2 - 4 - 16, 16777215);
|
||||
this.mc.fontRenderer.drawStringWithShadow(this.message, (l - this.mc.fontRenderer.getStringWidth(this.message)) / 2, i1 / 2 - 4 + 8, 16777215);
|
||||
this.mc.fontRenderer.drawStringWithShadow(this.currentDisplayedTrivia, (k - this.mc.fontRenderer.getStringWidth(this.currentDisplayedTrivia)) / 2, l - 16, 0xffff99);
|
||||
}
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
this.mc.fontRenderer.drawStringWithShadow(this.currentlyDisplayedText, (l - this.mc.fontRenderer.getStringWidth(this.currentlyDisplayedText)) / 2, i1 / 2 - 4 - 16, 16777215);
|
||||
this.mc.fontRenderer.drawStringWithShadow(this.message, (l - this.mc.fontRenderer.getStringWidth(this.message)) / 2, i1 / 2 - 4 + 8, 16777215);
|
||||
this.mc.fontRenderer.drawStringWithShadow(this.currentDisplayedTrivia, (k - this.mc.fontRenderer.getStringWidth(this.currentDisplayedTrivia)) / 2, l - 16, 0xffff99);
|
||||
}
|
||||
|
||||
this.framebuffer.unbindFramebuffer();
|
||||
this.framebuffer.unbindFramebuffer();
|
||||
|
||||
if (OpenGlHelper.isFramebufferEnabled())
|
||||
{
|
||||
this.framebuffer.framebufferRender(l * k, i1 * k);
|
||||
}
|
||||
if (OpenGlHelper.isFramebufferEnabled()) {
|
||||
this.framebuffer.framebufferRender(l * k, i1 * k);
|
||||
}
|
||||
|
||||
this.mc.func_147120_f();
|
||||
this.mc.func_147120_f();
|
||||
|
||||
try
|
||||
{
|
||||
Thread.yield();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.yield();
|
||||
} 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);
|
||||
|
@ -58,12 +50,11 @@ public class GuiAetherInGame extends Gui
|
|||
AetherOverlay.renderBossHP(this.mc);
|
||||
}
|
||||
|
||||
float portalTime = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * event.partialTicks;//player.portalAnimTime * 1.2F + (player.prevPortalAnimTime - player.portalAnimTime);
|
||||
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)
|
||||
{
|
||||
AetherOverlay.renderAetherPortal(portalTime, new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight));
|
||||
}
|
||||
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,12 +16,11 @@ 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");
|
||||
private static final ResourceLocation TEXTURE_LORE = Aether.locate("textures/gui/lore.png");
|
||||
|
||||
private static final ResourceLocation TEXTURE_LORE_BOOK = Aether.locate("textures/gui/lore_book.png");
|
||||
private static final ResourceLocation TEXTURE_LORE_BOOK = Aether.locate("textures/gui/lore_book.png");
|
||||
|
||||
private String stringToLoad;
|
||||
|
||||
|
@ -31,78 +30,67 @@ public class GuiLore extends GuiContainer
|
|||
|
||||
private int pageNumber;
|
||||
|
||||
public GuiLore(InventoryPlayer inventoryplayer)
|
||||
{
|
||||
super(new ContainerLore(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()
|
||||
{
|
||||
super.initGui();
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
this.previousPage = new GuiLoreButton(19, this.width / 2 - 110, this.height / 2 + 72, 20, 20, "<");
|
||||
this.nextPage = new GuiLoreButton(20, this.width / 2 + 90, this.height / 2 + 72, 20, 20, ">");
|
||||
this.previousPage = new GuiLoreButton(19, this.width / 2 - 110, this.height / 2 + 72, 20, 20, "<");
|
||||
this.nextPage = new GuiLoreButton(20, this.width / 2 + 90, this.height / 2 + 72, 20, 20, ">");
|
||||
|
||||
this.buttonList.add(this.previousPage);
|
||||
this.buttonList.add(this.nextPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button)
|
||||
{
|
||||
if (this.previousPage == button)
|
||||
{
|
||||
--this.pageNumber;
|
||||
}
|
||||
else if (this.nextPage == button)
|
||||
{
|
||||
++this.pageNumber;
|
||||
}
|
||||
}
|
||||
this.buttonList.add(this.previousPage);
|
||||
this.buttonList.add(this.nextPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
this.fontRendererObj.drawString("Prev.", 16, 160, 4210752);
|
||||
this.fontRendererObj.drawString("Next", 218, 160, 4210752);
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
if (this.previousPage == button) {
|
||||
--this.pageNumber;
|
||||
} else if (this.nextPage == button) {
|
||||
++this.pageNumber;
|
||||
}
|
||||
}
|
||||
|
||||
this.fontRendererObj.drawString("Book", 32, -5, 4210752);
|
||||
this.fontRendererObj.drawString("of Lore:", 24, 4, 4210752);
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
this.fontRendererObj.drawString("Prev.", 16, 160, 4210752);
|
||||
this.fontRendererObj.drawString("Next", 218, 160, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString("Item :", 75, 0, 4210752);
|
||||
this.fontRendererObj.drawString("Book", 32, -5, 4210752);
|
||||
this.fontRendererObj.drawString("of Lore:", 24, 4, 4210752);
|
||||
|
||||
ItemStack searchedStack = ((ContainerLore)this.inventorySlots).loreSlot.getStackInSlot(0);
|
||||
this.fontRendererObj.drawString("Item :", 75, 0, 4210752);
|
||||
|
||||
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;
|
||||
}
|
||||
ItemStack searchedStack = ((ContainerLore) this.inventorySlots).loreSlot.getStackInSlot(0);
|
||||
|
||||
int nameSize = 0;
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
int nameSize = 0;
|
||||
|
||||
++nameSize;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
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,29 +99,26 @@ public class GuiLore extends GuiContainer
|
|||
|
||||
this.previousPage.enabled = this.pageNumber != 0;
|
||||
this.nextPage.enabled = size > (15 * (this.pageNumber + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pageNumber = 0;
|
||||
this.stringToLoad = "";
|
||||
this.currentItem = null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.pageNumber = 0;
|
||||
this.stringToLoad = "";
|
||||
this.currentItem = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i1, int i2)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@Override
|
||||
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;
|
||||
int k = (this.height - this.ySize) / 2;
|
||||
int j = (this.width - this.xSize) / 2;
|
||||
int k = (this.height - this.ySize) / 2;
|
||||
|
||||
this.mc.renderEngine.bindTexture(TEXTURE_LORE);
|
||||
Gui.func_152125_a(j, k - 4, 0, 0, 120, 120, this.xSize, this.ySize + 61, 120, 120);
|
||||
this.mc.renderEngine.bindTexture(TEXTURE_LORE);
|
||||
Gui.func_152125_a(j, k - 4, 0, 0, 120, 120, this.xSize, this.ySize + 61, 120, 120);
|
||||
|
||||
this.mc.renderEngine.bindTexture(TEXTURE_LORE_BOOK);
|
||||
Gui.func_146110_a(j - 1, k - 20, 0, 0, this.xSize + 20, this.ySize - 60, 275, 315);
|
||||
Gui.func_146110_a(j + 90, k - 5, 0, 225, this.xSize + 20, this.ySize - 177, 500, 500);
|
||||
}
|
||||
this.mc.renderEngine.bindTexture(TEXTURE_LORE_BOOK);
|
||||
Gui.func_146110_a(j - 1, k - 20, 0, 0, this.xSize + 20, this.ySize - 60, 275, 315);
|
||||
Gui.func_146110_a(j + 90, k - 5, 0, 225, this.xSize + 20, this.ySize - 177, 500, 500);
|
||||
}
|
||||
|
||||
}
|
|
@ -9,50 +9,45 @@ 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;
|
||||
|
||||
this.buttonList.add(new GuiSunAltarSlider(this.world, this.width / 2 - 75, this.height/2, "Select Time"));
|
||||
this.buttonList.add(new GuiSunAltarSlider(this.world, this.width / 2 - 75, this.height / 2, "Select Time"));
|
||||
}
|
||||
|
||||
@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);
|
||||
this.mc.renderEngine.bindTexture(TEXTURE);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
int xSize = 175;
|
||||
int ySize = 78;
|
||||
int j = (this.width - xSize) / 2;
|
||||
int k = (this.height - ySize) / 2;
|
||||
int xSize = 175;
|
||||
int ySize = 78;
|
||||
int j = (this.width - xSize) / 2;
|
||||
int k = (this.height - ySize) / 2;
|
||||
|
||||
this.drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
|
||||
this.fontRendererObj.drawString("Sun Altar", (this.width - this.fontRendererObj.getStringWidth("Sun Altar")) / 2, k + 20, 0x404040);
|
||||
this.drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
|
||||
this.fontRendererObj.drawString("Sun Altar", (this.width - this.fontRendererObj.getStringWidth("Sun Altar")) / 2, k + 20, 0x404040);
|
||||
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
public boolean doesGuiPauseGame() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,60 +13,49 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiTreasureChest extends GuiContainer
|
||||
{
|
||||
private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("textures/gui/container/generic_54.png");
|
||||
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 final int inventoryRows;
|
||||
|
||||
private String chestType;
|
||||
private String chestType;
|
||||
|
||||
public GuiTreasureChest(InventoryPlayer playerInventory, TileEntityTreasureChest chestInventory)
|
||||
{
|
||||
super(new ContainerChest(playerInventory, chestInventory));
|
||||
public GuiTreasureChest(InventoryPlayer playerInventory, TileEntityTreasureChest chestInventory) {
|
||||
super(new ContainerChest(playerInventory, chestInventory));
|
||||
|
||||
this.allowUserInput = false;
|
||||
this.allowUserInput = false;
|
||||
|
||||
this.inventoryRows = chestInventory.getSizeInventory() / 9;
|
||||
this.inventoryRows = chestInventory.getSizeInventory() / 9;
|
||||
|
||||
this.ySize = 114 + this.inventoryRows * 18;
|
||||
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
|
||||
{
|
||||
this.chestType = "Platinum Treasure Chest";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.chestType = "Platinum Treasure Chest";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw the foreground layer for the GuiContainer (everything in front of the items)
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
this.fontRendererObj.drawString(this.chestType, 8, 6, 4210752);
|
||||
}
|
||||
/**
|
||||
* Draw the foreground layer for the GuiContainer (everything in front of the items)
|
||||
*/
|
||||
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)
|
||||
{
|
||||
/**
|
||||
* Draws the background layer of this container (behind the items).
|
||||
*/
|
||||
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;
|
||||
int j = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
|
||||
this.drawTexturedModalRect(i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96);
|
||||
}
|
||||
this.mc.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
|
||||
int i = (this.width - this.xSize) / 2;
|
||||
int j = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
|
||||
this.drawTexturedModalRect(i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96);
|
||||
}
|
||||
}
|
|
@ -8,43 +8,38 @@ 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_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");
|
||||
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;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
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;
|
||||
@Override
|
||||
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)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glPushMatrix();
|
||||
int i = this.getHoverState(this.field_146123_n);
|
||||
mc.getTextureManager().bindTexture(i == 2 ? BUTTON_HOVERED_TEXTURE : BUTTON_TEXTURE);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
if (this.visible) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glPushMatrix();
|
||||
int i = this.getHoverState(this.field_146123_n);
|
||||
mc.getTextureManager().bindTexture(i == 2 ? BUTTON_HOVERED_TEXTURE : BUTTON_TEXTURE);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
|
||||
func_146110_a(this.xPosition - 1, this.yPosition, 0, 0, 14, 14, 14, 14);
|
||||
func_146110_a(this.xPosition - 1, this.yPosition, 0, 0, 14, 14, 14, 14);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -13,10 +13,9 @@ 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");
|
||||
protected static final ResourceLocation buttonTextures = Aether.locate("textures/gui/buttons.png");
|
||||
|
||||
public int scrollMax = 100;
|
||||
|
||||
|
@ -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,12 +2,10 @@ 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)
|
||||
{
|
||||
super(24, xPos, yPos, 20, 20, "?");
|
||||
}
|
||||
public GuiButtonPerks(int xPos, int yPos) {
|
||||
super(24, xPos, yPos, 20, 20, "?");
|
||||
}
|
||||
|
||||
}
|
|
@ -4,38 +4,29 @@ 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)
|
||||
{
|
||||
super.drawButton(mc, mouseX, mouseY);
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
|
||||
super.drawButton(mc, mouseX, mouseY);
|
||||
|
||||
FontRenderer fontrenderer = mc.fontRenderer;
|
||||
FontRenderer fontrenderer = mc.fontRenderer;
|
||||
|
||||
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")
|
||||
{
|
||||
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + (this.width - 50) / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + this.width / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
|
||||
}
|
||||
}
|
||||
}
|
||||
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") {
|
||||
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + (this.width - 50) / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
|
||||
} else {
|
||||
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + this.width / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -10,50 +10,40 @@ 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");
|
||||
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)
|
||||
{
|
||||
FontRenderer fontrenderer = mc.fontRenderer;
|
||||
mc.getTextureManager().bindTexture(BUTTON_TEXTURES);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
int i = this.getHoverState(this.field_146123_n);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height);
|
||||
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
|
||||
this.mouseDragged(mc, mouseX, mouseY);
|
||||
int j = 14737632;
|
||||
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);
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
int i = this.getHoverState(this.field_146123_n);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height);
|
||||
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
|
||||
this.mouseDragged(mc, mouseX, mouseY);
|
||||
int j = 14737632;
|
||||
|
||||
if (this.packedFGColour != 0)
|
||||
{
|
||||
j = this.packedFGColour;
|
||||
}
|
||||
else
|
||||
if (!this.enabled)
|
||||
{
|
||||
j = 10526880;
|
||||
}
|
||||
else if (this.field_146123_n)
|
||||
{
|
||||
j = 16777120;
|
||||
}
|
||||
if (this.packedFGColour != 0) {
|
||||
j = this.packedFGColour;
|
||||
} else if (!this.enabled) {
|
||||
j = 10526880;
|
||||
} else if (this.field_146123_n) {
|
||||
j = 16777120;
|
||||
}
|
||||
|
||||
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, j);
|
||||
}
|
||||
}
|
||||
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, j);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -9,104 +9,88 @@ 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;
|
||||
public float sliderValue;
|
||||
|
||||
public boolean dragging = false;
|
||||
public boolean dragging = false;
|
||||
|
||||
private World world;
|
||||
private World world;
|
||||
|
||||
public GuiSunAltarSlider(World world, int par2, int par3, String par5Str)
|
||||
{
|
||||
super(1, par2, par3, 150, 20, par5Str);
|
||||
public GuiSunAltarSlider(World world, int par2, int par3, String par5Str) {
|
||||
super(1, par2, par3, 150, 20, par5Str);
|
||||
|
||||
this.world = world;
|
||||
}
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* 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) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
@Override
|
||||
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);
|
||||
long worldTime = world.getWorldInfo().getWorldTime();
|
||||
long remainder = worldTime % 24000L;
|
||||
long add = shouldTime > remainder ? shouldTime - remainder : shouldTime + 24000 - remainder;
|
||||
long shouldTime = (long) (24000L * sliderValue);
|
||||
long worldTime = world.getWorldInfo().getWorldTime();
|
||||
long remainder = worldTime % 24000L;
|
||||
long add = shouldTime > remainder ? shouldTime - remainder : shouldTime + 24000 - remainder;
|
||||
|
||||
world.getWorldInfo().setWorldTime(worldTime + add);
|
||||
if (this.sliderValue < 0.0F)
|
||||
{
|
||||
this.sliderValue = 0.0F;
|
||||
}
|
||||
world.getWorldInfo().setWorldTime(worldTime + add);
|
||||
if (this.sliderValue < 0.0F) {
|
||||
this.sliderValue = 0.0F;
|
||||
}
|
||||
|
||||
if (this.sliderValue > 1.0F)
|
||||
{
|
||||
this.sliderValue = 1.0F;
|
||||
}
|
||||
if (this.sliderValue > 1.0F) {
|
||||
this.sliderValue = 1.0F;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20);
|
||||
this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20);
|
||||
}
|
||||
}
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.drawTexturedModalRect(this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)), this.yPosition, 0, 66, 4, 20);
|
||||
this.drawTexturedModalRect(this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int mouseX, int mouseY)
|
||||
{
|
||||
this.sliderValue = (this.world.getWorldInfo().getWorldTime() % 24000) / 24000.0F;
|
||||
@Override
|
||||
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))
|
||||
{
|
||||
this.sliderValue = (float)(par2 - (this.xPosition + 4)) / (float)(this.width - 8);
|
||||
@Override
|
||||
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)
|
||||
{
|
||||
this.sliderValue = 0.0F;
|
||||
}
|
||||
if (this.sliderValue < 0.0F) {
|
||||
this.sliderValue = 0.0F;
|
||||
}
|
||||
|
||||
if (this.sliderValue > 1.0F)
|
||||
{
|
||||
this.sliderValue = 1.0F;
|
||||
}
|
||||
if (this.sliderValue > 1.0F) {
|
||||
this.sliderValue = 1.0F;
|
||||
}
|
||||
|
||||
this.dragging = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this.dragging = true;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(int mouseX, int mouseY)
|
||||
{
|
||||
this.dragging = false;
|
||||
@Override
|
||||
public void mouseReleased(int mouseX, int mouseY) {
|
||||
this.dragging = false;
|
||||
|
||||
AetherNetwork.sendToServer(new PacketSetTime(this.sliderValue, Minecraft.getMinecraft().thePlayer.dimension));
|
||||
}
|
||||
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)
|
||||
{
|
||||
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 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)
|
||||
{
|
||||
soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
}
|
||||
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,139 +8,114 @@ 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)
|
||||
{
|
||||
this.dialogue = dialogue;
|
||||
public void addDialogueWithOptions(String dialogue, DialogueOption... options) {
|
||||
this.dialogue = dialogue;
|
||||
|
||||
this.dialogueOptions.clear();
|
||||
this.dialogueOptions.clear();
|
||||
|
||||
this.addDialogueOptions(options);
|
||||
this.positionDialogueOptions(this.getDialogueOptions());
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
{
|
||||
this.positionDialogueOptions(this.getDialogueOptions());
|
||||
}
|
||||
|
||||
private void positionDialogueOptions(ArrayList<DialogueOption> options)
|
||||
{
|
||||
int lineNumber = 0;
|
||||
|
||||
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);
|
||||
|
||||
lineNumber++;
|
||||
}
|
||||
}
|
||||
|
||||
public void addDialogueOptions(DialogueOption... options)
|
||||
{
|
||||
for (DialogueOption option : options)
|
||||
{
|
||||
this.dialogueOptions.add(option);
|
||||
}
|
||||
this.addDialogueOptions(options);
|
||||
this.positionDialogueOptions(this.getDialogueOptions());
|
||||
}
|
||||
|
||||
public void addDialogueMessage(String dialogueMessage)
|
||||
{
|
||||
public void initGui() {
|
||||
this.positionDialogueOptions(this.getDialogueOptions());
|
||||
}
|
||||
|
||||
private void positionDialogueOptions(ArrayList<DialogueOption> options) {
|
||||
int lineNumber = 0;
|
||||
|
||||
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);
|
||||
|
||||
lineNumber++;
|
||||
}
|
||||
}
|
||||
|
||||
public void addDialogueOptions(DialogueOption... options) {
|
||||
for (DialogueOption option : options) {
|
||||
this.dialogueOptions.add(option);
|
||||
}
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean doesGuiPauseGame() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
|
||||
int optionWidth = 0;
|
||||
int optionWidth = 0;
|
||||
|
||||
for (String theDialogue : ((List<String>) this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300)))
|
||||
{
|
||||
int stringWidth = this.fontRendererObj.getStringWidth(theDialogue);
|
||||
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);
|
||||
this.drawString(this.fontRendererObj, theDialogue, this.width / 2 - stringWidth / 2, this.height / 2 + optionWidth * 10, 0xffffff);
|
||||
++optionWidth;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
dialogue.playPressSound(this.mc.getSoundHandler());
|
||||
|
||||
try
|
||||
{
|
||||
this.dialogueClicked(dialogue);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
this.drawString(this.fontRendererObj, theDialogue, this.width / 2 - stringWidth / 2, this.height / 2 + optionWidth * 10, 0xffffff);
|
||||
++optionWidth;
|
||||
}
|
||||
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
}
|
||||
|
||||
public void dialogueClicked(DialogueOption dialogue) throws IOException
|
||||
{
|
||||
|
||||
for (DialogueOption dialogue : this.dialogueOptions) {
|
||||
dialogue.renderDialogue(mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<DialogueOption> getDialogueOptions()
|
||||
{
|
||||
@Override
|
||||
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 {
|
||||
this.dialogueClicked(dialogue);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
}
|
||||
|
||||
public void dialogueClicked(DialogueOption dialogue) throws IOException {
|
||||
|
||||
}
|
||||
|
||||
public ArrayList<DialogueOption> getDialogueOptions() {
|
||||
return this.dialogueOptions;
|
||||
}
|
||||
|
||||
public String getDialogue()
|
||||
{
|
||||
public String getDialogue() {
|
||||
return this.dialogue;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,100 +10,76 @@ 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;
|
||||
private EntityValkyrieQueen valkyrieQueen;
|
||||
|
||||
private String title;
|
||||
private String title;
|
||||
|
||||
private int medalSlotId = -1;
|
||||
private int medalSlotId = -1;
|
||||
|
||||
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")});
|
||||
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();
|
||||
this.valkyrieQueen = valkyrieQueen;
|
||||
}
|
||||
this.title = this.getDialogue();
|
||||
this.valkyrieQueen = valkyrieQueen;
|
||||
}
|
||||
|
||||
@Override
|
||||
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)
|
||||
{
|
||||
DialogueOption medalDialogue = new DialogueOption(this.getMedalDiaulogue());
|
||||
@Override
|
||||
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) {
|
||||
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)
|
||||
{
|
||||
this.addDialogueMessage(this.title + ": Goodbye adventurer.");
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
}
|
||||
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();
|
||||
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) {
|
||||
this.addDialogueMessage(this.title + ": Goodbye adventurer.");
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.medalSlotId != -1)
|
||||
{
|
||||
AetherNetwork.sendToServer(new PacketInitiateValkyrieFight(this.medalSlotId, this.valkyrieQueen.getEntityId()));
|
||||
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
|
||||
{
|
||||
this.addDialogueMessage(this.title + ": Take your time.");
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
}
|
||||
else if (dialogue.getDialogueId() == 1)
|
||||
{
|
||||
this.addDialogueMessage(this.title + ": So be it then. Goodbye adventurer.");
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
}
|
||||
}
|
||||
this.valkyrieQueen.setBossReady(true);
|
||||
this.addDialogueMessage(this.title + ": Now then, let's begin!");
|
||||
this.dialogueTreeCompleted();
|
||||
} else {
|
||||
this.addDialogueMessage(this.title + ": Take your time.");
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
} 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)
|
||||
{
|
||||
ItemStack stack = this.mc.thePlayer.inventory.mainInventory[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)
|
||||
{
|
||||
this.medalSlotId = slotId;
|
||||
return "I'm ready, I have the medals right here!";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "I'll return when I have them. (" + 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 {
|
||||
return "I'll return when I have them. (" + stack.stackSize + "/10)";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "I'll return when I have them. (0/10)";
|
||||
}
|
||||
return "I'll return when I have them. (0/10)";
|
||||
}
|
||||
|
||||
}
|
|
@ -8,32 +8,28 @@ 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;
|
||||
private String dialogueName;
|
||||
|
||||
public GuiServerDialogue(String dialogueName, String dialogue, ArrayList<String> dialogueText)
|
||||
{
|
||||
super(dialogue);
|
||||
public GuiServerDialogue(String dialogueName, String dialogue, ArrayList<String> dialogueText) {
|
||||
super(dialogue);
|
||||
|
||||
this.dialogueName = dialogueName;
|
||||
this.dialogueName = dialogueName;
|
||||
|
||||
ArrayList<DialogueOption> dialogueOptions = Lists.newArrayList();
|
||||
ArrayList<DialogueOption> dialogueOptions = Lists.newArrayList();
|
||||
|
||||
for (String dialogueForOption : dialogueText)
|
||||
{
|
||||
dialogueOptions.add(new DialogueOption(dialogueForOption));
|
||||
}
|
||||
for (String dialogueForOption : dialogueText) {
|
||||
dialogueOptions.add(new DialogueOption(dialogueForOption));
|
||||
}
|
||||
|
||||
this.addDialogueOptions(dialogueOptions.toArray(new DialogueOption[] {}));
|
||||
}
|
||||
this.addDialogueOptions(dialogueOptions.toArray(new DialogueOption[]{}));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dialogueClicked(DialogueOption dialogue)
|
||||
{
|
||||
AetherNetwork.sendToServer(new PacketDialogueClicked(this.dialogueName, dialogue.getDialogueId()));
|
||||
this.dialogueTreeCompleted();
|
||||
}
|
||||
@Override
|
||||
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,59 +44,51 @@ public class GuiAccessories extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setWorldAndResolution(Minecraft mc, int width, int height)
|
||||
{
|
||||
super.setWorldAndResolution(mc, width, 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)
|
||||
{
|
||||
this.mc.displayGuiScreen(new GuiAetherPerks());
|
||||
}
|
||||
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)
|
||||
{
|
||||
this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 115, 8, 4210752);
|
||||
}
|
||||
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);
|
||||
|
||||
this.drawTexturedModalRect(this.width / 2 - 88, this.height / 2 - 166 / 2, 0, 0, 176, 166);
|
||||
|
||||
GuiInventory.func_147046_a(this.guiLeft + 35, this.guiTop + 75, 30, (float)(this.guiLeft + 51) - (float)mouseX, (float)(this.guiTop + 75 - 50) - (float)mouseY, this.mc.thePlayer);
|
||||
GuiInventory.func_147046_a(this.guiLeft + 35, this.guiTop + 75, 30, (float) (this.guiLeft + 51) - (float) mouseX, (float) (this.guiTop + 75 - 50) - (float) mouseY, this.mc.thePlayer);
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
|
@ -34,170 +33,150 @@ public class GuiAetherPerks extends GuiScreen
|
|||
|
||||
private DonatorMoaSkin moaSkin = new DonatorMoaSkin();
|
||||
|
||||
protected int guiLeft;
|
||||
protected int guiLeft;
|
||||
|
||||
protected int guiTop;
|
||||
protected int guiTop;
|
||||
|
||||
public GuiAetherPerks()
|
||||
{
|
||||
public GuiAetherPerks() {
|
||||
super();
|
||||
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
this.player = PlayerAether.get(this.mc.thePlayer);
|
||||
this.moaSkin = this.player.donatorMoaSkin;
|
||||
this.player = PlayerAether.get(this.mc.thePlayer);
|
||||
this.moaSkin = this.player.donatorMoaSkin;
|
||||
|
||||
this.moa = this.player.getEntity().ridingEntity instanceof EntityMoa ? (EntityMoa) this.player.getEntity().ridingEntity : new EntityMoa(this.mc.theWorld, AetherMoaTypes.blue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen()
|
||||
{
|
||||
this.moaWingMarking.updateCursorCounter();
|
||||
this.moaWing.updateCursorCounter();
|
||||
this.moaBody.updateCursorCounter();
|
||||
this.moaBodyMarking.updateCursorCounter();
|
||||
this.moaEye.updateCursorCounter();
|
||||
this.moaOutside.updateCursorCounter();
|
||||
public void updateScreen() {
|
||||
this.moaWingMarking.updateCursorCounter();
|
||||
this.moaWing.updateCursorCounter();
|
||||
this.moaBody.updateCursorCounter();
|
||||
this.moaBodyMarking.updateCursorCounter();
|
||||
this.moaEye.updateCursorCounter();
|
||||
this.moaOutside.updateCursorCounter();
|
||||
|
||||
if (!this.moaWingMarking.getText().isEmpty())
|
||||
{
|
||||
this.moaSkin.setWingMarkingColor(Integer.decode("0x" + this.moaWingMarking.getText()));
|
||||
}
|
||||
if (!this.moaWingMarking.getText().isEmpty()) {
|
||||
this.moaSkin.setWingMarkingColor(Integer.decode("0x" + this.moaWingMarking.getText()));
|
||||
}
|
||||
|
||||
if (!this.moaWing.getText().isEmpty())
|
||||
{
|
||||
this.moaSkin.setWingColor(Integer.decode("0x" + this.moaWing.getText()));
|
||||
}
|
||||
if (!this.moaWing.getText().isEmpty()) {
|
||||
this.moaSkin.setWingColor(Integer.decode("0x" + this.moaWing.getText()));
|
||||
}
|
||||
|
||||
if (!this.moaBody.getText().isEmpty())
|
||||
{
|
||||
this.moaSkin.setBodyColor(Integer.decode("0x" + this.moaBody.getText()));
|
||||
}
|
||||
if (!this.moaBody.getText().isEmpty()) {
|
||||
this.moaSkin.setBodyColor(Integer.decode("0x" + this.moaBody.getText()));
|
||||
}
|
||||
|
||||
if (!this.moaBodyMarking.getText().isEmpty())
|
||||
{
|
||||
this.moaSkin.setMarkingColor(Integer.decode("0x" + this.moaBodyMarking.getText()));
|
||||
}
|
||||
if (!this.moaBodyMarking.getText().isEmpty()) {
|
||||
this.moaSkin.setMarkingColor(Integer.decode("0x" + this.moaBodyMarking.getText()));
|
||||
}
|
||||
|
||||
if (!this.moaEye.getText().isEmpty())
|
||||
{
|
||||
this.moaSkin.setEyeColor(Integer.decode("0x" + this.moaEye.getText()));
|
||||
}
|
||||
if (!this.moaEye.getText().isEmpty()) {
|
||||
this.moaSkin.setEyeColor(Integer.decode("0x" + this.moaEye.getText()));
|
||||
}
|
||||
|
||||
if (!this.moaOutside.getText().isEmpty())
|
||||
{
|
||||
this.moaSkin.setOutsideColor(Integer.decode("0x" + this.moaOutside.getText()));
|
||||
}
|
||||
if (!this.moaOutside.getText().isEmpty()) {
|
||||
this.moaSkin.setOutsideColor(Integer.decode("0x" + this.moaOutside.getText()));
|
||||
}
|
||||
|
||||
this.moaSkin.shouldUseDefualt(this.defualtSkin.displayString.contains("true"));
|
||||
this.moaSkin.shouldUseDefualt(this.defualtSkin.displayString.contains("true"));
|
||||
|
||||
if (!this.enableHaloEditor)
|
||||
{
|
||||
this.enableHalo.visible = false;
|
||||
}
|
||||
if (!this.enableHaloEditor) {
|
||||
this.enableHalo.visible = false;
|
||||
}
|
||||
|
||||
if (!this.enableMoaEditor)
|
||||
{
|
||||
this.defualtSkin.visible = false;
|
||||
this.confirmPreference.visible = false;
|
||||
}
|
||||
}
|
||||
if (!this.enableMoaEditor) {
|
||||
this.defualtSkin.visible = false;
|
||||
this.confirmPreference.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui()
|
||||
{
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
public void initGui() {
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
|
||||
this.guiLeft = (this.width - 176) / 2;
|
||||
this.guiTop = (this.height - 166) / 2;
|
||||
this.guiLeft = (this.width - 176) / 2;
|
||||
this.guiTop = (this.height - 166) / 2;
|
||||
|
||||
this.buttonList.add(this.perkMoa = new GuiButton(1, 4, 17, 100, 20, "Moa Customizer"));
|
||||
this.buttonList.add(this.perkHalo = new GuiButton(5, 110, 17, 100, 20, "Developer Perks"));
|
||||
this.buttonList.add(this.perkMoa = new GuiButton(1, 4, 17, 100, 20, "Moa Customizer"));
|
||||
this.buttonList.add(this.perkHalo = new GuiButton(5, 110, 17, 100, 20, "Developer Perks"));
|
||||
|
||||
this.buttonList.add(this.enableHalo = new GuiButton(6, this.width / 2 - 50, this.height - 20, 100, 20, "Enable Halo: "));
|
||||
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"));
|
||||
this.buttonList.add(this.enableHalo = new GuiButton(6, this.width / 2 - 50, this.height - 20, 100, 20, "Enable Halo: "));
|
||||
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()))
|
||||
{
|
||||
this.perkHalo.visible = false;
|
||||
}
|
||||
if (!AetherRankings.isRankedPlayer(this.player.getEntity().getUniqueID())) {
|
||||
this.perkHalo.visible = false;
|
||||
}
|
||||
|
||||
this.enableHalo.displayString = this.enableHalo.displayString + Boolean.toString(this.player.shouldRenderHalo ? false : true);
|
||||
this.enableHalo.displayString = this.enableHalo.displayString + Boolean.toString(this.player.shouldRenderHalo ? false : true);
|
||||
|
||||
this.moaEye = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, 70, 45, 20);
|
||||
this.moaEye.setMaxStringLength(6);
|
||||
this.moaEye.setText(Integer.toHexString(this.player.donatorMoaSkin.getEyeColor()));
|
||||
this.moaEye = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, 70, 45, 20);
|
||||
this.moaEye.setMaxStringLength(6);
|
||||
this.moaEye.setText(Integer.toHexString(this.player.donatorMoaSkin.getEyeColor()));
|
||||
|
||||
this.moaWingMarking = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, this.height - 40, 45, 20);
|
||||
this.moaWingMarking.setMaxStringLength(6);
|
||||
this.moaWingMarking.setText(Integer.toHexString(this.player.donatorMoaSkin.getWingMarkingColor()));
|
||||
this.moaWingMarking = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, this.height - 40, 45, 20);
|
||||
this.moaWingMarking.setMaxStringLength(6);
|
||||
this.moaWingMarking.setText(Integer.toHexString(this.player.donatorMoaSkin.getWingMarkingColor()));
|
||||
|
||||
this.moaWing = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, this.height / 2 + 15, 45, 20);
|
||||
this.moaWing.setMaxStringLength(6);
|
||||
this.moaWing.setText(Integer.toHexString(this.player.donatorMoaSkin.getWingColor()));
|
||||
this.moaWing = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, this.height / 2 + 15, 45, 20);
|
||||
this.moaWing.setMaxStringLength(6);
|
||||
this.moaWing.setText(Integer.toHexString(this.player.donatorMoaSkin.getWingColor()));
|
||||
|
||||
this.moaBody = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, this.height / 2 + 15, 45, 20);
|
||||
this.moaBody.setMaxStringLength(6);
|
||||
this.moaBody.setText(Integer.toHexString(this.player.donatorMoaSkin.getBodyColor()));
|
||||
this.moaBody = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, this.height / 2 + 15, 45, 20);
|
||||
this.moaBody.setMaxStringLength(6);
|
||||
this.moaBody.setText(Integer.toHexString(this.player.donatorMoaSkin.getBodyColor()));
|
||||
|
||||
this.moaBodyMarking = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, this.height - 40, 45, 20);
|
||||
this.moaBodyMarking.setMaxStringLength(6);
|
||||
this.moaBodyMarking.setText(Integer.toHexString(this.player.donatorMoaSkin.getMarkingColor()));
|
||||
this.moaBodyMarking = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, this.height - 40, 45, 20);
|
||||
this.moaBodyMarking.setMaxStringLength(6);
|
||||
this.moaBodyMarking.setText(Integer.toHexString(this.player.donatorMoaSkin.getMarkingColor()));
|
||||
|
||||
this.moaOutside = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, 70, 45, 20);
|
||||
this.moaOutside.setMaxStringLength(6);
|
||||
this.moaOutside.setText(Integer.toHexString(this.player.donatorMoaSkin.getOutsideColor()));
|
||||
}
|
||||
this.moaOutside = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, 70, 45, 20);
|
||||
this.moaOutside.setMaxStringLength(6);
|
||||
this.moaOutside.setText(Integer.toHexString(this.player.donatorMoaSkin.getOutsideColor()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char typedChar, int keyCode)
|
||||
{
|
||||
super.keyTyped(typedChar, 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)
|
||||
{
|
||||
this.moaWingMarking.textboxKeyTyped(typedChar, keyCode);
|
||||
this.moaWing.textboxKeyTyped(typedChar, keyCode);
|
||||
this.moaBody.textboxKeyTyped(typedChar, keyCode);
|
||||
this.moaBodyMarking.textboxKeyTyped(typedChar, keyCode);
|
||||
this.moaEye.textboxKeyTyped(typedChar, keyCode);
|
||||
this.moaOutside.textboxKeyTyped(typedChar, keyCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
this.moaBodyMarking.textboxKeyTyped(typedChar, keyCode);
|
||||
this.moaEye.textboxKeyTyped(typedChar, keyCode);
|
||||
this.moaOutside.textboxKeyTyped(typedChar, keyCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton)
|
||||
{
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
|
||||
if (this.enableMoaEditor)
|
||||
{
|
||||
this.moaWingMarking.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaWing.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaBody.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaBodyMarking.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaEye.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaOutside.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
}
|
||||
}
|
||||
if (this.enableMoaEditor) {
|
||||
this.moaWingMarking.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaWing.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaBody.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaBodyMarking.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaEye.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
this.moaOutside.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed()
|
||||
{
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
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,92 +184,77 @@ 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;
|
||||
AetherNetwork.sendToServer(new PacketPerkChanged(this.player.getEntity().getEntityId(), EnumAetherPerkType.Halo, enableHalo));
|
||||
this.enableHalo.displayString = "Enable Halo: " + Boolean.toString(enableHalo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
this.drawDefaultBackground();
|
||||
|
||||
this.drawCenteredString(this.fontRendererObj, "Donator Options", 45, 4, 16777215);
|
||||
this.drawCenteredString(this.fontRendererObj, "Donator Options", 45, 4, 16777215);
|
||||
|
||||
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);
|
||||
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*/
|
||||
/* Left Side*/
|
||||
|
||||
this.drawString(this.fontRendererObj, "Leg/Beak Color", (this.width / 2) - 170, 55, 16777215);
|
||||
this.drawString(this.fontRendererObj, "Leg/Beak Color", (this.width / 2) - 170, 55, 16777215);
|
||||
|
||||
this.drawString(this.fontRendererObj, "Body Color", (this.width / 2) - 160, this.height / 2, 16777215);
|
||||
this.drawString(this.fontRendererObj, "Body Color", (this.width / 2) - 160, this.height / 2, 16777215);
|
||||
|
||||
this.drawString(this.fontRendererObj, "Body Marking Color", (this.width / 2) - 180, this.height - 55, 16777215);
|
||||
this.drawString(this.fontRendererObj, "Body Marking Color", (this.width / 2) - 180, this.height - 55, 16777215);
|
||||
|
||||
/* Right Side */
|
||||
/* Right Side */
|
||||
|
||||
this.drawString(this.fontRendererObj, "Eye Color", (this.width / 2) + 104, 55, 16777215);
|
||||
this.drawString(this.fontRendererObj, "Eye Color", (this.width / 2) + 104, 55, 16777215);
|
||||
|
||||
this.drawString(this.fontRendererObj, "Wing Color", (this.width / 2) + 102, this.height / 2, 16777215);
|
||||
this.drawString(this.fontRendererObj, "Wing Color", (this.width / 2) + 102, this.height / 2, 16777215);
|
||||
|
||||
this.drawString(this.fontRendererObj, "Wing Marking Color", (this.width / 2) + 82, this.height - 55, 16777215);
|
||||
this.drawString(this.fontRendererObj, "Wing Marking Color", (this.width / 2) + 82, this.height - 55, 16777215);
|
||||
|
||||
this.moaWingMarking.drawTextBox();
|
||||
this.moaWing.drawTextBox();
|
||||
this.moaBody.drawTextBox();
|
||||
this.moaBodyMarking.drawTextBox();
|
||||
this.moaEye.drawTextBox();
|
||||
this.moaOutside.drawTextBox();
|
||||
}
|
||||
this.moaWingMarking.drawTextBox();
|
||||
this.moaWing.drawTextBox();
|
||||
this.moaBody.drawTextBox();
|
||||
this.moaBodyMarking.drawTextBox();
|
||||
this.moaEye.drawTextBox();
|
||||
this.moaOutside.drawTextBox();
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawWorldBackground(int tint)
|
||||
{
|
||||
this.drawGradientRect(0, 0, this.width, 50, -1072689136, -804253680);
|
||||
public void drawWorldBackground(int tint) {
|
||||
this.drawGradientRect(0, 0, this.width, 50, -1072689136, -804253680);
|
||||
|
||||
if (this.mc.theWorld != null)
|
||||
{
|
||||
this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drawBackground(tint);
|
||||
}
|
||||
}
|
||||
if (this.mc.theWorld != null) {
|
||||
this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680);
|
||||
} else {
|
||||
this.drawBackground(tint);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -12,61 +12,46 @@ 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();
|
||||
private static Random random = new Random();
|
||||
|
||||
public AetherTrivia()
|
||||
{
|
||||
|
||||
}
|
||||
public AetherTrivia() {
|
||||
|
||||
public static String getNewTrivia()
|
||||
{
|
||||
BufferedReader bufferedreader = null;
|
||||
}
|
||||
|
||||
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;
|
||||
public static String getNewTrivia() {
|
||||
BufferedReader bufferedreader = null;
|
||||
|
||||
while ((s = bufferedreader.readLine()) != null)
|
||||
{
|
||||
s = s.trim();
|
||||
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;
|
||||
|
||||
if (!s.isEmpty())
|
||||
{
|
||||
list.add(s);
|
||||
}
|
||||
}
|
||||
while ((s = bufferedreader.readLine()) != null) {
|
||||
s = s.trim();
|
||||
|
||||
if (!list.isEmpty())
|
||||
{
|
||||
return "Pro Tip: " + (String)list.get(random.nextInt(list.size()));
|
||||
}
|
||||
}
|
||||
catch (IOException var8)
|
||||
{
|
||||
;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (bufferedreader != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
bufferedreader.close();
|
||||
}
|
||||
catch (IOException ioexception)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!s.isEmpty()) {
|
||||
list.add(s);
|
||||
}
|
||||
}
|
||||
|
||||
return "missingno";
|
||||
}
|
||||
if (!list.isEmpty()) {
|
||||
return "Pro Tip: " + (String) list.get(random.nextInt(list.size()));
|
||||
}
|
||||
} catch (IOException var8) {
|
||||
;
|
||||
} finally {
|
||||
if (bufferedreader != null) {
|
||||
try {
|
||||
bufferedreader.close();
|
||||
} catch (IOException ioexception) {
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "missingno";
|
||||
}
|
||||
|
||||
}
|
|
@ -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,19 +56,16 @@ 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;
|
||||
this.wingRight.rotateAngleX = this.wingRight.offsetZ = this.wingRight.offsetY = 0.0F;
|
||||
}
|
||||
|
||||
this.wingLeft.rotateAngleY += Math.sin(this.sinage) / 6F;
|
||||
|
|
|
@ -3,43 +3,40 @@ 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()
|
||||
{
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 32;
|
||||
public ModelRenderer halo1, halo2, halo3, halo4;
|
||||
|
||||
this.halo1 = new ModelRenderer(this, 0, 0);
|
||||
this.halo1.addBox(-3F, 0F, -2F, 1, 1, 4);
|
||||
this.halo1.setTextureSize(64, 32);
|
||||
this.halo1.setRotationPoint(0.0F, 0F, 0F);
|
||||
this.halo2 = new ModelRenderer(this, 0, 0);
|
||||
this.halo2.addBox(2F, 0F, -2F, 1, 1, 4);
|
||||
this.halo2.setTextureSize(64, 32);
|
||||
this.halo3 = new ModelRenderer(this, 0, 0);
|
||||
this.halo3.addBox(-2F, 0F, 2F, 4, 1, 1);
|
||||
this.halo3.setTextureSize(64, 32);
|
||||
this.halo4 = new ModelRenderer(this, 0, 0);
|
||||
this.halo4.addBox(-2F, 0F, -3F, 4, 1, 1);
|
||||
this.halo4.setTextureSize(64, 32);
|
||||
this.halo4.setRotationPoint(0.0F, 0F, 0.0F);
|
||||
}
|
||||
public ModelHalo() {
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 32;
|
||||
|
||||
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;
|
||||
this.halo1.rotationPointY = this.halo2.rotationPointY = this.halo3.rotationPointY = this.halo4.rotationPointY = 0.0F;
|
||||
this.halo1 = new ModelRenderer(this, 0, 0);
|
||||
this.halo1.addBox(-3F, 0F, -2F, 1, 1, 4);
|
||||
this.halo1.setTextureSize(64, 32);
|
||||
this.halo1.setRotationPoint(0.0F, 0F, 0F);
|
||||
this.halo2 = new ModelRenderer(this, 0, 0);
|
||||
this.halo2.addBox(2F, 0F, -2F, 1, 1, 4);
|
||||
this.halo2.setTextureSize(64, 32);
|
||||
this.halo3 = new ModelRenderer(this, 0, 0);
|
||||
this.halo3.addBox(-2F, 0F, 2F, 4, 1, 1);
|
||||
this.halo3.setTextureSize(64, 32);
|
||||
this.halo4 = new ModelRenderer(this, 0, 0);
|
||||
this.halo4.addBox(-2F, 0F, -3F, 4, 1, 1);
|
||||
this.halo4.setTextureSize(64, 32);
|
||||
this.halo4.setRotationPoint(0.0F, 0F, 0.0F);
|
||||
}
|
||||
|
||||
this.halo1.render(scale);
|
||||
this.halo2.render(scale);
|
||||
this.halo3.render(scale);
|
||||
this.halo4.render(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;
|
||||
this.halo1.rotationPointY = this.halo2.rotationPointY = this.halo3.rotationPointY = this.halo4.rotationPointY = 0.0F;
|
||||
|
||||
this.halo1.render(scale);
|
||||
this.halo2.render(scale);
|
||||
this.halo3.render(scale);
|
||||
this.halo4.render(scale);
|
||||
}
|
||||
|
||||
}
|
|
@ -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()
|
||||
{
|
||||
this(0.0F);
|
||||
}
|
||||
public AechorPlantModel() {
|
||||
this(0.0F);
|
||||
}
|
||||
|
||||
public AechorPlantModel(float modelSize)
|
||||
{
|
||||
this(modelSize, 0.0F);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
@ -104,41 +93,36 @@ public class AechorPlantModel extends ModelBase
|
|||
this.thorn[3].addBox(0F, 2.25F, -1.75F, 1, 1, 1, modelSize - 0.25F);
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
@Override
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
this.head.render(scale);
|
||||
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);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
|
||||
{
|
||||
@Override
|
||||
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,45 +131,42 @@ 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)
|
||||
{
|
||||
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;
|
||||
this.stamen[i].rotateAngleX += sinage * 0.4F;
|
||||
|
||||
this.stamen2[i].rotateAngleX = 0.2F + ((float)i / 15F);
|
||||
this.stamen2[i].rotateAngleY = head.rotateAngleY + 0.1F;
|
||||
this.stamen2[i].rotateAngleY += ((Math.PI * 2) / (float)3) * (float)i;
|
||||
this.stamen2[i].rotateAngleX += sinage * 0.4F;
|
||||
|
||||
this.stamen[i].rotationPointY = boff + ((sinage) * 2F);
|
||||
this.stamen2[i].rotationPointY = boff + ((sinage) * 2F);
|
||||
}
|
||||
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;
|
||||
this.stamen[i].rotateAngleX += sinage * 0.4F;
|
||||
|
||||
if (i < 4)
|
||||
{
|
||||
this.thorn[i].rotateAngleY = head.rotateAngleY;
|
||||
this.thorn[i].rotationPointY = boff * 0.5F;
|
||||
}
|
||||
this.stamen2[i].rotateAngleX = 0.2F + ((float) i / 15F);
|
||||
this.stamen2[i].rotateAngleY = head.rotateAngleY + 0.1F;
|
||||
this.stamen2[i].rotateAngleY += ((Math.PI * 2) / (float) 3) * (float) i;
|
||||
this.stamen2[i].rotateAngleX += sinage * 0.4F;
|
||||
|
||||
this.petal[i].rotateAngleX = ((i % 2 == 0) ? -0.25F : -0.4125F);
|
||||
this.petal[i].rotateAngleX += sinage;
|
||||
this.petal[i].rotateAngleY = head.rotateAngleY;
|
||||
this.petal[i].rotateAngleY += ((Math.PI * 2) / (float)10) * (float)i;
|
||||
|
||||
this.leaf[i].rotateAngleX = ((i % 2 == 0) ? 0.1F : 0.2F);
|
||||
this.stamen[i].rotationPointY = boff + ((sinage) * 2F);
|
||||
this.stamen2[i].rotationPointY = boff + ((sinage) * 2F);
|
||||
}
|
||||
|
||||
if (i < 4) {
|
||||
this.thorn[i].rotateAngleY = head.rotateAngleY;
|
||||
this.thorn[i].rotationPointY = boff * 0.5F;
|
||||
}
|
||||
|
||||
this.petal[i].rotateAngleX = ((i % 2 == 0) ? -0.25F : -0.4125F);
|
||||
this.petal[i].rotateAngleX += sinage;
|
||||
this.petal[i].rotateAngleY = head.rotateAngleY;
|
||||
this.petal[i].rotateAngleY += ((Math.PI * 2) / (float) 10) * (float) i;
|
||||
|
||||
this.leaf[i].rotateAngleX = ((i % 2 == 0) ? 0.1F : 0.2F);
|
||||
this.leaf[i].rotateAngleX += sinage * 0.75F;
|
||||
this.leaf[i].rotateAngleY = (float) (head.rotateAngleY + ((Math.PI * 2) / (float)10 / 2F));
|
||||
this.leaf[i].rotateAngleY += ((Math.PI * 2) / (float)10) * (float)i;
|
||||
|
||||
this.leaf[i].rotateAngleY = (float) (head.rotateAngleY + ((Math.PI * 2) / (float) 10 / 2F));
|
||||
this.leaf[i].rotateAngleY += ((Math.PI * 2) / (float) 10) * (float) i;
|
||||
|
||||
this.petal[i].rotationPointY = boff;
|
||||
this.leaf[i].rotationPointY = boff;
|
||||
}
|
||||
}
|
||||
|
||||
this.head.rotationPointY = boff + ((sinage) * 2F);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -7,134 +7,127 @@ 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;
|
||||
public ModelRenderer b2;
|
||||
public ModelRenderer b3;
|
||||
public ModelRenderer e1;
|
||||
public ModelRenderer e2;
|
||||
public ModelRenderer ff1;
|
||||
public ModelRenderer ff2;
|
||||
public ModelRenderer g;
|
||||
public ModelRenderer g2;
|
||||
public ModelRenderer h;
|
||||
public ModelRenderer h2;
|
||||
public float puffiness;
|
||||
public ModelRenderer a;
|
||||
public ModelRenderer b;
|
||||
public ModelRenderer b2;
|
||||
public ModelRenderer b3;
|
||||
public ModelRenderer e1;
|
||||
public ModelRenderer e2;
|
||||
public ModelRenderer ff1;
|
||||
public ModelRenderer ff2;
|
||||
public ModelRenderer g;
|
||||
public ModelRenderer g2;
|
||||
public ModelRenderer h;
|
||||
public ModelRenderer h2;
|
||||
public float puffiness;
|
||||
|
||||
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);
|
||||
this.a.setRotationPoint(0.0F, (float)(-1 + byte0), -4.0F);
|
||||
this.g = new ModelRenderer(this, 14, 0);
|
||||
this.g.addBox(-2.0F, -5.0F, -3.0F, 1, 4, 2, 0.0F);
|
||||
this.g.setRotationPoint(0.0F, (float)(-1 + byte0), -4.0F);
|
||||
this.g2 = new ModelRenderer(this, 14, 0);
|
||||
this.g2.addBox(1.0F, -5.0F, -3.0F, 1, 4, 2, 0.0F);
|
||||
this.g2.setRotationPoint(0.0F, (float)(-1 + byte0), -4.0F);
|
||||
this.h = new ModelRenderer(this, 20, 0);
|
||||
this.h.addBox(-4.0F, 0.0F, -3.0F, 2, 3, 2, 0.0F);
|
||||
this.h.setRotationPoint(0.0F, (float)(-1 + byte0), -4.0F);
|
||||
this.h2 = new ModelRenderer(this, 20, 0);
|
||||
this.h2.addBox(2.0F, 0.0F, -3.0F, 2, 3, 2, 0.0F);
|
||||
this.h2.setRotationPoint(0.0F, (float)(-1 + byte0), -4.0F);
|
||||
this.b = new ModelRenderer(this, 0, 10);
|
||||
this.b.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F);
|
||||
this.b.setRotationPoint(0.0F, (float)(0 + byte0), 0.0F);
|
||||
this.b2 = new ModelRenderer(this, 0, 24);
|
||||
this.b2.addBox(-2.0F, 4.0F, -2.0F, 4, 3, 4, 0.0F);
|
||||
this.b2.setRotationPoint(0.0F, (float)(0 + byte0), 0.0F);
|
||||
this.b3 = new ModelRenderer(this, 29, 0);
|
||||
this.b3.addBox(-3.5F, -3.5F, -3.5F, 7, 7, 7, 0.0F);
|
||||
this.b3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.e1 = new ModelRenderer(this, 24, 16);
|
||||
this.e1.addBox(-2.0F, 0.0F, -1.0F, 2, 2, 2);
|
||||
this.e1.setRotationPoint(3.0F, (float)(3 + byte0), -3.0F);
|
||||
this.e2 = new ModelRenderer(this, 24, 16);
|
||||
this.e2.addBox(0.0F, 0.0F, -1.0F, 2, 2, 2);
|
||||
this.e2.setRotationPoint(-3.0F, (float)(3 + byte0), -3.0F);
|
||||
this.ff1 = new ModelRenderer(this, 16, 24);
|
||||
this.ff1.addBox(-2.0F, 0.0F, -4.0F, 2, 2, 4);
|
||||
this.ff1.setRotationPoint(3.0F, (float)(3 + byte0), 4.0F);
|
||||
this.ff2 = new ModelRenderer(this, 16, 24);
|
||||
this.ff2.addBox(0.0F, 0.0F, -4.0F, 2, 2, 4);
|
||||
this.ff2.setRotationPoint(-3.0F, (float)(3 + byte0), 4.0F);
|
||||
}
|
||||
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);
|
||||
this.a.setRotationPoint(0.0F, (float) (-1 + byte0), -4.0F);
|
||||
this.g = new ModelRenderer(this, 14, 0);
|
||||
this.g.addBox(-2.0F, -5.0F, -3.0F, 1, 4, 2, 0.0F);
|
||||
this.g.setRotationPoint(0.0F, (float) (-1 + byte0), -4.0F);
|
||||
this.g2 = new ModelRenderer(this, 14, 0);
|
||||
this.g2.addBox(1.0F, -5.0F, -3.0F, 1, 4, 2, 0.0F);
|
||||
this.g2.setRotationPoint(0.0F, (float) (-1 + byte0), -4.0F);
|
||||
this.h = new ModelRenderer(this, 20, 0);
|
||||
this.h.addBox(-4.0F, 0.0F, -3.0F, 2, 3, 2, 0.0F);
|
||||
this.h.setRotationPoint(0.0F, (float) (-1 + byte0), -4.0F);
|
||||
this.h2 = new ModelRenderer(this, 20, 0);
|
||||
this.h2.addBox(2.0F, 0.0F, -3.0F, 2, 3, 2, 0.0F);
|
||||
this.h2.setRotationPoint(0.0F, (float) (-1 + byte0), -4.0F);
|
||||
this.b = new ModelRenderer(this, 0, 10);
|
||||
this.b.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F);
|
||||
this.b.setRotationPoint(0.0F, (float) (0 + byte0), 0.0F);
|
||||
this.b2 = new ModelRenderer(this, 0, 24);
|
||||
this.b2.addBox(-2.0F, 4.0F, -2.0F, 4, 3, 4, 0.0F);
|
||||
this.b2.setRotationPoint(0.0F, (float) (0 + byte0), 0.0F);
|
||||
this.b3 = new ModelRenderer(this, 29, 0);
|
||||
this.b3.addBox(-3.5F, -3.5F, -3.5F, 7, 7, 7, 0.0F);
|
||||
this.b3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.e1 = new ModelRenderer(this, 24, 16);
|
||||
this.e1.addBox(-2.0F, 0.0F, -1.0F, 2, 2, 2);
|
||||
this.e1.setRotationPoint(3.0F, (float) (3 + byte0), -3.0F);
|
||||
this.e2 = new ModelRenderer(this, 24, 16);
|
||||
this.e2.addBox(0.0F, 0.0F, -1.0F, 2, 2, 2);
|
||||
this.e2.setRotationPoint(-3.0F, (float) (3 + byte0), -3.0F);
|
||||
this.ff1 = new ModelRenderer(this, 16, 24);
|
||||
this.ff1.addBox(-2.0F, 0.0F, -4.0F, 2, 2, 4);
|
||||
this.ff1.setRotationPoint(3.0F, (float) (3 + byte0), 4.0F);
|
||||
this.ff2 = new ModelRenderer(this, 16, 24);
|
||||
this.ff2.addBox(0.0F, 0.0F, -4.0F, 2, 2, 4);
|
||||
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)
|
||||
{
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
float a;
|
||||
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)
|
||||
{
|
||||
a = 2.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, f5, f5);
|
||||
this.a.render(f5);
|
||||
this.g.render(f5);
|
||||
this.g2.render(f5);
|
||||
this.h.render(f5);
|
||||
this.h2.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glScalef(1.0F / a, 1.0F / a, 1.0F / a);
|
||||
GL11.glTranslatef(0.0F, 18.0F * f5, 0.0F);
|
||||
this.b.render(f5);
|
||||
this.b2.render(f5);
|
||||
this.e1.render(f5);
|
||||
this.e2.render(f5);
|
||||
this.ff1.render(f5);
|
||||
this.ff2.render(f5);
|
||||
float a1 = 1.0F + this.puffiness * 0.5F;
|
||||
GL11.glTranslatef(0.0F, 1.0F, 0.0F);
|
||||
GL11.glScalef(a1, a1, a1);
|
||||
this.b3.render(f5);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.a.render(f5);
|
||||
this.g.render(f5);
|
||||
this.g2.render(f5);
|
||||
this.h.render(f5);
|
||||
this.h2.render(f5);
|
||||
this.b.render(f5);
|
||||
this.b2.render(f5);
|
||||
GL11.glPushMatrix();
|
||||
a = 1.0F + this.puffiness * 0.5F;
|
||||
GL11.glTranslatef(0.0F, 1.0F, 0.0F);
|
||||
GL11.glScalef(a, a, a);
|
||||
this.b3.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
this.e1.render(f5);
|
||||
this.e2.render(f5);
|
||||
this.ff1.render(f5);
|
||||
this.ff2.render(f5);
|
||||
}
|
||||
}
|
||||
if (this.isChild) {
|
||||
a = 2.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, f5, f5);
|
||||
this.a.render(f5);
|
||||
this.g.render(f5);
|
||||
this.g2.render(f5);
|
||||
this.h.render(f5);
|
||||
this.h2.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glScalef(1.0F / a, 1.0F / a, 1.0F / a);
|
||||
GL11.glTranslatef(0.0F, 18.0F * f5, 0.0F);
|
||||
this.b.render(f5);
|
||||
this.b2.render(f5);
|
||||
this.e1.render(f5);
|
||||
this.e2.render(f5);
|
||||
this.ff1.render(f5);
|
||||
this.ff2.render(f5);
|
||||
float a1 = 1.0F + this.puffiness * 0.5F;
|
||||
GL11.glTranslatef(0.0F, 1.0F, 0.0F);
|
||||
GL11.glScalef(a1, a1, a1);
|
||||
this.b3.render(f5);
|
||||
} else {
|
||||
this.a.render(f5);
|
||||
this.g.render(f5);
|
||||
this.g2.render(f5);
|
||||
this.h.render(f5);
|
||||
this.h2.render(f5);
|
||||
this.b.render(f5);
|
||||
this.b2.render(f5);
|
||||
GL11.glPushMatrix();
|
||||
a = 1.0F + this.puffiness * 0.5F;
|
||||
GL11.glTranslatef(0.0F, 1.0F, 0.0F);
|
||||
GL11.glScalef(a, a, a);
|
||||
this.b3.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
this.e1.render(f5);
|
||||
this.e2.render(f5);
|
||||
this.ff1.render(f5);
|
||||
this.ff2.render(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;
|
||||
this.g.rotateAngleY = this.a.rotateAngleY;
|
||||
this.g2.rotateAngleX = this.a.rotateAngleX;
|
||||
this.g2.rotateAngleY = this.a.rotateAngleY;
|
||||
this.h.rotateAngleX = this.a.rotateAngleX;
|
||||
this.h.rotateAngleY = this.a.rotateAngleY;
|
||||
this.h2.rotateAngleX = this.a.rotateAngleX;
|
||||
this.h2.rotateAngleY = this.a.rotateAngleY;
|
||||
this.b.rotateAngleX = ((float)Math.PI / 2F);
|
||||
this.b2.rotateAngleX = ((float)Math.PI / 2F);
|
||||
this.b3.rotateAngleX = ((float)Math.PI / 2F);
|
||||
this.e1.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.0F * f1;
|
||||
this.ff1.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.2F * f1;
|
||||
this.e2.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.0F * f1;
|
||||
this.ff2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.2F * f1;
|
||||
}
|
||||
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;
|
||||
this.g.rotateAngleY = this.a.rotateAngleY;
|
||||
this.g2.rotateAngleX = this.a.rotateAngleX;
|
||||
this.g2.rotateAngleY = this.a.rotateAngleY;
|
||||
this.h.rotateAngleX = this.a.rotateAngleX;
|
||||
this.h.rotateAngleY = this.a.rotateAngleY;
|
||||
this.h2.rotateAngleX = this.a.rotateAngleX;
|
||||
this.h2.rotateAngleY = this.a.rotateAngleY;
|
||||
this.b.rotateAngleX = ((float) Math.PI / 2F);
|
||||
this.b2.rotateAngleX = ((float) Math.PI / 2F);
|
||||
this.b3.rotateAngleX = ((float) Math.PI / 2F);
|
||||
this.e1.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.0F * f1;
|
||||
this.ff1.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.2F * f1;
|
||||
this.e2.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.0F * f1;
|
||||
this.ff2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.2F * f1;
|
||||
}
|
||||
|
||||
}
|
|
@ -4,128 +4,124 @@ 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;
|
||||
public ModelRenderer BottomPartHead;
|
||||
public ModelRenderer LeftFin;
|
||||
public ModelRenderer BottomPartMiddlebody;
|
||||
public ModelRenderer Head;
|
||||
public ModelRenderer MiddleFin;
|
||||
public ModelRenderer BackfinRight;
|
||||
public ModelRenderer BackBody;
|
||||
public ModelRenderer BackfinLeft;
|
||||
public ModelRenderer Middlebody;
|
||||
public ModelRenderer FrontBody;
|
||||
public ModelRenderer RightFin;
|
||||
public ModelRenderer BottomPartHead;
|
||||
public ModelRenderer LeftFin;
|
||||
public ModelRenderer BottomPartMiddlebody;
|
||||
public ModelRenderer Head;
|
||||
public ModelRenderer MiddleFin;
|
||||
public ModelRenderer BackfinRight;
|
||||
public ModelRenderer BackBody;
|
||||
public ModelRenderer BackfinLeft;
|
||||
public ModelRenderer Middlebody;
|
||||
|
||||
public AerwhaleModel()
|
||||
{
|
||||
this.textureWidth = 512;
|
||||
this.textureHeight = 64;
|
||||
public AerwhaleModel() {
|
||||
this.textureWidth = 512;
|
||||
this.textureHeight = 64;
|
||||
|
||||
this.FrontBody = new ModelRenderer(this, 0, 0);
|
||||
this.FrontBody.addBox(-11.5F, -1.0F, -0.5F, 19, 5, 21);
|
||||
this.FrontBody.setRotationPoint(2.0F, 6.0F, 38.0F);
|
||||
this.FrontBody.setTextureSize(512, 64);
|
||||
this.FrontBody.mirror = true;
|
||||
this.setRotation(this.FrontBody, -0.1047198F, 0.0F, 0.0F);
|
||||
|
||||
this.RightFin = new ModelRenderer(this, 446, 1);
|
||||
this.RightFin.addBox(-20.0F, -2.0F, -6.0F, 19, 3, 14);
|
||||
this.RightFin.setRotationPoint(-10.0F, 4.0F, 10.0F);
|
||||
this.RightFin.setTextureSize(512, 64);
|
||||
this.RightFin.mirror = true;
|
||||
this.setRotation(this.RightFin, -0.148353F, 0.2094395F, 0.0F);
|
||||
this.RightFin.mirror = false;
|
||||
this.FrontBody = new ModelRenderer(this, 0, 0);
|
||||
this.FrontBody.addBox(-11.5F, -1.0F, -0.5F, 19, 5, 21);
|
||||
this.FrontBody.setRotationPoint(2.0F, 6.0F, 38.0F);
|
||||
this.FrontBody.setTextureSize(512, 64);
|
||||
this.FrontBody.mirror = true;
|
||||
this.setRotation(this.FrontBody, -0.1047198F, 0.0F, 0.0F);
|
||||
|
||||
this.BottomPartHead = new ModelRenderer(this, 116, 28);
|
||||
this.BottomPartHead.addBox(-13.0F, 4.0F, -15.0F, 26, 6, 30);
|
||||
this.BottomPartHead.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.BottomPartHead.setTextureSize(512, 64);
|
||||
this.BottomPartHead.mirror = true;
|
||||
this.setRotation(this.BottomPartHead, 0.0F, 0.0F, 0.0F);
|
||||
this.RightFin = new ModelRenderer(this, 446, 1);
|
||||
this.RightFin.addBox(-20.0F, -2.0F, -6.0F, 19, 3, 14);
|
||||
this.RightFin.setRotationPoint(-10.0F, 4.0F, 10.0F);
|
||||
this.RightFin.setTextureSize(512, 64);
|
||||
this.RightFin.mirror = true;
|
||||
this.setRotation(this.RightFin, -0.148353F, 0.2094395F, 0.0F);
|
||||
this.RightFin.mirror = false;
|
||||
|
||||
this.LeftFin = new ModelRenderer(this, 446, 1);
|
||||
this.LeftFin.addBox(1.0F, -2.0F, -6.0F, 19, 3, 14);
|
||||
this.LeftFin.setRotationPoint(10.0F, 4.0F, 10.0F);
|
||||
this.LeftFin.setTextureSize(512, 64);
|
||||
this.LeftFin.mirror = true;
|
||||
this.setRotation(this.LeftFin, -0.148353F, -0.2094395F, 0.0F);
|
||||
this.BottomPartHead = new ModelRenderer(this, 116, 28);
|
||||
this.BottomPartHead.addBox(-13.0F, 4.0F, -15.0F, 26, 6, 30);
|
||||
this.BottomPartHead.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.BottomPartHead.setTextureSize(512, 64);
|
||||
this.BottomPartHead.mirror = true;
|
||||
this.setRotation(this.BottomPartHead, 0.0F, 0.0F, 0.0F);
|
||||
|
||||
this.BottomPartMiddlebody = new ModelRenderer(this, 16, 32);
|
||||
this.BottomPartMiddlebody.addBox(-12.0F, 5.0F, -1.0F, 24, 6, 26);
|
||||
this.BottomPartMiddlebody.setRotationPoint(0.0F, -1.0F, 14.0F);
|
||||
this.BottomPartMiddlebody.setTextureSize(512, 64);
|
||||
this.BottomPartMiddlebody.mirror = true;
|
||||
this.setRotation(this.BottomPartMiddlebody, 0.0F, 0.0F, 0.0F);
|
||||
this.LeftFin = new ModelRenderer(this, 446, 1);
|
||||
this.LeftFin.addBox(1.0F, -2.0F, -6.0F, 19, 3, 14);
|
||||
this.LeftFin.setRotationPoint(10.0F, 4.0F, 10.0F);
|
||||
this.LeftFin.setTextureSize(512, 64);
|
||||
this.LeftFin.mirror = true;
|
||||
this.setRotation(this.LeftFin, -0.148353F, -0.2094395F, 0.0F);
|
||||
|
||||
this.Head = new ModelRenderer(this, 408, 18);
|
||||
this.Head.addBox(-12.0F, -9.0F, -14.0F, 24, 18, 28);
|
||||
this.Head.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.Head.setTextureSize(512, 64);
|
||||
this.Head.mirror = true;
|
||||
this.setRotation(this.Head, 0.0F, 0.0F, 0.0F);
|
||||
this.BottomPartMiddlebody = new ModelRenderer(this, 16, 32);
|
||||
this.BottomPartMiddlebody.addBox(-12.0F, 5.0F, -1.0F, 24, 6, 26);
|
||||
this.BottomPartMiddlebody.setRotationPoint(0.0F, -1.0F, 14.0F);
|
||||
this.BottomPartMiddlebody.setTextureSize(512, 64);
|
||||
this.BottomPartMiddlebody.mirror = true;
|
||||
this.setRotation(this.BottomPartMiddlebody, 0.0F, 0.0F, 0.0F);
|
||||
|
||||
this.MiddleFin = new ModelRenderer(this, 318, 35);
|
||||
this.MiddleFin.addBox(-1.0F, -11.0F, 7.0F, 2, 7, 8);
|
||||
this.MiddleFin.setRotationPoint(0.0F, -1.0F, 14.0F);
|
||||
this.MiddleFin.setTextureSize(512, 64);
|
||||
this.MiddleFin.mirror = true;
|
||||
this.setRotation(this.MiddleFin, -0.1441704F, 0.0F, 0.0F);
|
||||
this.Head = new ModelRenderer(this, 408, 18);
|
||||
this.Head.addBox(-12.0F, -9.0F, -14.0F, 24, 18, 28);
|
||||
this.Head.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.Head.setTextureSize(512, 64);
|
||||
this.Head.mirror = true;
|
||||
this.setRotation(this.Head, 0.0F, 0.0F, 0.0F);
|
||||
|
||||
this.BackfinRight = new ModelRenderer(this, 261, 5);
|
||||
this.BackfinRight.addBox(-11.0F, 0.0F, -6.0F, 15, 3, 24);
|
||||
this.BackfinRight.setRotationPoint(-4.0F, 5.0F, 59.0F);
|
||||
this.BackfinRight.setTextureSize(512, 64);
|
||||
this.BackfinRight.mirror = true;
|
||||
this.setRotation(this.BackfinRight, -0.1047198F, -0.7330383F, 0.0F);
|
||||
this.BackfinRight.mirror = false;
|
||||
this.MiddleFin = new ModelRenderer(this, 318, 35);
|
||||
this.MiddleFin.addBox(-1.0F, -11.0F, 7.0F, 2, 7, 8);
|
||||
this.MiddleFin.setRotationPoint(0.0F, -1.0F, 14.0F);
|
||||
this.MiddleFin.setTextureSize(512, 64);
|
||||
this.MiddleFin.mirror = true;
|
||||
this.setRotation(this.MiddleFin, -0.1441704F, 0.0F, 0.0F);
|
||||
|
||||
this.BackBody = new ModelRenderer(this, 228, 32);
|
||||
this.BackBody.addBox(-10.5F, -9.0F, -2.0F, 17, 10, 22);
|
||||
this.BackBody.setRotationPoint(2.0F, 5.0F, 38.0F);
|
||||
this.BackBody.setTextureSize(512, 64);
|
||||
this.BackBody.mirror = true;
|
||||
this.setRotation(this.BackBody, -0.1047198F, 0.0F, 0.0F);
|
||||
this.BackfinRight = new ModelRenderer(this, 261, 5);
|
||||
this.BackfinRight.addBox(-11.0F, 0.0F, -6.0F, 15, 3, 24);
|
||||
this.BackfinRight.setRotationPoint(-4.0F, 5.0F, 59.0F);
|
||||
this.BackfinRight.setTextureSize(512, 64);
|
||||
this.BackfinRight.mirror = true;
|
||||
this.setRotation(this.BackfinRight, -0.1047198F, -0.7330383F, 0.0F);
|
||||
this.BackfinRight.mirror = false;
|
||||
|
||||
this.BackfinLeft = new ModelRenderer(this, 261, 5);
|
||||
this.BackfinLeft.addBox(-4.0F, 0.0F, -6.0F, 13, 3, 24);
|
||||
this.BackfinLeft.setRotationPoint(5.0F, 5.0F, 59.0F);
|
||||
this.BackfinLeft.setTextureSize(512, 64);
|
||||
this.BackfinLeft.mirror = true;
|
||||
this.setRotation(this.BackfinLeft, -0.1047198F, 0.7330383F, 0.0F);
|
||||
this.BackBody = new ModelRenderer(this, 228, 32);
|
||||
this.BackBody.addBox(-10.5F, -9.0F, -2.0F, 17, 10, 22);
|
||||
this.BackBody.setRotationPoint(2.0F, 5.0F, 38.0F);
|
||||
this.BackBody.setTextureSize(512, 64);
|
||||
this.BackBody.mirror = true;
|
||||
this.setRotation(this.BackBody, -0.1047198F, 0.0F, 0.0F);
|
||||
|
||||
this.Middlebody = new ModelRenderer(this, 314, 25);
|
||||
this.Middlebody.addBox(-11.0F, -5.0F, -1.0F, 22, 14, 25);
|
||||
this.Middlebody.setRotationPoint(0.0F, -1.0F, 14.0F);
|
||||
this.Middlebody.setTextureSize(512, 64);
|
||||
this.Middlebody.mirror = true;
|
||||
this.setRotation(this.Middlebody, -0.0698132F, 0.0F, 0.0F);
|
||||
}
|
||||
this.BackfinLeft = new ModelRenderer(this, 261, 5);
|
||||
this.BackfinLeft.addBox(-4.0F, 0.0F, -6.0F, 13, 3, 24);
|
||||
this.BackfinLeft.setRotationPoint(5.0F, 5.0F, 59.0F);
|
||||
this.BackfinLeft.setTextureSize(512, 64);
|
||||
this.BackfinLeft.mirror = true;
|
||||
this.setRotation(this.BackfinLeft, -0.1047198F, 0.7330383F, 0.0F);
|
||||
|
||||
@Override
|
||||
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);
|
||||
this.BottomPartHead.render(scale);
|
||||
this.LeftFin.render(scale);
|
||||
this.BottomPartMiddlebody.render(scale);
|
||||
this.Head.render(scale);
|
||||
this.MiddleFin.render(scale);
|
||||
this.BackfinRight.render(scale);
|
||||
this.BackBody.render(scale);
|
||||
this.BackfinLeft.render(scale);
|
||||
this.Middlebody.render(scale);
|
||||
}
|
||||
this.Middlebody = new ModelRenderer(this, 314, 25);
|
||||
this.Middlebody.addBox(-11.0F, -5.0F, -1.0F, 22, 14, 25);
|
||||
this.Middlebody.setRotationPoint(0.0F, -1.0F, 14.0F);
|
||||
this.Middlebody.setTextureSize(512, 64);
|
||||
this.Middlebody.mirror = true;
|
||||
this.setRotation(this.Middlebody, -0.0698132F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
@Override
|
||||
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);
|
||||
this.BottomPartHead.render(scale);
|
||||
this.LeftFin.render(scale);
|
||||
this.BottomPartMiddlebody.render(scale);
|
||||
this.Head.render(scale);
|
||||
this.MiddleFin.render(scale);
|
||||
this.BackfinRight.render(scale);
|
||||
this.BackBody.render(scale);
|
||||
this.BackfinLeft.render(scale);
|
||||
this.Middlebody.render(scale);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
}
|
|
@ -5,132 +5,125 @@ 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;
|
||||
public ModelRenderer head, body;
|
||||
|
||||
public ModelRenderer legs, legs2;
|
||||
public ModelRenderer legs, legs2;
|
||||
|
||||
public ModelRenderer wings, wings2;
|
||||
public ModelRenderer wings, wings2;
|
||||
|
||||
public ModelRenderer jaw, neck;
|
||||
public ModelRenderer jaw, neck;
|
||||
|
||||
public ModelRenderer feather1, feather2, feather3;
|
||||
public ModelRenderer feather1, feather2, feather3;
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
this.jaw = new ModelRenderer(this, 24, 13);
|
||||
this.jaw.addBox(-2.0F, -1.0F, -6.0F, 4, 1, 8, -0.1F);
|
||||
this.jaw.setRotationPoint(0.0F, (float)(-8 + 16), -4.0F);
|
||||
this.jaw = new ModelRenderer(this, 24, 13);
|
||||
this.jaw.addBox(-2.0F, -1.0F, -6.0F, 4, 1, 8, -0.1F);
|
||||
this.jaw.setRotationPoint(0.0F, (float) (-8 + 16), -4.0F);
|
||||
|
||||
this.body = new ModelRenderer(this, 0, 0);
|
||||
this.body.addBox(-3.0F, -3.0F, 0.0F, 6, 8, 5, 0.0F);
|
||||
this.body.setRotationPoint(0.0F, (float)(0 + 16), 0.0F);
|
||||
this.body = new ModelRenderer(this, 0, 0);
|
||||
this.body.addBox(-3.0F, -3.0F, 0.0F, 6, 8, 5, 0.0F);
|
||||
this.body.setRotationPoint(0.0F, (float) (0 + 16), 0.0F);
|
||||
|
||||
this.legs = new ModelRenderer(this, 22, 0);
|
||||
this.legs.addBox(-1.0F, -1.0F, -1.0F, 2, 9, 2);
|
||||
this.legs.setRotationPoint(-2.0F, (float)(0 + 16), 1.0F);
|
||||
this.legs = new ModelRenderer(this, 22, 0);
|
||||
this.legs.addBox(-1.0F, -1.0F, -1.0F, 2, 9, 2);
|
||||
this.legs.setRotationPoint(-2.0F, (float) (0 + 16), 1.0F);
|
||||
|
||||
this.legs2 = new ModelRenderer(this, 22, 0);
|
||||
this.legs2.addBox(-1.0F, -1.0F, -1.0F, 2, 9, 2);
|
||||
this.legs2.setRotationPoint(2.0F, (float)(0 + 16), 1.0F);
|
||||
this.legs2 = new ModelRenderer(this, 22, 0);
|
||||
this.legs2.addBox(-1.0F, -1.0F, -1.0F, 2, 9, 2);
|
||||
this.legs2.setRotationPoint(2.0F, (float) (0 + 16), 1.0F);
|
||||
|
||||
this.wings = new ModelRenderer(this, 52, 0);
|
||||
this.wings.addBox(-1.0F, -0.0F, -1.0F, 1, 8, 4);
|
||||
this.wings.setRotationPoint(-3.0F, (float)(16), 2.0F);
|
||||
this.wings = new ModelRenderer(this, 52, 0);
|
||||
this.wings.addBox(-1.0F, -0.0F, -1.0F, 1, 8, 4);
|
||||
this.wings.setRotationPoint(-3.0F, (float) (16), 2.0F);
|
||||
|
||||
this.wings2 = new ModelRenderer(this, 52, 0);
|
||||
this.wings2.addBox(0.0F, -0.0F, -1.0F, 1, 8, 4);
|
||||
this.wings2.setRotationPoint(3.0F, (float)(-4 + 16), 0.0F);
|
||||
this.wings2 = new ModelRenderer(this, 52, 0);
|
||||
this.wings2.addBox(0.0F, -0.0F, -1.0F, 1, 8, 4);
|
||||
this.wings2.setRotationPoint(3.0F, (float) (-4 + 16), 0.0F);
|
||||
|
||||
this.neck = new ModelRenderer(this, 44, 0);
|
||||
this.neck.addBox(-1.0F, -6.0F, -1.0F, 2, 6, 2);
|
||||
this.neck.setRotationPoint(0.0F, (float)(-2 + 16), -4.0F);
|
||||
this.neck = new ModelRenderer(this, 44, 0);
|
||||
this.neck.addBox(-1.0F, -6.0F, -1.0F, 2, 6, 2);
|
||||
this.neck.setRotationPoint(0.0F, (float) (-2 + 16), -4.0F);
|
||||
|
||||
this.feather1 = new ModelRenderer(this, 30, 0);
|
||||
this.feather1.addBox(-1.0F, -5.0F, 5.0F, 2, 1, 5, -0.3F);
|
||||
this.feather1.setRotationPoint(0.0F, (float)(1 + 16), 1.0F);
|
||||
this.feather2 = new ModelRenderer(this, 30, 0);
|
||||
this.feather2.addBox(-1.0F, -5.0F, 5.0F, 2, 1, 5, -0.3F);
|
||||
this.feather2.setRotationPoint(0.0F, (float)(1 + 16), 1.0F);
|
||||
this.feather3 = new ModelRenderer(this, 30, 0);
|
||||
this.feather3.addBox(-1.0F, -5.0F, 5.0F, 2, 1, 5, -0.3F);
|
||||
this.feather3.setRotationPoint(0.0F, (float)(1 + 16), 1.0F);
|
||||
this.feather1.rotationPointY += 0.5F;
|
||||
this.feather2.rotationPointY += 0.5F;
|
||||
this.feather3.rotationPointY += 0.5F;
|
||||
}
|
||||
this.feather1 = new ModelRenderer(this, 30, 0);
|
||||
this.feather1.addBox(-1.0F, -5.0F, 5.0F, 2, 1, 5, -0.3F);
|
||||
this.feather1.setRotationPoint(0.0F, (float) (1 + 16), 1.0F);
|
||||
this.feather2 = new ModelRenderer(this, 30, 0);
|
||||
this.feather2.addBox(-1.0F, -5.0F, 5.0F, 2, 1, 5, -0.3F);
|
||||
this.feather2.setRotationPoint(0.0F, (float) (1 + 16), 1.0F);
|
||||
this.feather3 = new ModelRenderer(this, 30, 0);
|
||||
this.feather3.addBox(-1.0F, -5.0F, 5.0F, 2, 1, 5, -0.3F);
|
||||
this.feather3.setRotationPoint(0.0F, (float) (1 + 16), 1.0F);
|
||||
this.feather1.rotationPointY += 0.5F;
|
||||
this.feather2.rotationPointY += 0.5F;
|
||||
this.feather3.rotationPointY += 0.5F;
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
this.body.render(scale);
|
||||
this.legs.render(scale);
|
||||
this.legs2.render(scale);
|
||||
this.wings.render(scale);
|
||||
this.wings2.render(scale);
|
||||
this.neck.render(scale);
|
||||
this.feather1.render(scale);
|
||||
this.feather2.render(scale);
|
||||
this.feather3.render(scale);
|
||||
}
|
||||
@Override
|
||||
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);
|
||||
this.body.render(scale);
|
||||
this.legs.render(scale);
|
||||
this.legs2.render(scale);
|
||||
this.wings.render(scale);
|
||||
this.wings2.render(scale);
|
||||
this.neck.render(scale);
|
||||
this.feather1.render(scale);
|
||||
this.feather2.render(scale);
|
||||
this.feather3.render(scale);
|
||||
}
|
||||
|
||||
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;
|
||||
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;
|
||||
|
||||
this.jaw.rotateAngleX = head.rotateAngleX;
|
||||
this.jaw.rotateAngleY = head.rotateAngleY;
|
||||
this.jaw.rotateAngleX = head.rotateAngleX;
|
||||
this.jaw.rotateAngleY = head.rotateAngleY;
|
||||
|
||||
this.body.rotateAngleX = 1.570796F;
|
||||
this.body.rotateAngleX = 1.570796F;
|
||||
|
||||
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;
|
||||
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)
|
||||
{
|
||||
this.wings.rotationPointZ = -1F;
|
||||
this.wings2.rotationPointZ = -1F;
|
||||
this.wings.rotationPointY = 12F;
|
||||
this.wings2.rotationPointY = 12F;
|
||||
this.wings.rotateAngleX = 0.0F;
|
||||
this.wings2.rotateAngleX = 0.0F;
|
||||
this.wings.rotateAngleZ = ageInTicks;
|
||||
this.wings2.rotateAngleZ = -ageInTicks;
|
||||
this.legs.rotateAngleX = 0.6F;
|
||||
this.legs2.rotateAngleX = 0.6F;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.wings.rotationPointZ = -3F;
|
||||
this.wings2.rotationPointZ = -3F;
|
||||
this.wings.rotationPointY = 14F;
|
||||
this.wings2.rotationPointY = 14F;
|
||||
this.wings.rotateAngleX = (float) (Math.PI / 2.0F);
|
||||
this.wings2.rotateAngleX = (float) (Math.PI / 2.0F);
|
||||
this.wings.rotateAngleZ = 0.0F;
|
||||
this.wings2.rotateAngleZ = 0.0F;
|
||||
}
|
||||
if (ageInTicks > 0.001F) {
|
||||
this.wings.rotationPointZ = -1F;
|
||||
this.wings2.rotationPointZ = -1F;
|
||||
this.wings.rotationPointY = 12F;
|
||||
this.wings2.rotationPointY = 12F;
|
||||
this.wings.rotateAngleX = 0.0F;
|
||||
this.wings2.rotateAngleX = 0.0F;
|
||||
this.wings.rotateAngleZ = ageInTicks;
|
||||
this.wings2.rotateAngleZ = -ageInTicks;
|
||||
this.legs.rotateAngleX = 0.6F;
|
||||
this.legs2.rotateAngleX = 0.6F;
|
||||
} else {
|
||||
this.wings.rotationPointZ = -3F;
|
||||
this.wings2.rotationPointZ = -3F;
|
||||
this.wings.rotationPointY = 14F;
|
||||
this.wings2.rotationPointY = 14F;
|
||||
this.wings.rotateAngleX = (float) (Math.PI / 2.0F);
|
||||
this.wings2.rotateAngleX = (float) (Math.PI / 2.0F);
|
||||
this.wings.rotateAngleZ = 0.0F;
|
||||
this.wings2.rotateAngleZ = 0.0F;
|
||||
}
|
||||
|
||||
this.feather1.rotateAngleY = -0.375F;
|
||||
this.feather2.rotateAngleY = 0.0F;
|
||||
this.feather3.rotateAngleY = 0.375F;
|
||||
this.feather1.rotateAngleX = 0.25F;
|
||||
this.feather2.rotateAngleX = 0.25F;
|
||||
this.feather3.rotateAngleX = 0.25F;
|
||||
this.feather1.rotateAngleY = -0.375F;
|
||||
this.feather2.rotateAngleY = 0.0F;
|
||||
this.feather3.rotateAngleY = 0.375F;
|
||||
this.feather1.rotateAngleX = 0.25F;
|
||||
this.feather2.rotateAngleX = 0.25F;
|
||||
this.feather3.rotateAngleX = 0.25F;
|
||||
|
||||
this.neck.rotateAngleX = 0.0F;
|
||||
this.neck.rotateAngleY = head.rotateAngleY;
|
||||
this.jaw.rotateAngleX += 0.35F;
|
||||
}
|
||||
this.neck.rotateAngleX = 0.0F;
|
||||
this.neck.rotateAngleY = head.rotateAngleY;
|
||||
this.jaw.rotateAngleX += 0.35F;
|
||||
}
|
||||
|
||||
}
|
|
@ -6,49 +6,43 @@ import net.minecraft.entity.Entity;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class CrystalModel extends ModelBase
|
||||
{
|
||||
public class CrystalModel extends ModelBase {
|
||||
|
||||
public ModelRenderer head[];
|
||||
public ModelRenderer head[];
|
||||
|
||||
public float sinage[];
|
||||
|
||||
private static final float sponge = (180F / 3.141593F);
|
||||
|
||||
public CrystalModel()
|
||||
{
|
||||
this(0.0F);
|
||||
}
|
||||
public CrystalModel() {
|
||||
this(0.0F);
|
||||
}
|
||||
|
||||
public CrystalModel(float f)
|
||||
{
|
||||
this(f, 0.0F);
|
||||
}
|
||||
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)
|
||||
{
|
||||
@Override
|
||||
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*/);
|
||||
GL11.glEnable(3042 /*GL_BLEND*/);
|
||||
GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
GL11.glEnable(3042 /*GL_BLEND*/);
|
||||
GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
|
@ -68,16 +62,14 @@ public class CrystalModel extends ModelBase
|
|||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
|
||||
}
|
||||
}
|
||||
|
||||
@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 ++)
|
||||
{
|
||||
this.head[i].rotateAngleY = netHeadYaw / 57.29578F;
|
||||
this.head[i].rotateAngleX = headPitch / 57.29578F;
|
||||
@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++) {
|
||||
this.head[i].rotateAngleY = netHeadYaw / 57.29578F;
|
||||
this.head[i].rotateAngleX = headPitch / 57.29578F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -5,75 +5,68 @@ 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;
|
||||
ModelRenderer udders;
|
||||
ModelRenderer horn1;
|
||||
ModelRenderer horn2;
|
||||
|
||||
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);
|
||||
this.head.setRotationPoint(0.0F, 4.0F, -8.0F);
|
||||
this.horn1 = new ModelRenderer(this, 22, 0);
|
||||
this.horn1.addBox(-4.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F);
|
||||
this.horn1.setRotationPoint(0.0F, 3.0F, -7.0F);
|
||||
this.horn2 = new ModelRenderer(this, 22, 0);
|
||||
this.horn2.addBox(3.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F);
|
||||
this.horn2.setRotationPoint(0.0F, 3.0F, -7.0F);
|
||||
this.udders = new ModelRenderer(this, 52, 0);
|
||||
this.udders.addBox(-2.0F, -3.0F, 0.0F, 4, 6, 2, 0.0F);
|
||||
this.udders.setRotationPoint(0.0F, 14.0F, 6.0F);
|
||||
this.udders.rotateAngleX = ((float)Math.PI / 2F);
|
||||
this.body = new ModelRenderer(this, 18, 4);
|
||||
this.body.addBox(-6.0F, -10.0F, -7.0F, 12, 18, 10, scale);
|
||||
this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
|
||||
--this.leg1.rotationPointX;
|
||||
++this.leg2.rotationPointX;
|
||||
this.leg1.rotationPointZ += 0.0F;
|
||||
this.leg2.rotationPointZ += 0.0F;
|
||||
--this.leg3.rotationPointX;
|
||||
++this.leg4.rotationPointX;
|
||||
--this.leg3.rotationPointZ;
|
||||
--this.leg4.rotationPointZ;
|
||||
}
|
||||
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);
|
||||
this.head.setRotationPoint(0.0F, 4.0F, -8.0F);
|
||||
this.horn1 = new ModelRenderer(this, 22, 0);
|
||||
this.horn1.addBox(-4.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F);
|
||||
this.horn1.setRotationPoint(0.0F, 3.0F, -7.0F);
|
||||
this.horn2 = new ModelRenderer(this, 22, 0);
|
||||
this.horn2.addBox(3.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F);
|
||||
this.horn2.setRotationPoint(0.0F, 3.0F, -7.0F);
|
||||
this.udders = new ModelRenderer(this, 52, 0);
|
||||
this.udders.addBox(-2.0F, -3.0F, 0.0F, 4, 6, 2, 0.0F);
|
||||
this.udders.setRotationPoint(0.0F, 14.0F, 6.0F);
|
||||
this.udders.rotateAngleX = ((float) Math.PI / 2F);
|
||||
this.body = new ModelRenderer(this, 18, 4);
|
||||
this.body.addBox(-6.0F, -10.0F, -7.0F, 12, 18, 10, scale);
|
||||
this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
|
||||
--this.leg1.rotationPointX;
|
||||
++this.leg2.rotationPointX;
|
||||
this.leg1.rotationPointZ += 0.0F;
|
||||
this.leg2.rotationPointZ += 0.0F;
|
||||
--this.leg3.rotationPointX;
|
||||
++this.leg4.rotationPointX;
|
||||
--this.leg3.rotationPointZ;
|
||||
--this.leg4.rotationPointZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
@Override
|
||||
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)
|
||||
{
|
||||
float f6 = 2.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6);
|
||||
GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F);
|
||||
this.horn1.render(scale);
|
||||
this.horn2.render(scale);
|
||||
this.udders.render(scale);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.horn1.render(scale);
|
||||
this.horn2.render(scale);
|
||||
this.udders.render(scale);
|
||||
}
|
||||
}
|
||||
if (this.isChild) {
|
||||
float f6 = 2.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6);
|
||||
GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F);
|
||||
this.horn1.render(scale);
|
||||
this.horn2.render(scale);
|
||||
this.udders.render(scale);
|
||||
} else {
|
||||
this.horn1.render(scale);
|
||||
this.horn2.render(scale);
|
||||
this.udders.render(scale);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
@Override
|
||||
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;
|
||||
this.horn1.rotateAngleX = this.head.rotateAngleX;
|
||||
this.horn2.rotateAngleY = this.head.rotateAngleY;
|
||||
this.horn2.rotateAngleX = this.head.rotateAngleX;
|
||||
}
|
||||
this.horn1.rotateAngleY = this.head.rotateAngleY;
|
||||
this.horn1.rotateAngleX = this.head.rotateAngleX;
|
||||
this.horn2.rotateAngleY = this.head.rotateAngleY;
|
||||
this.horn2.rotateAngleX = this.head.rotateAngleX;
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue