Compare commits

...

2 commits

Author SHA1 Message Date
LordMZTE 93c83c6453
chore: format code 2023-03-13 19:53:26 +01:00
LordMZTE 1a3c60f456
fix: no longer spam packets 2023-03-13 19:53:04 +01:00
394 changed files with 31176 additions and 24561 deletions

130
.clang-format Normal file
View file

@ -0,0 +1,130 @@
---
AccessModifierOffset: 0
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: None
AlignConsecutiveAssignments: None
AlignConsecutiveMacros: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: DontAlign
AlignOperands: DontAlign
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros: []
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: After
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakAfterJavaFieldAnnotations: true
#BreakArrays: false
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeConceptDeclarations: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: true
ColumnLimit: 90
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: false
DerivePointerAlignment: false
DisableFormat: false # wtf
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
ForEachMacros: ["BOOST_FOREACH"]
IfMacros: []
IncludeBlocks: Regroup
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: Indent
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
#IndentRequiresClause: false
IndentWidth: 4
IndentWrappedFunctionNames: false
#InsertBraces: false
InsertTrailingCommas: Wrapped
JavaImportGroups: ["java"]
JavaScriptQuotes: Double
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: OuterScope
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PackConstructorInitializers: NextLine
PointerAlignment: Left
QualifierAlignment: Left
ReferenceAlignment: Left
ReflowComments: true
#RemoveSemicolon: true
#RequiresClausePosition: OwnLine
#RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Always
SortIncludes: CaseInsensitive
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAroundPointerQualifiers: After
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: false
SpaceBeforeParens: ControlStatementsExceptControlMacros
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++20
StatementAttributeLikeMacros: []
StatementMacros: []
TabWidth: 4
TypenameMacros: []
UseCRLF: false # wtf
UseTab: Never
WhitespaceSensitiveMacros: ["BOOST_PP_STRINGSIZE"]

View file

@ -1,10 +1,8 @@
package com.gildedgames.the_aether;
import com.gildedgames.the_aether.events.AetherEntityEvents;
import net.minecraft.util.ResourceLocation;
import com.gildedgames.the_aether.blocks.BlocksAether;
import com.gildedgames.the_aether.entities.EntitiesAether;
import com.gildedgames.the_aether.events.AetherEntityEvents;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.network.AetherNetwork;
import com.gildedgames.the_aether.player.PlayerAetherEvents;
@ -14,23 +12,25 @@ import com.gildedgames.the_aether.registry.achievements.AchievementsAether;
import com.gildedgames.the_aether.registry.creative_tabs.AetherCreativeTabs;
import com.gildedgames.the_aether.tileentity.AetherTileEntities;
import com.gildedgames.the_aether.world.AetherWorld;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.util.ResourceLocation;
@Mod(modid = Aether.MOD_ID, version = "v1.1.2.2")
public class Aether {
public static final String MOD_ID = "aether_legacy";
@Instance(Aether.MOD_ID)
public static Aether instance;
@SidedProxy(clientSide = "com.gildedgames.the_aether.client.ClientProxy", serverSide = "com.gildedgames.the_aether.CommonProxy")
@SidedProxy(
clientSide = "com.gildedgames.the_aether.client.ClientProxy",
serverSide = "com.gildedgames.the_aether.CommonProxy"
)
public static CommonProxy proxy;
@EventHandler

View file

@ -6,7 +6,6 @@ import java.io.IOException;
import net.minecraftforge.common.config.Configuration;
public class AetherConfig {
public static Configuration config;
private static int max_life_shards;
@ -35,71 +34,211 @@ public class AetherConfig {
private static boolean disable_eternal_day;
private static int phyg_spawnrate, flyingcow_spawnrate, sheepuff_spawnrate, aerbunny_spawnrate, moa_spawnrate, aerwhale_spawnrate;
private static int phyg_spawnrate, flyingcow_spawnrate, sheepuff_spawnrate,
aerbunny_spawnrate, moa_spawnrate, aerwhale_spawnrate;
private static int zephyr_spawnrate, cockatrice_spawnrate, swet_spawnrate, aechorplant_spawnrate, whirlwind_spawnrate;
private static int zephyr_spawnrate, cockatrice_spawnrate, swet_spawnrate,
aechorplant_spawnrate, whirlwind_spawnrate;
public static void init(File location) {
File newFile = new File(location + "/aether" + "/AetherI.cfg");
File newFile = new File(
location + "/aether"
+ "/AetherI.cfg"
);
try {
newFile.createNewFile();
} catch (IOException e) {
}
} catch (IOException e) {}
config = new Configuration(newFile);
config.load();
christmas_content = config.get("Aether World Generation", "Christmas Content", false).getBoolean(false);
seasonal_christmas = config.get("Aether World Generation", "Spawns Holiday Trees during December and January automatically. Christmas Content overrides this.", true).getBoolean(true);
tallgrass = config.get("Aether World Generation", "Enable Tall Grass", false).getBoolean(false);
christmas_content
= config.get("Aether World Generation", "Christmas Content", false)
.getBoolean(false);
seasonal_christmas
= config
.get(
"Aether World Generation",
"Spawns Holiday Trees during December and January automatically. Christmas Content overrides this.",
true
)
.getBoolean(true);
tallgrass = config.get("Aether World Generation", "Enable Tall Grass", false)
.getBoolean(false);
aether_dimension_id = config.get("World Identification", "Aether Dimension ID", 4).getInt(4);
aether_biome_id = config.get("World Identification", "Aether Biome ID", 127).getInt(127);
aether_dimension_id
= config.get("World Identification", "Aether Dimension ID", 4).getInt(4);
aether_biome_id
= config.get("World Identification", "Aether Biome ID", 127).getInt(127);
skyrootBucketOnly = config.get("Misc", "Activate portal with only Skyroot bucket", false).getBoolean(false);
valkyrie_cape = config.get("Misc", "Enables the Valkyrie Cape in dungeon loot", true).getBoolean(true);
golden_feather = config.get("Misc", "Enables the Golden Feather in dungeon loot", false).getBoolean(false);
skyrootBucketOnly
= config.get("Misc", "Activate portal with only Skyroot bucket", false)
.getBoolean(false);
valkyrie_cape
= config.get("Misc", "Enables the Valkyrie Cape in dungeon loot", true)
.getBoolean(true);
golden_feather
= config.get("Misc", "Enables the Golden Feather in dungeon loot", false)
.getBoolean(false);
travel_dimension = config.get("Misc", "Dimension below aether", 0).getInt(0);
floating_block_collision = config.get("Misc", "Floating block collision", true).getBoolean(true);
floating_block_collision
= config.get("Misc", "Floating block collision", true).getBoolean(true);
disable_trivia = config.get("Trivia", "Disable random trivia", false).getBoolean(false);
disable_trivia
= config.get("Trivia", "Disable random trivia", false).getBoolean(false);
old_mobs = config.get("Misc", "Enable Legacy Visuals", false).getBoolean(false);
aether_start = config.get("Gameplay", "Spawns Player with Aether Portal Frame", false).getBoolean(false);
aether_start
= config.get("Gameplay", "Spawns Player with Aether Portal Frame", false)
.getBoolean(false);
max_life_shards = config.get("Gameplay", "Max Life Shards", 10).getInt(10);
menu_enabled = config.get("Misc", "Enables the Aether Menu", false).getBoolean(false);
menu_button = config.get("Misc", "Enables the Aether Menu toggle button", true).getBoolean(true);
menu_enabled
= config.get("Misc", "Enables the Aether Menu", false).getBoolean(false);
menu_button = config.get("Misc", "Enables the Aether Menu toggle button", true)
.getBoolean(true);
install_resourcepack = config.get("Misc", "Determines whether the Aether b1.7.3 resource pack should be generated.", true).getBoolean(true);
install_resourcepack
= config
.get(
"Misc",
"Determines whether the Aether b1.7.3 resource pack should be generated.",
true
)
.getBoolean(true);
legacy_altar_name = config.get("Misc", "Changes whether the Altar should be named Enchanter or not.", false).getBoolean(false);
legacy_altar_name
= config
.get(
"Misc",
"Changes whether the Altar should be named Enchanter or not.",
false
)
.getBoolean(false);
inebriation_id = config.get("Misc", "Sets the id for the Inebriation effect.", 31).getInt(31);
inebriation_id = config.get("Misc", "Sets the id for the Inebriation effect.", 31)
.getInt(31);
sun_altar_multiplayer = config.get("Gameplay", "Removes the requirement for a player to be an operator to use the Sun Altar in multiplayer.", false).getBoolean(false);
sun_altar_multiplayer
= config
.get(
"Gameplay",
"Removes the requirement for a player to be an operator to use the Sun Altar in multiplayer.",
false
)
.getBoolean(false);
repeat_sun_spirit_dialog = config.get("Misc", "If disabed, the Sun Spirit's dialog will only show once per world.", true).getBoolean(true);
repeat_sun_spirit_dialog
= config
.get(
"Misc",
"If disabed, the Sun Spirit's dialog will only show once per world.",
true
)
.getBoolean(true);
disable_eternal_day = config.get("Misc", "Disables eternal day making time cycle in the Aether without having to kill the Sun Spirit. This is mainly intended for use in modpacks.", false).getBoolean(false);
disable_eternal_day
= config
.get(
"Misc",
"Disables eternal day making time cycle in the Aether without having to kill the Sun Spirit. This is mainly intended for use in modpacks.",
false
)
.getBoolean(false);
//Spawnrates
phyg_spawnrate = config.get("Spawnrates", "Phyg Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
flyingcow_spawnrate = config.get("Spawnrates", "Flying Cow Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
sheepuff_spawnrate = config.get("Spawnrates", "Sheepuff Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
aerbunny_spawnrate = config.get("Spawnrates", "Aerbunny Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
moa_spawnrate = config.get("Spawnrates", "Moa Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
aerwhale_spawnrate = config.get("Spawnrates", "Aerwhale Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
zephyr_spawnrate = config.get("Spawnrates", "Zephyr Spawnrate. 1 is always, higher numbers decrease chances.", 65).getInt(65);
cockatrice_spawnrate = config.get("Spawnrates", "Cockatrice Spawnrate. 1 is always, higher numbers decrease chances.", 45).getInt(45);
swet_spawnrate = config.get("Spawnrates", "Swet Spawnrate. 1 is always, higher numbers decrease chances.", 40).getInt(40);
aechorplant_spawnrate = config.get("Spawnrates", "Aechor Plant Spawnrate. 1 is always, higher numbers decrease chances.", 55).getInt(55);
whirlwind_spawnrate = config.get("Spawnrates", "Whirlwind Spawnrate. 1 is always, higher numbers decrease chances.", 55).getInt(55);
phyg_spawnrate
= config
.get(
"Spawnrates",
"Phyg Spawnrate. 1 is always, higher numbers decrease chances.",
1
)
.getInt(1);
flyingcow_spawnrate
= config
.get(
"Spawnrates",
"Flying Cow Spawnrate. 1 is always, higher numbers decrease chances.",
1
)
.getInt(1);
sheepuff_spawnrate
= config
.get(
"Spawnrates",
"Sheepuff Spawnrate. 1 is always, higher numbers decrease chances.",
1
)
.getInt(1);
aerbunny_spawnrate
= config
.get(
"Spawnrates",
"Aerbunny Spawnrate. 1 is always, higher numbers decrease chances.",
1
)
.getInt(1);
moa_spawnrate
= config
.get(
"Spawnrates",
"Moa Spawnrate. 1 is always, higher numbers decrease chances.",
1
)
.getInt(1);
aerwhale_spawnrate
= config
.get(
"Spawnrates",
"Aerwhale Spawnrate. 1 is always, higher numbers decrease chances.",
1
)
.getInt(1);
zephyr_spawnrate
= config
.get(
"Spawnrates",
"Zephyr Spawnrate. 1 is always, higher numbers decrease chances.",
65
)
.getInt(65);
cockatrice_spawnrate
= config
.get(
"Spawnrates",
"Cockatrice Spawnrate. 1 is always, higher numbers decrease chances.",
45
)
.getInt(45);
swet_spawnrate
= config
.get(
"Spawnrates",
"Swet Spawnrate. 1 is always, higher numbers decrease chances.",
40
)
.getInt(40);
aechorplant_spawnrate
= config
.get(
"Spawnrates",
"Aechor Plant Spawnrate. 1 is always, higher numbers decrease chances.",
55
)
.getInt(55);
whirlwind_spawnrate
= config
.get(
"Spawnrates",
"Whirlwind Spawnrate. 1 is always, higher numbers decrease chances.",
55
)
.getInt(55);
config.save();
}
@ -144,28 +283,23 @@ public class AetherConfig {
return AetherConfig.skyrootBucketOnly;
}
public static boolean valkyrieCapeEnabled()
{
public static boolean valkyrieCapeEnabled() {
return AetherConfig.valkyrie_cape;
}
public static boolean goldenFeatherEnabled()
{
public static boolean goldenFeatherEnabled() {
return AetherConfig.golden_feather;
}
public static boolean menuEnabled()
{
public static boolean menuEnabled() {
return AetherConfig.menu_enabled;
}
public static boolean menuButtonEnabled()
{
public static boolean menuButtonEnabled() {
return AetherConfig.menu_button;
}
public static boolean installResourcepack()
{
public static boolean installResourcepack() {
return AetherConfig.install_resourcepack;
}
@ -173,8 +307,7 @@ public class AetherConfig {
return AetherConfig.legacy_altar_name;
}
public static int getInebriationId()
{
public static int getInebriationId() {
return AetherConfig.inebriation_id;
}
@ -186,13 +319,11 @@ public class AetherConfig {
return repeat_sun_spirit_dialog;
}
public static boolean shouldAetherStart()
{
public static boolean shouldAetherStart() {
return aether_start;
}
public static boolean eternalDayDisabled()
{
public static boolean eternalDayDisabled() {
return disable_eternal_day;
}
@ -203,33 +334,43 @@ public class AetherConfig {
public static int getPhygSpawnrate() {
return phyg_spawnrate;
}
public static int getFlyingCowSpawnrate() {
return flyingcow_spawnrate;
}
public static int getSheepuffSpawnrate() {
return sheepuff_spawnrate;
}
public static int getAerbunnySpawnrate() {
return aerbunny_spawnrate;
}
public static int getMoaSpawnrate() {
return moa_spawnrate;
}
public static int getAerwhaleSpawnrate() {
return aerwhale_spawnrate;
}
public static int getZephyrSpawnrate() {
return zephyr_spawnrate;
}
public static int getCockatriceSpawnrate() {
return cockatrice_spawnrate;
}
public static int getSwetSpawnrate() {
return swet_spawnrate;
}
public static int getAechorPlantSpawnrate() {
return aechorplant_spawnrate;
}
public static int getWhirlwindSpawnrate() {
return whirlwind_spawnrate;
}

View file

@ -1,17 +1,32 @@
package com.gildedgames.the_aether;
import java.util.Random;
import com.gildedgames.the_aether.api.player.IPlayerAether;
import com.gildedgames.the_aether.blocks.BlocksAether;
import com.gildedgames.the_aether.blocks.portal.BlockAetherPortal;
import com.gildedgames.the_aether.entities.EntitiesAether;
import com.gildedgames.the_aether.entities.bosses.EntityValkyrie;
import com.gildedgames.the_aether.entities.passive.mountable.EntityAerbunny;
import com.gildedgames.the_aether.entities.passive.mountable.EntityFlyingCow;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.items.dungeon.ItemDungeonKey;
import com.gildedgames.the_aether.items.util.EnumSkyrootBucketType;
import com.gildedgames.the_aether.items.weapons.ItemSkyrootSword;
import com.gildedgames.the_aether.network.AetherNetwork;
import com.gildedgames.the_aether.network.packets.PacketSendEternalDay;
import com.gildedgames.the_aether.network.packets.PacketSendShouldCycle;
import com.gildedgames.the_aether.player.PlayerAether;
import com.gildedgames.the_aether.registry.achievements.AchievementsAether;
import com.gildedgames.the_aether.world.AetherData;
import com.gildedgames.the_aether.world.AetherWorldProvider;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.enchantment.EnchantmentHelper;
@ -41,39 +56,25 @@ import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.living.LivingFallEvent;
import net.minecraftforge.event.entity.player.*;
import com.gildedgames.the_aether.blocks.BlocksAether;
import com.gildedgames.the_aether.blocks.portal.BlockAetherPortal;
import com.gildedgames.the_aether.entities.EntitiesAether;
import com.gildedgames.the_aether.entities.bosses.EntityValkyrie;
import com.gildedgames.the_aether.entities.passive.mountable.EntityFlyingCow;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.items.dungeon.ItemDungeonKey;
import com.gildedgames.the_aether.items.util.EnumSkyrootBucketType;
import com.gildedgames.the_aether.items.weapons.ItemSkyrootSword;
import com.gildedgames.the_aether.registry.achievements.AchievementsAether;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
import net.minecraftforge.event.world.WorldEvent;
import java.util.Random;
public class
AetherEventHandler {
public class AetherEventHandler {
@SubscribeEvent
public void checkBlockBannedEvent(PlayerInteractEvent event) {
if(event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
if (event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK)
return;
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) {
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.world.spawnParticle(
"smoke", event.x, event.y, event.z, 0.0D, 0.0D, 0.0D
);
}
event.setCanceled(true);
@ -89,27 +90,41 @@ AetherEventHandler {
if (event.target instanceof EntityAgeable) {
ItemStack itemstack = event.entityPlayer.inventory.getCurrentItem();
if (itemstack != null && itemstack.getItem() == ItemsAether.aether_spawn_egg) {
if (itemstack != null
&& itemstack.getItem() == ItemsAether.aether_spawn_egg) {
if (!event.entityPlayer.worldObj.isRemote) {
Class<?> oclass = EntitiesAether.getClassFromID(itemstack.getItemDamage());
Class<?> oclass
= EntitiesAether.getClassFromID(itemstack.getItemDamage());
if (oclass != null && oclass.isAssignableFrom(this.getClass())) {
EntityAgeable entityageable = ((EntityAgeable) event.target).createChild((EntityAgeable) event.target);
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);
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());
entityageable.setCustomNameTag(itemstack.getDisplayName()
);
}
if (!event.entityPlayer.capabilities.isCreativeMode) {
--itemstack.stackSize;
if (itemstack.stackSize <= 0) {
event.entityPlayer.inventory.setInventorySlotContents(event.entityPlayer.inventory.currentItem, (ItemStack) null);
event.entityPlayer.inventory.setInventorySlotContents(
event.entityPlayer.inventory.currentItem,
(ItemStack) null
);
}
}
}
@ -118,19 +133,36 @@ AetherEventHandler {
}
}
if (event.target instanceof EntityCow || event.target instanceof EntityFlyingCow) {
if (event.target instanceof EntityCow
|| event.target instanceof EntityFlyingCow) {
EntityPlayer player = event.entityPlayer;
ItemStack heldItem = player.getCurrentEquippedItem();
if (heldItem != null && heldItem.getItem() == ItemsAether.skyroot_bucket && EnumSkyrootBucketType.getType(heldItem.getItemDamage()) == EnumSkyrootBucketType.Empty) {
if (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);
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
);
}
}
}
@ -143,12 +175,18 @@ AetherEventHandler {
ItemStack stack = event.current;
EntityPlayer player = event.entityPlayer;
boolean isWater = (!AetherConfig.activateOnlyWithSkyroot() && stack.getItem() == Items.water_bucket) || (stack.getItem() == ItemsAether.skyroot_bucket && stack.getItemDamage() == 1);
boolean isWater = (!AetherConfig.activateOnlyWithSkyroot()
&& stack.getItem() == Items.water_bucket)
|| (stack.getItem() == ItemsAether.skyroot_bucket
&& stack.getItemDamage() == 1);
boolean isLava = stack.getItem() == Items.lava_bucket;
boolean validDimension = (player.dimension == AetherConfig.getTravelDimensionID() || player.dimension == AetherConfig.getAetherDimensionID());
boolean validDimension
= (player.dimension == AetherConfig.getTravelDimensionID()
|| player.dimension == AetherConfig.getAetherDimensionID());
if (target != null && target.typeOfHit == MovingObjectType.BLOCK && validDimension) {
if (target != null && target.typeOfHit == MovingObjectType.BLOCK
&& validDimension) {
int i = target.blockX;
int j = target.blockY;
int k = target.blockZ;
@ -174,9 +212,11 @@ AetherEventHandler {
}
if (isWater) {
if (((BlockAetherPortal) BlocksAether.aether_portal).trySpawnPortal(worldObj, i, j, k)) {
if (((BlockAetherPortal) BlocksAether.aether_portal)
.trySpawnPortal(worldObj, i, j, k)) {
if (!player.capabilities.isCreativeMode) {
if (stack.getItem() == ItemsAether.skyroot_bucket && stack.getItemDamage() == 1) {
if (stack.getItem() == ItemsAether.skyroot_bucket
&& stack.getItemDamage() == 1) {
event.result = new ItemStack(ItemsAether.skyroot_bucket);
}
@ -226,12 +266,24 @@ AetherEventHandler {
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)) {
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) {
EntityItem item = new EntityItem(entity.worldObj, entity.posX, entity.posY, entity.posZ, items.getEntityItem());
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);
}
@ -242,16 +294,15 @@ AetherEventHandler {
}
@SubscribeEvent
public void onEntityStruckByLightning(EntityStruckByLightningEvent event)
{
if (event.entity instanceof EntityPlayer)
{
public void onEntityStruckByLightning(EntityStruckByLightningEvent event) {
if (event.entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entity;
if (player.inventory.getCurrentItem() != null)
{
if (player.inventory.getCurrentItem().getItem() == ItemsAether.lightning_sword || player.inventory.getCurrentItem().getItem() == ItemsAether.lightning_knife)
{
if (player.inventory.getCurrentItem() != null) {
if (player.inventory.getCurrentItem().getItem()
== ItemsAether.lightning_sword
|| player.inventory.getCurrentItem().getItem()
== ItemsAether.lightning_knife) {
event.setCanceled(true);
}
}
@ -259,57 +310,69 @@ AetherEventHandler {
}
@SubscribeEvent
public void onEntityDamage(LivingAttackEvent event)
{
if (event.entityLiving instanceof EntityAerbunny)
{
public void onEntityDamage(LivingAttackEvent event) {
if (event.entityLiving instanceof EntityAerbunny) {
EntityAerbunny aerbunny = (EntityAerbunny) event.entityLiving;
if (aerbunny.isRiding() && aerbunny.ridingEntity instanceof EntityPlayer)
{
if (aerbunny.isRiding() && aerbunny.ridingEntity instanceof EntityPlayer) {
event.setCanceled(true);
}
}
}
@SubscribeEvent
public void onEntityAttack(AttackEntityEvent event)
{
if (event.entityPlayer.getHeldItem() != null)
{
if (event.entityPlayer.getHeldItem().getItem() == ItemsAether.flaming_sword)
{
if (event.target.canAttackWithItem())
{
if (!event.target.hitByEntity(event.entityPlayer))
{
if (event.target instanceof EntityLivingBase)
{
public void onEntityAttack(AttackEntityEvent event) {
if (event.entityPlayer.getHeldItem() != null) {
if (event.entityPlayer.getHeldItem().getItem() == ItemsAether.flaming_sword) {
if (event.target.canAttackWithItem()) {
if (!event.target.hitByEntity(event.entityPlayer)) {
if (event.target instanceof EntityLivingBase) {
int defaultTime = 30;
int fireAspectModifier = EnchantmentHelper.getFireAspectModifier(event.entityPlayer);
if (fireAspectModifier > 0)
{
int fireAspectModifier
= EnchantmentHelper.getFireAspectModifier(
event.entityPlayer
);
if (fireAspectModifier > 0) {
defaultTime += (fireAspectModifier * 4);
}
event.target.setFire(defaultTime);
}
}
}
}
else if (event.entityPlayer.getHeldItem().getItem() == ItemsAether.pig_slayer)
{
} else if (event.entityPlayer.getHeldItem().getItem() == ItemsAether.pig_slayer) {
String s = EntityList.getEntityString((Entity) event.target);
if (s != null && (s.toLowerCase().contains("pig") || s.toLowerCase().contains("phyg") || s.toLowerCase().contains("taegore") || event.target.getUniqueID().toString().equals("1d680bb6-2a9a-4f25-bf2f-a1af74361d69"))) {
if (event.target.worldObj.isRemote)
{
if (s != null
&& (s.toLowerCase().contains("pig")
|| s.toLowerCase().contains("phyg")
|| s.toLowerCase().contains("taegore")
|| event.target.getUniqueID().toString().equals(
"1d680bb6-2a9a-4f25-bf2f-a1af74361d69"
))) {
if (event.target.worldObj.isRemote) {
for (int j = 0; j < 20; j++) {
Random itemRand = new Random();
double d = itemRand.nextGaussian() * 0.02D;
double d1 = itemRand.nextGaussian() * 0.02D;
double d2 = itemRand.nextGaussian() * 0.02D;
double d3 = 5D;
event.target.worldObj.spawnParticle("flame", (event.target.posX + (double) (itemRand.nextFloat() * event.target.width * 2.0F)) - (double) event.target.width - d * d3, (event.target.posY + (double) (itemRand.nextFloat() * event.target.height)) - d1 * d3, (event.target.posZ + (double) (itemRand.nextFloat() * event.target.width * 2.0F)) - (double) event.target.width - d2 * d3, d, d1, d2);
event.target.worldObj.spawnParticle(
"flame",
(event.target.posX
+ (double
) (itemRand.nextFloat() * event.target.width * 2.0F))
- (double) event.target.width - d * d3,
(event.target.posY
+ (double) (itemRand.nextFloat() * event.target.height))
- d1 * d3,
(event.target.posZ
+ (double
) (itemRand.nextFloat() * event.target.width * 2.0F))
- (double) event.target.width - d2 * d3,
d,
d1,
d2
);
}
}
}
@ -318,92 +381,95 @@ AetherEventHandler {
}
public boolean isGravititeTool(Item stackID) {
return stackID == ItemsAether.gravitite_shovel || stackID == ItemsAether.gravitite_axe || stackID == ItemsAether.gravitite_pickaxe;
return stackID == ItemsAether.gravitite_shovel
|| stackID == ItemsAether.gravitite_axe
|| stackID == ItemsAether.gravitite_pickaxe;
}
@SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent event)
{
if (!event.world.isRemote)
{
public void onWorldTick(TickEvent.WorldTickEvent event) {
if (!event.world.isRemote) {
AetherData data = AetherData.getInstance(event.world);
WorldProvider provider = event.world.provider;
if (provider instanceof AetherWorldProvider)
{
if (provider instanceof AetherWorldProvider) {
AetherWorldProvider providerAether = (AetherWorldProvider) provider;
providerAether.setIsEternalDay(data.isEternalDay());
AetherNetwork.sendToAll(new PacketSendEternalDay(providerAether.getIsEternalDay()));
AetherNetwork.sendToAll(
new PacketSendEternalDay(providerAether.getIsEternalDay())
);
providerAether.setShouldCycleCatchup(data.isShouldCycleCatchup());
AetherNetwork.sendToAll(new PacketSendShouldCycle(providerAether.getShouldCycleCatchup()));
AetherNetwork.sendToAll(
new PacketSendShouldCycle(providerAether.getShouldCycleCatchup())
);
}
}
for (Object entity : event.world.loadedEntityList)
{
if (entity instanceof EntityItem)
{
for (Object entity : event.world.loadedEntityList) {
if (entity instanceof EntityItem) {
EntityItem entityItem = (EntityItem) entity;
if (entityItem.getEntityItem().getItem() == ItemsAether.dungeon_key)
{
ObfuscationReflectionHelper.setPrivateValue(Entity.class, entityItem, true, "invulnerable", "field_83001_bt");
if (entityItem.getEntityItem().getItem() == ItemsAether.dungeon_key) {
ObfuscationReflectionHelper.setPrivateValue(
Entity.class, entityItem, true, "invulnerable", "field_83001_bt"
);
}
}
}
}
@SubscribeEvent
public void onPlayerSleepInBed(PlayerWakeUpEvent event)
{
public void onPlayerSleepInBed(PlayerWakeUpEvent event) {
final World world = event.entityPlayer.worldObj;
if (!world.isRemote && event.entityPlayer.dimension == AetherConfig.getAetherDimensionID())
{
final MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
if (!world.isRemote
&& event.entityPlayer.dimension == AetherConfig.getAetherDimensionID()) {
final MinecraftServer server
= FMLCommonHandler.instance().getMinecraftServerInstance();
final WorldServer worldServer = server.worldServerForDimension(0);
if (worldServer.playerEntities.size() > 0)
{
if (worldServer.areAllPlayersAsleep())
{
if (worldServer.playerEntities.size() > 0) {
if (worldServer.areAllPlayersAsleep()) {
performTimeSet(event, world, worldServer);
}
}
else
{
} else {
performTimeSet(event, world, worldServer);
}
}
}
@SubscribeEvent
public void onFall(LivingFallEvent event)
{
if (event.entityLiving instanceof EntityPlayer)
{
IPlayerAether playerAether = PlayerAether.get((EntityPlayer) event.entityLiving);
public void onFall(LivingFallEvent event) {
if (event.entityLiving instanceof EntityPlayer) {
IPlayerAether playerAether
= PlayerAether.get((EntityPlayer) event.entityLiving);
if (playerAether.getAccessoryInventory().wearingArmor(new ItemStack(ItemsAether.sentry_boots)) || playerAether.getAccessoryInventory().isWearingGravititeSet() || playerAether.getAccessoryInventory().isWearingValkyrieSet())
{
if (playerAether.getAccessoryInventory().wearingArmor(
new ItemStack(ItemsAether.sentry_boots)
)
|| playerAether.getAccessoryInventory().isWearingGravititeSet()
|| playerAether.getAccessoryInventory().isWearingValkyrieSet()) {
event.setCanceled(true);
}
}
}
private void performTimeSet(PlayerWakeUpEvent event, World world, WorldServer worldServer)
{
if (world.getGameRules().getGameRuleBooleanValue("doDaylightCycle") && event.entityPlayer.isPlayerFullyAsleep())
{
private void
performTimeSet(PlayerWakeUpEvent event, World world, WorldServer worldServer) {
if (world.getGameRules().getGameRuleBooleanValue("doDaylightCycle")
&& event.entityPlayer.isPlayerFullyAsleep()) {
final long i = worldServer.getWorldInfo().getWorldTime() + 24000L;
worldServer.getWorldInfo().setWorldTime(i - i % 24000L);
PlayerAether.get(event.entityPlayer).setBedLocation(event.entityPlayer.getBedLocation(AetherConfig.getAetherDimensionID()));
PlayerAether.get(event.entityPlayer)
.setBedLocation(
event.entityPlayer.getBedLocation(AetherConfig.getAetherDimensionID())
);
}
}
}

View file

@ -1,28 +1,21 @@
package com.gildedgames.the_aether;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.FMLCommonHandler;
public class CommonProxy {
public static int berryBushRenderID;
public static int treasureChestRenderID;
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() {
return null;
@ -32,5 +25,4 @@ public class CommonProxy {
FMLCommonHandler.instance().bus().register(event);
MinecraftForge.EVENT_BUS.register(event);
}
}

View file

@ -12,121 +12,187 @@ import com.gildedgames.the_aether.api.freezables.AetherFreezable;
import com.gildedgames.the_aether.api.freezables.AetherFreezableFuel;
import com.gildedgames.the_aether.api.moa.AetherMoaType;
import com.gildedgames.the_aether.api.player.IPlayerAether;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
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();
public static final IPlayerAether get(EntityPlayer playerIn) {
return (IPlayerAether) playerIn.getExtendedProperties("aether_legacy:player_aether");
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()));
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;
}
public AetherEnchantment register(AetherEnchantment type) {
ItemStack stack = type.getInput();
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
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;
}
public AetherEnchantmentFuel register(AetherEnchantmentFuel type) {
ItemStack stack = type.getFuelStack();
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
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;
}
public AetherFreezable register(AetherFreezable type) {
ItemStack stack = type.getInput();
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
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;
}
public AetherFreezableFuel register(AetherFreezableFuel type) {
ItemStack stack = type.getFuelStack();
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
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;
}
public AetherMoaType register(String modId, String name, AetherMoaType type) {
iMoaTypeRegistry.put(new ResourceLocation(modId, name), (AetherMoaType) type.setRegistryName(modId, name));
iMoaTypeRegistry.put(
new ResourceLocation(modId, name),
(AetherMoaType) type.setRegistryName(modId, name)
);
return type;
}
public AetherMoaType register(ResourceLocation registryName, AetherMoaType type) {
iMoaTypeRegistry.put(registryName, (AetherMoaType) type.setRegistryName(registryName));
iMoaTypeRegistry.put(
registryName, (AetherMoaType) type.setRegistryName(registryName)
);
return type;
}
public boolean isAccessory(ItemStack stack) {
return iAccessoryRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
return iAccessoryRegistry.containsKey(new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
));
}
public AetherAccessory getAccessory(ItemStack stack) {
return iAccessoryRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
return iAccessoryRegistry.get(new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
));
}
public boolean hasEnchantment(ItemStack stack) {
return iEnchantmentRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
return iEnchantmentRegistry.containsKey(new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
));
}
public AetherEnchantment getEnchantment(ItemStack stack) {
return iEnchantmentRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
return iEnchantmentRegistry.get(new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
));
}
public boolean isEnchantmentFuel(ItemStack stack) {
return iEnchantmentFuelRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
return iEnchantmentFuelRegistry.containsKey(new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
));
}
public AetherEnchantmentFuel getEnchantmentFuel(ItemStack stack) {
return iEnchantmentFuelRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
return iEnchantmentFuelRegistry.get(new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
));
}
public boolean hasFreezable(ItemStack stack) {
return iFreezableRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
return iFreezableRegistry.containsKey(new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
));
}
public AetherFreezable getFreezable(ItemStack stack) {
return iFreezableRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
return iFreezableRegistry.get(new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
));
}
public boolean isFreezableFuel(ItemStack stack) {
return iFreezableFuelRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
return iFreezableFuelRegistry.containsKey(new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
));
}
public AetherFreezableFuel getFreezableFuel(ItemStack stack) {
return iFreezableFuelRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
return iFreezableFuelRegistry.get(new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
));
}
public List<AetherEnchantment> getEnchantmentValues() {
@ -160,5 +226,4 @@ public class AetherAPI {
public static AetherAPI instance() {
return instance;
}
}

View file

@ -3,7 +3,6 @@ package com.gildedgames.the_aether.api;
import net.minecraft.util.ResourceLocation;
public class RegistryEntry {
private ResourceLocation location;
public RegistryEntry setRegistryName(String modid, String location) {
@ -27,5 +26,4 @@ public class RegistryEntry {
public ResourceLocation getRegistryName() {
return this.location;
}
}

View file

@ -47,7 +47,5 @@ public enum AccessoryType {
identityMap.func_148746_a(EXTRA_MISC, 7);
return identityMap;
}
}

View file

@ -1,13 +1,11 @@
package com.gildedgames.the_aether.api.accessories;
import com.gildedgames.the_aether.api.RegistryEntry;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class AetherAccessory extends RegistryEntry {
private ItemStack accessoryStack;
private AccessoryType accessoryType;
@ -25,9 +23,14 @@ public class AetherAccessory extends RegistryEntry {
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;
this.extraType = type == AccessoryType.RING ? AccessoryType.EXTRA_RING
: type == AccessoryType.MISC ? AccessoryType.EXTRA_MISC
: null;
this.setRegistryName(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
this.setRegistryName(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
);
}
public AccessoryType getAccessoryType() {

View file

@ -1,13 +1,11 @@
package com.gildedgames.the_aether.api.enchantments;
import com.gildedgames.the_aether.api.RegistryEntry;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class AetherEnchantment extends RegistryEntry {
public int timeRequired;
public ItemStack input, output;
@ -53,7 +51,10 @@ public class AetherEnchantment extends RegistryEntry {
this.output = output;
this.timeRequired = timeRequired;
this.setRegistryName(input.getItem().getUnlocalizedName().toString() + "_meta_" + (input.isItemStackDamageable() ? 0 : input.getItemDamage()));
this.setRegistryName(
input.getItem().getUnlocalizedName().toString() + "_meta_"
+ (input.isItemStackDamageable() ? 0 : input.getItemDamage())
);
}
public int getTimeRequired() {
@ -73,13 +74,18 @@ public class AetherEnchantment extends RegistryEntry {
if (obj instanceof AetherEnchantment) {
AetherEnchantment freezable = (AetherEnchantment) obj;
boolean inputCheck = this.getInput().getItem() == freezable.getInput().getItem() && this.getInput().getItemDamage() == freezable.getInput().getItemDamage();
boolean outputCheck = this.getOutput().getItem() == freezable.getOutput().getItem() && this.getOutput().getItemDamage() == freezable.getOutput().getItemDamage();
boolean inputCheck
= this.getInput().getItem() == freezable.getInput().getItem()
&& this.getInput().getItemDamage()
== freezable.getInput().getItemDamage();
boolean outputCheck
= this.getOutput().getItem() == freezable.getOutput().getItem()
&& this.getOutput().getItemDamage()
== freezable.getOutput().getItemDamage();
return inputCheck && outputCheck;
}
return false;
}
}

View file

@ -1,13 +1,11 @@
package com.gildedgames.the_aether.api.enchantments;
import com.gildedgames.the_aether.api.RegistryEntry;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class AetherEnchantmentFuel extends RegistryEntry {
public int timeGiven;
public ItemStack fuelStack;
@ -24,7 +22,10 @@ public class AetherEnchantmentFuel extends RegistryEntry {
this.timeGiven = timeGiven;
this.fuelStack = fuelStack;
this.setRegistryName(fuelStack.getItem().getUnlocalizedName().toString() + "_meta_" + (fuelStack.isItemStackDamageable() ? 0 : fuelStack.getItemDamage()));
this.setRegistryName(
fuelStack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (fuelStack.isItemStackDamageable() ? 0 : fuelStack.getItemDamage())
);
}
public int getTimeGiven() {
@ -40,10 +41,11 @@ public class AetherEnchantmentFuel extends RegistryEntry {
if (obj instanceof AetherEnchantmentFuel) {
AetherEnchantmentFuel fuel = (AetherEnchantmentFuel) obj;
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem() && this.getFuelStack().getItemDamage() == fuel.getFuelStack().getItemDamage();
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem()
&& this.getFuelStack().getItemDamage()
== fuel.getFuelStack().getItemDamage();
}
return false;
}
}

View file

@ -1,10 +1,5 @@
package com.gildedgames.the_aether.api.events;
import com.gildedgames.the_aether.api.moa.AetherMoaType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.MinecraftForge;
import com.gildedgames.the_aether.api.accessories.AetherAccessory;
import com.gildedgames.the_aether.api.enchantments.AetherEnchantment;
import com.gildedgames.the_aether.api.events.accessories.ValidAccessoryEvent;
@ -12,13 +7,18 @@ import com.gildedgames.the_aether.api.events.enchantments.AetherEnchantmentEvent
import com.gildedgames.the_aether.api.events.freezables.AetherFreezableEvent;
import com.gildedgames.the_aether.api.events.moas.MoaHatchEvent;
import com.gildedgames.the_aether.api.freezables.AetherFreezable;
import com.gildedgames.the_aether.api.moa.AetherMoaType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.MinecraftForge;
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();
}
@ -29,30 +29,40 @@ public class AetherHooks {
MinecraftForge.EVENT_BUS.post(event);
}
public static void onItemEnchant(TileEntity enchanter, AetherEnchantment enchantment) {
AetherEnchantmentEvent.EnchantEvent event = new AetherEnchantmentEvent.EnchantEvent(enchanter, 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) {
AetherFreezableEvent.FreezeEvent event = new AetherFreezableEvent.FreezeEvent(freezer, freezable);
AetherFreezableEvent.FreezeEvent event
= new AetherFreezableEvent.FreezeEvent(freezer, freezable);
MinecraftForge.EVENT_BUS.post(event);
}
public static int onSetEnchantmentTime(TileEntity enchanter, AetherEnchantment enchantment, int original) {
AetherEnchantmentEvent.SetTimeEvent event = new AetherEnchantmentEvent.SetTimeEvent(enchanter, enchantment, 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;
if (MinecraftForge.EVENT_BUS.post(event))
return original;
return event.getNewTime();
}
public static int onSetFreezableTime(TileEntity freezer, AetherFreezable freezable, int original) {
AetherFreezableEvent.SetTimeEvent event = new AetherFreezableEvent.SetTimeEvent(freezer, freezable, 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;
if (MinecraftForge.EVENT_BUS.post(event))
return original;
return event.getNewTime();
}

View file

@ -1,11 +1,9 @@
package com.gildedgames.the_aether.api.events.accessories;
import com.gildedgames.the_aether.api.accessories.AetherAccessory;
import cpw.mods.fml.common.eventhandler.Event;
public class AetherAccessoryEvent extends Event {
private AetherAccessory accessory;
public AetherAccessoryEvent(AetherAccessory accessory) {
@ -15,5 +13,4 @@ public class AetherAccessoryEvent extends Event {
public AetherAccessory getAetherAccessory() {
return this.accessory;
}
}

View file

@ -1,16 +1,12 @@
package com.gildedgames.the_aether.api.events.accessories;
import net.minecraft.entity.player.EntityPlayer;
import com.gildedgames.the_aether.api.accessories.AetherAccessory;
import cpw.mods.fml.common.eventhandler.Cancelable;
import net.minecraft.entity.player.EntityPlayer;
@Cancelable
public class ValidAccessoryEvent extends AetherAccessoryEvent {
public ValidAccessoryEvent(EntityPlayer player, AetherAccessory accessory) {
super(accessory);
}
}

View file

@ -1,16 +1,11 @@
package com.gildedgames.the_aether.api.events.enchantments;
import com.gildedgames.the_aether.api.enchantments.AetherEnchantment;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraft.tileentity.TileEntity;
import com.gildedgames.the_aether.api.enchantments.AetherEnchantment;
import cpw.mods.fml.common.eventhandler.Event;
public class AetherEnchantmentEvent extends Event {
public AetherEnchantmentEvent() {
}
public AetherEnchantmentEvent() {}
public static class SetTimeEvent extends AetherEnchantmentEvent {
private TileEntity tileEntity;
@ -21,7 +16,9 @@ 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;
@ -68,5 +65,4 @@ public class AetherEnchantmentEvent extends Event {
return this.enchantent;
}
}
}

View file

@ -1,16 +1,11 @@
package com.gildedgames.the_aether.api.events.freezables;
import com.gildedgames.the_aether.api.freezables.AetherFreezable;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraft.tileentity.TileEntity;
import com.gildedgames.the_aether.api.freezables.AetherFreezable;
import cpw.mods.fml.common.eventhandler.Event;
public class AetherFreezableEvent extends Event {
public AetherFreezableEvent() {
}
public AetherFreezableEvent() {}
public static class SetTimeEvent extends AetherFreezableEvent {
private TileEntity tileEntity;
@ -21,7 +16,9 @@ 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;
@ -68,5 +65,4 @@ public class AetherFreezableEvent extends Event {
return this.freezable;
}
}
}

View file

@ -1,11 +1,9 @@
package com.gildedgames.the_aether.api.events.moas;
import com.gildedgames.the_aether.api.moa.AetherMoaType;
import cpw.mods.fml.common.eventhandler.Event;
public class MoaEvent extends Event {
private AetherMoaType moaType;
public MoaEvent(AetherMoaType moaType) {
@ -15,5 +13,4 @@ public class MoaEvent extends Event {
public AetherMoaType getMoaType() {
return this.moaType;
}
}

View file

@ -4,7 +4,6 @@ import com.gildedgames.the_aether.api.moa.AetherMoaType;
import net.minecraft.tileentity.TileEntity;
public class MoaHatchEvent extends MoaEvent {
private TileEntity incubator;
public MoaHatchEvent(AetherMoaType moaType, TileEntity incubator) {
@ -16,5 +15,4 @@ public class MoaHatchEvent extends MoaEvent {
public TileEntity getTileEntity() {
return this.incubator;
}
}

View file

@ -1,13 +1,11 @@
package com.gildedgames.the_aether.api.freezables;
import com.gildedgames.the_aether.api.RegistryEntry;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class AetherFreezable extends RegistryEntry {
public int timeRequired;
public ItemStack input, output;
@ -49,7 +47,10 @@ public class AetherFreezable extends RegistryEntry {
this.output = output;
this.timeRequired = timeRequired;
this.setRegistryName(input.getItem().getUnlocalizedName().toString() + "_meta_" + (input.isItemStackDamageable() ? 0 : input.getItemDamage()));
this.setRegistryName(
input.getItem().getUnlocalizedName().toString() + "_meta_"
+ (input.isItemStackDamageable() ? 0 : input.getItemDamage())
);
}
public int getTimeRequired() {
@ -69,13 +70,18 @@ public class AetherFreezable extends RegistryEntry {
if (obj instanceof AetherFreezable) {
AetherFreezable freezable = (AetherFreezable) obj;
boolean inputCheck = this.getInput().getItem() == freezable.getInput().getItem() && this.getInput().getItemDamage() == freezable.getInput().getItemDamage();
boolean outputCheck = this.getOutput().getItem() == freezable.getOutput().getItem() && this.getOutput().getItemDamage() == freezable.getOutput().getItemDamage();
boolean inputCheck
= this.getInput().getItem() == freezable.getInput().getItem()
&& this.getInput().getItemDamage()
== freezable.getInput().getItemDamage();
boolean outputCheck
= this.getOutput().getItem() == freezable.getOutput().getItem()
&& this.getOutput().getItemDamage()
== freezable.getOutput().getItemDamage();
return inputCheck && outputCheck;
}
return false;
}
}

View file

@ -6,7 +6,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class AetherFreezableFuel extends RegistryEntry {
public int timeGiven;
public ItemStack fuelStack;
@ -23,7 +22,10 @@ public class AetherFreezableFuel extends RegistryEntry {
this.timeGiven = timeGiven;
this.fuelStack = fuelStack;
this.setRegistryName(fuelStack.getItem().getUnlocalizedName().toString() + "_meta_" + (fuelStack.isItemStackDamageable() ? 0 : fuelStack.getItemDamage()));
this.setRegistryName(
fuelStack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (fuelStack.isItemStackDamageable() ? 0 : fuelStack.getItemDamage())
);
}
public int getTimeGiven() {
@ -39,10 +41,11 @@ public class AetherFreezableFuel extends RegistryEntry {
if (obj instanceof AetherFreezableFuel) {
AetherFreezableFuel fuel = (AetherFreezableFuel) obj;
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem() && this.getFuelStack().getItemDamage() == fuel.getFuelStack().getItemDamage();
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem()
&& this.getFuelStack().getItemDamage()
== fuel.getFuelStack().getItemDamage();
}
return false;
}
}

View file

@ -1,12 +1,10 @@
package com.gildedgames.the_aether.api.moa;
import com.gildedgames.the_aether.api.RegistryEntry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.ResourceLocation;
public class AetherMoaType extends RegistryEntry {
private MoaProperties properties;
public int hexColor;
@ -20,7 +18,9 @@ public class AetherMoaType extends RegistryEntry {
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;
@ -31,7 +31,11 @@ public class AetherMoaType extends RegistryEntry {
return this.properties.getCustomTexture(saddled, isBeingRidden);
}
return new ResourceLocation("aether_legacy", "textures/entities/moa/" + ("moa_") + this.getRegistryName().getResourcePath().toLowerCase() + ".png");
return new ResourceLocation(
"aether_legacy",
"textures/entities/moa/" + ("moa_")
+ this.getRegistryName().getResourcePath().toLowerCase() + ".png"
);
}
public MoaProperties getMoaProperties() {
@ -45,5 +49,4 @@ public class AetherMoaType extends RegistryEntry {
public int getMoaEggColor() {
return this.hexColor;
}
}

View file

@ -3,7 +3,6 @@ package com.gildedgames.the_aether.api.moa;
import net.minecraft.util.ResourceLocation;
public class MoaProperties {
private int maxJumps;
private float moaSpeed;
@ -36,5 +35,4 @@ public class MoaProperties {
public ResourceLocation getCustomTexture(boolean isSaddled, boolean isBeingRidden) {
return this.location;
}
}

View file

@ -2,15 +2,13 @@ package com.gildedgames.the_aether.api.player;
import java.util.ArrayList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.common.IExtendedEntityProperties;
import com.gildedgames.the_aether.api.player.util.IAccessoryInventory;
import com.gildedgames.the_aether.api.player.util.IAetherAbility;
import com.gildedgames.the_aether.api.player.util.IAetherBoss;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.common.IExtendedEntityProperties;
public interface IPlayerAether extends IExtendedEntityProperties {
public void onUpdate();
public void setInPortal();
@ -50,5 +48,4 @@ public interface IPlayerAether extends IExtendedEntityProperties {
public int getMaxShardCount();
public boolean isDonator();
}

View file

@ -1,18 +1,15 @@
package com.gildedgames.the_aether.api.player.util;
import io.netty.buffer.ByteBuf;
import java.util.List;
import com.gildedgames.the_aether.api.accessories.AccessoryType;
import io.netty.buffer.ByteBuf;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import com.gildedgames.the_aether.api.accessories.AccessoryType;
public interface IAccessoryInventory extends IInventory {
public void dropAccessories();
public void damageAccessory(int damage, AccessoryType type);
@ -54,5 +51,4 @@ public interface IAccessoryInventory extends IInventory {
public List<ItemStack> getAccessories();
public int getAccessoryCount(ItemStack stack);
}

View file

@ -1,9 +1,7 @@
package com.gildedgames.the_aether.api.player.util;
public interface IAetherAbility {
public void onUpdate();
public boolean shouldExecute();
}

View file

@ -1,11 +1,9 @@
package com.gildedgames.the_aether.api.player.util;
public interface IAetherBoss {
public String getBossName();
public float getBossHealth();
public float getMaxBossHealth();
}

View file

@ -4,11 +4,9 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class BlockAether extends Block {
public BlockAether(Material material, String texture) {
super(material);
this.setBlockTextureName(texture);
}
}

View file

@ -2,15 +2,13 @@ package com.gildedgames.the_aether.blocks;
import java.util.Random;
import com.gildedgames.the_aether.blocks.natural.BlockAetherFlower;
import net.minecraft.block.IGrowable;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import com.gildedgames.the_aether.blocks.natural.BlockAetherFlower;
public class BlockAetherSapling extends BlockAetherFlower implements IGrowable {
public WorldGenerator treeGenObject = null;
public BlockAetherSapling(WorldGenerator treeGen) {
@ -55,7 +53,5 @@ public class BlockAetherSapling extends BlockAetherFlower implements IGrowable {
if (worldIn.rand.nextFloat() < 0.45D) {
this.growTree(worldIn, x, y, z, rand);
}
}
}

View file

@ -6,7 +6,6 @@ import net.minecraft.init.Blocks;
import net.minecraft.world.World;
public class BlockIcestone extends Block {
public BlockIcestone() {
super(Material.ice);
@ -33,5 +32,4 @@ public class BlockIcestone extends Block {
}
}
}
}

View file

@ -1,5 +1,8 @@
package com.gildedgames.the_aether.blocks;
import java.util.Iterator;
import java.util.Random;
import com.gildedgames.the_aether.AetherConfig;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.player.PlayerAether;
@ -18,12 +21,9 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import java.util.Iterator;
import java.util.Random;
public class BlockSkyrootBed extends BlockBed
{
public static final int[][] field_149981_a = new int[][] {{0, 1}, { -1, 0}, {0, -1}, {1, 0}};
public class BlockSkyrootBed extends BlockBed {
public static final int[][] field_149981_a
= new int[][] { { 0, 1 }, { -1, 0 }, { 0, -1 }, { 1, 0 } };
@SideOnly(Side.CLIENT)
private IIcon[] field_149980_b;
@SideOnly(Side.CLIENT)
@ -31,116 +31,138 @@ public class BlockSkyrootBed extends BlockBed
@SideOnly(Side.CLIENT)
private IIcon[] field_149983_N;
public BlockSkyrootBed()
{
public BlockSkyrootBed() {
super();
this.func_149978_e();
this.disableStats();
}
@Override
public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
{
if (p_149727_1_.isRemote)
{
public boolean onBlockActivated(
World p_149727_1_,
int p_149727_2_,
int p_149727_3_,
int p_149727_4_,
EntityPlayer p_149727_5_,
int p_149727_6_,
float p_149727_7_,
float p_149727_8_,
float p_149727_9_
) {
if (p_149727_1_.isRemote) {
return true;
}
else
{
} else {
int i1 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_);
if (!isBlockHeadOfBed(i1))
{
if (!isBlockHeadOfBed(i1)) {
int j1 = getDirection(i1);
p_149727_2_ += field_149981_a[j1][0];
p_149727_4_ += field_149981_a[j1][1];
if (p_149727_1_.getBlock(p_149727_2_, p_149727_3_, p_149727_4_) != this)
{
if (p_149727_1_.getBlock(p_149727_2_, p_149727_3_, p_149727_4_) != this) {
return true;
}
i1 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_);
}
if (p_149727_5_.dimension == AetherConfig.getAetherDimensionID() || p_149727_5_.dimension == 0)
{
if (func_149976_c(i1))
{
if (p_149727_5_.dimension == AetherConfig.getAetherDimensionID()
|| p_149727_5_.dimension == 0) {
if (func_149976_c(i1)) {
EntityPlayer entityplayer1 = null;
Iterator iterator = p_149727_1_.playerEntities.iterator();
while (iterator.hasNext())
{
EntityPlayer entityplayer2 = (EntityPlayer)iterator.next();
while (iterator.hasNext()) {
EntityPlayer entityplayer2 = (EntityPlayer) iterator.next();
if (entityplayer2.isPlayerSleeping())
{
ChunkCoordinates chunkcoordinates = entityplayer2.playerLocation;
if (entityplayer2.isPlayerSleeping()) {
ChunkCoordinates chunkcoordinates
= entityplayer2.playerLocation;
if (chunkcoordinates.posX == p_149727_2_ && chunkcoordinates.posY == p_149727_3_ && chunkcoordinates.posZ == p_149727_4_)
{
if (chunkcoordinates.posX == p_149727_2_
&& chunkcoordinates.posY == p_149727_3_
&& chunkcoordinates.posZ == p_149727_4_) {
entityplayer1 = entityplayer2;
}
}
}
if (entityplayer1 != null)
{
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.occupied", new Object[0]));
if (entityplayer1 != null) {
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation(
"tile.bed.occupied", new Object[0]
));
return true;
}
func_149979_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, false);
func_149979_a(
p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, false
);
}
EntityPlayer.EnumStatus enumstatus = p_149727_5_.sleepInBedAt(p_149727_2_, p_149727_3_, p_149727_4_);
EntityPlayer.EnumStatus enumstatus
= p_149727_5_.sleepInBedAt(p_149727_2_, p_149727_3_, p_149727_4_);
if (enumstatus == EntityPlayer.EnumStatus.OK)
{
func_149979_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, true);
if (enumstatus == EntityPlayer.EnumStatus.OK) {
func_149979_a(
p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, true
);
return true;
}
else
{
if (enumstatus == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW)
{
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.noSleep", new Object[0]));
} else {
if (enumstatus == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW) {
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation(
"tile.bed.noSleep", new Object[0]
));
if (p_149727_5_.dimension == AetherConfig.getAetherDimensionID())
{
p_149727_5_.addChatMessage(new ChatComponentTranslation("gui.skyroot_bed.respawn_point"));
p_149727_5_.setSpawnChunk(new ChunkCoordinates(p_149727_2_, p_149727_3_, p_149727_4_), false, AetherConfig.getAetherDimensionID());
PlayerAether.get(p_149727_5_).setBedLocation(new ChunkCoordinates(p_149727_2_, p_149727_3_, p_149727_4_));
if (p_149727_5_.dimension
== AetherConfig.getAetherDimensionID()) {
p_149727_5_.addChatMessage(new ChatComponentTranslation(
"gui.skyroot_bed.respawn_point"
));
p_149727_5_.setSpawnChunk(
new ChunkCoordinates(
p_149727_2_, p_149727_3_, p_149727_4_
),
false,
AetherConfig.getAetherDimensionID()
);
PlayerAether.get(p_149727_5_)
.setBedLocation(new ChunkCoordinates(
p_149727_2_, p_149727_3_, p_149727_4_
));
}
}
else if (enumstatus == EntityPlayer.EnumStatus.NOT_SAFE)
{
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.notSafe", new Object[0]));
} else if (enumstatus == EntityPlayer.EnumStatus.NOT_SAFE) {
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation(
"tile.bed.notSafe", new Object[0]
));
}
return true;
}
}
else
{
double d2 = (double)p_149727_2_ + 0.5D;
double d0 = (double)p_149727_3_ + 0.5D;
double d1 = (double)p_149727_4_ + 0.5D;
} else {
double d2 = (double) p_149727_2_ + 0.5D;
double d0 = (double) p_149727_3_ + 0.5D;
double d1 = (double) p_149727_4_ + 0.5D;
p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_);
int k1 = getDirection(i1);
p_149727_2_ += field_149981_a[k1][0];
p_149727_4_ += field_149981_a[k1][1];
if (p_149727_1_.getBlock(p_149727_2_, p_149727_3_, p_149727_4_) == this)
{
if (p_149727_1_.getBlock(p_149727_2_, p_149727_3_, p_149727_4_) == this) {
p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_);
d2 = (d2 + (double)p_149727_2_ + 0.5D) / 2.0D;
d0 = (d0 + (double)p_149727_3_ + 0.5D) / 2.0D;
d1 = (d1 + (double)p_149727_4_ + 0.5D) / 2.0D;
d2 = (d2 + (double) p_149727_2_ + 0.5D) / 2.0D;
d0 = (d0 + (double) p_149727_3_ + 0.5D) / 2.0D;
d1 = (d1 + (double) p_149727_4_ + 0.5D) / 2.0D;
}
p_149727_1_.newExplosion((Entity)null, (double)((float)p_149727_2_ + 0.5F), (double)((float)p_149727_3_ + 0.5F), (double)((float)p_149727_4_ + 0.5F), 5.0F, true, true);
p_149727_1_.newExplosion(
(Entity) null,
(double) ((float) p_149727_2_ + 0.5F),
(double) ((float) p_149727_3_ + 0.5F),
(double) ((float) p_149727_4_ + 0.5F),
5.0F,
true,
true
);
return true;
}
}
@ -148,55 +170,59 @@ public class BlockSkyrootBed extends BlockBed
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_)
{
if (p_149691_1_ == 0)
{
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
if (p_149691_1_ == 0) {
return BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
}
else
{
} else {
int k = getDirection(p_149691_2_);
int l = Direction.bedDirection[k][p_149691_1_];
int i1 = isBlockHeadOfBed(p_149691_2_) ? 1 : 0;
return (i1 != 1 || l != 2) && (i1 != 0 || l != 3) ? (l != 5 && l != 4 ? this.field_149983_N[i1] : this.field_149982_M[i1]) : this.field_149980_b[i1];
return (i1 != 1 || l != 2) && (i1 != 0 || l != 3)
? (l != 5 && l != 4 ? this.field_149983_N[i1] : this.field_149982_M[i1])
: this.field_149980_b[i1];
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_)
{
this.field_149983_N = new IIcon[] {p_149651_1_.registerIcon(this.getTextureName() + "_feet_top"), p_149651_1_.registerIcon(this.getTextureName() + "_head_top")};
this.field_149980_b = new IIcon[] {p_149651_1_.registerIcon(this.getTextureName() + "_feet_end"), p_149651_1_.registerIcon(this.getTextureName() + "_head_end")};
this.field_149982_M = new IIcon[] {p_149651_1_.registerIcon(this.getTextureName() + "_feet_side"), p_149651_1_.registerIcon(this.getTextureName() + "_head_side")};
public void registerBlockIcons(IIconRegister p_149651_1_) {
this.field_149983_N = new IIcon[] {
p_149651_1_.registerIcon(this.getTextureName() + "_feet_top"),
p_149651_1_.registerIcon(this.getTextureName() + "_head_top")
};
this.field_149980_b = new IIcon[] {
p_149651_1_.registerIcon(this.getTextureName() + "_feet_end"),
p_149651_1_.registerIcon(this.getTextureName() + "_head_end")
};
this.field_149982_M = new IIcon[] {
p_149651_1_.registerIcon(this.getTextureName() + "_feet_side"),
p_149651_1_.registerIcon(this.getTextureName() + "_head_side")
};
}
private void func_149978_e()
{
private void func_149978_e() {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F);
}
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return isBlockHeadOfBed(p_149650_1_) ? Item.getItemById(0) : ItemsAether.skyroot_bed_item;
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
return isBlockHeadOfBed(p_149650_1_) ? Item.getItemById(0)
: ItemsAether.skyroot_bed_item;
}
@SideOnly(Side.CLIENT)
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_)
{
public Item
getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
return ItemsAether.skyroot_bed_item;
}
@Override
public boolean isBed(IBlockAccess world, int x, int y, int z, EntityLivingBase player)
{
public boolean
isBed(IBlockAccess world, int x, int y, int z, EntityLivingBase player) {
return true;
}
@Override
public boolean isBedFoot(IBlockAccess world, int x, int y, int z)
{
public boolean isBedFoot(IBlockAccess world, int x, int y, int z) {
return BlockSkyrootBed.isBlockHeadOfBed(world.getBlockMetadata(x, y, z));
}
}

View file

@ -1,18 +1,6 @@
package com.gildedgames.the_aether.blocks;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.items.block.ItemAetherSlab;
import com.gildedgames.the_aether.items.block.ItemBlockEnchanter;
import com.gildedgames.the_aether.items.block.ItemBlockMetadata;
import com.gildedgames.the_aether.items.block.ItemBlockRarity;
import com.gildedgames.the_aether.registry.creative_tabs.AetherCreativeTabs;
import com.gildedgames.the_aether.world.biome.decoration.AetherGenOakTree;
import com.gildedgames.the_aether.world.biome.decoration.AetherGenSkyrootTree;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import com.gildedgames.the_aether.blocks.container.BlockEnchanter;
import com.gildedgames.the_aether.blocks.container.BlockFreezer;
import com.gildedgames.the_aether.blocks.container.BlockIncubator;
@ -48,12 +36,21 @@ import com.gildedgames.the_aether.blocks.natural.BlockHolystone;
import com.gildedgames.the_aether.blocks.natural.BlockQuicksoil;
import com.gildedgames.the_aether.blocks.portal.BlockAetherPortal;
import com.gildedgames.the_aether.blocks.util.BlockFloating;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.items.block.ItemAetherSlab;
import com.gildedgames.the_aether.items.block.ItemBlockEnchanter;
import com.gildedgames.the_aether.items.block.ItemBlockMetadata;
import com.gildedgames.the_aether.items.block.ItemBlockRarity;
import com.gildedgames.the_aether.registry.creative_tabs.AetherCreativeTabs;
import com.gildedgames.the_aether.world.biome.decoration.AetherGenOakTree;
import com.gildedgames.the_aether.world.biome.decoration.AetherGenSkyrootTree;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.item.EnumRarity;
public class BlocksAether {
public static Block aether_grass, enchanted_aether_grass, aether_dirt;
public static Block holystone, mossy_holystone, holystone_brick;
@ -62,7 +59,8 @@ public class BlocksAether {
public static Block ambrosium_ore, zanite_ore, gravitite_ore;
public static Block skyroot_leaves, golden_oak_leaves, skyroot_log, golden_oak_log, skyroot_planks;
public static Block skyroot_leaves, golden_oak_leaves, skyroot_log, golden_oak_log,
skyroot_planks;
public static Block quicksoil_glass, aerogel;
@ -84,7 +82,8 @@ public class BlocksAether {
public static Block locked_carved_stone, locked_angelic_stone, locked_hellfire_stone;
public static Block locked_sentry_stone, locked_light_angelic_stone, locked_light_hellfire_stone;
public static Block locked_sentry_stone, locked_light_angelic_stone,
locked_light_hellfire_stone;
public static Block carved_trap, angelic_trap, hellfire_trap;
@ -98,13 +97,18 @@ public class BlocksAether {
public static Block skyroot_fence, skyroot_fence_gate;
public static Block carved_stairs, angelic_stairs, hellfire_stairs, skyroot_stairs, mossy_holystone_stairs, holystone_stairs, holystone_brick_stairs, aerogel_stairs;
public static Block carved_stairs, angelic_stairs, hellfire_stairs, skyroot_stairs,
mossy_holystone_stairs, holystone_stairs, holystone_brick_stairs, aerogel_stairs;
public static Block carved_slab, angelic_slab, hellfire_slab, skyroot_slab, holystone_slab, holystone_brick_slab, mossy_holystone_slab, aerogel_slab;
public static Block carved_slab, angelic_slab, hellfire_slab, skyroot_slab,
holystone_slab, holystone_brick_slab, mossy_holystone_slab, aerogel_slab;
public static Block carved_double_slab, angelic_double_slab, hellfire_double_slab, skyroot_double_slab, holystone_double_slab, holystone_brick_double_slab, mossy_holystone_double_slab, aerogel_double_slab;
public static Block carved_double_slab, angelic_double_slab, hellfire_double_slab,
skyroot_double_slab, holystone_double_slab, holystone_brick_double_slab,
mossy_holystone_double_slab, aerogel_double_slab;
public static Block holystone_wall, mossy_holystone_wall, holystone_brick_wall, carved_wall, angelic_wall, hellfire_wall, aerogel_wall;
public static Block holystone_wall, mossy_holystone_wall, holystone_brick_wall,
carved_wall, angelic_wall, hellfire_wall, aerogel_wall;
public static Block holiday_leaves, decorated_holiday_leaves, present;
@ -116,101 +120,382 @@ public class BlocksAether {
public static void initialization() {
aether_grass = registerMeta("aether_grass", new BlockAetherGrass());
enchanted_aether_grass = registerRarity("enchanted_aether_grass", new BlockEnchantedAetherGrass(), EnumRarity.rare);
enchanted_aether_grass = registerRarity(
"enchanted_aether_grass", new BlockEnchantedAetherGrass(), EnumRarity.rare
);
aether_dirt = registerMeta("aether_dirt", new BlockAetherDirt());
holystone = registerMeta("holystone", new BlockHolystone());
mossy_holystone = registerMeta("mossy_holystone", new BlockHolystone().setBlockTextureName(Aether.find("mossy_holystone")));
holystone_brick = register("holystone_brick", new BlockAether(Material.rock, Aether.find("holystone_brick")).setHardness(0.5F).setResistance(10.0F));
mossy_holystone = registerMeta(
"mossy_holystone",
new BlockHolystone().setBlockTextureName(Aether.find("mossy_holystone"))
);
holystone_brick = register(
"holystone_brick",
new BlockAether(Material.rock, Aether.find("holystone_brick"))
.setHardness(0.5F)
.setResistance(10.0F)
);
aercloud = registerMeta("aercloud", new BlockAercloud());
aerogel = registerRarity("aerogel", new BlockAerogel(), ItemsAether.aether_loot);
quicksoil = registerMeta("quicksoil", new BlockQuicksoil());
icestone = register("icestone", new BlockIcestone());
ambrosium_ore = register("ambrosium_ore", new BlockAetherOre(0).setBlockTextureName(Aether.find("ambrosium_ore")));
zanite_ore = register("zanite_ore", new BlockAetherOre(1).setBlockTextureName(Aether.find("zanite_ore")));
gravitite_ore = register("gravitite_ore", new BlockFloating(Material.rock, false).setHardness(5.0F).setBlockTextureName(Aether.find("gravitite_ore")));
enchanted_gravitite = registerRarity("enchanted_gravitite", new BlockFloating(Material.rock, true).setHardness(5.0F).setBlockTextureName(Aether.find("enchanted_gravitite")), EnumRarity.rare);
ambrosium_ore = register(
"ambrosium_ore",
new BlockAetherOre(0).setBlockTextureName(Aether.find("ambrosium_ore"))
);
zanite_ore = register(
"zanite_ore",
new BlockAetherOre(1).setBlockTextureName(Aether.find("zanite_ore"))
);
gravitite_ore = register(
"gravitite_ore",
new BlockFloating(Material.rock, false)
.setHardness(5.0F)
.setBlockTextureName(Aether.find("gravitite_ore"))
);
enchanted_gravitite = registerRarity(
"enchanted_gravitite",
new BlockFloating(Material.rock, true)
.setHardness(5.0F)
.setBlockTextureName(Aether.find("enchanted_gravitite")),
EnumRarity.rare
);
zanite_block = register("zanite_block", new BlockZanite());
skyroot_leaves = register("skyroot_leaves", new BlockAetherLeaves().setBlockTextureName(Aether.find("skyroot_leaves")));
golden_oak_leaves = register("golden_oak_leaves", new BlockAetherLeaves().setBlockTextureName(Aether.find("golden_oak_leaves")));
crystal_leaves = register("crystal_leaves", new BlockAetherLeaves().setBlockTextureName(Aether.find("crystal_leaves")));
crystal_fruit_leaves = register("crystal_fruit_leaves", new BlockAetherLeaves().setBlockTextureName(Aether.find("crystal_fruit_leaves")));
holiday_leaves = register("holiday_leaves", new BlockAetherLeaves().setBlockTextureName(Aether.find("holiday_leaves")));
decorated_holiday_leaves = register("decorated_holiday_leaves", new BlockAetherLeaves().setBlockTextureName(Aether.find("decorated_holiday_leaves")));
skyroot_leaves = register(
"skyroot_leaves",
new BlockAetherLeaves().setBlockTextureName(Aether.find("skyroot_leaves"))
);
golden_oak_leaves = register(
"golden_oak_leaves",
new BlockAetherLeaves().setBlockTextureName(Aether.find("golden_oak_leaves"))
);
crystal_leaves = register(
"crystal_leaves",
new BlockAetherLeaves().setBlockTextureName(Aether.find("crystal_leaves"))
);
crystal_fruit_leaves = register(
"crystal_fruit_leaves",
new BlockAetherLeaves().setBlockTextureName(Aether.find("crystal_fruit_leaves"
))
);
holiday_leaves = register(
"holiday_leaves",
new BlockAetherLeaves().setBlockTextureName(Aether.find("holiday_leaves"))
);
decorated_holiday_leaves = register(
"decorated_holiday_leaves",
new BlockAetherLeaves().setBlockTextureName(
Aether.find("decorated_holiday_leaves")
)
);
present = register("present", new BlockPresent());
skyroot_log = registerMeta("skyroot_log", new BlockAetherLog().setBlockTextureName(Aether.find("skyroot_log")));
golden_oak_log = registerMeta("golden_oak_log", new BlockAetherLog().setBlockTextureName(Aether.find("golden_oak_log")));
skyroot_log = registerMeta(
"skyroot_log",
new BlockAetherLog().setBlockTextureName(Aether.find("skyroot_log"))
);
golden_oak_log = registerMeta(
"golden_oak_log",
new BlockAetherLog().setBlockTextureName(Aether.find("golden_oak_log"))
);
skyroot_planks = register("skyroot_planks", new BlockSkyrootPlanks());
quicksoil_glass = registerRarity("quicksoil_glass", new BlockQuicksoilGlass(), EnumRarity.rare);
ambrosium_torch = register("ambrosium_torch", new BlockAmbrosiumTorch().setBlockTextureName(Aether.find("ambrosium_torch")));
quicksoil_glass = registerRarity(
"quicksoil_glass", new BlockQuicksoilGlass(), EnumRarity.rare
);
ambrosium_torch = register(
"ambrosium_torch",
new BlockAmbrosiumTorch().setBlockTextureName(Aether.find("ambrosium_torch"))
);
berry_bush_stem = register("berry_bush_stem", new BlockBerryBushStem());
berry_bush = register("berry_bush", new BlockBerryBush());
purple_flower = register("purple_flower", new BlockAetherFlower().setBlockTextureName(Aether.find("purple_flower")));
white_flower = register("white_flower", new BlockAetherFlower().setBlockTextureName(Aether.find("white_flower")));
skyroot_sapling = register("skyroot_sapling", new BlockAetherSapling(new AetherGenSkyrootTree(false)).setBlockTextureName(Aether.find("skyroot_sapling")));
golden_oak_sapling = register("golden_oak_sapling", new BlockAetherSapling(new AetherGenOakTree()).setBlockTextureName(Aether.find("golden_oak_sapling")));
purple_flower = register(
"purple_flower",
new BlockAetherFlower().setBlockTextureName(Aether.find("purple_flower"))
);
white_flower = register(
"white_flower",
new BlockAetherFlower().setBlockTextureName(Aether.find("white_flower"))
);
skyroot_sapling = register(
"skyroot_sapling",
new BlockAetherSapling(new AetherGenSkyrootTree(false))
.setBlockTextureName(Aether.find("skyroot_sapling"))
);
golden_oak_sapling = register(
"golden_oak_sapling",
new BlockAetherSapling(new AetherGenOakTree())
.setBlockTextureName(Aether.find("golden_oak_sapling"))
);
enchanter = registerEnchanter("enchanter", new BlockEnchanter());
freezer = registerMeta("freezer", new BlockFreezer());
incubator = registerMeta("incubator", new BlockIncubator());
sun_altar = register("sun_altar", new BlockSunAltar());
chest_mimic = register("chest_mimic", new BlockMimicChest());
treasure_chest = register("treasure_chest", new BlockTreasureChest());
aether_portal = register("aether_portal", new BlockAetherPortal()).setCreativeTab(null);
aether_portal
= register("aether_portal", new BlockAetherPortal()).setCreativeTab(null);
pillar = register("pillar", new BlockPillar("pillar_top", "pillar_side"));
pillar_top = register("pillar_top", new BlockPillar("pillar_top", "pillar_carved"));
carved_stone = register("carved_stone", new BlockDungeonBase(false).setBlockTextureName(Aether.find("carved_stone")));
sentry_stone = register("sentry_stone", new BlockDungeonBase(true).setBlockTextureName(Aether.find("sentry_stone")));
angelic_stone = register("angelic_stone", new BlockDungeonBase(false).setBlockTextureName(Aether.find("angelic_stone")));
light_angelic_stone = register("light_angelic_stone", new BlockDungeonBase(true).setBlockTextureName(Aether.find("light_angelic_stone")));
hellfire_stone = register("hellfire_stone", new BlockDungeonBase(false).setBlockTextureName(Aether.find("hellfire_stone")));
light_hellfire_stone = register("light_hellfire_stone", new BlockDungeonBase(true).setBlockTextureName(Aether.find("light_hellfire_stone")));
locked_carved_stone = register("locked_carved_stone", new BlockDungeonBase(carved_stone, false).setBlockTextureName(Aether.find("carved_stone"))).setCreativeTab(null);
locked_sentry_stone = register("locked_sentry_stone", new BlockDungeonBase(sentry_stone, true).setBlockTextureName(Aether.find("sentry_stone"))).setCreativeTab(null);
locked_angelic_stone = register("locked_angelic_stone", new BlockDungeonBase(angelic_stone, false).setBlockTextureName(Aether.find("angelic_stone"))).setCreativeTab(null);
locked_light_angelic_stone = register("locked_light_angelic_stone", new BlockDungeonBase(light_angelic_stone, true).setBlockTextureName(Aether.find("light_angelic_stone"))).setCreativeTab(null);
locked_hellfire_stone = register("locked_hellfire_stone", new BlockDungeonBase(hellfire_stone, false).setBlockTextureName(Aether.find("hellfire_stone"))).setCreativeTab(null);
locked_light_hellfire_stone = register("locked_light_hellfire_stone", new BlockDungeonBase(light_hellfire_stone, true).setBlockTextureName(Aether.find("light_hellfire_stone"))).setCreativeTab(null);
carved_trap = register("carved_trap", new BlockDungeonTrap(carved_stone).setBlockTextureName(Aether.find("carved_stone"))).setCreativeTab(null);
angelic_trap = register("angelic_trap", new BlockDungeonTrap(angelic_stone).setBlockTextureName(Aether.find("angelic_stone"))).setCreativeTab(null);
hellfire_trap = register("hellfire_trap", new BlockDungeonTrap(hellfire_stone).setBlockTextureName(Aether.find("hellfire_stone"))).setCreativeTab(null);
pillar_top
= register("pillar_top", new BlockPillar("pillar_top", "pillar_carved"));
carved_stone = register(
"carved_stone",
new BlockDungeonBase(false).setBlockTextureName(Aether.find("carved_stone"))
);
sentry_stone = register(
"sentry_stone",
new BlockDungeonBase(true).setBlockTextureName(Aether.find("sentry_stone"))
);
angelic_stone = register(
"angelic_stone",
new BlockDungeonBase(false).setBlockTextureName(Aether.find("angelic_stone"))
);
light_angelic_stone = register(
"light_angelic_stone",
new BlockDungeonBase(true).setBlockTextureName(
Aether.find("light_angelic_stone")
)
);
hellfire_stone = register(
"hellfire_stone",
new BlockDungeonBase(false).setBlockTextureName(Aether.find("hellfire_stone"))
);
light_hellfire_stone = register(
"light_hellfire_stone",
new BlockDungeonBase(true).setBlockTextureName(
Aether.find("light_hellfire_stone")
)
);
locked_carved_stone = register(
"locked_carved_stone",
new BlockDungeonBase(carved_stone, false)
.setBlockTextureName(Aether.find("carved_stone"))
)
.setCreativeTab(null);
locked_sentry_stone = register(
"locked_sentry_stone",
new BlockDungeonBase(sentry_stone, true)
.setBlockTextureName(Aether.find("sentry_stone"))
)
.setCreativeTab(null);
locked_angelic_stone = register(
"locked_angelic_stone",
new BlockDungeonBase(angelic_stone, false)
.setBlockTextureName(Aether.find("angelic_stone"))
)
.setCreativeTab(null);
locked_light_angelic_stone
= register(
"locked_light_angelic_stone",
new BlockDungeonBase(light_angelic_stone, true)
.setBlockTextureName(Aether.find("light_angelic_stone"))
)
.setCreativeTab(null);
locked_hellfire_stone
= register(
"locked_hellfire_stone",
new BlockDungeonBase(hellfire_stone, false)
.setBlockTextureName(Aether.find("hellfire_stone"))
)
.setCreativeTab(null);
locked_light_hellfire_stone
= register(
"locked_light_hellfire_stone",
new BlockDungeonBase(light_hellfire_stone, true)
.setBlockTextureName(Aether.find("light_hellfire_stone"))
)
.setCreativeTab(null);
carved_trap = register(
"carved_trap",
new BlockDungeonTrap(carved_stone)
.setBlockTextureName(Aether.find("carved_stone"))
)
.setCreativeTab(null);
angelic_trap = register(
"angelic_trap",
new BlockDungeonTrap(angelic_stone)
.setBlockTextureName(Aether.find("angelic_stone"))
)
.setCreativeTab(null);
hellfire_trap = register(
"hellfire_trap",
new BlockDungeonTrap(hellfire_stone)
.setBlockTextureName(Aether.find("hellfire_stone"))
)
.setCreativeTab(null);
skyroot_fence = register("skyroot_fence", new BlockAetherFence());
skyroot_fence_gate = register("skyroot_fence_gate", new BlockAetherFenceGate());
carved_wall = register("carved_wall", new BlockAetherWall(carved_stone));
angelic_wall = register("angelic_wall", new BlockAetherWall(angelic_stone));
hellfire_wall = register("hellfire_wall", new BlockAetherWall(hellfire_stone));
holystone_wall = register("holystone_wall", new BlockAetherWall(holystone));
holystone_brick_wall = register("holystone_brick_wall", new BlockAetherWall(holystone_brick));
mossy_holystone_wall = register("mossy_holystone_wall", new BlockAetherWall(mossy_holystone));
aerogel_wall = registerRarity("aerogel_wall", new BlockAetherWall(aerogel), ItemsAether.aether_loot);
holystone_brick_wall
= register("holystone_brick_wall", new BlockAetherWall(holystone_brick));
mossy_holystone_wall
= register("mossy_holystone_wall", new BlockAetherWall(mossy_holystone));
aerogel_wall = registerRarity(
"aerogel_wall", new BlockAetherWall(aerogel), ItemsAether.aether_loot
);
carved_stairs = register("carved_stairs", new BlockAetherStairs(carved_stone));
angelic_stairs = register("angelic_stairs", new BlockAetherStairs(angelic_stone));
hellfire_stairs = register("hellfire_stairs", new BlockAetherStairs(hellfire_stone));
skyroot_stairs = register("skyroot_stairs", new BlockAetherStairs(skyroot_planks));
hellfire_stairs
= register("hellfire_stairs", new BlockAetherStairs(hellfire_stone));
skyroot_stairs
= register("skyroot_stairs", new BlockAetherStairs(skyroot_planks));
holystone_stairs = register("holystone_stairs", new BlockAetherStairs(holystone));
holystone_brick_stairs = register("holystone_brick_stairs", new BlockAetherStairs(holystone_brick));
mossy_holystone_stairs = register("mossy_holystone_stairs", new BlockAetherStairs(mossy_holystone));
aerogel_stairs = registerRarity("aerogel_stairs", new BlockAetherStairs(aerogel), ItemsAether.aether_loot);
skyroot_double_slab = register("skyroot_double_slab", new BlockAetherSlab("skyroot_double_slab", true, Material.wood).setBlockTextureName(Aether.find("skyroot_planks")).setHardness(2.0F).setResistance(5.0F)).setCreativeTab(null);
carved_double_slab = register("carved_double_slab", new BlockAetherSlab("carved_double_slab", true, Material.rock).setBlockTextureName(Aether.find("carved_stone")).setHardness(2.0F).setResistance(10.0F)).setCreativeTab(null);
angelic_double_slab = register("angelic_double_slab", new BlockAetherSlab("angelic_double_slab", true, Material.rock).setBlockTextureName(Aether.find("angelic_stone")).setHardness(2.0F).setResistance(10.0F)).setCreativeTab(null);
hellfire_double_slab = register("hellfire_double_slab", new BlockAetherSlab("hellfire_double_slab", true, Material.rock).setBlockTextureName(Aether.find("hellfire_stone")).setHardness(2.0F).setResistance(10.0F)).setCreativeTab(null);
holystone_double_slab = register("holystone_double_slab", new BlockAetherSlab("holystone_double_slab", true, Material.rock).setBlockTextureName(Aether.find("holystone")).setHardness(2.0F).setResistance(10.0F)).setCreativeTab(null);
mossy_holystone_double_slab = register("mossy_holystone_double_slab", new BlockAetherSlab("mossy_holystone_double_slab", true, Material.rock).setBlockTextureName(Aether.find("mossy_holystone")).setHardness(2.0F).setResistance(10.0F)).setCreativeTab(null);
holystone_brick_double_slab = register("holystone_brick_double_slab", new BlockAetherSlab("holystone_brick_double_slab", true, Material.rock).setBlockTextureName(Aether.find("holystone_brick")).setHardness(2.0F).setResistance(10.0F)).setCreativeTab(null);
aerogel_double_slab = register("aerogel_double_slab", new BlockAetherSlab("aerogel_double_slab", true, Material.rock).setBlockTextureName(Aether.find("aerogel")).setHardness(2.0F).setResistance(2000F).setLightOpacity(3).setStepSound(Block.soundTypeMetal)).setCreativeTab(null);
skyroot_slab = registerSlab("skyroot_slab", new BlockAetherSlab("skyroot_slab", false, Material.wood).setBlockTextureName(Aether.find("skyroot_planks")).setHardness(2.0F).setResistance(5.0F), skyroot_double_slab);
carved_slab = registerSlab("carved_slab", new BlockAetherSlab("carved_slab", false, Material.rock).setBlockTextureName(Aether.find("carved_stone")).setHardness(0.5F).setResistance(10.0F), carved_double_slab);
angelic_slab = registerSlab("angelic_slab", new BlockAetherSlab("angelic_slab", false, Material.rock).setBlockTextureName(Aether.find("angelic_stone")).setHardness(0.5F).setResistance(10.0F), angelic_double_slab);
hellfire_slab = registerSlab("hellfire_slab", new BlockAetherSlab("hellfire_slab", false, Material.rock).setBlockTextureName(Aether.find("hellfire_stone")).setHardness(0.5F).setResistance(10.0F), hellfire_double_slab);
holystone_slab = registerSlab("holystone_slab", new BlockAetherSlab("holystone_slab", false, Material.rock).setBlockTextureName(Aether.find("holystone")).setHardness(0.5F).setResistance(10.0F), holystone_double_slab);
mossy_holystone_slab = registerSlab("mossy_holystone_slab", new BlockAetherSlab("mossy_holystone_slab", false, Material.rock).setBlockTextureName(Aether.find("mossy_holystone")).setHardness(0.5F).setResistance(10.0F), mossy_holystone_double_slab);
holystone_brick_slab = registerSlab("holystone_brick_slab", new BlockAetherSlab("holystone_brick_slab", false, Material.rock).setBlockTextureName(Aether.find("holystone_brick")).setHardness(0.5F).setResistance(10.0F), holystone_brick_double_slab);
aerogel_slab = registerSlab("aerogel_slab", new BlockAetherSlab("aerogel_slab", false, Material.rock).setBlockTextureName(Aether.find("aerogel")).setHardness(0.5F).setResistance(2000F).setLightOpacity(3).setStepSound(Block.soundTypeMetal), aerogel_double_slab);
holystone_brick_stairs
= register("holystone_brick_stairs", new BlockAetherStairs(holystone_brick));
mossy_holystone_stairs
= register("mossy_holystone_stairs", new BlockAetherStairs(mossy_holystone));
aerogel_stairs = registerRarity(
"aerogel_stairs", new BlockAetherStairs(aerogel), ItemsAether.aether_loot
);
skyroot_double_slab
= register(
"skyroot_double_slab",
new BlockAetherSlab("skyroot_double_slab", true, Material.wood)
.setBlockTextureName(Aether.find("skyroot_planks"))
.setHardness(2.0F)
.setResistance(5.0F)
)
.setCreativeTab(null);
carved_double_slab
= register(
"carved_double_slab",
new BlockAetherSlab("carved_double_slab", true, Material.rock)
.setBlockTextureName(Aether.find("carved_stone"))
.setHardness(2.0F)
.setResistance(10.0F)
)
.setCreativeTab(null);
angelic_double_slab
= register(
"angelic_double_slab",
new BlockAetherSlab("angelic_double_slab", true, Material.rock)
.setBlockTextureName(Aether.find("angelic_stone"))
.setHardness(2.0F)
.setResistance(10.0F)
)
.setCreativeTab(null);
hellfire_double_slab
= register(
"hellfire_double_slab",
new BlockAetherSlab("hellfire_double_slab", true, Material.rock)
.setBlockTextureName(Aether.find("hellfire_stone"))
.setHardness(2.0F)
.setResistance(10.0F)
)
.setCreativeTab(null);
holystone_double_slab
= register(
"holystone_double_slab",
new BlockAetherSlab("holystone_double_slab", true, Material.rock)
.setBlockTextureName(Aether.find("holystone"))
.setHardness(2.0F)
.setResistance(10.0F)
)
.setCreativeTab(null);
mossy_holystone_double_slab
= register(
"mossy_holystone_double_slab",
new BlockAetherSlab("mossy_holystone_double_slab", true, Material.rock)
.setBlockTextureName(Aether.find("mossy_holystone"))
.setHardness(2.0F)
.setResistance(10.0F)
)
.setCreativeTab(null);
holystone_brick_double_slab
= register(
"holystone_brick_double_slab",
new BlockAetherSlab("holystone_brick_double_slab", true, Material.rock)
.setBlockTextureName(Aether.find("holystone_brick"))
.setHardness(2.0F)
.setResistance(10.0F)
)
.setCreativeTab(null);
aerogel_double_slab
= register(
"aerogel_double_slab",
new BlockAetherSlab("aerogel_double_slab", true, Material.rock)
.setBlockTextureName(Aether.find("aerogel"))
.setHardness(2.0F)
.setResistance(2000F)
.setLightOpacity(3)
.setStepSound(Block.soundTypeMetal)
)
.setCreativeTab(null);
skyroot_slab = registerSlab(
"skyroot_slab",
new BlockAetherSlab("skyroot_slab", false, Material.wood)
.setBlockTextureName(Aether.find("skyroot_planks"))
.setHardness(2.0F)
.setResistance(5.0F),
skyroot_double_slab
);
carved_slab = registerSlab(
"carved_slab",
new BlockAetherSlab("carved_slab", false, Material.rock)
.setBlockTextureName(Aether.find("carved_stone"))
.setHardness(0.5F)
.setResistance(10.0F),
carved_double_slab
);
angelic_slab = registerSlab(
"angelic_slab",
new BlockAetherSlab("angelic_slab", false, Material.rock)
.setBlockTextureName(Aether.find("angelic_stone"))
.setHardness(0.5F)
.setResistance(10.0F),
angelic_double_slab
);
hellfire_slab = registerSlab(
"hellfire_slab",
new BlockAetherSlab("hellfire_slab", false, Material.rock)
.setBlockTextureName(Aether.find("hellfire_stone"))
.setHardness(0.5F)
.setResistance(10.0F),
hellfire_double_slab
);
holystone_slab = registerSlab(
"holystone_slab",
new BlockAetherSlab("holystone_slab", false, Material.rock)
.setBlockTextureName(Aether.find("holystone"))
.setHardness(0.5F)
.setResistance(10.0F),
holystone_double_slab
);
mossy_holystone_slab = registerSlab(
"mossy_holystone_slab",
new BlockAetherSlab("mossy_holystone_slab", false, Material.rock)
.setBlockTextureName(Aether.find("mossy_holystone"))
.setHardness(0.5F)
.setResistance(10.0F),
mossy_holystone_double_slab
);
holystone_brick_slab = registerSlab(
"holystone_brick_slab",
new BlockAetherSlab("holystone_brick_slab", false, Material.rock)
.setBlockTextureName(Aether.find("holystone_brick"))
.setHardness(0.5F)
.setResistance(10.0F),
holystone_brick_double_slab
);
aerogel_slab = registerSlab(
"aerogel_slab",
new BlockAetherSlab("aerogel_slab", false, Material.rock)
.setBlockTextureName(Aether.find("aerogel"))
.setHardness(0.5F)
.setResistance(2000F)
.setLightOpacity(3)
.setStepSound(Block.soundTypeMetal),
aerogel_double_slab
);
skyroot_bookshelf = register("skyroot_bookshelf", new BlockSkyrootBookshelf());
skyroot_bed = registerBed("skyroot_bed", new BlockSkyrootBed().setBlockTextureName(Aether.find("skyroot_bed")));
skyroot_bed = registerBed(
"skyroot_bed",
new BlockSkyrootBed().setBlockTextureName(Aether.find("skyroot_bed"))
);
}
public static void initializeHarvestLevels()
{
public static void initializeHarvestLevels() {
BlocksAether.aether_grass.setHarvestLevel("shovel", 0);
BlocksAether.enchanted_aether_grass.setHarvestLevel("shovel", 0);
BlocksAether.aether_dirt.setHarvestLevel("shovel", 0);
@ -285,7 +570,14 @@ public class BlocksAether {
slab1.setBlockName(name);
slab1.setCreativeTab(AetherCreativeTabs.blocks);
GameRegistry.registerBlock(slab1, ItemAetherSlab.class, name, (BlockAetherSlab) slab1, (BlockAetherSlab) slab2, false);
GameRegistry.registerBlock(
slab1,
ItemAetherSlab.class,
name,
(BlockAetherSlab) slab1,
(BlockAetherSlab) slab2,
false
);
return slab1;
}
@ -333,5 +625,4 @@ public class BlocksAether {
return block;
}
}

View file

@ -9,13 +9,14 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public abstract class BlockAetherContainer extends BlockContainer {
public BlockAetherContainer(Material materialIn) {
super(materialIn);
}
@Override
public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack stack) {
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);
@ -35,5 +36,4 @@ public abstract class BlockAetherContainer extends BlockContainer {
worldIn.setTileEntity(x, y, z, tileentity);
}
}
}

View file

@ -6,6 +6,8 @@ import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.blocks.BlocksAether;
import com.gildedgames.the_aether.network.AetherGuiHandler;
import com.gildedgames.the_aether.tileentity.TileEntityEnchanter;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -19,11 +21,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockEnchanter extends BlockAetherContainer {
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
@ -47,7 +45,8 @@ public class BlockEnchanter extends BlockAetherContainer {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
return side == 1 ? this.blockIconTop
: (side == 0 ? this.blockIconBottom : this.blockIcon);
}
@Override
@ -86,7 +85,17 @@ public class BlockEnchanter extends BlockAetherContainer {
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(
World world,
int x,
int y,
int z,
EntityPlayer player,
int side,
float hitX,
float hitY,
float hitZ
) {
player.openGui(Aether.instance, AetherGuiHandler.enchanter, world, x, y, z);
return true;
@ -115,16 +124,29 @@ public class BlockEnchanter extends BlockAetherContainer {
}
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()));
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());
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);
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);
}
}
@ -135,5 +157,4 @@ public class BlockEnchanter extends BlockAetherContainer {
super.breakBlock(worldIn, x, y, z, block, meta);
}
}

View file

@ -6,6 +6,8 @@ import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.blocks.BlocksAether;
import com.gildedgames.the_aether.network.AetherGuiHandler;
import com.gildedgames.the_aether.tileentity.TileEntityFreezer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -19,11 +21,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockFreezer extends BlockAetherContainer {
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
@ -47,7 +45,8 @@ public class BlockFreezer extends BlockAetherContainer {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
return side == 1 ? this.blockIconTop
: (side == 0 ? this.blockIconBottom : this.blockIcon);
}
@Override
@ -73,7 +72,17 @@ public class BlockFreezer extends BlockAetherContainer {
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(
World world,
int x,
int y,
int z,
EntityPlayer player,
int side,
float hitX,
float hitY,
float hitZ
) {
player.openGui(Aether.instance, AetherGuiHandler.freezer, world, x, y, z);
return true;
@ -115,16 +124,29 @@ public class BlockFreezer extends BlockAetherContainer {
}
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()));
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());
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);
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);
}
}
@ -135,5 +157,4 @@ public class BlockFreezer extends BlockAetherContainer {
super.breakBlock(worldIn, x, y, z, block, meta);
}
}

View file

@ -6,6 +6,8 @@ import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.blocks.BlocksAether;
import com.gildedgames.the_aether.network.AetherGuiHandler;
import com.gildedgames.the_aether.tileentity.TileEntityIncubator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -19,11 +21,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockIncubator extends BlockAetherContainer {
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
@ -47,7 +45,8 @@ public class BlockIncubator extends BlockAetherContainer {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
return side == 1 ? this.blockIconTop
: (side == 0 ? this.blockIconBottom : this.blockIcon);
}
@Override
@ -86,7 +85,17 @@ public class BlockIncubator extends BlockAetherContainer {
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(
World world,
int x,
int y,
int z,
EntityPlayer player,
int side,
float hitX,
float hitY,
float hitZ
) {
player.openGui(Aether.instance, AetherGuiHandler.incubator, world, x, y, z);
return true;
@ -115,16 +124,29 @@ public class BlockIncubator extends BlockAetherContainer {
}
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()));
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());
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);
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);
}
}
@ -135,5 +157,4 @@ public class BlockIncubator extends BlockAetherContainer {
super.breakBlock(worldIn, x, y, z, block, meta);
}
}

View file

@ -4,6 +4,9 @@ import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.AetherConfig;
import com.gildedgames.the_aether.blocks.BlocksAether;
import com.gildedgames.the_aether.world.AetherWorldProvider;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.entity.EntityPlayerSP;
@ -17,14 +20,9 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.world.WorldProvider;
public class BlockSunAltar extends Block {
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
@ -45,7 +43,10 @@ public class BlockSunAltar extends Block {
@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);
return side == 1
? this.blockIconTop
: (side == 0 ? BlocksAether.hellfire_stone.getBlockTextureFromSide(side)
: this.blockIcon);
}
@Override
@ -61,59 +62,67 @@ public class BlockSunAltar extends Block {
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (player.dimension == AetherConfig.getAetherDimensionID())
{
if (world.provider instanceof AetherWorldProvider)
{
public boolean onBlockActivated(
World world,
int x,
int y,
int z,
EntityPlayer player,
int side,
float hitX,
float hitY,
float hitZ
) {
if (player.dimension == AetherConfig.getAetherDimensionID()) {
if (world.provider instanceof AetherWorldProvider) {
AetherWorldProvider provider = (AetherWorldProvider) world.provider;
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
MinecraftServer server
= FMLCommonHandler.instance().getMinecraftServerInstance();
if (provider.getIsEternalDay() && provider.getShouldCycleCatchup())
{
if (server != null && ((server.isDedicatedServer() && (server.getConfigurationManager().func_152596_g(player.getGameProfile()) || AetherConfig.sunAltarMultiplayer()) || !server.isDedicatedServer())))
{
if (provider.getIsEternalDay() && provider.getShouldCycleCatchup()) {
if (server != null
&& ((
server.isDedicatedServer()
&& (server.getConfigurationManager()
.func_152596_g(player.getGameProfile())
|| AetherConfig.sunAltarMultiplayer())
|| !server.isDedicatedServer()
))) {
Aether.proxy.openSunAltar();
}
else if (world.isRemote)
{
if (player instanceof EntityPlayerSP && (player.canCommandSenderUseCommand(2, "") || AetherConfig.sunAltarMultiplayer()))
{
} else if (world.isRemote) {
if (player instanceof EntityPlayerSP
&& (player.canCommandSenderUseCommand(2, "")
|| AetherConfig.sunAltarMultiplayer())) {
Aether.proxy.openSunAltar();
} else {
player.addChatComponentMessage(new ChatComponentText(
I18n.format("gui.sun_altar.permission")
));
}
else
{
player.addChatComponentMessage(new ChatComponentText(I18n.format("gui.sun_altar.permission")));
}
} else if (!provider.getIsEternalDay()) {
if (world.isRemote) {
player.addChatComponentMessage(new ChatComponentText(
I18n.format("gui.sun_altar.eternal_day")
));
}
} else if (!provider.getShouldCycleCatchup()) {
if (world.isRemote) {
player.addChatComponentMessage(new ChatComponentText(
I18n.format("gui.sun_altar.cycle_catchup")
));
}
}
}
else if (!provider.getIsEternalDay())
{
if (world.isRemote)
{
player.addChatComponentMessage(new ChatComponentText(I18n.format("gui.sun_altar.eternal_day")));
}
}
else if (!provider.getShouldCycleCatchup())
{
if (world.isRemote)
{
player.addChatComponentMessage(new ChatComponentText(I18n.format("gui.sun_altar.cycle_catchup")));
}
}
}
}
else
{
if (world.isRemote)
{
player.addChatComponentMessage(new ChatComponentText(I18n.format("gui.sun_altar.message")));
} else {
if (world.isRemote) {
player.addChatComponentMessage(
new ChatComponentText(I18n.format("gui.sun_altar.message"))
);
}
}
return true;
}
}

View file

@ -1,15 +1,12 @@
package com.gildedgames.the_aether.blocks.decorative;
import com.gildedgames.the_aether.Aether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockBreakable;
import net.minecraft.block.material.Material;
import com.gildedgames.the_aether.Aether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockAerogel extends BlockBreakable {
public BlockAerogel() {
super(Aether.find("aerogel"), Material.rock, false);
@ -30,5 +27,4 @@ public class BlockAerogel extends BlockBreakable {
public boolean renderAsNormalBlock() {
return true;
}
}

View file

@ -1,5 +1,7 @@
package com.gildedgames.the_aether.blocks.decorative;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.blocks.BlocksAether;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFence;
import net.minecraft.block.material.Material;
@ -7,11 +9,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.blocks.BlocksAether;
public class BlockAetherFence extends BlockFence {
public BlockAetherFence() {
super(Aether.find("skyroot_planks"), Material.wood);
@ -26,9 +24,15 @@ public class BlockAetherFence extends BlockFence {
}
@Override
public boolean canConnectFenceTo(IBlockAccess p_149826_1_, int p_149826_2_, int p_149826_3_, int p_149826_4_) {
public boolean canConnectFenceTo(
IBlockAccess p_149826_1_, int p_149826_2_, int p_149826_3_, int p_149826_4_
) {
Block block = p_149826_1_.getBlock(p_149826_2_, p_149826_3_, p_149826_4_);
return block != this && block != Blocks.fence_gate && block != BlocksAether.skyroot_fence_gate ? (block.getMaterial().isOpaque() && block.renderAsNormalBlock() ? block.getMaterial() != Material.gourd : false) : true;
return block != this && block != Blocks.fence_gate
&& block != BlocksAether.skyroot_fence_gate
? (block.getMaterial().isOpaque() && block.renderAsNormalBlock()
? block.getMaterial() != Material.gourd
: false)
: true;
}
}

View file

@ -1,16 +1,13 @@
package com.gildedgames.the_aether.blocks.decorative;
import net.minecraft.block.BlockFenceGate;
import net.minecraft.util.IIcon;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.blocks.BlocksAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockFenceGate;
import net.minecraft.util.IIcon;
public class BlockAetherFenceGate extends BlockFenceGate {
public BlockAetherFenceGate() {
super();
@ -25,5 +22,4 @@ public class BlockAetherFenceGate extends BlockFenceGate {
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
}
}

View file

@ -2,6 +2,7 @@ package com.gildedgames.the_aether.blocks.decorative;
import java.util.Random;
import com.gildedgames.the_aether.blocks.BlocksAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
@ -10,10 +11,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.world.World;
import com.gildedgames.the_aether.blocks.BlocksAether;
public class BlockAetherSlab extends BlockSlab {
private String name;
public BlockAetherSlab(String name, boolean double_slab, Material materialIn) {
@ -25,7 +23,8 @@ public class BlockAetherSlab extends BlockSlab {
}
@Override
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
public Item
getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
return Item.getItemFromBlock(this.getDroppedSlab());
}
@ -67,6 +66,9 @@ public class BlockAetherSlab extends BlockSlab {
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return this == BlocksAether.aerogel_slab || this == BlocksAether.aerogel_double_slab ? 1 : 0;
return this == BlocksAether.aerogel_slab
|| this == BlocksAether.aerogel_double_slab
? 1
: 0;
}
}

View file

@ -4,11 +4,9 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs;
public class BlockAetherStairs extends BlockStairs {
public BlockAetherStairs(Block block) {
super(block, 0);
this.setLightOpacity(0);
}
}

View file

@ -3,6 +3,8 @@ package com.gildedgames.the_aether.blocks.decorative;
import java.util.List;
import com.gildedgames.the_aether.blocks.BlocksAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockWall;
import net.minecraft.creativetab.CreativeTabs;
@ -10,11 +12,8 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockAetherWall extends BlockWall {
private Block block;
public BlockAetherWall(Block block) {
@ -30,8 +29,9 @@ public class BlockAetherWall extends BlockWall {
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({"unchecked", "rawtypes"})
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
@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));
}

View file

@ -3,7 +3,6 @@ package com.gildedgames.the_aether.blocks.decorative;
import net.minecraft.block.BlockTorch;
public class BlockAmbrosiumTorch extends BlockTorch {
public BlockAmbrosiumTorch() {
super();
@ -11,5 +10,4 @@ public class BlockAmbrosiumTorch extends BlockTorch {
this.setLightLevel(0.9375F);
this.setStepSound(soundTypeWood);
}
}

View file

@ -1,5 +1,10 @@
package com.gildedgames.the_aether.blocks.decorative;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.entities.block.EntityTNTPresent;
import com.gildedgames.the_aether.items.ItemsAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -10,15 +15,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.entities.block.EntityTNTPresent;
import com.gildedgames.the_aether.items.ItemsAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPresent extends Block {
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
@ -55,7 +52,8 @@ public class BlockPresent extends Block {
}
@Override
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
public void
harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
int randomNumber = (int) (((9 - 6 + 1) * world.rand.nextDouble()) + 6);
int crateType = world.rand.nextInt(4);
@ -67,10 +65,14 @@ public class BlockPresent extends Block {
}
} else if (crateType == 1) {
if (world.rand.nextInt(9) == 0) {
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.candy_cane_sword));
this.dropBlockAsItem(
world, x, y, z, new ItemStack(ItemsAether.candy_cane_sword)
);
} else {
for (int size = 1; size <= randomNumber; ++size) {
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.gingerbread_man));
this.dropBlockAsItem(
world, x, y, z, new ItemStack(ItemsAether.gingerbread_man)
);
}
}
} else {
@ -83,5 +85,4 @@ public class BlockPresent extends Block {
world.playSoundAtEntity(present, "game.tnt.primed", 1.0F, 1.0F);
}
}
}

View file

@ -2,16 +2,13 @@ package com.gildedgames.the_aether.blocks.decorative;
import java.util.Random;
import com.gildedgames.the_aether.Aether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockBreakable;
import net.minecraft.block.material.Material;
import com.gildedgames.the_aether.Aether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockQuicksoilGlass extends BlockBreakable {
public BlockQuicksoilGlass() {
super(Aether.find("quicksoil_glass"), Material.glass, false);
@ -43,5 +40,4 @@ public class BlockQuicksoilGlass extends BlockBreakable {
protected boolean canSilkHarvest() {
return true;
}
}

View file

@ -2,6 +2,10 @@ package com.gildedgames.the_aether.blocks.decorative;
import java.util.Random;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.blocks.BlocksAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Items;
@ -9,14 +13,7 @@ import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.blocks.BlocksAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockSkyrootBookshelf extends Block {
public BlockSkyrootBookshelf() {
super(Material.wood);
@ -30,7 +27,9 @@ public class BlockSkyrootBookshelf extends Block {
@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_);
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

View file

@ -1,12 +1,10 @@
package com.gildedgames.the_aether.blocks.decorative;
import com.gildedgames.the_aether.Aether;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import com.gildedgames.the_aether.Aether;
public class BlockSkyrootPlanks extends Block {
public BlockSkyrootPlanks() {
super(Material.wood);
@ -15,5 +13,4 @@ public class BlockSkyrootPlanks extends Block {
this.setStepSound(soundTypeWood);
this.setBlockTextureName(Aether.find("skyroot_planks"));
}
}

View file

@ -1,13 +1,11 @@
package com.gildedgames.the_aether.blocks.decorative;
import com.gildedgames.the_aether.Aether;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
import com.gildedgames.the_aether.Aether;
public class BlockZanite extends Block {
public BlockZanite() {
super(Material.iron);
@ -18,8 +16,9 @@ public class BlockZanite extends Block {
}
@Override
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
public boolean isBeaconBase(
IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ
) {
return true;
}
}

View file

@ -10,7 +10,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockDungeonBase extends Block {
private Block pickBlock;
private boolean isLit;
@ -49,7 +48,9 @@ public class BlockDungeonBase extends Block {
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
public ItemStack getPickBlock(
MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player
) {
if (this.pickBlock != null) {
return new ItemStack(this.pickBlock);
}
@ -60,5 +61,4 @@ public class BlockDungeonBase extends Block {
public Block getUnlockedBlock() {
return this.pickBlock == null ? this : this.pickBlock;
}
}

View file

@ -11,7 +11,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class BlockDungeonTrap extends Block {
private Block pickBlock;
public BlockDungeonTrap(Block pickBlock) {
@ -48,8 +47,14 @@ public class BlockDungeonTrap extends Block {
}
}
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
);
}
}
}

View file

@ -11,7 +11,6 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class BlockMimicChest extends BlockChest {
public BlockMimicChest() {
super(13);
@ -24,21 +23,41 @@ public class BlockMimicChest extends BlockChest {
}
@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) {
public void
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
this.spawnMimic(worldIn, player, x, y, z);
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
public ItemStack getPickBlock(
MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player
) {
return new ItemStack(Blocks.chest);
}
@ -54,5 +73,4 @@ public class BlockMimicChest extends BlockChest {
world.setBlockToAir(x, y, z);
}
}

View file

@ -1,7 +1,6 @@
package com.gildedgames.the_aether.blocks.dungeon;
import com.gildedgames.the_aether.Aether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockRotatedPillar;
@ -10,7 +9,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
public class BlockPillar extends BlockRotatedPillar {
private String topTexture;
private String sideTexture;
@ -41,5 +39,4 @@ public class BlockPillar extends BlockRotatedPillar {
this.field_150164_N = registry.registerIcon(Aether.find(this.topTexture));
this.sideIcon = registry.registerIcon(Aether.find(this.sideTexture));
}
}

View file

@ -7,6 +7,8 @@ import com.gildedgames.the_aether.CommonProxy;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.network.AetherGuiHandler;
import com.gildedgames.the_aether.tileentity.TileEntityTreasureChest;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockChest;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
@ -16,11 +18,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockTreasureChest extends BlockChest {
public BlockTreasureChest() {
super(56);
@ -29,23 +27,32 @@ public class BlockTreasureChest extends BlockChest {
}
@Override
public float getBlockHardness(World p_149712_1_, int p_149712_2_, int p_149712_3_, int p_149712_4_)
{
TileEntityTreasureChest treasurechest = (TileEntityTreasureChest) p_149712_1_.getTileEntity(p_149712_2_, p_149712_3_, p_149712_4_);
public float getBlockHardness(
World p_149712_1_, int p_149712_2_, int p_149712_3_, int p_149712_4_
) {
TileEntityTreasureChest treasurechest = (TileEntityTreasureChest
) p_149712_1_.getTileEntity(p_149712_2_, p_149712_3_, p_149712_4_);
if (treasurechest != null)
{
if (treasurechest != null) {
return treasurechest.isLocked() ? this.blockHardness : 5.0F;
}
else {
} else {
return this.blockHardness;
}
}
@Override
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ)
{
TileEntityTreasureChest treasurechest = (TileEntityTreasureChest) world.getTileEntity(x, y, z);
public float getExplosionResistance(
Entity par1Entity,
World world,
int x,
int y,
int z,
double explosionX,
double explosionY,
double explosionZ
) {
TileEntityTreasureChest treasurechest
= (TileEntityTreasureChest) world.getTileEntity(x, y, z);
return treasurechest.isLocked() ? this.blockResistance : 10.0F;
}
@ -62,17 +69,29 @@ public class BlockTreasureChest extends BlockChest {
}
@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
) {
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();
if (treasurechest.isLocked()) {
if (guiID == null || guiID != null && guiID.getItem() != ItemsAether.dungeon_key) {
if (guiID == null
|| guiID != null && guiID.getItem() != ItemsAether.dungeon_key) {
return false;
}
@ -80,7 +99,9 @@ public class BlockTreasureChest extends BlockChest {
--guiID.stackSize;
} else {
playerIn.openGui(Aether.instance, AetherGuiHandler.treasure_chest, worldIn, x, y, z);
playerIn.openGui(
Aether.instance, AetherGuiHandler.treasure_chest, worldIn, x, y, z
);
}
return true;
@ -95,5 +116,4 @@ public class BlockTreasureChest extends BlockChest {
public int getRenderType() {
return CommonProxy.treasureChestRenderID;
}
}

View file

@ -5,6 +5,8 @@ import java.util.List;
import com.gildedgames.the_aether.items.block.IColoredBlock;
import com.gildedgames.the_aether.items.block.INamedBlock;
import com.gildedgames.the_aether.registry.achievements.AchievementsAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
@ -18,11 +20,7 @@ import net.minecraft.util.Facing;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
public BlockAercloud() {
super(Material.ice);
@ -32,15 +30,17 @@ 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_) {
@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) {
public void
onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
entity.fallDistance = 0;
if (world.getBlockMetadata(x, y, z) == 1) {
@ -59,10 +59,8 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
entity.motionY = 2.0D;
} else {
if (entity instanceof EntityArrow)
{
if (entity.ticksExisted >= 1200)
{
if (entity instanceof EntityArrow) {
if (entity.ticksExisted >= 1200) {
entity.setDead();
}
}
@ -129,7 +127,9 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
@Override
public String getUnlocalizedName(ItemStack stack) {
return stack.getItemDamage() == 1 ? "blue_aercloud" : stack.getItemDamage() == 2 ? "golden_aercloud" : "cold_aercloud";
return stack.getItemDamage() == 1 ? "blue_aercloud"
: stack.getItemDamage() == 2 ? "golden_aercloud"
: "cold_aercloud";
}
@Override
@ -145,10 +145,21 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
public boolean shouldSideBeRendered(
IBlockAccess p_149646_1_,
int p_149646_2_,
int p_149646_3_,
int p_149646_4_,
int p_149646_5_
) {
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_) != p_149646_1_.getBlockMetadata(p_149646_2_ - Facing.offsetsXForSide[p_149646_5_], p_149646_3_ - Facing.offsetsYForSide[p_149646_5_], p_149646_4_ - Facing.offsetsZForSide[p_149646_5_])) {
if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_)
!= p_149646_1_.getBlockMetadata(
p_149646_2_ - Facing.offsetsXForSide[p_149646_5_],
p_149646_3_ - Facing.offsetsYForSide[p_149646_5_],
p_149646_4_ - Facing.offsetsZForSide[p_149646_5_]
)) {
return true;
}
@ -156,12 +167,16 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
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) {
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);
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);
}
}

View file

@ -1,14 +1,12 @@
package com.gildedgames.the_aether.blocks.natural;
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class BlockAetherDirt extends Block {
public BlockAetherDirt() {
super(Material.ground);
@ -19,7 +17,8 @@ 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);
}
@ -27,5 +26,4 @@ public class BlockAetherDirt extends Block {
public int damageDropped(int meta) {
return 1;
}
}

View file

@ -8,20 +8,29 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
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() {
this.setHardness(0.0F);
this.setTickRandomly(true);
this.setStepSound(soundTypeGrass);
this.setBlockBounds(0.5F - 0.2F, 0.0F, 0.5F - 0.2F, 0.5F + 0.2F, 0.2F * 3.0F, 0.5F + 0.2F);
this.setBlockBounds(
0.5F - 0.2F, 0.0F, 0.5F - 0.2F, 0.5F + 0.2F, 0.2F * 3.0F, 0.5F + 0.2F
);
}
@Override
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;
return soil == BlocksAether.aether_grass || soil == BlocksAether.aether_dirt
|| soil == BlocksAether.enchanted_aether_grass;
}
@Override
@ -34,5 +43,4 @@ public class BlockAetherFlower extends BlockBush {
public int getRenderType() {
return CommonProxy.aetherFlowerRenderID;
}
}

View file

@ -5,6 +5,8 @@ import java.util.Random;
import com.gildedgames.the_aether.blocks.BlocksAether;
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
import com.gildedgames.the_aether.world.AetherWorld;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.IGrowable;
import net.minecraft.block.material.Material;
@ -19,11 +21,7 @@ import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockAetherGrass extends Block implements IGrowable {
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
@ -42,7 +40,8 @@ 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) {
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) {
@ -50,7 +49,10 @@ public class BlockAetherGrass extends Block implements IGrowable {
int j1 = y + rand.nextInt(5) - 3;
int k1 = z + rand.nextInt(3) - 1;
if (worldIn.getBlock(i1, j1, k1) == BlocksAether.aether_dirt && worldIn.getBlockMetadata(i1, j1, k1) == 0 && worldIn.getBlockLightValue(i1, j1 + 1, k1) >= 4 && worldIn.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) {
if (worldIn.getBlock(i1, j1, k1) == BlocksAether.aether_dirt
&& worldIn.getBlockMetadata(i1, j1, k1) == 0
&& worldIn.getBlockLightValue(i1, j1 + 1, k1) >= 4
&& worldIn.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) {
worldIn.setBlock(i1, j1, k1, BlocksAether.aether_grass);
}
}
@ -64,7 +66,8 @@ public class BlockAetherGrass extends Block implements IGrowable {
}
@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);
}
@ -77,53 +80,79 @@ public class BlockAetherGrass extends Block implements IGrowable {
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon("aether_legacy:aether_grass_side");
this.blockIconSnowy = registry.registerIcon("aether_legacy:aether_grass_side_snowy");
this.blockIconSnowy
= registry.registerIcon("aether_legacy:aether_grass_side_snowy");
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);
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)
{
if (side == 1) {
return this.blockIconTop;
}
else if (side == 0)
{
} else if (side == 0) {
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
}
else
{
} else {
Material material = world.getBlock(x, y + 1, z).getMaterial();
return material != Material.snow && material != Material.craftedSnow ? this.blockIcon : this.blockIconSnowy;
return material != Material.snow && material != Material.craftedSnow
? this.blockIcon
: this.blockIconSnowy;
}
}
@Override
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
public boolean canSustainPlant(
IBlockAccess world,
int x,
int y,
int z,
ForgeDirection direction,
IPlantable plantable
) {
EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);
return plantType == EnumPlantType.Plains;
}
@Override
public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) {
public boolean func_149851_a(
World p_149851_1_,
int p_149851_2_,
int p_149851_3_,
int p_149851_4_,
boolean p_149851_5_
) {
return true;
}
@Override
public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) {
public boolean func_149852_a(
World p_149852_1_,
Random p_149852_2_,
int p_149852_3_,
int p_149852_4_,
int p_149852_5_
) {
return true;
}
@Override
public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) {
public void func_149853_b(
World p_149853_1_,
Random p_149853_2_,
int p_149853_3_,
int p_149853_4_,
int p_149853_5_
) {
int l = 0;
while (l < 128) {
@ -138,7 +167,8 @@ public class BlockAetherGrass extends Block implements IGrowable {
j1 += (p_149853_2_.nextInt(3) - 1) * p_149853_2_.nextInt(3) / 2;
k1 += p_149853_2_.nextInt(3) - 1;
if (p_149853_1_.getBlock(i1, j1 - 1, k1) == BlocksAether.aether_grass && !p_149853_1_.getBlock(i1, j1, k1).isNormalCube()) {
if (p_149853_1_.getBlock(i1, j1 - 1, k1) == BlocksAether.aether_grass
&& !p_149853_1_.getBlock(i1, j1, k1).isNormalCube()) {
++l1;
continue;
}
@ -148,11 +178,17 @@ public class BlockAetherGrass extends Block implements IGrowable {
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);
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);
AetherWorld.aether_biome.plantFlower(
p_149853_1_, p_149853_2_, i1, j1, k1
);
}
}
@ -161,5 +197,4 @@ public class BlockAetherGrass extends Block implements IGrowable {
}
}
}
}

View file

@ -8,6 +8,9 @@ import com.gildedgames.the_aether.entities.particles.ParticleCrystalLeaves;
import com.gildedgames.the_aether.entities.particles.ParticleGoldenOakLeaves;
import com.gildedgames.the_aether.entities.particles.ParticleHolidayLeaves;
import com.gildedgames.the_aether.items.ItemsAether;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockLeaves;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -17,12 +20,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockAetherLeaves extends BlockLeaves {
@SideOnly(Side.CLIENT)
private IIcon fastIcon;
@ -65,7 +63,8 @@ public class BlockAetherLeaves extends BlockLeaves {
return;
}
if (net.minecraft.client.Minecraft.getMinecraft().gameSettings.particleSetting == 2) {
if (net.minecraft.client.Minecraft.getMinecraft().gameSettings.particleSetting
== 2) {
return;
}
@ -78,12 +77,14 @@ public class BlockAetherLeaves extends BlockLeaves {
double d4 = (rand.nextFloat() - 0.5D) * 0.5D;
double d5 = (rand.nextFloat() - 0.5D) * 0.5D;
ParticleGoldenOakLeaves obj = new ParticleGoldenOakLeaves(world, d, d1, d2, d3, d4, d5);
ParticleGoldenOakLeaves obj
= new ParticleGoldenOakLeaves(world, d, d1, d2, d3, d4, d5);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(obj);
}
}
if (this == BlocksAether.holiday_leaves || this == BlocksAether.decorated_holiday_leaves) {
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;
@ -93,13 +94,17 @@ public class BlockAetherLeaves extends BlockLeaves {
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 (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;
@ -109,8 +114,11 @@ public class BlockAetherLeaves extends BlockLeaves {
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
);
}
}
}
@ -118,11 +126,16 @@ public class BlockAetherLeaves extends BlockLeaves {
@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_sapling) : null;
return this == BlocksAether.skyroot_leaves
? Item.getItemFromBlock(BlocksAether.skyroot_sapling)
: this == BlocksAether.golden_oak_leaves
? Item.getItemFromBlock(BlocksAether.golden_oak_sapling)
: null;
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
public ArrayList<ItemStack>
getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> drops = super.getDrops(world, x, y, z, metadata, fortune);
if (this == BlocksAether.crystal_fruit_leaves) {
@ -134,8 +147,7 @@ public class BlockAetherLeaves extends BlockLeaves {
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_)
{
public void registerBlockIcons(IIconRegister p_149651_1_) {
this.fancyIcon = p_149651_1_.registerIcon(this.getTextureName());
this.fastIcon = p_149651_1_.registerIcon(this.getTextureName() + "_opaque");
}
@ -143,25 +155,27 @@ public class BlockAetherLeaves extends BlockLeaves {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
if (Minecraft.getMinecraft().gameSettings.fancyGraphics)
{
if (Minecraft.getMinecraft().gameSettings.fancyGraphics) {
return fancyIcon;
}
else
{
} else {
return fastIcon;
}
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
public boolean shouldSideBeRendered(
IBlockAccess p_149646_1_,
int p_149646_2_,
int p_149646_3_,
int p_149646_4_,
int p_149646_5_
) {
return true;
}
@Override
public String[] func_150125_e() {
return new String[]{this.getUnlocalizedName()};
return new String[] { this.getUnlocalizedName() };
}
}

View file

@ -7,7 +7,8 @@ import com.gildedgames.the_aether.blocks.BlocksAether;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.items.tools.*;
import com.gildedgames.the_aether.items.util.EnumAetherToolType;
import com.gildedgames.the_aether.items.tools.*;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockLog;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.enchantment.Enchantment;
@ -19,19 +20,16 @@ import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatList;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.event.ForgeEventFactory;
public class BlockAetherLog extends BlockLog {
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);
@ -39,38 +37,77 @@ public class BlockAetherLog extends BlockLog {
ItemStack stack = player.getCurrentEquippedItem();
if (this.canSilkHarvest(worldIn, player, x, y, z, meta) && EnchantmentHelper.getSilkTouchModifier(player))
{
if (this.canSilkHarvest(worldIn, player, x, y, z, meta)
&& EnchantmentHelper.getSilkTouchModifier(player)) {
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
ItemStack itemstack = this.createStackedBlock(meta);
if (itemstack != null)
{
if (itemstack != null) {
items.add(itemstack);
}
ForgeEventFactory.fireBlockHarvesting(items, worldIn, this, x, y, z, meta, 0, 1.0f, true, player);
for (ItemStack is : items)
{
ForgeEventFactory.fireBlockHarvesting(
items, worldIn, this, x, y, z, meta, 0, 1.0f, true, player
);
for (ItemStack is : items) {
this.dropBlockAsItem(worldIn, x, y, z, is);
}
}
else
{
if (stack != null && ((stack.getItem() instanceof ItemAetherTool && ((ItemAetherTool) stack.getItem()).toolType == EnumAetherToolType.AXE) || stack.getItem() == Items.diamond_axe)) {
if (stack.getItem() instanceof ItemZaniteTool || stack.getItem() instanceof ItemGravititeTool || stack.getItem() instanceof ItemValkyrieTool || stack.getItem() == Items.diamond_axe) {
} else {
if (stack != null
&& ((stack.getItem() instanceof ItemAetherTool
&& ((ItemAetherTool) stack.getItem()).toolType
== EnumAetherToolType.AXE)
|| stack.getItem() == Items.diamond_axe)) {
if (stack.getItem() instanceof ItemZaniteTool
|| 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(
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));
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));
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));
this.dropBlockAsItem(
player.worldObj,
x,
y,
z,
meta,
EnchantmentHelper.getEnchantmentLevel(
Enchantment.fortune.effectId, stack
)
);
}
} else {
super.harvestBlock(worldIn, player, x, y, z, meta);
@ -95,9 +132,10 @@ public class BlockAetherLog extends BlockLog {
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");
this.field_150167_a[i]
= registry.registerIcon(this.getTextureName() + "_side");
this.field_150166_b[i]
= registry.registerIcon(this.getTextureName() + "_top");
}
}
}

View file

@ -20,7 +20,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockAetherOre extends Block {
public BlockAetherOre(int level) {
super(Material.rock);
@ -31,21 +30,34 @@ public class BlockAetherOre extends Block {
}
@Override
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
public void
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
player.addExhaustion(0.025F);
ItemStack stack = player.getCurrentEquippedItem();
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0) {
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack)
> 0) {
super.harvestBlock(worldIn, player, x, y, z, meta);
return;
}
if (stack != null && stack.getItem() instanceof ItemSkyrootTool && ((ItemAetherTool) stack.getItem()).toolType == EnumAetherToolType.PICKAXE) {
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));
this.dropBlockAsItem(
worldIn,
x,
y,
z,
meta,
EnchantmentHelper.getEnchantmentLevel(
Enchantment.fortune.effectId, stack
)
);
}
} else {
super.harvestBlock(worldIn, player, x, y, z, meta);
@ -54,12 +66,14 @@ public class BlockAetherOre extends Block {
@Override
public Item getItemDropped(int meta, Random random, int fortune) {
return this == BlocksAether.zanite_ore ? ItemsAether.zanite_gemstone : ItemsAether.ambrosium_shard;
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)) {
if (fortune > 0
&& Item.getItemFromBlock(this) != this.getItemDropped(0, random, fortune)) {
int j = random.nextInt(fortune + 2) - 1;
if (j < 0) {
@ -76,7 +90,8 @@ public class BlockAetherOre extends Block {
public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) {
Random random = new Random();
if (this.getItemDropped(p_149690_5_, random, p_149690_7_) != Item.getItemFromBlock(this)) {
if (this.getItemDropped(p_149690_5_, random, p_149690_7_)
!= Item.getItemFromBlock(this)) {
int amount = 0;
if (this == BlocksAether.ambrosium_ore) {
@ -90,5 +105,4 @@ public class BlockAetherOre extends Block {
return 0;
}
}

View file

@ -6,6 +6,8 @@ import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.CommonProxy;
import com.gildedgames.the_aether.blocks.BlocksAether;
import com.gildedgames.the_aether.items.ItemsAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@ -15,11 +17,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockBerryBush extends BlockAetherFlower {
public BlockBerryBush() {
this.setHardness(0.2F);
this.setHarvestLevel("axe", 0);
@ -39,7 +37,8 @@ public class BlockBerryBush extends BlockAetherFlower {
}
@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) {
@ -57,7 +56,9 @@ public class BlockBerryBush extends BlockAetherFlower {
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
if (randomNum != 0) {
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0));
this.dropBlockAsItem(
world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0)
);
}
}
@ -75,19 +76,31 @@ public class BlockBerryBush extends BlockAetherFlower {
}
int randomNum = world.rand.nextInt(max - min + 1) + min;
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0));
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) {
public boolean
shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
return true;
}
@ -95,5 +108,4 @@ public class BlockBerryBush extends BlockAetherFlower {
public int getRenderType() {
return CommonProxy.berryBushRenderID;
}
}

View file

@ -4,21 +4,21 @@ import java.util.Random;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.blocks.BlocksAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.IGrowable;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockBerryBushStem extends BlockAetherFlower implements IGrowable {
public BlockBerryBushStem() {
this.setHardness(0.2F);
this.setStepSound(soundTypeGrass);
this.setBlockTextureName(Aether.find("berry_bush_stem"));
this.setBlockBounds(0.5F - 0.4F, 0.0F, 0.5F - 0.4F, 0.5F + 0.4F, 0.4F * 2.0F, 0.5F + 0.4F);
this.setBlockBounds(
0.5F - 0.4F, 0.0F, 0.5F - 0.4F, 0.5F + 0.4F, 0.4F * 2.0F, 0.5F + 0.4F
);
}
@Override
@ -35,12 +35,14 @@ public class BlockBerryBushStem extends BlockAetherFlower implements IGrowable {
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
public AxisAlignedBB
getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
return null;
}
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
public boolean
shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
return true;
}
@ -58,5 +60,4 @@ public class BlockBerryBushStem extends BlockAetherFlower implements IGrowable {
public void func_149853_b(World world, Random random, int x, int y, int z) {
world.setBlock(x, y, z, BlocksAether.berry_bush);
}
}

View file

@ -1,15 +1,14 @@
package com.gildedgames.the_aether.blocks.natural;
import com.gildedgames.the_aether.blocks.BlocksAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockEnchantedAetherGrass extends Block {
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
@ -25,14 +24,19 @@ public class BlockEnchantedAetherGrass extends Block {
@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");
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);
return side == 1
? this.blockIconTop
: (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side)
: this.blockIcon);
}
@Override
@ -46,5 +50,4 @@ public class BlockEnchantedAetherGrass extends Block {
return this.blockIcon;
}
}

View file

@ -1,14 +1,12 @@
package com.gildedgames.the_aether.blocks.natural;
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class BlockHolystone extends Block {
public BlockHolystone() {
super(Material.rock);
@ -19,7 +17,8 @@ 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);
}
@ -27,5 +26,4 @@ public class BlockHolystone extends Block {
public int damageDropped(int meta) {
return 1;
}
}

View file

@ -1,14 +1,12 @@
package com.gildedgames.the_aether.blocks.natural;
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class BlockQuicksoil extends Block {
public BlockQuicksoil() {
super(Material.sand);
@ -21,7 +19,8 @@ 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);
}
@ -29,5 +28,4 @@ public class BlockQuicksoil extends Block {
public int damageDropped(int meta) {
return 1;
}
}

View file

@ -10,7 +10,6 @@ import net.minecraft.util.Direction;
import net.minecraft.world.World;
public class AetherPortalSize {
private final World world;
private final int axis;
public final int rightDir;
@ -27,15 +26,26 @@ public class AetherPortalSize {
this.leftDir = BlockPortal.field_150001_a[axis][0];
this.rightDir = BlockPortal.field_150001_a[axis][1];
for (int i1 = y; y > i1 - 21 && y > 0 && this.isEmptyBlock(worldIn.getBlock(x, y - 1, z)); --y) {
for (int i1 = y;
y > i1 - 21 && y > 0 && this.isEmptyBlock(worldIn.getBlock(x, y - 1, z));
--y) {
;
}
int i = this.getDistanceUntilEdge(x, y, z, this.leftDir) - 1;
if (i >= 0) {
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);
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;
@ -85,9 +95,12 @@ public class AetherPortalSize {
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);
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;
@ -98,13 +111,21 @@ public class AetherPortalSize {
}
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]]);
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]]);
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;
@ -114,9 +135,11 @@ public class AetherPortalSize {
}
for (int j = 0; j < this.width; ++j) {
int i = this.bottomLeft.posX + j * Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]];
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]];
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;
@ -135,11 +158,13 @@ public class AetherPortalSize {
}
protected boolean isEmptyBlock(Block blockIn) {
return blockIn.getMaterial() == Material.air || blockIn == Blocks.fire || blockIn == BlocksAether.aether_portal;
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;
return this.bottomLeft != null && this.width >= 2 && this.width <= 21
&& this.height >= 3 && this.height <= 21;
}
public void placePortalBlocks() {
@ -153,5 +178,4 @@ public class AetherPortalSize {
}
}
}
}

View file

@ -6,6 +6,9 @@ import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.entities.particles.ParticleAetherPortal;
import com.gildedgames.the_aether.entities.util.EntityHook;
import com.gildedgames.the_aether.player.PlayerAether;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockPortal;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -15,12 +18,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockAetherPortal extends BlockPortal {
public BlockAetherPortal() {
super();
@ -36,11 +34,14 @@ public class BlockAetherPortal extends BlockPortal {
}
@Override
public void onEntityCollidedWithBlock(World world, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity entity) {
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();
((EntityHook) entity.getExtendedProperties("aether_legacy:entity_hook"))
.setInPortal();
}
}
@ -52,9 +53,11 @@ public class BlockAetherPortal extends BlockPortal {
return true;
} else {
AetherPortalSize aetherportal$size1 = new AetherPortalSize(worldIn, x, y, z, 2);
AetherPortalSize aetherportal$size1
= new AetherPortalSize(worldIn, x, y, z, 2);
if (aetherportal$size1.isValid() && aetherportal$size1.portalBlockCount == 0) {
if (aetherportal$size1.isValid()
&& aetherportal$size1.portalBlockCount == 0) {
aetherportal$size1.placePortalBlocks();
return true;
@ -71,13 +74,18 @@ public class BlockAetherPortal extends BlockPortal {
if (l == 1) {
AetherPortalSize blockportal$size = new AetherPortalSize(worldIn, x, y, z, 1);
if (!blockportal$size.isValid() || blockportal$size.portalBlockCount < blockportal$size.width * blockportal$size.height) {
if (!blockportal$size.isValid()
|| blockportal$size.portalBlockCount
< blockportal$size.width * blockportal$size.height) {
worldIn.setBlock(x, y, z, Blocks.air);
}
} else if (l == 2) {
AetherPortalSize blockportal$size1 = new AetherPortalSize(worldIn, x, y, z, 2);
AetherPortalSize blockportal$size1
= new AetherPortalSize(worldIn, x, y, z, 2);
if (!blockportal$size1.isValid() || blockportal$size1.portalBlockCount < blockportal$size1.width * blockportal$size1.height) {
if (!blockportal$size1.isValid()
|| blockportal$size1.portalBlockCount
< blockportal$size1.width * blockportal$size1.height) {
worldIn.setBlock(x, y, z, Blocks.air);
}
}
@ -87,7 +95,15 @@ public class BlockAetherPortal extends BlockPortal {
@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);
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) {
@ -99,7 +115,8 @@ public class BlockAetherPortal extends BlockPortal {
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
int j = rand.nextInt(2) * 2 - 1;
if (world.getBlock(x - 1, y, z) != this && world.getBlock(x + 1, y, z) != this) {
if (world.getBlock(x - 1, y, z) != this
&& world.getBlock(x + 1, y, z) != this) {
d0 = (double) x + 0.5D + 0.25D * (double) j;
d3 = (double) (rand.nextFloat() * 2.0F * (float) j);
} else {
@ -107,14 +124,12 @@ public class BlockAetherPortal extends BlockPortal {
d5 = (double) (rand.nextFloat() * 2.0F * (float) j);
}
ParticleAetherPortal particle = new ParticleAetherPortal(world, d0, d1, d2, d3, d4, d5);
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) {
}
public void updateTick(World world, int x, int y, int z, Random rand) {}
}

View file

@ -12,7 +12,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockFloating extends Block {
private boolean leveled;
public BlockFloating(Material material, boolean leveled) {
@ -25,7 +24,9 @@ public class BlockFloating extends Block {
}
@Override
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
public boolean isBeaconBase(
IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ
) {
return this == BlocksAether.enchanted_gravitite;
}
@ -35,13 +36,15 @@ public class BlockFloating extends Block {
}
@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)) {
if (!this.leveled
|| this.leveled && world.isBlockIndirectlyGettingPowered(x, y, z)) {
this.floatBlock(world, x, y, z);
}
}
@ -49,30 +52,30 @@ public class BlockFloating extends Block {
private void floatBlock(World world, int x, int y, int z) {
boolean floatInstantly = BlockSand.fallInstantly;
if (canContinue(world, x, y + 1, z) && y >= 0)
{
if (!floatInstantly)
{
if (!world.isRemote)
{
EntityFloatingBlock entity = new EntityFloatingBlock(world, x, y, z, world.getBlock(x, y, z), world.getBlockMetadata(x, y, z));
if (canContinue(world, x, y + 1, z) && y >= 0) {
if (!floatInstantly) {
if (!world.isRemote) {
EntityFloatingBlock entity = new EntityFloatingBlock(
world,
x,
y,
z,
world.getBlock(x, y, z),
world.getBlockMetadata(x, y, z)
);
world.setBlockToAir(x, y, z);
world.spawnEntityInWorld(entity);
}
}
else
{
} else {
world.setBlockToAir(x, y, z);
int bottomPos = y - 1;
while (canContinue(world, x, bottomPos, z) && bottomPos > 0)
{
while (canContinue(world, x, bottomPos, z) && bottomPos > 0) {
bottomPos = bottomPos - 1;
}
if (bottomPos > 0)
{
if (bottomPos > 0) {
world.setBlock(x, bottomPos + 1, z, this);
}
}
@ -93,5 +96,4 @@ public class BlockFloating extends Block {
return false;
}
}

View file

@ -3,20 +3,34 @@ package com.gildedgames.the_aether.client;
import java.security.Key;
import java.util.List;
import com.gildedgames.the_aether.AetherConfig;
import com.gildedgames.the_aether.client.gui.AetherLoadingScreen;
import com.gildedgames.the_aether.client.gui.GuiCustomizationScreen;
import com.gildedgames.the_aether.client.gui.GuiEnterAether;
import com.gildedgames.the_aether.client.gui.button.*;
import com.gildedgames.the_aether.client.gui.button.GuiAccessoryButton;
import com.gildedgames.the_aether.client.gui.button.GuiCapeButton;
import com.gildedgames.the_aether.client.gui.button.GuiCustomizationScreenButton;
import com.gildedgames.the_aether.client.gui.button.*;
import com.gildedgames.the_aether.client.gui.inventory.GuiAccessories;
import com.gildedgames.the_aether.client.gui.menu.AetherMainMenu;
import com.gildedgames.the_aether.client.gui.menu.GuiMenuToggleButton;
import com.gildedgames.the_aether.client.renders.entity.PlayerAetherRenderer;
import com.gildedgames.the_aether.entities.EntitiesAether;
import com.gildedgames.the_aether.items.ItemAetherSpawnEgg;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.items.armor.ItemAetherArmor;
import com.gildedgames.the_aether.network.AetherGuiHandler;
import com.gildedgames.the_aether.network.AetherNetwork;
import com.gildedgames.the_aether.network.packets.PacketCapeChanged;
import com.gildedgames.the_aether.network.packets.PacketExtendedAttack;
import com.gildedgames.the_aether.network.packets.PacketOpenContainer;
import com.gildedgames.the_aether.player.PlayerAether;
import com.gildedgames.the_aether.player.perks.AetherRankings;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.*;
import net.minecraft.client.gui.inventory.GuiContainer;
@ -39,27 +53,10 @@ import net.minecraft.world.World;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent;
import net.minecraftforge.client.event.RenderPlayerEvent.SetArmorModel;
import com.gildedgames.the_aether.AetherConfig;
import com.gildedgames.the_aether.client.gui.AetherLoadingScreen;
import com.gildedgames.the_aether.client.renders.entity.PlayerAetherRenderer;
import com.gildedgames.the_aether.entities.EntitiesAether;
import com.gildedgames.the_aether.items.ItemAetherSpawnEgg;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.items.armor.ItemAetherArmor;
import com.gildedgames.the_aether.network.AetherGuiHandler;
import com.gildedgames.the_aether.network.AetherNetwork;
import com.gildedgames.the_aether.network.packets.PacketOpenContainer;
import com.gildedgames.the_aether.player.PlayerAether;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
public class AetherClientEvents {
private static boolean wasInAether = false;
@SubscribeEvent
@ -76,8 +73,10 @@ public class AetherClientEvents {
}
}
if (mc.thePlayer != null && !(mc.thePlayer.movementInput instanceof AetherMovementInput)) {
mc.thePlayer.movementInput = new AetherMovementInput(mc, mc.gameSettings);
if (mc.thePlayer != null
&& !(mc.thePlayer.movementInput instanceof AetherMovementInput)) {
mc.thePlayer.movementInput
= new AetherMovementInput(mc, mc.gameSettings);
}
handleExtendedReach(mc);
@ -97,8 +96,7 @@ public class AetherClientEvents {
}
}
private void handleExtendedReach(Minecraft mc)
{
private void handleExtendedReach(Minecraft mc) {
EntityPlayer player = mc.thePlayer;
if (player != null) {
@ -109,9 +107,13 @@ public class AetherClientEvents {
if (stack != null) {
if (isValkyrieItem(stack.getItem())) {
Vec3 playerVision = player.getLookVec();
AxisAlignedBB reachDistance = player.boundingBox.expand(10.0D, 10.0D, 10.0D);
AxisAlignedBB reachDistance
= player.boundingBox.expand(10.0D, 10.0D, 10.0D);
List<Entity> locatedEntities = player.worldObj.getEntitiesWithinAABB(Entity.class, reachDistance);
List<Entity> locatedEntities
= player.worldObj.getEntitiesWithinAABB(
Entity.class, reachDistance
);
Entity found = null;
double foundLen = 0.0D;
@ -123,11 +125,17 @@ public class AetherClientEvents {
Entity ent = (Entity) o;
if (!ent.canBeCollidedWith() && !(ent instanceof EntityDragon)) {
if (!ent.canBeCollidedWith()
&& !(ent instanceof EntityDragon)) {
continue;
}
Vec3 vec = Vec3.createVectorHelper(ent.posX - player.posX, ent.boundingBox.minY + ent.height / 2f - player.posY - player.getEyeHeight(), ent.posZ - player.posZ);
Vec3 vec = Vec3.createVectorHelper(
ent.posX - player.posX,
ent.boundingBox.minY + ent.height / 2f - player.posY
- player.getEyeHeight(),
ent.posZ - player.posZ
);
double len = vec.lengthVector();
if (len > 8.0F) {
@ -137,7 +145,8 @@ public class AetherClientEvents {
vec = vec.normalize();
double dot = playerVision.dotProduct(vec);
if (dot < 1.0 - 0.125 / len || !player.canEntityBeSeen(ent)) {
if (dot < 1.0 - 0.125 / len
|| !player.canEntityBeSeen(ent)) {
continue;
}
@ -150,7 +159,9 @@ public class AetherClientEvents {
if (found != null && player.ridingEntity != found) {
stack.damageItem(1, player);
AetherNetwork.sendToServer(new PacketExtendedAttack(found.getEntityId()));
AetherNetwork.sendToServer(
new PacketExtendedAttack(found.getEntityId())
);
}
}
}
@ -159,36 +170,33 @@ public class AetherClientEvents {
}
}
public boolean isValkyrieItem(Item stackID)
{
return stackID == ItemsAether.valkyrie_shovel || stackID == ItemsAether.valkyrie_axe || stackID == ItemsAether.valkyrie_pickaxe || stackID == ItemsAether.valkyrie_lance;
public boolean isValkyrieItem(Item stackID) {
return stackID == ItemsAether.valkyrie_shovel
|| stackID == ItemsAether.valkyrie_axe
|| stackID == ItemsAether.valkyrie_pickaxe
|| stackID == ItemsAether.valkyrie_lance;
}
@SubscribeEvent
public void onOpenGui(GuiOpenEvent event)
{
public void onOpenGui(GuiOpenEvent event) {
Minecraft mc = FMLClientHandler.instance().getClient();
if (mc.thePlayer != null && event.gui instanceof GuiDownloadTerrain)
{
if (mc.thePlayer != null && event.gui instanceof GuiDownloadTerrain) {
GuiEnterAether enterAether = new GuiEnterAether(true);
GuiEnterAether exitAether = new GuiEnterAether(false);
if (mc.thePlayer.dimension == AetherConfig.getAetherDimensionID())
{
if (mc.thePlayer.dimension == AetherConfig.getAetherDimensionID()) {
event.gui = enterAether;
wasInAether = true;
}
else if (wasInAether)
{
else if (wasInAether) {
event.gui = exitAether;
wasInAether = false;
}
}
}
private void sendPickupPacket(Minecraft mc) {
if (mc.objectMouseOver != null) {
if (!this.onPickEntity(mc.objectMouseOver, mc.thePlayer, mc.theWorld)) {
@ -196,14 +204,21 @@ public class AetherClientEvents {
}
if (mc.thePlayer.capabilities.isCreativeMode) {
int index = mc.thePlayer.inventoryContainer.inventorySlots.size() - 9 + mc.thePlayer.inventory.currentItem;
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) {
private boolean
onPickEntity(MovingObjectPosition target, EntityPlayer player, World world) {
ItemStack result = null;
boolean isCreative = player.capabilities.isCreativeMode;
@ -226,7 +241,8 @@ public class AetherClientEvents {
for (int x = 0; x < 9; x++) {
ItemStack stack = player.inventory.getStackInSlot(x);
if (stack != null && stack.isItemEqual(result) && ItemStack.areItemStackTagsEqual(stack, result)) {
if (stack != null && stack.isItemEqual(result)
&& ItemStack.areItemStackTagsEqual(stack, result)) {
player.inventory.currentItem = x;
return true;
@ -249,7 +265,8 @@ public class AetherClientEvents {
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;
}
@ -273,9 +290,11 @@ public class AetherClientEvents {
}
}
private static final GuiAccessoryButton ACCESSORY_BUTTON = new GuiAccessoryButton(0, 0);
private static final GuiAccessoryButton ACCESSORY_BUTTON
= new GuiAccessoryButton(0, 0);
private static final GuiMenuToggleButton MAIN_MENU_BUTTON = new GuiMenuToggleButton(0, 0);
private static final GuiMenuToggleButton MAIN_MENU_BUTTON
= new GuiMenuToggleButton(0, 0);
private static int previousSelectedTabIndex = -1;
@ -288,60 +307,78 @@ public class AetherClientEvents {
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()) {
event.buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 28, guiTop + 38));
previousSelectedTabIndex = CreativeTabs.tabInventory.getTabIndex();
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) {
event.buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 26, guiTop + 65));
}
if (clazz == GuiAccessories.class)
{
if (!shouldRemoveButton)
{
event.buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 8, guiTop + 65));
} else if (clazz == GuiInventory.class) {
event.buttonList.add(
ACCESSORY_BUTTON.setPosition(guiLeft + 26, guiTop + 65)
);
}
else
{
if (clazz == GuiAccessories.class) {
if (!shouldRemoveButton) {
event.buttonList.add(
ACCESSORY_BUTTON.setPosition(guiLeft + 8, guiTop + 65)
);
} else {
shouldRemoveButton = false;
}
}
}
if (AetherConfig.config.get("Misc", "Enables the Aether Menu toggle button", false).getBoolean() && event.gui instanceof GuiMainMenu)
{
if (AetherConfig.config
.get("Misc", "Enables the Aether Menu toggle button", false)
.getBoolean()
&& event.gui instanceof GuiMainMenu) {
event.buttonList.add(MAIN_MENU_BUTTON.setPosition(event.gui.width - 24, 4));
}
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean() && event.gui.getClass() == GuiMainMenu.class)
{
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean()
&& event.gui.getClass() == GuiMainMenu.class) {
Minecraft.getMinecraft().displayGuiScreen(new AetherMainMenu());
}
if (event.gui.getClass() == GuiOptions.class)
{
if (Minecraft.getMinecraft().thePlayer != null)
{
if (AetherRankings.isRankedPlayer(Minecraft.getMinecraft().thePlayer.getUniqueID()))
{
event.buttonList.add(new GuiCustomizationScreenButton(545, event.gui.width / 2 - 155, event.gui.height / 6 + 48 - 6, 150, 20, I18n.format("gui.options.perk_customization")));
if (event.gui.getClass() == GuiOptions.class) {
if (Minecraft.getMinecraft().thePlayer != null) {
if (AetherRankings.isRankedPlayer(
Minecraft.getMinecraft().thePlayer.getUniqueID()
)) {
event.buttonList.add(new GuiCustomizationScreenButton(
545,
event.gui.width / 2 - 155,
event.gui.height / 6 + 48 - 6,
150,
20,
I18n.format("gui.options.perk_customization")
));
}
}
}
if (event.gui.getClass() == ScreenChatOptions.class)
{
if (Minecraft.getMinecraft().thePlayer != null)
{
if (event.gui.getClass() == ScreenChatOptions.class) {
if (Minecraft.getMinecraft().thePlayer != null) {
int i = 13;
event.buttonList.add(new GuiCapeButton(event.gui.width / 2 - 155 + i % 2 * 160, event.gui.height / 6 + 24 * (i >> 1)));
event.buttonList.add(new GuiCapeButton(
event.gui.width / 2 - 155 + i % 2 * 160,
event.gui.height / 6 + 24 * (i >> 1)
));
}
}
}
@ -349,16 +386,31 @@ public class AetherClientEvents {
@SubscribeEvent
public void onMouseClicked(DrawScreenEvent.Post event) {
if (Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) {
GuiContainerCreative guiScreen = (GuiContainerCreative) Minecraft.getMinecraft().currentScreen;
GuiContainerCreative guiScreen
= (GuiContainerCreative) Minecraft.getMinecraft().currentScreen;
if (previousSelectedTabIndex != guiScreen.func_147056_g()) {
List<GuiButton> buttonList = ObfuscationReflectionHelper.getPrivateValue(GuiScreen.class, (GuiScreen) guiScreen, 4);
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));
buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 28, guiTop + 38)
);
} else if (previousSelectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) {
buttonList.remove(ACCESSORY_BUTTON);
}
@ -369,10 +421,10 @@ public class AetherClientEvents {
}
@SubscribeEvent
public void onDrawGui(GuiScreenEvent.DrawScreenEvent.Pre event)
{
if (!AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean() && event.gui.getClass() == AetherMainMenu.class)
{
public void onDrawGui(GuiScreenEvent.DrawScreenEvent.Pre event) {
if (!AetherConfig.config.get("Misc", "Enables the Aether Menu", false)
.getBoolean()
&& event.gui.getClass() == AetherMainMenu.class) {
Minecraft.getMinecraft().displayGuiScreen(new GuiMainMenu());
}
}
@ -381,23 +433,27 @@ public class AetherClientEvents {
public void onButtonPressed(GuiScreenEvent.ActionPerformedEvent.Pre event) {
Class<?> clazz = event.gui.getClass();
if ((clazz == GuiInventory.class || clazz == GuiContainerCreative.class) && event.button.id == 18067) {
AetherNetwork.sendToServer(new PacketOpenContainer(AetherGuiHandler.accessories));
if ((clazz == GuiInventory.class || clazz == GuiContainerCreative.class)
&& event.button.id == 18067) {
AetherNetwork.sendToServer(
new PacketOpenContainer(AetherGuiHandler.accessories)
);
}
if (event.button.getClass() == GuiCustomizationScreenButton.class)
{
Minecraft.getMinecraft().displayGuiScreen(new GuiCustomizationScreen(event.gui));
if (event.button.getClass() == GuiCustomizationScreenButton.class) {
Minecraft.getMinecraft().displayGuiScreen(new GuiCustomizationScreen(event.gui
));
}
if (event.button.getClass() == GuiCapeButton.class)
{
if (event.button.getClass() == GuiCapeButton.class) {
PlayerAether player = PlayerAether.get(Minecraft.getMinecraft().thePlayer);
boolean enableCape = !player.shouldRenderCape;
player.shouldRenderCape = enableCape;
AetherNetwork.sendToServer(new PacketCapeChanged(player.getEntity().getEntityId(), player.shouldRenderCape));
AetherNetwork.sendToServer(new PacketCapeChanged(
player.getEntity().getEntityId(), player.shouldRenderCape
));
}
}
@ -407,7 +463,9 @@ public class AetherClientEvents {
PlayerAether playerAether = PlayerAether.get(player);
if (playerAether != null) {
if (playerAether.getAccessoryInventory().wearingAccessory(new ItemStack(ItemsAether.invisibility_cape))) {
if (playerAether.getAccessoryInventory().wearingAccessory(
new ItemStack(ItemsAether.invisibility_cape)
)) {
event.setCanceled(true);
}
}
@ -423,7 +481,12 @@ public class AetherClientEvents {
@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);
event.result = PlayerAetherRenderer.instance().renderAetherArmor(
PlayerAether.get(event.entityPlayer),
event.renderer,
event.stack,
3 - event.slot
);
}
}
@ -432,27 +495,30 @@ public class AetherClientEvents {
if (event.entity instanceof EntityPlayer) {
PlayerAether playerAether = PlayerAether.get((EntityPlayer) event.entity);
if (event.renderer instanceof RenderPlayer)
{
PlayerAetherRenderer.instance().renderAccessories(playerAether, (RenderPlayer) event.renderer, event.x, event.y, event.z, PlayerAetherRenderer.instance().getPartialTicks());
if (event.renderer instanceof RenderPlayer) {
PlayerAetherRenderer.instance().renderAccessories(
playerAether,
(RenderPlayer) event.renderer,
event.x,
event.y,
event.z,
PlayerAetherRenderer.instance().getPartialTicks()
);
}
}
}
@SubscribeEvent
public void onKeyInputEvent(InputEvent.KeyInputEvent event)
{
if (Minecraft.getMinecraft().thePlayer != null)
{
if (AetherKeybinds.keyBindingAccessories.isPressed())
{
if (Minecraft.getMinecraft().currentScreen == null)
{
AetherNetwork.sendToServer(new PacketOpenContainer(AetherGuiHandler.accessories));
public void onKeyInputEvent(InputEvent.KeyInputEvent event) {
if (Minecraft.getMinecraft().thePlayer != null) {
if (AetherKeybinds.keyBindingAccessories.isPressed()) {
if (Minecraft.getMinecraft().currentScreen == null) {
AetherNetwork.sendToServer(
new PacketOpenContainer(AetherGuiHandler.accessories)
);
shouldRemoveButton = true;
}
}
}
}
}

View file

@ -4,17 +4,16 @@ import cpw.mods.fml.client.registry.ClientRegistry;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
public class AetherKeybinds
{
public class AetherKeybinds {
public static KeyBinding[] keyBindings = new KeyBinding[1];
public static KeyBinding keyBindingAccessories = new KeyBinding("key.aether.accessory_menu", Keyboard.KEY_I, "key.aether.category");
public static KeyBinding keyBindingAccessories = new KeyBinding(
"key.aether.accessory_menu", Keyboard.KEY_I, "key.aether.category"
);
public static void initialization()
{
public static void initialization() {
keyBindings[0] = keyBindingAccessories;
for (int i = 0; i < keyBindings.length; ++i)
{
for (int i = 0; i < keyBindings.length; ++i) {
ClientRegistry.registerKeyBinding(keyBindings[i]);
}
}

View file

@ -5,13 +5,11 @@ import com.gildedgames.the_aether.entities.util.EntityMountable;
import com.gildedgames.the_aether.entities.util.EntitySaddleMount;
import com.gildedgames.the_aether.network.AetherNetwork;
import com.gildedgames.the_aether.network.packets.PacketSendSneaking;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.util.MovementInputFromOptions;
public class AetherMovementInput extends MovementInputFromOptions {
private Minecraft mc;
private GameSettings gameSettings;
@ -47,7 +45,9 @@ public class AetherMovementInput extends MovementInputFromOptions {
this.currentSneak = isSneaking;
if (this.previousSneak != this.currentSneak) {
AetherNetwork.sendToServer(new PacketSendSneaking(this.mc.thePlayer.getEntityId(), this.currentSneak));
AetherNetwork.sendToServer(new PacketSendSneaking(
this.mc.thePlayer.getEntityId(), this.currentSneak
));
this.previousSneak = this.currentSneak;
}
@ -59,5 +59,4 @@ public class AetherMovementInput extends MovementInputFromOptions {
this.sneak = false;
}
}
}

View file

@ -1,12 +1,11 @@
package com.gildedgames.the_aether.client;
import com.gildedgames.the_aether.AetherConfig;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import com.gildedgames.the_aether.AetherConfig;
import com.gildedgames.the_aether.CommonProxy;
import com.gildedgames.the_aether.client.audio.AetherMusicHandler;
import com.gildedgames.the_aether.client.gui.AetherLoadingScreen;
@ -15,61 +14,130 @@ import com.gildedgames.the_aether.client.gui.GuiSunAltar;
import com.gildedgames.the_aether.client.renders.AetherEntityRenderer;
import com.gildedgames.the_aether.client.renders.RendersAether;
import com.gildedgames.the_aether.compatibility.client.AetherClientCompatibility;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
public class ClientProxy extends CommonProxy {
public static final IIcon[] ACCESSORY_ICONS = new IIcon[8];
@Override
public void init() {
try
{
File resourcePacks = Minecraft.getMinecraft().getResourcePackRepository().getDirResourcepacks().getCanonicalFile();
try {
File resourcePacks = Minecraft.getMinecraft()
.getResourcePackRepository()
.getDirResourcepacks()
.getCanonicalFile();
File buckets = new File(resourcePacks + "/Aether b1.7.3 Textures/assets/aether_legacy/textures/items/misc/buckets");
File weapons = new File(resourcePacks + "/Aether b1.7.3 Textures/assets/aether_legacy/textures/items/weapons");
File armor = new File(resourcePacks + "/Aether b1.7.3 Textures/assets/aether_legacy/textures/items/armor");
File accessories = new File(resourcePacks + "/Aether b1.7.3 Textures/assets/aether_legacy/textures/items/accessories");
File weapons = new File(
resourcePacks
+ "/Aether b1.7.3 Textures/assets/aether_legacy/textures/items/weapons"
);
File armor = new File(
resourcePacks
+ "/Aether b1.7.3 Textures/assets/aether_legacy/textures/items/armor"
);
File accessories = new File(
resourcePacks
+ "/Aether b1.7.3 Textures/assets/aether_legacy/textures/items/accessories"
);
File[] directories = new File[] {buckets, weapons, armor, accessories};
File[] directories = new File[] { buckets, weapons, armor, accessories };
if (AetherConfig.installResourcepack())
{
for (File file : directories)
{
if (!file.exists())
{
if (AetherConfig.installResourcepack()) {
for (File file : directories) {
if (!file.exists()) {
file.mkdirs();
}
}
generateFile("data/Aether_b1.7.3/pack.mcmeta", "pack.mcmeta", resourcePacks.getAbsolutePath() + "/Aether b1.7.3 Textures");
generateFile("data/Aether_b1.7.3/pack.png", "pack.png", resourcePacks.getAbsolutePath() + "/Aether b1.7.3 Textures");
generateFile("data/Aether_b1.7.3/skyroot_remedy_bucket.png", "skyroot_remedy_bucket.png", buckets.getAbsolutePath());
generateFile("data/Aether_b1.7.3/weapons/bow_pulling_0.png", "bow_pulling_0.png", weapons.getAbsolutePath());
generateFile("data/Aether_b1.7.3/weapons/bow_pulling_1.png", "bow_pulling_1.png", weapons.getAbsolutePath());
generateFile("data/Aether_b1.7.3/weapons/bow_pulling_2.png", "bow_pulling_2.png", weapons.getAbsolutePath());
generateFile("data/Aether_b1.7.3/weapons/flaming_sword.png", "flaming_sword.png", weapons.getAbsolutePath());
generateFile("data/Aether_b1.7.3/weapons/holy_sword.png", "holy_sword.png", weapons.getAbsolutePath());
generateFile("data/Aether_b1.7.3/weapons/lightning_sword.png", "lightning_sword.png", weapons.getAbsolutePath());
generateFile("data/Aether_b1.7.3/weapons/phoenix_bow.png", "phoenix_bow.png", weapons.getAbsolutePath());
generateFile("data/Aether_b1.7.3/armor/phoenix_boots.png", "phoenix_boots.png", armor.getAbsolutePath());
generateFile("data/Aether_b1.7.3/armor/phoenix_leggings.png", "phoenix_leggings.png", armor.getAbsolutePath());
generateFile("data/Aether_b1.7.3/armor/phoenix_chestplate.png", "phoenix_chestplate.png", armor.getAbsolutePath());
generateFile("data/Aether_b1.7.3/armor/phoenix_helmet.png", "phoenix_helmet.png", armor.getAbsolutePath());
generateFile("data/Aether_b1.7.3/accessories/phoenix_gloves.png", "phoenix_gloves.png", accessories.getAbsolutePath());
generateFile("data/Aether_b1.7.3/accessories/agility_cape.png", "agility_cape.png", accessories.getAbsolutePath());
generateFile(
"data/Aether_b1.7.3/pack.mcmeta",
"pack.mcmeta",
resourcePacks.getAbsolutePath() + "/Aether b1.7.3 Textures"
);
generateFile(
"data/Aether_b1.7.3/pack.png",
"pack.png",
resourcePacks.getAbsolutePath() + "/Aether b1.7.3 Textures"
);
generateFile(
"data/Aether_b1.7.3/skyroot_remedy_bucket.png",
"skyroot_remedy_bucket.png",
buckets.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/weapons/bow_pulling_0.png",
"bow_pulling_0.png",
weapons.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/weapons/bow_pulling_1.png",
"bow_pulling_1.png",
weapons.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/weapons/bow_pulling_2.png",
"bow_pulling_2.png",
weapons.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/weapons/flaming_sword.png",
"flaming_sword.png",
weapons.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/weapons/holy_sword.png",
"holy_sword.png",
weapons.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/weapons/lightning_sword.png",
"lightning_sword.png",
weapons.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/weapons/phoenix_bow.png",
"phoenix_bow.png",
weapons.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/armor/phoenix_boots.png",
"phoenix_boots.png",
armor.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/armor/phoenix_leggings.png",
"phoenix_leggings.png",
armor.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/armor/phoenix_chestplate.png",
"phoenix_chestplate.png",
armor.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/armor/phoenix_helmet.png",
"phoenix_helmet.png",
armor.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/accessories/phoenix_gloves.png",
"phoenix_gloves.png",
accessories.getAbsolutePath()
);
generateFile(
"data/Aether_b1.7.3/accessories/agility_cape.png",
"agility_cape.png",
accessories.getAbsolutePath()
);
}
}
catch (IOException ignore) { }
} catch (IOException ignore) {}
berryBushRenderID = RenderingRegistry.getNextAvailableRenderId();
treasureChestRenderID = RenderingRegistry.getNextAvailableRenderId();
@ -77,7 +145,11 @@ public class ClientProxy extends CommonProxy {
EntityRenderer previousRenderer = Minecraft.getMinecraft().entityRenderer;
Minecraft.getMinecraft().entityRenderer = new AetherEntityRenderer(Minecraft.getMinecraft(), previousRenderer, Minecraft.getMinecraft().getResourceManager());
Minecraft.getMinecraft().entityRenderer = new AetherEntityRenderer(
Minecraft.getMinecraft(),
previousRenderer,
Minecraft.getMinecraft().getResourceManager()
);
RendersAether.initialization();
@ -90,21 +162,18 @@ public class ClientProxy extends CommonProxy {
AetherClientCompatibility.initialization();
}
public void generateFile(String input, String name, String path)
{
public void generateFile(String input, String name, String path) {
try {
File file = new File(path + "/" + name);
if (!file.exists())
{
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(input);
if (!file.exists()) {
InputStream inputStream
= this.getClass().getClassLoader().getResourceAsStream(input);
FileOutputStream outputStream = new FileOutputStream(file);
if (inputStream != null)
{
if (inputStream != null) {
int i;
while ((i = inputStream.read()) != -1)
{
while ((i = inputStream.read()) != -1) {
outputStream.write(i);
}
@ -112,15 +181,15 @@ public class ClientProxy extends CommonProxy {
outputStream.close();
}
}
}
catch (IOException ignore) { }
} catch (IOException ignore) {}
}
@Override
public void sendMessage(EntityPlayer player, String text) {
if (this.getPlayer() == player)
{
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(text));
if (this.getPlayer() == player) {
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(
new ChatComponentText(text)
);
}
}
@ -133,5 +202,4 @@ public class ClientProxy extends CommonProxy {
public EntityPlayer getPlayer() {
return Minecraft.getMinecraft().thePlayer;
}
}

View file

@ -2,6 +2,11 @@ package com.gildedgames.the_aether.client.audio;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.AetherConfig;
import com.gildedgames.the_aether.client.audio.music.AetherMusicTicker;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.PositionedSoundRecord;
@ -12,15 +17,7 @@ import net.minecraft.client.gui.GuiScreenWorking;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.sound.PlaySoundEvent17;
import com.gildedgames.the_aether.client.audio.music.AetherMusicTicker;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class AetherMusicHandler {
private Minecraft mc = Minecraft.getMinecraft();
private final AetherMusicTicker musicTicker = new AetherMusicTicker(this.mc);
@ -41,25 +38,21 @@ public class AetherMusicHandler {
}
}
if (!(mc.getSoundHandler().isSoundPlaying(musicTicker.getRecord())))
{
if (!(mc.getSoundHandler().isSoundPlaying(musicTicker.getRecord()))) {
musicTicker.trackRecord(null);
}
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean() && Minecraft.getMinecraft().theWorld == null && !(screen instanceof GuiScreenWorking))
{
if (!musicTicker.playingMenuMusic())
{
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean()
&& Minecraft.getMinecraft().theWorld == null
&& !(screen instanceof GuiScreenWorking)) {
if (!musicTicker.playingMenuMusic()) {
musicTicker.playMenuMusic();
}
if (musicTicker.playingMinecraftMusic())
{
if (musicTicker.playingMinecraftMusic()) {
musicTicker.stopMinecraftMusic();
}
}
else
{
} else {
musicTicker.stopMenuMusic();
}
}
@ -76,19 +69,27 @@ public class AetherMusicHandler {
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 (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;
}
}
if (sound.getPositionedSoundLocation().toString().equals("minecraft:music.menu"))
{
if (sound.getPositionedSoundLocation().toString().equals(
"minecraft:music.menu"
)) {
musicTicker.trackMinecraftMusic(sound);
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean() && Minecraft.getMinecraft().theWorld == null && !(screen instanceof GuiScreenWorking))
{
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false)
.getBoolean()
&& Minecraft.getMinecraft().theWorld == null
&& !(screen instanceof GuiScreenWorking)) {
event.result = null;
}
}
@ -102,9 +103,10 @@ public class AetherMusicHandler {
@SideOnly(Side.CLIENT)
public static ISound getAchievementSound(int number) {
ResourceLocation sound = number == 1 ? Aether.locate("achievement_bronze") : number == 2 ? Aether.locate("achievement_silver") : Aether.locate("achievement");
ResourceLocation sound = number == 1 ? Aether.locate("achievement_bronze")
: number == 2 ? Aether.locate("achievement_silver")
: Aether.locate("achievement");
return PositionedSoundRecord.func_147673_a(sound);
}
}

View file

@ -4,6 +4,8 @@ import java.util.Random;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.AetherConfig;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.PositionedSoundRecord;
@ -12,12 +14,8 @@ import net.minecraft.server.gui.IUpdatePlayerListBox;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class AetherMusicTicker implements IUpdatePlayerListBox {
private final Random rand = new Random();
private final Minecraft mc;
private ISound currentMusic, currentRecord, menuMusic, minecraftMusic;
@ -46,11 +44,19 @@ public class AetherMusicTicker implements IUpdatePlayerListBox {
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(
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);
@ -67,51 +73,50 @@ public class AetherMusicTicker implements IUpdatePlayerListBox {
return this.currentMusic != null;
}
public boolean playingRecord()
{
public boolean playingRecord() {
return this.currentRecord != null;
}
public boolean playingMenuMusic()
{
public boolean playingMenuMusic() {
return this.menuMusic != null;
}
public boolean playingMinecraftMusic()
{
public boolean playingMinecraftMusic() {
return this.minecraftMusic != null;
}
public ISound getRecord()
{
public ISound getRecord() {
return this.currentRecord;
}
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.currentMusic
= PositionedSoundRecord.func_147673_a(requestedMusicType.getMusicLocation());
this.mc.getSoundHandler().playSound(this.currentMusic);
this.timeUntilNextMusic = Integer.MAX_VALUE;
}
public void trackRecord(ISound record)
{
public void trackRecord(ISound record) {
this.currentRecord = record;
}
public void trackMinecraftMusic(ISound record)
{
public void trackMinecraftMusic(ISound record) {
this.minecraftMusic = record;
}
public void playMenuMusic()
{
this.menuMusic = PositionedSoundRecord.func_147673_a(TrackType.TRACK_MENU.getMusicLocation());
public void playMenuMusic() {
this.menuMusic
= PositionedSoundRecord.func_147673_a(TrackType.TRACK_MENU.getMusicLocation()
);
this.mc.getSoundHandler().playSound(this.menuMusic);
}
@ -123,19 +128,15 @@ public class AetherMusicTicker implements IUpdatePlayerListBox {
}
}
public void stopMenuMusic()
{
if (this.menuMusic != null)
{
public void stopMenuMusic() {
if (this.menuMusic != null) {
this.mc.getSoundHandler().stopSound(this.menuMusic);
this.menuMusic = null;
}
}
public void stopMinecraftMusic()
{
if (this.minecraftMusic != null)
{
public void stopMinecraftMusic() {
if (this.minecraftMusic != null) {
this.mc.getSoundHandler().stopSound(this.minecraftMusic);
this.minecraftMusic = null;
}
@ -153,7 +154,9 @@ public class AetherMusicTicker implements IUpdatePlayerListBox {
private final int minDelay;
private final int maxDelay;
private TrackType(ResourceLocation musicLocationIn, int minDelayIn, int maxDelayIn) {
private TrackType(
ResourceLocation musicLocationIn, int minDelayIn, int maxDelayIn
) {
this.musicLocation = musicLocationIn;
this.minDelay = minDelayIn;
this.maxDelay = maxDelayIn;
@ -171,5 +174,4 @@ public class AetherMusicTicker implements IUpdatePlayerListBox {
return this.maxDelay;
}
}
}

View file

@ -1,5 +1,7 @@
package com.gildedgames.the_aether.client.gui;
import com.gildedgames.the_aether.client.gui.trivia.AetherTrivia;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.LoadingScreenRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
@ -7,15 +9,9 @@ import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.shader.Framebuffer;
import org.lwjgl.opengl.GL11;
import com.gildedgames.the_aether.client.gui.trivia.AetherTrivia;
import cpw.mods.fml.client.FMLClientHandler;
public class AetherLoadingScreen extends LoadingScreenRenderer {
private String message = "";
private Minecraft mc;
@ -56,7 +52,9 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
if (j - this.systemTime >= 100L) {
this.systemTime = j;
ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
ScaledResolution scaledresolution = new ScaledResolution(
this.mc, this.mc.displayWidth, this.mc.displayHeight
);
int k = scaledresolution.getScaleFactor();
int l = scaledresolution.getScaledWidth();
int i1 = scaledresolution.getScaledHeight();
@ -70,7 +68,14 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
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.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);
@ -85,9 +90,19 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
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, (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();
@ -106,7 +121,9 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
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 + b1), 0.0D
);
tessellator.addVertex((double) (j1 + progress), (double) k1, 0.0D);
tessellator.draw();
GL11.glEnable(GL11.GL_TEXTURE_2D);
@ -114,8 +131,19 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
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, (l - this.mc.fontRenderer.getStringWidth(this.currentDisplayedTrivia)) / 2, i1 - 16, 0xffff99);
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,
(l - this.mc.fontRenderer.getStringWidth(this.currentDisplayedTrivia))
/ 2,
i1 - 16,
0xffff99
);
}
this.framebuffer.unbindFramebuffer();
@ -133,5 +161,4 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
}
}
}
}

View file

@ -1,5 +1,8 @@
package com.gildedgames.the_aether.client.gui;
import com.gildedgames.the_aether.client.overlay.AetherOverlay;
import com.gildedgames.the_aether.player.PlayerAether;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
@ -8,13 +11,7 @@ import net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import com.gildedgames.the_aether.client.overlay.AetherOverlay;
import com.gildedgames.the_aether.player.PlayerAether;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class GuiAetherInGame extends Gui {
private Minecraft mc;
public GuiAetherInGame(Minecraft mc) {
@ -27,7 +24,8 @@ public class GuiAetherInGame extends Gui {
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);
}
}
@ -50,11 +48,14 @@ public class GuiAetherInGame extends Gui {
AetherOverlay.renderBossHP(this.mc);
}
float portalTime = player.prevTimeInPortal + (player.timeInPortal - player.prevTimeInPortal) * event.partialTicks;
float portalTime = player.prevTimeInPortal
+ (player.timeInPortal - player.prevTimeInPortal) * event.partialTicks;
if (portalTime > 0.0F) {
AetherOverlay.renderAetherPortal(portalTime, new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight));
AetherOverlay.renderAetherPortal(
portalTime,
new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight)
);
}
}
}

View file

@ -15,75 +15,82 @@ import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
@SideOnly(Side.CLIENT)
public class GuiCustomizationScreen extends GuiScreen
{
public class GuiCustomizationScreen extends GuiScreen {
private final GuiScreen parentScreen;
private String title;
public GuiCustomizationScreen(GuiScreen parentScreenIn)
{
public GuiCustomizationScreen(GuiScreen parentScreenIn) {
this.parentScreen = parentScreenIn;
}
@Override
public void initGui()
{
public void initGui() {
int i = 0;
this.title = I18n.format("gui.options.perk_customization.title");
this.buttonList.add(new GuiHaloButton(this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1)));
this.buttonList.add(new GuiHaloButton(
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1)
));
++i;
if (AetherRankings.isDeveloper(Minecraft.getMinecraft().thePlayer.getUniqueID()))
{
this.buttonList.add(new GuiGlowButton(this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1)));
if (AetherRankings.isDeveloper(Minecraft.getMinecraft().thePlayer.getUniqueID()
)) {
this.buttonList.add(new GuiGlowButton(
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1)
));
++i;
}
if (i % 2 == 1)
{
if (i % 2 == 1) {
++i;
}
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 24 * (i >> 1), I18n.format("gui.done")));
this.buttonList.add(new GuiButton(
200,
this.width / 2 - 100,
this.height / 6 + 24 * (i >> 1),
I18n.format("gui.done")
));
}
@Override
protected void actionPerformed(GuiButton button)
{
if (button.enabled)
{
if (button.id == 200)
{
protected void actionPerformed(GuiButton button) {
if (button.enabled) {
if (button.id == 200) {
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(this.parentScreen);
}
else if (button.id == 201)
{
} else if (button.id == 201) {
PlayerAether player = PlayerAether.get(mc.thePlayer);
boolean enableHalo = !player.shouldRenderHalo;
player.shouldRenderHalo = enableHalo;
AetherNetwork.sendToServer(new PacketPerkChanged(player.getEntity().getEntityId(), EnumAetherPerkType.Halo, player.shouldRenderHalo));
}
else if (button.id == 202)
{
AetherNetwork.sendToServer(new PacketPerkChanged(
player.getEntity().getEntityId(),
EnumAetherPerkType.Halo,
player.shouldRenderHalo
));
} else if (button.id == 202) {
PlayerAether player = PlayerAether.get(mc.thePlayer);
boolean enableGlow = !player.shouldRenderGlow;
player.shouldRenderGlow = enableGlow;
AetherNetwork.sendToServer(new PacketPerkChanged(player.getEntity().getEntityId(), EnumAetherPerkType.Glow, player.shouldRenderGlow));
AetherNetwork.sendToServer(new PacketPerkChanged(
player.getEntity().getEntityId(),
EnumAetherPerkType.Glow,
player.shouldRenderGlow
));
}
}
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.drawDefaultBackground();
this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 20, 16777215);
this.drawCenteredString(
this.fontRendererObj, this.title, this.width / 2, 20, 16777215
);
super.drawScreen(mouseX, mouseY, partialTicks);
}
}

View file

@ -2,23 +2,20 @@ package com.gildedgames.the_aether.client.gui;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.AetherConfig;
import com.gildedgames.the_aether.inventory.ContainerEnchanter;
import com.gildedgames.the_aether.tileentity.TileEntityEnchanter;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.gildedgames.the_aether.inventory.ContainerEnchanter;
import com.gildedgames.the_aether.tileentity.TileEntityEnchanter;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiEnchanter extends GuiContainer {
private static final ResourceLocation TEXTURE = Aether.locate("textures/gui/altar.png");
private static final ResourceLocation TEXTURE
= Aether.locate("textures/gui/altar.png");
private TileEntityEnchanter enchanter;
@ -29,12 +26,19 @@ public class GuiEnchanter extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String enchanterName = AetherConfig.legacyAltarName() ?
I18n.format("container.aether_legacy.enchanter")
String enchanterName = AetherConfig.legacyAltarName()
? I18n.format("container.aether_legacy.enchanter")
: I18n.format("container.aether_legacy.altar");
this.fontRendererObj.drawString(enchanterName, this.xSize / 2 - this.fontRendererObj.getStringWidth(enchanterName) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(
enchanterName,
this.xSize / 2 - this.fontRendererObj.getStringWidth(enchanterName) / 2,
6,
4210752
);
this.fontRendererObj.drawString(
I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752
);
}
@Override
@ -48,11 +52,12 @@ public class GuiEnchanter extends GuiContainer {
if (this.enchanter.isEnchanting()) {
i1 = this.enchanter.getEnchantmentTimeRemaining(12);
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2);
this.drawTexturedModalRect(
k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2
);
}
i1 = this.enchanter.getEnchantmentProgressScaled(24);
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
}
}

View file

@ -4,40 +4,56 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
public class GuiEnterAether extends GuiScreen
{
public class GuiEnterAether extends GuiScreen {
public boolean aether;
public GuiEnterAether(boolean dimension)
{
public GuiEnterAether(boolean dimension) {
aether = dimension;
}
public void initGui()
{
public void initGui() {
this.buttonList.clear();
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.drawBackground(0);
if (aether)
{
this.drawCenteredString(this.fontRendererObj, I18n.format("gui.loading.enteraether"), this.width / 2, this.height / 2 - 45, 16777215);
this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain"), this.width / 2, this.height / 2 - 25, 16777215);
}
else
{
this.drawCenteredString(this.fontRendererObj, I18n.format("gui.loading.exitaether"), this.width / 2, this.height / 2 - 45, 16777215);
this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain"), this.width / 2, this.height / 2 - 25, 16777215);
if (aether) {
this.drawCenteredString(
this.fontRendererObj,
I18n.format("gui.loading.enteraether"),
this.width / 2,
this.height / 2 - 45,
16777215
);
this.drawCenteredString(
this.fontRendererObj,
I18n.format("multiplayer.downloadingTerrain"),
this.width / 2,
this.height / 2 - 25,
16777215
);
} else {
this.drawCenteredString(
this.fontRendererObj,
I18n.format("gui.loading.exitaether"),
this.width / 2,
this.height / 2 - 45,
16777215
);
this.drawCenteredString(
this.fontRendererObj,
I18n.format("multiplayer.downloadingTerrain"),
this.width / 2,
this.height / 2 - 25,
16777215
);
}
super.drawScreen(mouseX, mouseY, partialTicks);
}
public boolean doesGuiPauseGame()
{
public boolean doesGuiPauseGame() {
return false;
}
}

View file

@ -1,23 +1,20 @@
package com.gildedgames.the_aether.client.gui;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.inventory.ContainerFreezer;
import com.gildedgames.the_aether.tileentity.TileEntityFreezer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.gildedgames.the_aether.inventory.ContainerFreezer;
import com.gildedgames.the_aether.tileentity.TileEntityFreezer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiFreezer extends GuiContainer {
private static final ResourceLocation TEXTURE = Aether.locate("textures/gui/altar.png");
private static final ResourceLocation TEXTURE
= Aether.locate("textures/gui/altar.png");
private TileEntityFreezer freezer;
@ -30,8 +27,15 @@ public class GuiFreezer extends GuiContainer {
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);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(
freezerName,
this.xSize / 2 - this.fontRendererObj.getStringWidth(freezerName) / 2,
6,
4210752
);
this.fontRendererObj.drawString(
I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752
);
}
@Override
@ -45,11 +49,12 @@ public class GuiFreezer extends GuiContainer {
if (this.freezer.isFreezing()) {
i1 = this.freezer.getFreezingTimeRemaining(12);
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2);
this.drawTexturedModalRect(
k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2
);
}
i1 = this.freezer.getFreezingProgressScaled(24);
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
}
}

View file

@ -1,24 +1,26 @@
package com.gildedgames.the_aether.client.gui;
import com.gildedgames.the_aether.Aether;
import org.lwjgl.opengl.GL11;
import com.gildedgames.the_aether.inventory.ContainerIncubator;
import com.gildedgames.the_aether.tileentity.TileEntityIncubator;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import com.gildedgames.the_aether.inventory.ContainerIncubator;
import com.gildedgames.the_aether.tileentity.TileEntityIncubator;
import org.lwjgl.opengl.GL11;
public class GuiIncubator extends GuiContainer {
private TileEntityIncubator incubatorInventory;
private static final ResourceLocation TEXTURE_INCUBATOR = Aether.locate("textures/gui/incubator.png");
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;
@ -28,8 +30,15 @@ public class GuiIncubator extends GuiContainer {
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);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 0x404040);
this.fontRendererObj.drawString(
incubatorName,
this.xSize / 2 - this.fontRendererObj.getStringWidth(incubatorName) / 2,
6,
4210752
);
this.fontRendererObj.drawString(
I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 0x404040
);
}
@Override
@ -53,5 +62,4 @@ public class GuiIncubator extends GuiContainer {
this.drawTexturedModalRect(j + 103, k + 70 - i1, 179, 70 - i1, 10, i1);
}
}

View file

@ -3,6 +3,9 @@ package com.gildedgames.the_aether.client.gui;
import java.util.List;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.client.gui.button.GuiLoreButton;
import com.gildedgames.the_aether.inventory.ContainerLore;
import com.gildedgames.the_aether.registry.AetherLore;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
@ -10,18 +13,14 @@ import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.gildedgames.the_aether.client.gui.button.GuiLoreButton;
import com.gildedgames.the_aether.inventory.ContainerLore;
import com.gildedgames.the_aether.registry.AetherLore;
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;
@ -42,8 +41,12 @@ public class GuiLore extends GuiContainer {
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);
@ -69,30 +72,57 @@ public class GuiLore extends GuiContainer {
this.fontRendererObj.drawString("Item :", 75, 0, 4210752);
ItemStack searchedStack = ((ContainerLore) this.inventorySlots).loreSlot.getStackInSlot(0);
ItemStack searchedStack
= ((ContainerLore) this.inventorySlots).loreSlot.getStackInSlot(0);
if (searchedStack != null) {
if (this.currentItem == null || (searchedStack.getItem() != this.currentItem.getItem() || (!searchedStack.isItemStackDamageable() && searchedStack.getItemDamage() != this.currentItem.getItemDamage()))) {
if (this.currentItem == null
|| (searchedStack.getItem() != this.currentItem.getItem()
|| (!searchedStack.isItemStackDamageable()
&& searchedStack.getItemDamage()
!= this.currentItem.getItemDamage()))) {
this.pageNumber = 0;
this.stringToLoad = I18n.format(AetherLore.getLoreEntryKey(searchedStack));
this.stringToLoad
= I18n.format(AetherLore.getLoreEntryKey(searchedStack));
this.currentItem = searchedStack;
}
int nameSize = 0;
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);
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)) {
int actualSize = this.pageNumber >= 1 ? size - ((15 - (nameSize - 1)) * this.pageNumber) : size + (nameSize - 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);
this.fontRendererObj.drawString(
lore,
(((actualSize >= 6 ? 184 : 71))
- this.fontRendererObj.getStringWidth(lore) / 2),
(actualSize >= 6 ? -68 : 28) + (10 * actualSize),
4210752
);
}
size++;
@ -115,11 +145,16 @@ public class GuiLore extends GuiContainer {
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);
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);
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
);
}
}

View file

@ -1,23 +1,19 @@
package com.gildedgames.the_aether.client.gui;
import com.gildedgames.the_aether.Aether;
import org.lwjgl.opengl.GL11;
import com.gildedgames.the_aether.client.gui.button.GuiSunAltarSlider;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import com.gildedgames.the_aether.client.gui.button.GuiSunAltarSlider;
import org.lwjgl.opengl.GL11;
public class GuiSunAltar extends GuiScreen {
private static final ResourceLocation TEXTURE = Aether.locate("textures/gui/sun_altar.png");
private static final ResourceLocation TEXTURE
= Aether.locate("textures/gui/sun_altar.png");
private World world;
public GuiSunAltar() {
}
public GuiSunAltar() {}
@SuppressWarnings("unchecked")
@Override
@ -26,7 +22,9 @@ public class GuiSunAltar extends GuiScreen {
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
@ -41,7 +39,12 @@ public class GuiSunAltar extends GuiScreen {
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.fontRendererObj.drawString(
"Sun Altar",
(this.width - this.fontRendererObj.getStringWidth("Sun Altar")) / 2,
k + 20,
0x404040
);
super.drawScreen(mouseX, mouseY, partialTicks);
}
@ -51,10 +54,9 @@ public class GuiSunAltar extends GuiScreen {
return false;
}
protected void keyTyped(char p_73869_1_, int p_73869_2_)
{
if (p_73869_2_ == 1 || p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode())
{
protected void keyTyped(char p_73869_1_, int p_73869_2_) {
if (p_73869_2_ == 1
|| p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
this.mc.thePlayer.closeScreen();
}
}

View file

@ -1,27 +1,27 @@
package com.gildedgames.the_aether.client.gui;
import com.gildedgames.the_aether.tileentity.TileEntityTreasureChest;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.gildedgames.the_aether.tileentity.TileEntityTreasureChest;
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");
private static final ResourceLocation CHEST_GUI_TEXTURE
= new ResourceLocation("textures/gui/container/generic_54.png");
private final int inventoryRows;
private String chestType;
public GuiTreasureChest(InventoryPlayer playerInventory, TileEntityTreasureChest chestInventory) {
public GuiTreasureChest(
InventoryPlayer playerInventory, TileEntityTreasureChest chestInventory
) {
super(new ContainerChest(playerInventory, chestInventory));
this.allowUserInput = false;
@ -51,12 +51,15 @@ public class GuiTreasureChest extends GuiContainer {
/**
* Draws the background layer of this container (behind the items).
*/
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
protected void
drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
int i = (this.width - this.xSize) / 2;
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.drawTexturedModalRect(
i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96
);
}
}

View file

@ -4,14 +4,14 @@ import com.gildedgames.the_aether.Aether;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
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) {
super(18067, x, y, 12, 12, "");
@ -26,13 +26,17 @@ public class GuiAccessoryButton extends GuiButton {
@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;
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);
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);
@ -40,5 +44,4 @@ public class GuiAccessoryButton extends GuiButton {
GL11.glPopMatrix();
}
}
}

View file

@ -1,20 +1,18 @@
package com.gildedgames.the_aether.client.gui.button;
import com.gildedgames.the_aether.Aether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
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;
@ -75,34 +73,66 @@ public class GuiAetherButton extends GuiButton {
FontRenderer fontrenderer = minecraft.fontRenderer;
minecraft.renderEngine.bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
boolean flag = i >= this.xPosition && j >= this.yPosition && i < this.xPosition + this.width && j < this.yPosition + this.height;
boolean flag = i >= this.xPosition && j >= this.yPosition
&& i < this.xPosition + this.width && j < this.yPosition + this.height;
int k = this.getHoverState(flag);
this.drawTexturedModalRect(this.xPosition + this.scrollHeight - 90, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height);
this.drawTexturedModalRect(this.xPosition + this.scrollHeight + this.width / 2 - 90, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height);
this.drawTexturedModalRect(
this.xPosition + this.scrollHeight - 90,
this.yPosition,
0,
46 + k * 20,
this.width / 2,
this.height
);
this.drawTexturedModalRect(
this.xPosition + this.scrollHeight + this.width / 2 - 90,
this.yPosition,
200 - this.width / 2,
46 + k * 20,
this.width / 2,
this.height
);
this.mouseDragged(minecraft, i, j);
GL11.glDisable(GL11.GL_BLEND);
if (!this.enabled) {
this.drawString(fontrenderer, this.displayString, this.xPosition + this.width / 10 + this.scrollHeight - 80, this.yPosition + (this.height - 8) / 2, -6250336);
this.drawString(
fontrenderer,
this.displayString,
this.xPosition + this.width / 10 + this.scrollHeight - 80,
this.yPosition + (this.height - 8) / 2,
-6250336
);
} else if (flag) {
this.drawString(fontrenderer, this.displayString, this.xPosition + this.width / 10 + this.scrollHeight - 80, this.yPosition + (this.height - 8) / 2, 0x77cccc);
this.drawString(
fontrenderer,
this.displayString,
this.xPosition + this.width / 10 + this.scrollHeight - 80,
this.yPosition + (this.height - 8) / 2,
0x77cccc
);
} else {
this.drawString(fontrenderer, this.displayString, this.xPosition + this.width / 10 + this.scrollHeight - 80, this.yPosition + (this.height - 8) / 2, 14737632);
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) {
return this.enabled && this.visible && var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height;
return this.enabled && this.visible && var2 >= this.xPosition
&& var3 >= this.yPosition && var2 < this.xPosition + this.width
&& var3 < this.yPosition + this.height;
}
}

View file

@ -3,9 +3,7 @@ package com.gildedgames.the_aether.client.gui.button;
import net.minecraft.client.gui.GuiButton;
public class GuiButtonPerks extends GuiButton {
public GuiButtonPerks(int xPos, int yPos) {
super(24, xPos, yPos, 20, 20, "?");
}
}

View file

@ -5,24 +5,20 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.resources.I18n;
public class GuiCapeButton extends GuiButton
{
public GuiCapeButton(int xPos, int yPos)
{
public class GuiCapeButton extends GuiButton {
public GuiCapeButton(int xPos, int yPos) {
super(203, xPos, yPos, 150, 20, I18n.format("gui.button.aether_cape"));
}
public void drawButton(Minecraft mc, int mouseX, int mouseY)
{
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
PlayerAether player = PlayerAether.get(mc.thePlayer);
if (player.shouldRenderCape)
{
this.displayString = I18n.format("gui.button.aether_cape") + " " + I18n.format("options.on");
}
else
{
this.displayString = I18n.format("gui.button.aether_cape") + " " + I18n.format("options.off");
if (player.shouldRenderCape) {
this.displayString
= I18n.format("gui.button.aether_cape") + " " + I18n.format("options.on");
} else {
this.displayString = I18n.format("gui.button.aether_cape") + " "
+ I18n.format("options.off");
}
super.drawButton(mc, mouseX, mouseY);

View file

@ -2,10 +2,15 @@ package com.gildedgames.the_aether.client.gui.button;
import net.minecraft.client.gui.GuiButton;
public class GuiCustomizationScreenButton extends GuiButton
{
public GuiCustomizationScreenButton(int p_i1021_1_, int p_i1021_2_, int p_i1021_3_, int p_i1021_4_, int p_i1021_5_, String p_i1021_6_)
{
public class GuiCustomizationScreenButton extends GuiButton {
public GuiCustomizationScreenButton(
int p_i1021_1_,
int p_i1021_2_,
int p_i1021_3_,
int p_i1021_4_,
int p_i1021_5_,
String p_i1021_6_
) {
super(p_i1021_1_, p_i1021_2_, p_i1021_3_, p_i1021_4_, p_i1021_5_, p_i1021_6_);
}
}

View file

@ -5,10 +5,17 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.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;
}
@ -20,13 +27,30 @@ public class GuiDescButton extends GuiButton {
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);
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);
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);
this.drawCenteredString(
fontrenderer,
this.descText,
this.xPosition + this.width / 2,
this.yPosition + (this.height + 24) / 2,
0xfffffF
);
}
}
}
}

View file

@ -5,24 +5,20 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.resources.I18n;
public class GuiGlowButton extends GuiButton
{
public GuiGlowButton(int xPos, int yPos)
{
public class GuiGlowButton extends GuiButton {
public GuiGlowButton(int xPos, int yPos) {
super(202, xPos, yPos, 150, 20, I18n.format("gui.button.glow"));
}
public void drawButton(Minecraft mc, int mouseX, int mouseY)
{
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
PlayerAether player = PlayerAether.get(mc.thePlayer);
if (player.shouldRenderGlow)
{
this.displayString = I18n.format("gui.button.glow") + " " + I18n.format("options.on");
}
else
{
this.displayString = I18n.format("gui.button.glow") + " " + I18n.format("options.off");
if (player.shouldRenderGlow) {
this.displayString
= I18n.format("gui.button.glow") + " " + I18n.format("options.on");
} else {
this.displayString
= I18n.format("gui.button.glow") + " " + I18n.format("options.off");
}
super.drawButton(mc, mouseX, mouseY);

View file

@ -5,24 +5,20 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.resources.I18n;
public class GuiHaloButton extends GuiButton
{
public GuiHaloButton(int xPos, int yPos)
{
public class GuiHaloButton extends GuiButton {
public GuiHaloButton(int xPos, int yPos) {
super(201, xPos, yPos, 150, 20, I18n.format("gui.button.halo"));
}
public void drawButton(Minecraft mc, int mouseX, int mouseY)
{
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
PlayerAether player = PlayerAether.get(mc.thePlayer);
if (player.shouldRenderHalo)
{
this.displayString = I18n.format("gui.button.halo") + " " + I18n.format("options.on");
}
else
{
this.displayString = I18n.format("gui.button.halo") + " " + I18n.format("options.off");
if (player.shouldRenderHalo) {
this.displayString
= I18n.format("gui.button.halo") + " " + I18n.format("options.on");
} else {
this.displayString
= I18n.format("gui.button.halo") + " " + I18n.format("options.off");
}
super.drawButton(mc, mouseX, mouseY);

View file

@ -6,14 +6,15 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
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);
}
@ -23,13 +24,31 @@ public class GuiLoreButton extends GuiButton {
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;
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);
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.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;
@ -41,8 +60,13 @@ public class GuiLoreButton extends GuiButton {
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
);
}
}
}

View file

@ -1,16 +1,13 @@
package com.gildedgames.the_aether.client.gui.button;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import com.gildedgames.the_aether.network.AetherNetwork;
import com.gildedgames.the_aether.network.packets.PacketSetTime;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
public class GuiSunAltarSlider extends GuiButton {
public float sliderValue;
public boolean dragging = false;
@ -24,8 +21,8 @@ public class GuiSunAltarSlider extends GuiButton {
}
/**
* Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over
* this button.
* 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;
@ -35,12 +32,14 @@ public class GuiSunAltarSlider extends GuiButton {
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);
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 add = shouldTime > remainder ? shouldTime - remainder
: shouldTime + 24000 - remainder;
world.getWorldInfo().setWorldTime(worldTime + add);
if (this.sliderValue < 0.0F) {
@ -50,12 +49,25 @@ public class GuiSunAltarSlider extends GuiButton {
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);
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
);
}
}
@ -69,7 +81,8 @@ public class GuiSunAltarSlider extends GuiButton {
@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);
this.sliderValue
= (float) (par2 - (this.xPosition + 4)) / (float) (this.width - 8);
if (this.sliderValue < 0.0F) {
this.sliderValue = 0.0F;
@ -90,7 +103,8 @@ public class GuiSunAltarSlider extends GuiButton {
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
));
}
}

View file

@ -8,7 +8,6 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
public class DialogueOption extends Gui {
private int dialogueId;
private String dialogueText;
@ -26,16 +25,35 @@ public class DialogueOption extends Gui {
}
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);
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) {
return mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
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));
soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(
new ResourceLocation("gui.button.press"), 1.0F
));
}
public void setDialogueText(String dialogueText) {
@ -70,5 +88,4 @@ public class DialogueOption extends Gui {
public String getDialogueText() {
return this.dialogueText;
}
}

View file

@ -9,7 +9,6 @@ import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ChatComponentText;
public class GuiDialogue extends GuiScreen {
private ArrayList<DialogueOption> dialogueOptions = new ArrayList<DialogueOption>();
private String dialogue;
@ -43,7 +42,13 @@ public class GuiDialogue extends GuiScreen {
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);
option.setYPosition(
(this.height / 2)
+ this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300)
.size()
* 12
+ 12 * lineNumber
);
lineNumber++;
}
@ -56,7 +61,9 @@ public class GuiDialogue extends GuiScreen {
}
public void addDialogueMessage(String dialogueMessage) {
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(dialogueMessage));
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(
new ChatComponentText(dialogueMessage)
);
}
public void dialogueTreeCompleted() {
@ -75,11 +82,25 @@ public class GuiDialogue extends GuiScreen {
int optionWidth = 0;
for (String theDialogue : ((List<String>) this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300))) {
for (String theDialogue : ((List<String>) this.fontRendererObj
.listFormattedStringToWidth(this.dialogue, 300))) {
int stringWidth = this.fontRendererObj.getStringWidth(theDialogue);
this.drawGradientRect(this.width / 2 - stringWidth / 2 - 2, this.height / 2 + optionWidth * 12 - 2, this.width / 2 + stringWidth / 2 + 2, this.height / 2 + optionWidth * 10 + 10, 0x66000000, 0x66000000);
this.drawString(this.fontRendererObj, theDialogue, this.width / 2 - stringWidth / 2, this.height / 2 + optionWidth * 10, 0xffffff);
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;
}
@ -107,9 +128,7 @@ public class GuiDialogue extends GuiScreen {
super.mouseClicked(mouseX, mouseY, mouseButton);
}
public void dialogueClicked(DialogueOption dialogue) throws IOException {
}
public void dialogueClicked(DialogueOption dialogue) throws IOException {}
public ArrayList<DialogueOption> getDialogueOptions() {
return this.dialogueOptions;
@ -118,5 +137,4 @@ public class GuiDialogue extends GuiScreen {
public String getDialogue() {
return this.dialogue;
}
}

View file

@ -3,17 +3,15 @@ package com.gildedgames.the_aether.client.gui.dialogue.entity;
import com.gildedgames.the_aether.client.gui.dialogue.DialogueOption;
import com.gildedgames.the_aether.client.gui.dialogue.GuiDialogue;
import com.gildedgames.the_aether.entities.bosses.valkyrie_queen.EntityValkyrieQueen;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.network.AetherNetwork;
import com.gildedgames.the_aether.network.packets.PacketInitiateValkyrieFight;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.EnumDifficulty;
import com.gildedgames.the_aether.items.ItemsAether;
import com.gildedgames.the_aether.network.AetherNetwork;
import com.gildedgames.the_aether.network.packets.PacketInitiateValkyrieFight;
public class GuiValkyrieDialogue extends GuiDialogue {
private EntityValkyrieQueen valkyrieQueen;
private String title;
@ -21,7 +19,13 @@ public class GuiValkyrieDialogue extends GuiDialogue {
private int medalSlotId = -1;
public GuiValkyrieDialogue(EntityValkyrieQueen valkyrieQueen) {
super("[\247e" + valkyrieQueen.getName() + ", " + I18n.format("title.aether_legacy.valkyrie_queen.name") + "\247r]", new DialogueOption(I18n.format("gui.queen.dialog.0")), new DialogueOption(I18n.format("gui.queen.dialog.1")), new DialogueOption(I18n.format("gui.queen.dialog.2")));
super(
"[\247e" + valkyrieQueen.getName() + ", "
+ I18n.format("title.aether_legacy.valkyrie_queen.name") + "\247r]",
new DialogueOption(I18n.format("gui.queen.dialog.0")),
new DialogueOption(I18n.format("gui.queen.dialog.1")),
new DialogueOption(I18n.format("gui.queen.dialog.2"))
);
this.title = this.getDialogue();
this.valkyrieQueen = valkyrieQueen;
@ -31,44 +35,65 @@ public class GuiValkyrieDialogue extends GuiDialogue {
public void dialogueClicked(DialogueOption dialogue) {
if (this.getDialogueOptions().size() == 3) {
if (dialogue.getDialogueId() == 0) {
this.addDialogueMessage(this.title + ": " + I18n.format("gui.queen.answer.0"));
this.addDialogueMessage(
this.title + ": " + I18n.format("gui.queen.answer.0")
);
this.dialogueTreeCompleted();
} else if (dialogue.getDialogueId() == 1) {
DialogueOption medalDialogue = new DialogueOption(this.getMedalDiaulogue());
DialogueOption medalDialogue
= new DialogueOption(this.getMedalDiaulogue());
this.addDialogueWithOptions(this.title + ": " + I18n.format("gui.queen.answer.1"), medalDialogue, new DialogueOption(I18n.format("gui.valkyrie.dialog.player.denyfight")));
this.addDialogueWithOptions(
this.title + ": " + I18n.format("gui.queen.answer.1"),
medalDialogue,
new DialogueOption(I18n.format("gui.valkyrie.dialog.player.denyfight")
)
);
} else if (dialogue.getDialogueId() == 2) {
this.addDialogueMessage(this.title + ": " + I18n.format("gui.queen.answer.2"));
this.addDialogueMessage(
this.title + ": " + I18n.format("gui.queen.answer.2")
);
this.dialogueTreeCompleted();
}
} else {
if (dialogue.getDialogueId() == 0) {
if (this.mc.theWorld.difficultySetting == EnumDifficulty.PEACEFUL) {
this.addDialogueMessage(this.title + ": " + I18n.format("gui.queen.peaceful"));
this.addDialogueMessage(
this.title + ": " + I18n.format("gui.queen.peaceful")
);
this.dialogueTreeCompleted();
return;
}
if (this.medalSlotId != -1) {
AetherNetwork.sendToServer(new PacketInitiateValkyrieFight(this.medalSlotId, this.valkyrieQueen.getEntityId()));
AetherNetwork.sendToServer(new PacketInitiateValkyrieFight(
this.medalSlotId, this.valkyrieQueen.getEntityId()
));
this.valkyrieQueen.setBossReady(true);
this.addDialogueMessage(this.title + ": " + I18n.format("gui.valkyrie.dialog.ready"));
this.addDialogueMessage(
this.title + ": " + I18n.format("gui.valkyrie.dialog.ready")
);
this.dialogueTreeCompleted();
} else {
this.addDialogueMessage(this.title + ": " + I18n.format("gui.valkyrie.dialog.nomedals"));
this.addDialogueMessage(
this.title + ": " + I18n.format("gui.valkyrie.dialog.nomedals")
);
this.dialogueTreeCompleted();
}
} else if (dialogue.getDialogueId() == 1) {
this.addDialogueMessage(this.title + ": " + I18n.format("gui.valkyrie.dialog.nofight"));
this.addDialogueMessage(
this.title + ": " + I18n.format("gui.valkyrie.dialog.nofight")
);
this.dialogueTreeCompleted();
}
}
}
private String getMedalDiaulogue() {
for (int slotId = 0; slotId < this.mc.thePlayer.inventory.mainInventory.length; ++slotId) {
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) {
@ -76,12 +101,12 @@ public class GuiValkyrieDialogue extends GuiDialogue {
this.medalSlotId = slotId;
return I18n.format("gui.valkyrie.dialog.player.havemedals");
} else {
return I18n.format("gui.valkyrie.dialog.player.lackmedals") + " (" + stack.stackSize + "/10)";
return I18n.format("gui.valkyrie.dialog.player.lackmedals") + " ("
+ stack.stackSize + "/10)";
}
}
}
return I18n.format("gui.valkyrie.dialog.player.lackmedals") + " (0/10)";
}
}

View file

@ -4,15 +4,16 @@ import java.util.ArrayList;
import com.gildedgames.the_aether.client.gui.dialogue.DialogueOption;
import com.gildedgames.the_aether.client.gui.dialogue.GuiDialogue;
import com.google.common.collect.Lists;
import com.gildedgames.the_aether.network.AetherNetwork;
import com.gildedgames.the_aether.network.packets.PacketDialogueClicked;
import com.google.common.collect.Lists;
public class GuiServerDialogue extends GuiDialogue {
private String dialogueName;
public GuiServerDialogue(String dialogueName, String dialogue, ArrayList<String> dialogueText) {
public GuiServerDialogue(
String dialogueName, String dialogue, ArrayList<String> dialogueText
) {
super(dialogue);
this.dialogueName = dialogueName;
@ -23,13 +24,14 @@ public class GuiServerDialogue extends GuiDialogue {
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()));
AetherNetwork.sendToServer(
new PacketDialogueClicked(this.dialogueName, dialogue.getDialogueId())
);
this.dialogueTreeCompleted();
}
}

View file

@ -3,30 +3,29 @@ package com.gildedgames.the_aether.client.gui.inventory;
import com.gildedgames.the_aether.Aether;
import com.gildedgames.the_aether.client.AetherKeybinds;
import com.gildedgames.the_aether.client.gui.button.GuiAccessoryButton;
import com.gildedgames.the_aether.inventory.ContainerAccessories;
import com.gildedgames.the_aether.network.AetherNetwork;
import com.gildedgames.the_aether.network.packets.PacketOpenContainer;
import com.gildedgames.the_aether.player.PlayerAether;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.GuiScreenEvent;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import com.gildedgames.the_aether.inventory.ContainerAccessories;
import com.gildedgames.the_aether.network.AetherNetwork;
import com.gildedgames.the_aether.network.packets.PacketOpenContainer;
import com.gildedgames.the_aether.player.PlayerAether;
public class GuiAccessories extends GuiContainer {
private static final ResourceLocation ACCESSORIES = Aether.locate("textures/gui/inventory/accessories.png");
private static final ResourceLocation ACCESSORIES
= Aether.locate("textures/gui/inventory/accessories.png");
private PlayerAether playerAether;
public GuiAccessories(PlayerAether player) {
super(new ContainerAccessories(player.getAccessoryInventory(), player.getEntity()));
super(new ContainerAccessories(player.getAccessoryInventory(), player.getEntity())
);
this.playerAether = player;
this.allowUserInput = true;
@ -38,8 +37,9 @@ public class GuiAccessories extends GuiContainer {
super.initGui();
/*
if (AetherRankings.isRankedPlayer(this.playerAether.getEntity().getUniqueID()) || this.playerAether.isDonator()) {
this.buttonList.add(new GuiButtonPerks(this.width / 2 - 108, this.height / 2 - 83));
if (AetherRankings.isRankedPlayer(this.playerAether.getEntity().getUniqueID()) ||
this.playerAether.isDonator()) { this.buttonList.add(new GuiButtonPerks(this.width
/ 2 - 108, this.height / 2 - 83));
}
*/
@ -79,30 +79,41 @@ public class GuiAccessories extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 115, 8, 4210752);
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);
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
);
}
@Override
public void handleKeyboardInput()
{
public void handleKeyboardInput() {
super.handleKeyboardInput();
int keyPressed = Keyboard.getEventKey();
if (keyPressed == AetherKeybinds.keyBindingAccessories.getKeyCode() && Keyboard.getEventKeyState())
{
if (keyPressed == AetherKeybinds.keyBindingAccessories.getKeyCode()
&& Keyboard.getEventKeyState()) {
Minecraft.getMinecraft().thePlayer.closeScreen();
}
}

View file

@ -1,13 +1,5 @@
package com.gildedgames.the_aether.client.gui.inventory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiInventory;
import org.lwjgl.input.Keyboard;
import com.gildedgames.the_aether.entities.passive.mountable.EntityMoa;
import com.gildedgames.the_aether.entities.util.AetherMoaTypes;
import com.gildedgames.the_aether.network.AetherNetwork;
@ -16,9 +8,14 @@ import com.gildedgames.the_aether.player.PlayerAether;
import com.gildedgames.the_aether.player.perks.AetherRankings;
import com.gildedgames.the_aether.player.perks.util.DonatorMoaSkin;
import com.gildedgames.the_aether.player.perks.util.EnumAetherPerkType;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiInventory;
import org.lwjgl.input.Keyboard;
public class GuiAetherPerks extends GuiScreen {
private boolean enableMoaEditor, enableHaloEditor;
private PlayerAether player;
@ -29,7 +26,8 @@ public class GuiAetherPerks extends GuiScreen {
private GuiButton defualtSkin, enableHalo, confirmPreference;
private GuiTextField moaWingMarking, moaWing, moaBody, moaBodyMarking, moaEye, moaOutside;
private GuiTextField moaWingMarking, moaWing, moaBody, moaBodyMarking, moaEye,
moaOutside;
private DonatorMoaSkin moaSkin = new DonatorMoaSkin();
@ -44,7 +42,9 @@ public class GuiAetherPerks extends GuiScreen {
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);
this.moa = this.player.getEntity().ridingEntity instanceof EntityMoa
? (EntityMoa) this.player.getEntity().ridingEntity
: new EntityMoa(this.mc.theWorld, AetherMoaTypes.blue);
}
@Override
@ -57,7 +57,9 @@ public class GuiAetherPerks extends GuiScreen {
this.moaOutside.updateCursorCounter();
if (!this.moaWingMarking.getText().isEmpty()) {
this.moaSkin.setWingMarkingColor(Integer.decode("0x" + this.moaWingMarking.getText()));
this.moaSkin.setWingMarkingColor(
Integer.decode("0x" + this.moaWingMarking.getText())
);
}
if (!this.moaWing.getText().isEmpty()) {
@ -69,7 +71,9 @@ public class GuiAetherPerks extends GuiScreen {
}
if (!this.moaBodyMarking.getText().isEmpty()) {
this.moaSkin.setMarkingColor(Integer.decode("0x" + this.moaBodyMarking.getText()));
this.moaSkin.setMarkingColor(
Integer.decode("0x" + this.moaBodyMarking.getText())
);
}
if (!this.moaEye.getText().isEmpty()) {
@ -77,7 +81,8 @@ public class GuiAetherPerks extends GuiScreen {
}
if (!this.moaOutside.getText().isEmpty()) {
this.moaSkin.setOutsideColor(Integer.decode("0x" + this.moaOutside.getText()));
this.moaSkin.setOutsideColor(Integer.decode("0x" + this.moaOutside.getText())
);
}
this.moaSkin.shouldUseDefualt(this.defualtSkin.displayString.contains("true"));
@ -100,42 +105,82 @@ public class GuiAetherPerks extends GuiScreen {
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;
}
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
= 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.setText(Integer.toHexString(this.player.donatorMoaSkin.getEyeColor())
);
this.moaWingMarking = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, this.height - 40, 45, 20);
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.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 = 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.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 = 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.setText(Integer.toHexString(this.player.donatorMoaSkin.getBodyColor()
));
this.moaBodyMarking = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, this.height - 40, 45, 20);
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.setText(
Integer.toHexString(this.player.donatorMoaSkin.getMarkingColor())
);
this.moaOutside = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, 70, 45, 20);
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.setText(
Integer.toHexString(this.player.donatorMoaSkin.getOutsideColor())
);
}
@Override
@ -143,7 +188,9 @@ public class GuiAetherPerks extends GuiScreen {
super.keyTyped(typedChar, keyCode);
if (this.enableMoaEditor) {
if (keyCode > 1 && keyCode < 12 || keyCode == 14 || keyCode == 30 || keyCode == 48 || keyCode == 46 || keyCode == 32 || keyCode == 18 || keyCode == 33) {
if (keyCode > 1 && keyCode < 12 || keyCode == 14 || keyCode == 30
|| keyCode == 48 || keyCode == 46 || keyCode == 32 || keyCode == 18
|| keyCode == 33) {
this.moaWingMarking.textboxKeyTyped(typedChar, keyCode);
this.moaWing.textboxKeyTyped(typedChar, keyCode);
this.moaBody.textboxKeyTyped(typedChar, keyCode);
@ -171,7 +218,9 @@ public class GuiAetherPerks extends GuiScreen {
@Override
public void onGuiClosed() {
Keyboard.enableRepeatEvents(false);
AetherNetwork.sendToServer(new PacketPerkChanged(this.player.getEntity().getEntityId(), EnumAetherPerkType.Moa, this.moaSkin));
AetherNetwork.sendToServer(new PacketPerkChanged(
this.player.getEntity().getEntityId(), EnumAetherPerkType.Moa, this.moaSkin
));
}
@Override
@ -185,12 +234,18 @@ public class GuiAetherPerks extends GuiScreen {
this.confirmPreference.visible = true;
this.defualtSkin.visible = true;
} else if (button.id == 2) {
boolean enableDefualt = this.player.donatorMoaSkin.shouldUseDefualt() ? false : true;
boolean enableDefualt
= this.player.donatorMoaSkin.shouldUseDefualt() ? false : true;
this.defualtSkin.displayString = "Use Default: " + Boolean.toString(enableDefualt);
this.defualtSkin.displayString
= "Use Default: " + Boolean.toString(enableDefualt);
this.player.donatorMoaSkin.shouldUseDefualt(enableDefualt);
} else if (button.id == 4) {
AetherNetwork.sendToServer(new PacketPerkChanged(this.player.getEntity().getEntityId(), EnumAetherPerkType.Moa, this.moaSkin));
AetherNetwork.sendToServer(new PacketPerkChanged(
this.player.getEntity().getEntityId(),
EnumAetherPerkType.Moa,
this.moaSkin
));
} else if (button.id == 5) {
boolean shouldEnable = this.enableHaloEditor ? false : true;
@ -201,8 +256,11 @@ public class GuiAetherPerks extends GuiScreen {
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);
AetherNetwork.sendToServer(new PacketPerkChanged(
this.player.getEntity().getEntityId(), EnumAetherPerkType.Halo, enableHalo
));
this.enableHalo.displayString
= "Enable Halo: " + Boolean.toString(enableHalo);
}
}
@ -213,23 +271,62 @@ public class GuiAetherPerks extends GuiScreen {
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);
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*/
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 */
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();
@ -240,7 +337,14 @@ public class GuiAetherPerks extends GuiScreen {
}
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());
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);
@ -256,5 +360,4 @@ public class GuiAetherPerks extends GuiScreen {
this.drawBackground(tint);
}
}
}

Some files were not shown because too many files have changed in this diff Show more