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,60 +12,62 @@ 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";
public static final String MOD_ID = "aether_legacy";
@Instance(Aether.MOD_ID)
public static Aether instance;
@Instance(Aether.MOD_ID)
public static Aether instance;
@SidedProxy(
clientSide = "com.gildedgames.the_aether.client.ClientProxy",
serverSide = "com.gildedgames.the_aether.CommonProxy"
)
public static CommonProxy proxy;
@SidedProxy(clientSide = "com.gildedgames.the_aether.client.ClientProxy", serverSide = "com.gildedgames.the_aether.CommonProxy")
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
AetherRankings.initialization();
AetherNetwork.preInitialization();
AetherConfig.init(event.getModConfigurationDirectory());
}
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
AetherRankings.initialization();
AetherNetwork.preInitialization();
AetherConfig.init(event.getModConfigurationDirectory());
}
@EventHandler
public void init(FMLInitializationEvent event) {
BlocksAether.initialization();
BlocksAether.initializeHarvestLevels();
ItemsAether.initialization();
AetherRegistries.register();
EntitiesAether.initialization();
AetherCreativeTabs.initialization();
AetherTileEntities.initialization();
AetherWorld.initialization();
AchievementsAether.initialization();
@EventHandler
public void init(FMLInitializationEvent event) {
BlocksAether.initialization();
BlocksAether.initializeHarvestLevels();
ItemsAether.initialization();
AetherRegistries.register();
EntitiesAether.initialization();
AetherCreativeTabs.initialization();
AetherTileEntities.initialization();
AetherWorld.initialization();
AchievementsAether.initialization();
proxy.init();
proxy.init();
CommonProxy.registerEvent(new PlayerAetherEvents());
CommonProxy.registerEvent(new AetherEventHandler());
CommonProxy.registerEvent(new AetherEntityEvents());
}
CommonProxy.registerEvent(new PlayerAetherEvents());
CommonProxy.registerEvent(new AetherEventHandler());
CommonProxy.registerEvent(new AetherEntityEvents());
}
public static ResourceLocation locate(String location) {
return new ResourceLocation(MOD_ID, location);
}
public static ResourceLocation locate(String location) {
return new ResourceLocation(MOD_ID, location);
}
public static String find(String location) {
return modAddress() + location;
}
public static String find(String location) {
return modAddress() + location;
}
public static String modAddress() {
return MOD_ID + ":";
}
public static String modAddress() {
return MOD_ID + ":";
}
}

View File

@ -6,231 +6,372 @@ import java.io.IOException;
import net.minecraftforge.common.config.Configuration;
public class AetherConfig {
public static Configuration config;
public static Configuration config;
private static int max_life_shards;
private static int max_life_shards;
private static boolean christmas_content, tallgrass, seasonal_christmas;
private static boolean christmas_content, tallgrass, seasonal_christmas;
private static int aether_biome_id, aether_dimension_id;
private static int aether_biome_id, aether_dimension_id;
private static boolean disable_trivia, old_mobs;
private static boolean disable_trivia, old_mobs;
private static boolean skyrootBucketOnly, valkyrie_cape, golden_feather;
private static boolean skyrootBucketOnly, valkyrie_cape, golden_feather;
private static boolean floating_block_collision;
private static boolean floating_block_collision;
private static int travel_dimension;
private static int travel_dimension;
private static boolean menu_enabled, menu_button, install_resourcepack;
private static boolean menu_enabled, menu_button, install_resourcepack;
private static boolean legacy_altar_name;
private static boolean legacy_altar_name;
private static int inebriation_id;
private static int inebriation_id;
private static boolean sun_altar_multiplayer, repeat_sun_spirit_dialog;
private static boolean sun_altar_multiplayer, repeat_sun_spirit_dialog;
private static boolean aether_start;
private static boolean aether_start;
private static boolean disable_eternal_day;
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"
);
public static void init(File location) {
File newFile = new File(location + "/aether" + "/AetherI.cfg");
try {
newFile.createNewFile();
} catch (IOException e) {}
try {
newFile.createNewFile();
} catch (IOException e) {
config = new Configuration(newFile);
}
config.load();
config = new Configuration(newFile);
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);
config.load();
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);
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);
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);
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);
disable_trivia
= config.get("Trivia", "Disable random trivia", 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);
old_mobs = config.get("Misc", "Enable Legacy Visuals", false).getBoolean(false);
disable_trivia = config.get("Trivia", "Disable random trivia", false).getBoolean(false);
aether_start
= config.get("Gameplay", "Spawns Player with Aether Portal Frame", false)
.getBoolean(false);
old_mobs = config.get("Misc", "Enable Legacy Visuals", false).getBoolean(false);
max_life_shards = config.get("Gameplay", "Max Life Shards", 10).getInt(10);
aether_start = config.get("Gameplay", "Spawns Player with Aether Portal Frame", false).getBoolean(false);
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);
max_life_shards = config.get("Gameplay", "Max Life Shards", 10).getInt(10);
install_resourcepack
= config
.get(
"Misc",
"Determines whether the Aether b1.7.3 resource pack should be generated.",
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);
legacy_altar_name
= config
.get(
"Misc",
"Changes whether the Altar should be named Enchanter or not.",
false
)
.getBoolean(false);
install_resourcepack = config.get("Misc", "Determines whether the Aether b1.7.3 resource pack should be generated.", true).getBoolean(true);
inebriation_id = config.get("Misc", "Sets the id for the Inebriation effect.", 31)
.getInt(31);
legacy_altar_name = config.get("Misc", "Changes whether the Altar should be named Enchanter or not.", 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);
inebriation_id = config.get("Misc", "Sets the id for the Inebriation effect.", 31).getInt(31);
repeat_sun_spirit_dialog
= config
.get(
"Misc",
"If disabed, the Sun Spirit's dialog will only show once per world.",
true
)
.getBoolean(true);
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);
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);
repeat_sun_spirit_dialog = config.get("Misc", "If disabed, the Sun Spirit's dialog will only show once per world.", true).getBoolean(true);
//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);
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);
config.save();
}
//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);
public static int getAetherDimensionID() {
return AetherConfig.aether_dimension_id;
}
config.save();
}
public static int getAetherBiomeID() {
return AetherConfig.aether_biome_id;
}
public static int getAetherDimensionID() {
return AetherConfig.aether_dimension_id;
}
public static int getMaxLifeShards() {
return AetherConfig.max_life_shards;
}
public static int getAetherBiomeID() {
return AetherConfig.aether_biome_id;
}
public static int getTravelDimensionID() {
return AetherConfig.travel_dimension;
}
public static int getMaxLifeShards() {
return AetherConfig.max_life_shards;
}
public static boolean shouldFloatWithBlock() {
return AetherConfig.floating_block_collision;
}
public static int getTravelDimensionID() {
return AetherConfig.travel_dimension;
}
public static boolean triviaDisabled() {
return AetherConfig.disable_trivia;
}
public static boolean shouldFloatWithBlock() {
return AetherConfig.floating_block_collision;
}
public static boolean oldMobsEnabled() {
return AetherConfig.old_mobs;
}
public static boolean triviaDisabled() {
return AetherConfig.disable_trivia;
}
public static boolean shouldLoadHolidayContent() {
return AetherConfig.christmas_content;
}
public static boolean oldMobsEnabled() {
return AetherConfig.old_mobs;
}
public static boolean tallgrassEnabled() {
return AetherConfig.tallgrass;
}
public static boolean shouldLoadHolidayContent() {
return AetherConfig.christmas_content;
}
public static boolean activateOnlyWithSkyroot() {
return AetherConfig.skyrootBucketOnly;
}
public static boolean tallgrassEnabled() {
return AetherConfig.tallgrass;
}
public static boolean valkyrieCapeEnabled() {
return AetherConfig.valkyrie_cape;
}
public static boolean activateOnlyWithSkyroot() {
return AetherConfig.skyrootBucketOnly;
}
public static boolean goldenFeatherEnabled() {
return AetherConfig.golden_feather;
}
public static boolean valkyrieCapeEnabled()
{
return AetherConfig.valkyrie_cape;
}
public static boolean menuEnabled() {
return AetherConfig.menu_enabled;
}
public static boolean goldenFeatherEnabled()
{
return AetherConfig.golden_feather;
}
public static boolean menuButtonEnabled() {
return AetherConfig.menu_button;
}
public static boolean menuEnabled()
{
return AetherConfig.menu_enabled;
}
public static boolean installResourcepack() {
return AetherConfig.install_resourcepack;
}
public static boolean menuButtonEnabled()
{
return AetherConfig.menu_button;
}
public static boolean legacyAltarName() {
return AetherConfig.legacy_altar_name;
}
public static boolean installResourcepack()
{
return AetherConfig.install_resourcepack;
}
public static int getInebriationId() {
return AetherConfig.inebriation_id;
}
public static boolean legacyAltarName() {
return AetherConfig.legacy_altar_name;
}
public static boolean sunAltarMultiplayer() {
return AetherConfig.sun_altar_multiplayer;
}
public static int getInebriationId()
{
return AetherConfig.inebriation_id;
}
public static boolean repeatSunSpiritDialogue() {
return repeat_sun_spirit_dialog;
}
public static boolean sunAltarMultiplayer() {
return AetherConfig.sun_altar_multiplayer;
}
public static boolean shouldAetherStart() {
return aether_start;
}
public static boolean repeatSunSpiritDialogue() {
return repeat_sun_spirit_dialog;
}
public static boolean eternalDayDisabled() {
return disable_eternal_day;
}
public static boolean shouldAetherStart()
{
return aether_start;
}
public static boolean allowSeasonalChristmas() {
return seasonal_christmas;
}
public static boolean eternalDayDisabled()
{
return disable_eternal_day;
}
public static int getPhygSpawnrate() {
return phyg_spawnrate;
}
public static boolean allowSeasonalChristmas() {
return seasonal_christmas;
}
public static int getFlyingCowSpawnrate() {
return flyingcow_spawnrate;
}
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;
}
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,369 +56,420 @@ 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 {
@SubscribeEvent
public void checkBlockBannedEvent(PlayerInteractEvent event) {
if (event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK)
return;
EntityPlayer player = event.entityPlayer;
ItemStack currentStack = player.getCurrentEquippedItem();
public class
AetherEventHandler {
if (player.dimension == AetherConfig.getAetherDimensionID()) {
if (currentStack != null) {
if (currentStack.getItem() == Items.flint_and_steel
|| currentStack.getItem() == Item.getItemFromBlock(Blocks.torch)
|| currentStack.getItem() == Items.fire_charge) {
for (int i = 0; i < 10; ++i) {
event.world.spawnParticle(
"smoke", event.x, event.y, event.z, 0.0D, 0.0D, 0.0D
);
}
@SubscribeEvent
public void checkBlockBannedEvent(PlayerInteractEvent event) {
if(event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
EntityPlayer player = event.entityPlayer;
ItemStack currentStack = player.getCurrentEquippedItem();
event.setCanceled(true);
}
} else if (event.world.getBlock(event.x, event.y, event.z) == Blocks.bed) {
event.setCanceled(true);
}
}
}
if (player.dimension == AetherConfig.getAetherDimensionID()) {
if (currentStack != null) {
if (currentStack.getItem() == Items.flint_and_steel || currentStack.getItem() == Item.getItemFromBlock(Blocks.torch) || currentStack.getItem() == Items.fire_charge) {
for (int i = 0; i < 10; ++i) {
event.world.spawnParticle("smoke", event.x, event.y, event.z, 0.0D, 0.0D, 0.0D);
}
@SubscribeEvent
public void onEntityInteract(EntityInteractEvent event) {
if (event.target instanceof EntityAgeable) {
ItemStack itemstack = event.entityPlayer.inventory.getCurrentItem();
event.setCanceled(true);
}
} else if (event.world.getBlock(event.x, event.y, event.z) == Blocks.bed) {
event.setCanceled(true);
}
}
}
if (itemstack != null
&& itemstack.getItem() == ItemsAether.aether_spawn_egg) {
if (!event.entityPlayer.worldObj.isRemote) {
Class<?> oclass
= EntitiesAether.getClassFromID(itemstack.getItemDamage());
@SubscribeEvent
public void onEntityInteract(EntityInteractEvent event) {
if (event.target instanceof EntityAgeable) {
ItemStack itemstack = event.entityPlayer.inventory.getCurrentItem();
if (oclass != null && oclass.isAssignableFrom(this.getClass())) {
EntityAgeable entityageable
= ((EntityAgeable) event.target)
.createChild((EntityAgeable) event.target);
if (itemstack != null && itemstack.getItem() == ItemsAether.aether_spawn_egg) {
if (!event.entityPlayer.worldObj.isRemote) {
Class<?> oclass = EntitiesAether.getClassFromID(itemstack.getItemDamage());
if (entityageable != null) {
entityageable.setGrowingAge(-24000);
entityageable.setLocationAndAngles(
event.target.posX,
event.target.posY,
event.target.posZ,
0.0F,
0.0F
);
event.entityPlayer.worldObj.spawnEntityInWorld(entityageable);
if (oclass != null && oclass.isAssignableFrom(this.getClass())) {
EntityAgeable entityageable = ((EntityAgeable) event.target).createChild((EntityAgeable) event.target);
if (itemstack.hasDisplayName()) {
entityageable.setCustomNameTag(itemstack.getDisplayName()
);
}
if (entityageable != null) {
entityageable.setGrowingAge(-24000);
entityageable.setLocationAndAngles(event.target.posX, event.target.posY, event.target.posZ, 0.0F, 0.0F);
event.entityPlayer.worldObj.spawnEntityInWorld(entityageable);
if (!event.entityPlayer.capabilities.isCreativeMode) {
--itemstack.stackSize;
if (itemstack.hasDisplayName()) {
entityageable.setCustomNameTag(itemstack.getDisplayName());
}
if (itemstack.stackSize <= 0) {
event.entityPlayer.inventory.setInventorySlotContents(
event.entityPlayer.inventory.currentItem,
(ItemStack) null
);
}
}
}
}
}
}
}
if (!event.entityPlayer.capabilities.isCreativeMode) {
--itemstack.stackSize;
if (event.target instanceof EntityCow
|| event.target instanceof EntityFlyingCow) {
EntityPlayer player = event.entityPlayer;
ItemStack heldItem = player.getCurrentEquippedItem();
if (itemstack.stackSize <= 0) {
event.entityPlayer.inventory.setInventorySlotContents(event.entityPlayer.inventory.currentItem, (ItemStack) null);
}
}
}
}
}
}
}
if (heldItem != null && heldItem.getItem() == ItemsAether.skyroot_bucket
&& EnumSkyrootBucketType.getType(heldItem.getItemDamage())
== EnumSkyrootBucketType.Empty) {
if (!player.capabilities.isCreativeMode) {
--heldItem.stackSize;
}
if (event.target instanceof EntityCow || event.target instanceof EntityFlyingCow) {
EntityPlayer player = event.entityPlayer;
ItemStack heldItem = player.getCurrentEquippedItem();
if (heldItem.stackSize <= 0) {
player.inventory.setInventorySlotContents(
player.inventory.currentItem,
new ItemStack(
ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta
)
);
} else if (!player.inventory.addItemStackToInventory(new ItemStack(
ItemsAether.skyroot_bucket,
1,
EnumSkyrootBucketType.Milk.meta
))) {
player.dropPlayerItemWithRandomChoice(
new ItemStack(
ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta
),
false
);
}
}
}
}
if (heldItem != null && heldItem.getItem() == ItemsAether.skyroot_bucket && EnumSkyrootBucketType.getType(heldItem.getItemDamage()) == EnumSkyrootBucketType.Empty) {
if (!player.capabilities.isCreativeMode) {
--heldItem.stackSize;
}
@SubscribeEvent
public void onFillBucket(FillBucketEvent event) {
World worldObj = event.world;
MovingObjectPosition target = event.target;
ItemStack stack = event.current;
EntityPlayer player = event.entityPlayer;
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);
}
}
}
}
boolean isWater = (!AetherConfig.activateOnlyWithSkyroot()
&& stack.getItem() == Items.water_bucket)
|| (stack.getItem() == ItemsAether.skyroot_bucket
&& stack.getItemDamage() == 1);
boolean isLava = stack.getItem() == Items.lava_bucket;
@SubscribeEvent
public void onFillBucket(FillBucketEvent event) {
World worldObj = event.world;
MovingObjectPosition target = event.target;
ItemStack stack = event.current;
EntityPlayer player = event.entityPlayer;
boolean validDimension
= (player.dimension == AetherConfig.getTravelDimensionID()
|| player.dimension == AetherConfig.getAetherDimensionID());
boolean isWater = (!AetherConfig.activateOnlyWithSkyroot() && stack.getItem() == Items.water_bucket) || (stack.getItem() == ItemsAether.skyroot_bucket && stack.getItemDamage() == 1);
boolean isLava = stack.getItem() == Items.lava_bucket;
if (target != null && target.typeOfHit == MovingObjectType.BLOCK
&& validDimension) {
int i = target.blockX;
int j = target.blockY;
int k = target.blockZ;
boolean validDimension = (player.dimension == AetherConfig.getTravelDimensionID() || player.dimension == AetherConfig.getAetherDimensionID());
if (target.sideHit == 0) {
--j;
}
if (target != null && target.typeOfHit == MovingObjectType.BLOCK && validDimension) {
int i = target.blockX;
int j = target.blockY;
int k = target.blockZ;
if (target.sideHit == 1) {
++j;
}
if (target.sideHit == 0) {
--j;
}
if (target.sideHit == 2) {
--k;
}
if (target.sideHit == 1) {
++j;
}
if (target.sideHit == 3) {
++k;
}
if (target.sideHit == 2) {
--k;
}
if (target.sideHit == 4) {
--i;
}
if (target.sideHit == 3) {
++k;
}
if (isWater) {
if (((BlockAetherPortal) BlocksAether.aether_portal)
.trySpawnPortal(worldObj, i, j, k)) {
if (!player.capabilities.isCreativeMode) {
if (stack.getItem() == ItemsAether.skyroot_bucket
&& stack.getItemDamage() == 1) {
event.result = new ItemStack(ItemsAether.skyroot_bucket);
}
if (target.sideHit == 4) {
--i;
}
if (stack.getItem() == Items.water_bucket) {
event.result = new ItemStack(Items.bucket);
}
}
if (isWater) {
if (((BlockAetherPortal) BlocksAether.aether_portal).trySpawnPortal(worldObj, i, j, k)) {
if (!player.capabilities.isCreativeMode) {
if (stack.getItem() == ItemsAether.skyroot_bucket && stack.getItemDamage() == 1) {
event.result = new ItemStack(ItemsAether.skyroot_bucket);
}
event.setResult(Event.Result.ALLOW);
}
}
if (stack.getItem() == Items.water_bucket) {
event.result = new ItemStack(Items.bucket);
}
}
if (isLava && player.dimension == AetherConfig.getAetherDimensionID()) {
if (player.capabilities.isCreativeMode && player.isSneaking()) {
return;
}
event.setResult(Event.Result.ALLOW);
}
}
if (worldObj.isAirBlock(i, j, k)) {
worldObj.setBlock(i, j, k, BlocksAether.aerogel);
if (isLava && player.dimension == AetherConfig.getAetherDimensionID()) {
if (player.capabilities.isCreativeMode && player.isSneaking()) {
return;
}
if (!player.capabilities.isCreativeMode) {
event.result = new ItemStack(Items.bucket);
}
}
if (worldObj.isAirBlock(i, j, k)) {
worldObj.setBlock(i, j, k, BlocksAether.aerogel);
event.setResult(Event.Result.ALLOW);
}
}
}
if (!player.capabilities.isCreativeMode) {
event.result = new ItemStack(Items.bucket);
}
}
@SubscribeEvent
public void onCrafting(ItemCraftedEvent event) {
if (this.isGravititeTool(event.crafting.getItem())) {
event.player.triggerAchievement(AchievementsAether.grav_tools);
} else if (event.crafting.getItem() == Item.getItemFromBlock(BlocksAether.enchanter)) {
event.player.triggerAchievement(AchievementsAether.enchanter);
}
}
event.setResult(Event.Result.ALLOW);
}
}
}
@SubscribeEvent
public void onEntityDropLoot(LivingDropsEvent event) {
if (event.source instanceof EntityDamageSource) {
EntityLivingBase entity = event.entityLiving;
EntityDamageSource source = (EntityDamageSource) event.source;
@SubscribeEvent
public void onCrafting(ItemCraftedEvent event) {
if (this.isGravititeTool(event.crafting.getItem())) {
event.player.triggerAchievement(AchievementsAether.grav_tools);
} else if (event.crafting.getItem() == Item.getItemFromBlock(BlocksAether.enchanter)) {
event.player.triggerAchievement(AchievementsAether.enchanter);
}
}
if (source.getEntity() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) source.getEntity();
ItemStack currentItem = player.inventory.getCurrentItem();
@SubscribeEvent
public void onEntityDropLoot(LivingDropsEvent event) {
if (event.source instanceof EntityDamageSource) {
EntityLivingBase entity = event.entityLiving;
EntityDamageSource source = (EntityDamageSource) event.source;
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 (source.getEntity() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) source.getEntity();
ItemStack currentItem = player.inventory.getCurrentItem();
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 (currentItem != null && currentItem.getItem() instanceof ItemSkyrootSword && !(entity instanceof EntityPlayer) && !(entity instanceof EntityWither) && !(entity instanceof EntityValkyrie)) {
for (EntityItem items : event.drops) {
ItemStack stack = items.getEntityItem();
entity.worldObj.spawnEntityInWorld(item);
}
}
}
}
}
}
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());
@SubscribeEvent
public void onEntityStruckByLightning(EntityStruckByLightningEvent event) {
if (event.entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entity;
entity.worldObj.spawnEntityInWorld(item);
}
}
}
}
}
}
if (player.inventory.getCurrentItem() != null) {
if (player.inventory.getCurrentItem().getItem()
== ItemsAether.lightning_sword
|| player.inventory.getCurrentItem().getItem()
== ItemsAether.lightning_knife) {
event.setCanceled(true);
}
}
}
}
@SubscribeEvent
public void onEntityStruckByLightning(EntityStruckByLightningEvent event)
{
if (event.entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.entity;
@SubscribeEvent
public void onEntityDamage(LivingAttackEvent event) {
if (event.entityLiving instanceof EntityAerbunny) {
EntityAerbunny aerbunny = (EntityAerbunny) event.entityLiving;
if (player.inventory.getCurrentItem() != null)
{
if (player.inventory.getCurrentItem().getItem() == ItemsAether.lightning_sword || player.inventory.getCurrentItem().getItem() == ItemsAether.lightning_knife)
{
event.setCanceled(true);
}
}
}
}
if (aerbunny.isRiding() && aerbunny.ridingEntity instanceof EntityPlayer) {
event.setCanceled(true);
}
}
}
@SubscribeEvent
public void onEntityDamage(LivingAttackEvent event)
{
if (event.entityLiving instanceof EntityAerbunny)
{
EntityAerbunny aerbunny = (EntityAerbunny) event.entityLiving;
@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) {
int defaultTime = 30;
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) {
String s = EntityList.getEntityString((Entity) event.target);
if (aerbunny.isRiding() && aerbunny.ridingEntity instanceof EntityPlayer)
{
event.setCanceled(true);
}
}
}
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
);
}
}
}
}
}
}
@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)
{
int defaultTime = 30;
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)
{
String s = EntityList.getEntityString((Entity) event.target);
public boolean isGravititeTool(Item stackID) {
return stackID == ItemsAether.gravitite_shovel
|| stackID == ItemsAether.gravitite_axe
|| stackID == ItemsAether.gravitite_pickaxe;
}
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);
}
}
}
}
}
}
@SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent event) {
if (!event.world.isRemote) {
AetherData data = AetherData.getInstance(event.world);
public boolean isGravititeTool(Item stackID) {
return stackID == ItemsAether.gravitite_shovel || stackID == ItemsAether.gravitite_axe || stackID == ItemsAether.gravitite_pickaxe;
}
WorldProvider provider = event.world.provider;
@SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent event)
{
if (!event.world.isRemote)
{
AetherData data = AetherData.getInstance(event.world);
if (provider instanceof AetherWorldProvider) {
AetherWorldProvider providerAether = (AetherWorldProvider) provider;
WorldProvider provider = event.world.provider;
providerAether.setIsEternalDay(data.isEternalDay());
AetherNetwork.sendToAll(
new PacketSendEternalDay(providerAether.getIsEternalDay())
);
if (provider instanceof AetherWorldProvider)
{
AetherWorldProvider providerAether = (AetherWorldProvider) provider;
providerAether.setShouldCycleCatchup(data.isShouldCycleCatchup());
AetherNetwork.sendToAll(
new PacketSendShouldCycle(providerAether.getShouldCycleCatchup())
);
}
}
providerAether.setIsEternalDay(data.isEternalDay());
AetherNetwork.sendToAll(new PacketSendEternalDay(providerAether.getIsEternalDay()));
for (Object entity : event.world.loadedEntityList) {
if (entity instanceof EntityItem) {
EntityItem entityItem = (EntityItem) entity;
providerAether.setShouldCycleCatchup(data.isShouldCycleCatchup());
AetherNetwork.sendToAll(new PacketSendShouldCycle(providerAether.getShouldCycleCatchup()));
}
}
if (entityItem.getEntityItem().getItem() == ItemsAether.dungeon_key) {
ObfuscationReflectionHelper.setPrivateValue(
Entity.class, entityItem, true, "invulnerable", "field_83001_bt"
);
}
}
}
}
for (Object entity : event.world.loadedEntityList)
{
if (entity instanceof EntityItem)
{
EntityItem entityItem = (EntityItem) entity;
@SubscribeEvent
public void onPlayerSleepInBed(PlayerWakeUpEvent event) {
final World world = event.entityPlayer.worldObj;
if (entityItem.getEntityItem().getItem() == ItemsAether.dungeon_key)
{
ObfuscationReflectionHelper.setPrivateValue(Entity.class, entityItem, true, "invulnerable", "field_83001_bt");
}
}
}
}
if (!world.isRemote
&& event.entityPlayer.dimension == AetherConfig.getAetherDimensionID()) {
final MinecraftServer server
= FMLCommonHandler.instance().getMinecraftServerInstance();
@SubscribeEvent
public void onPlayerSleepInBed(PlayerWakeUpEvent event)
{
final World world = event.entityPlayer.worldObj;
final WorldServer worldServer = server.worldServerForDimension(0);
if (!world.isRemote && event.entityPlayer.dimension == AetherConfig.getAetherDimensionID())
{
final MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
if (worldServer.playerEntities.size() > 0) {
if (worldServer.areAllPlayersAsleep()) {
performTimeSet(event, world, worldServer);
}
} else {
performTimeSet(event, world, worldServer);
}
}
}
final WorldServer worldServer = server.worldServerForDimension(0);
@SubscribeEvent
public void onFall(LivingFallEvent event) {
if (event.entityLiving instanceof EntityPlayer) {
IPlayerAether playerAether
= PlayerAether.get((EntityPlayer) event.entityLiving);
if (worldServer.playerEntities.size() > 0)
{
if (worldServer.areAllPlayersAsleep())
{
performTimeSet(event, world, worldServer);
}
}
else
{
performTimeSet(event, world, worldServer);
}
}
}
if (playerAether.getAccessoryInventory().wearingArmor(
new ItemStack(ItemsAether.sentry_boots)
)
|| playerAether.getAccessoryInventory().isWearingGravititeSet()
|| playerAether.getAccessoryInventory().isWearingValkyrieSet()) {
event.setCanceled(true);
}
}
}
@SubscribeEvent
public void onFall(LivingFallEvent event)
{
if (event.entityLiving instanceof EntityPlayer)
{
IPlayerAether playerAether = PlayerAether.get((EntityPlayer) event.entityLiving);
private void
performTimeSet(PlayerWakeUpEvent event, World world, WorldServer worldServer) {
if (world.getGameRules().getGameRuleBooleanValue("doDaylightCycle")
&& event.entityPlayer.isPlayerFullyAsleep()) {
final long i = worldServer.getWorldInfo().getWorldTime() + 24000L;
if (playerAether.getAccessoryInventory().wearingArmor(new ItemStack(ItemsAether.sentry_boots)) || playerAether.getAccessoryInventory().isWearingGravititeSet() || playerAether.getAccessoryInventory().isWearingValkyrieSet())
{
event.setCanceled(true);
}
}
}
worldServer.getWorldInfo().setWorldTime(i - i % 24000L);
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,36 +1,28 @@
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 berryBushRenderID;
public static int treasureChestRenderID;
public static int treasureChestRenderID;
public static int aetherFlowerRenderID;
public static int aetherFlowerRenderID;
public void init() {}
public void init() {
public void openSunAltar() {}
}
public void sendMessage(EntityPlayer player, String text) {}
public void openSunAltar() {
}
public void sendMessage(EntityPlayer player, String text) {
}
public EntityPlayer getPlayer() {
return null;
}
public static void registerEvent(Object event) {
FMLCommonHandler.instance().bus().register(event);
MinecraftForge.EVENT_BUS.register(event);
}
public EntityPlayer getPlayer() {
return null;
}
public static void registerEvent(Object event) {
FMLCommonHandler.instance().bus().register(event);
MinecraftForge.EVENT_BUS.register(event);
}
}

View File

@ -12,153 +12,218 @@ 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();
private static final AetherAPI instance = new AetherAPI();
public static final IPlayerAether get(EntityPlayer playerIn) {
return (IPlayerAether
) playerIn.getExtendedProperties("aether_legacy:player_aether");
}
public static final IPlayerAether get(EntityPlayer playerIn) {
return (IPlayerAether) playerIn.getExtendedProperties("aether_legacy:player_aether");
}
public AetherAccessory register(AetherAccessory type) {
ItemStack stack = type.getAccessoryStack();
ResourceLocation registryName = new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
);
public AetherAccessory register(AetherAccessory type) {
ItemStack stack = type.getAccessoryStack();
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
iAccessoryRegistry.put(
registryName, (AetherAccessory) type.setRegistryName(registryName)
);
iAccessoryRegistry.put(registryName, (AetherAccessory) type.setRegistryName(registryName));
return type;
}
return type;
}
public AetherEnchantment register(AetherEnchantment type) {
ItemStack stack = type.getInput();
ResourceLocation registryName = new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
);
public AetherEnchantment register(AetherEnchantment type) {
ItemStack stack = type.getInput();
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
iEnchantmentRegistry.put(
registryName, (AetherEnchantment) type.setRegistryName(registryName)
);
iEnchantmentRegistry.put(registryName, (AetherEnchantment) type.setRegistryName(registryName));
return type;
}
return type;
}
public AetherEnchantmentFuel register(AetherEnchantmentFuel type) {
ItemStack stack = type.getFuelStack();
ResourceLocation registryName = new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
);
public AetherEnchantmentFuel register(AetherEnchantmentFuel type) {
ItemStack stack = type.getFuelStack();
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
iEnchantmentFuelRegistry.put(
registryName, (AetherEnchantmentFuel) type.setRegistryName(registryName)
);
iEnchantmentFuelRegistry.put(registryName, (AetherEnchantmentFuel) type.setRegistryName(registryName));
return type;
}
return type;
}
public AetherFreezable register(AetherFreezable type) {
ItemStack stack = type.getInput();
ResourceLocation registryName = new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
);
public AetherFreezable register(AetherFreezable type) {
ItemStack stack = type.getInput();
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
iFreezableRegistry.put(
registryName, (AetherFreezable) type.setRegistryName(registryName)
);
iFreezableRegistry.put(registryName, (AetherFreezable) type.setRegistryName(registryName));
return type;
}
return type;
}
public AetherFreezableFuel register(AetherFreezableFuel type) {
ItemStack stack = type.getFuelStack();
ResourceLocation registryName = new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
);
public AetherFreezableFuel register(AetherFreezableFuel type) {
ItemStack stack = type.getFuelStack();
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
iFreezableFuelRegistry.put(
registryName, (AetherFreezableFuel) type.setRegistryName(registryName)
);
iFreezableFuelRegistry.put(registryName, (AetherFreezableFuel) type.setRegistryName(registryName));
return type;
}
return type;
}
public AetherMoaType register(String modId, String name, AetherMoaType type) {
iMoaTypeRegistry.put(
new ResourceLocation(modId, name),
(AetherMoaType) type.setRegistryName(modId, name)
);
public AetherMoaType register(String modId, String name, AetherMoaType type) {
iMoaTypeRegistry.put(new ResourceLocation(modId, name), (AetherMoaType) type.setRegistryName(modId, name));
return type;
}
return type;
}
public AetherMoaType register(ResourceLocation registryName, AetherMoaType type) {
iMoaTypeRegistry.put(
registryName, (AetherMoaType) type.setRegistryName(registryName)
);
public AetherMoaType register(ResourceLocation registryName, AetherMoaType type) {
iMoaTypeRegistry.put(registryName, (AetherMoaType) type.setRegistryName(registryName));
return type;
}
return type;
}
public boolean isAccessory(ItemStack stack) {
return iAccessoryRegistry.containsKey(new ResourceLocation(
stack.getItem().getUnlocalizedName().toString() + "_meta_"
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
));
}
public boolean isAccessory(ItemStack stack) {
return iAccessoryRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
}
public AetherAccessory getAccessory(ItemStack stack) {
return iAccessoryRegistry.get(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())));
}
public boolean hasEnchantment(ItemStack stack) {
return iEnchantmentRegistry.containsKey(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())));
}
public AetherEnchantment getEnchantment(ItemStack stack) {
return iEnchantmentRegistry.get(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())));
}
public boolean isEnchantmentFuel(ItemStack stack) {
return iEnchantmentFuelRegistry.containsKey(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())));
}
public AetherEnchantmentFuel getEnchantmentFuel(ItemStack stack) {
return iEnchantmentFuelRegistry.get(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())));
}
public boolean hasFreezable(ItemStack stack) {
return iFreezableRegistry.containsKey(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())));
}
public AetherFreezable getFreezable(ItemStack stack) {
return iFreezableRegistry.get(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())));
}
public boolean isFreezableFuel(ItemStack stack) {
return iFreezableFuelRegistry.containsKey(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())));
}
public AetherFreezableFuel getFreezableFuel(ItemStack stack) {
return iFreezableFuelRegistry.get(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())));
}
public List<AetherEnchantment> getEnchantmentValues() {
return new ArrayList<AetherEnchantment>(iEnchantmentRegistry.values());
}
public List<AetherEnchantment> getEnchantmentValues() {
return new ArrayList<AetherEnchantment>(iEnchantmentRegistry.values());
}
public List<AetherFreezable> getFreezableValues() {
return new ArrayList<AetherFreezable>(iFreezableRegistry.values());
}
public List<AetherFreezable> getFreezableValues() {
return new ArrayList<AetherFreezable>(iFreezableRegistry.values());
}
public List<AetherMoaType> getMoaTypeValues() {
return new ArrayList<AetherMoaType>(iMoaTypeRegistry.values());
}
public List<AetherMoaType> getMoaTypeValues() {
return new ArrayList<AetherMoaType>(iMoaTypeRegistry.values());
}
public int getMoaTypeId(AetherMoaType type) {
return this.getMoaTypeValues().indexOf(type);
}
public int getMoaTypeId(AetherMoaType type) {
return this.getMoaTypeValues().indexOf(type);
}
public AetherMoaType getMoaType(int id) {
return this.getMoaTypeValues().get(id);
}
public AetherMoaType getMoaType(int id) {
return this.getMoaTypeValues().get(id);
}
public AetherMoaType getRandomMoaType() {
return this.getMoaTypeValues().get(new Random().nextInt(this.getMoaTypeSize()));
}
public AetherMoaType getRandomMoaType() {
return this.getMoaTypeValues().get(new Random().nextInt(this.getMoaTypeSize()));
}
public int getMoaTypeSize() {
return this.getMoaTypeValues().size();
}
public static AetherAPI instance() {
return instance;
}
public int getMoaTypeSize() {
return this.getMoaTypeValues().size();
}
public static AetherAPI instance() {
return instance;
}
}

View File

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

View File

@ -3,51 +3,49 @@ package com.gildedgames.the_aether.api.accessories;
import net.minecraft.util.ObjectIntIdentityMap;
public enum AccessoryType {
RING("ring", 11, 3),
EXTRA_RING("ring", 11, 3),
PENDANT("pendant", 16, 7),
CAPE("cape", 15, 5),
SHIELD("shield", 13, 0),
GLOVES("gloves", 10, 0),
MISC("misc", 10, 0),
EXTRA_MISC("misc", 10, 0);
RING("ring", 11, 3),
EXTRA_RING("ring", 11, 3),
PENDANT("pendant", 16, 7),
CAPE("cape", 15, 5),
SHIELD("shield", 13, 0),
GLOVES("gloves", 10, 0),
MISC("misc", 10, 0),
EXTRA_MISC("misc", 10, 0);
private int maxDamage, damagedReduced;
private int maxDamage, damagedReduced;
private String displayName;
private String displayName;
AccessoryType(String displayName, int maxDamage, int damageReduced) {
this.displayName = displayName;
this.maxDamage = maxDamage;
this.damagedReduced = damageReduced;
}
AccessoryType(String displayName, int maxDamage, int damageReduced) {
this.displayName = displayName;
this.maxDamage = maxDamage;
this.damagedReduced = damageReduced;
}
public int getMaxDamage() {
return this.maxDamage;
}
public int getMaxDamage() {
return this.maxDamage;
}
public int getDamageReduced() {
return this.damagedReduced;
}
public int getDamageReduced() {
return this.damagedReduced;
}
public String getDisplayName() {
return this.displayName;
}
public String getDisplayName() {
return this.displayName;
}
public static ObjectIntIdentityMap createCompleteList() {
ObjectIntIdentityMap identityMap = new ObjectIntIdentityMap();
public static ObjectIntIdentityMap createCompleteList() {
ObjectIntIdentityMap identityMap = new ObjectIntIdentityMap();
identityMap.func_148746_a(PENDANT, 0);
identityMap.func_148746_a(CAPE, 1);
identityMap.func_148746_a(SHIELD, 2);
identityMap.func_148746_a(MISC, 3);
identityMap.func_148746_a(RING, 4);
identityMap.func_148746_a(EXTRA_RING, 5);
identityMap.func_148746_a(GLOVES, 6);
identityMap.func_148746_a(EXTRA_MISC, 7);
return identityMap;
}
identityMap.func_148746_a(PENDANT, 0);
identityMap.func_148746_a(CAPE, 1);
identityMap.func_148746_a(SHIELD, 2);
identityMap.func_148746_a(MISC, 3);
identityMap.func_148746_a(RING, 4);
identityMap.func_148746_a(EXTRA_RING, 5);
identityMap.func_148746_a(GLOVES, 6);
identityMap.func_148746_a(EXTRA_MISC, 7);
return identityMap;
}
}

View File

@ -1,44 +1,47 @@
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 ItemStack accessoryStack;
private AccessoryType accessoryType;
private AccessoryType accessoryType;
private AccessoryType extraType;
private AccessoryType extraType;
public AetherAccessory(Block item, AccessoryType type) {
this(new ItemStack(item), type);
}
public AetherAccessory(Block item, AccessoryType type) {
this(new ItemStack(item), type);
}
public AetherAccessory(Item item, AccessoryType type) {
this(new ItemStack(item), type);
}
public AetherAccessory(Item item, AccessoryType type) {
this(new ItemStack(item), type);
}
public AetherAccessory(ItemStack stack, AccessoryType type) {
this.accessoryType = type;
this.accessoryStack = stack;
this.extraType = type == AccessoryType.RING ? AccessoryType.EXTRA_RING
: type == AccessoryType.MISC ? AccessoryType.EXTRA_MISC
: null;
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.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() {
return this.accessoryType;
}
public AccessoryType getAccessoryType() {
return this.accessoryType;
}
public AccessoryType getExtraType() {
return this.extraType;
}
public AccessoryType getExtraType() {
return this.extraType;
}
public ItemStack getAccessoryStack() {
return this.accessoryStack;
}
public ItemStack getAccessoryStack() {
return this.accessoryStack;
}
}

View File

@ -1,85 +1,91 @@
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 int timeRequired;
public ItemStack input, output;
public ItemStack input, output;
public AetherEnchantment(ItemStack input, Block output, int timeRequired) {
this(input, new ItemStack(output), timeRequired);
}
public AetherEnchantment(ItemStack input, Block output, int timeRequired) {
this(input, new ItemStack(output), timeRequired);
}
public AetherEnchantment(Block input, ItemStack output, int timeRequired) {
this(new ItemStack(input), output, timeRequired);
}
public AetherEnchantment(Block input, ItemStack output, int timeRequired) {
this(new ItemStack(input), output, timeRequired);
}
public AetherEnchantment(Block input, Block output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherEnchantment(Block input, Block output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherEnchantment(ItemStack input, Item output, int timeRequired) {
this(input, new ItemStack(output), timeRequired);
}
public AetherEnchantment(ItemStack input, Item output, int timeRequired) {
this(input, new ItemStack(output), timeRequired);
}
public AetherEnchantment(Item input, ItemStack output, int timeRequired) {
this(new ItemStack(input), output, timeRequired);
}
public AetherEnchantment(Item input, ItemStack output, int timeRequired) {
this(new ItemStack(input), output, timeRequired);
}
public AetherEnchantment(Item input, Item output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherEnchantment(Item input, Item output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherEnchantment(Block input, Item output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherEnchantment(Block input, Item output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherEnchantment(Item input, Block output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherEnchantment(Item input, Block output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherEnchantment(Item result, int timeRequired) {
this(new ItemStack(result), new ItemStack(result), timeRequired);
}
public AetherEnchantment(Item result, int timeRequired) {
this(new ItemStack(result), new ItemStack(result), timeRequired);
}
public AetherEnchantment(ItemStack input, ItemStack output, int timeRequired) {
this.input = input;
this.output = output;
this.timeRequired = timeRequired;
public AetherEnchantment(ItemStack input, ItemStack output, int timeRequired) {
this.input = input;
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() {
return this.timeRequired;
}
public int getTimeRequired() {
return this.timeRequired;
}
public ItemStack getInput() {
return this.input;
}
public ItemStack getInput() {
return this.input;
}
public ItemStack getOutput() {
return this.output;
}
public ItemStack getOutput() {
return this.output;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof AetherEnchantment) {
AetherEnchantment freezable = (AetherEnchantment) obj;
@Override
public boolean equals(Object obj) {
if (obj instanceof AetherEnchantment) {
AetherEnchantment freezable = (AetherEnchantment) obj;
boolean inputCheck
= this.getInput().getItem() == freezable.getInput().getItem()
&& this.getInput().getItemDamage()
== freezable.getInput().getItemDamage();
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;
}
return inputCheck && outputCheck;
}
return false;
}
}

View File

@ -1,49 +1,51 @@
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 int timeGiven;
public ItemStack fuelStack;
public ItemStack fuelStack;
public AetherEnchantmentFuel(Block fuelBlock, int timeGiven) {
this(new ItemStack(fuelBlock), timeGiven);
}
public AetherEnchantmentFuel(Block fuelBlock, int timeGiven) {
this(new ItemStack(fuelBlock), timeGiven);
}
public AetherEnchantmentFuel(Item fuelItem, int timeGiven) {
this(new ItemStack(fuelItem), timeGiven);
}
public AetherEnchantmentFuel(Item fuelItem, int timeGiven) {
this(new ItemStack(fuelItem), timeGiven);
}
public AetherEnchantmentFuel(ItemStack fuelStack, int timeGiven) {
this.timeGiven = timeGiven;
this.fuelStack = fuelStack;
public AetherEnchantmentFuel(ItemStack fuelStack, int timeGiven) {
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() {
return this.timeGiven;
}
public int getTimeGiven() {
return this.timeGiven;
}
public ItemStack getFuelStack() {
return this.fuelStack;
}
public ItemStack getFuelStack() {
return this.fuelStack;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof AetherEnchantmentFuel) {
AetherEnchantmentFuel fuel = (AetherEnchantmentFuel) obj;
@Override
public boolean equals(Object obj) {
if (obj instanceof AetherEnchantmentFuel) {
AetherEnchantmentFuel fuel = (AetherEnchantmentFuel) obj;
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem() && this.getFuelStack().getItemDamage() == fuel.getFuelStack().getItemDamage();
}
return false;
}
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,48 +7,63 @@ 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) {
ValidAccessoryEvent event = new ValidAccessoryEvent(player, 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();
}
return !event.isCanceled();
}
public static void onMoaHatched(AetherMoaType type, TileEntity incubator) {
MoaHatchEvent event = new MoaHatchEvent(type, incubator);
public static void onMoaHatched(AetherMoaType type, TileEntity incubator) {
MoaHatchEvent event = new MoaHatchEvent(type, incubator);
MinecraftForge.EVENT_BUS.post(event);
}
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);
}
MinecraftForge.EVENT_BUS.post(event);
}
public static void onItemFreeze(TileEntity freezer, AetherFreezable freezable) {
AetherFreezableEvent.FreezeEvent event
= new AetherFreezableEvent.FreezeEvent(freezer, freezable);
public static void onItemFreeze(TileEntity freezer, AetherFreezable freezable) {
AetherFreezableEvent.FreezeEvent event = new AetherFreezableEvent.FreezeEvent(freezer, freezable);
MinecraftForge.EVENT_BUS.post(event);
}
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();
}
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();
}
return event.getNewTime();
}
}

View File

@ -1,19 +1,16 @@
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;
private AetherAccessory accessory;
public AetherAccessoryEvent(AetherAccessory accessory) {
this.accessory = accessory;
}
public AetherAccessory getAetherAccessory() {
return this.accessory;
}
public AetherAccessoryEvent(AetherAccessory accessory) {
this.accessory = accessory;
}
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);
}
public ValidAccessoryEvent(EntityPlayer player, AetherAccessory accessory) {
super(accessory);
}
}

View File

@ -1,72 +1,68 @@
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;
}
private AetherEnchantment enchantment;
public static class SetTimeEvent extends AetherEnchantmentEvent {
private TileEntity tileEntity;
private int original;
private AetherEnchantment enchantment;
private int newTime;
private int original;
public SetTimeEvent(
TileEntity tileEntity, AetherEnchantment enchantment, int original
) {
this.tileEntity = tileEntity;
this.enchantment = enchantment;
this.original = original;
private int newTime;
this.setNewTime(original);
}
public SetTimeEvent(TileEntity tileEntity, AetherEnchantment enchantment, int original) {
this.tileEntity = tileEntity;
this.enchantment = enchantment;
this.original = original;
public TileEntity getTileEntity() {
return this.tileEntity;
}
this.setNewTime(original);
}
public AetherEnchantment getEnchantment() {
return this.enchantment;
}
public TileEntity getTileEntity() {
return this.tileEntity;
}
public int getOriginal() {
return this.original;
}
public AetherEnchantment getEnchantment() {
return this.enchantment;
}
public int getNewTime() {
return this.newTime;
}
public int getOriginal() {
return this.original;
}
public void setNewTime(int newTime) {
this.newTime = newTime;
}
}
public int getNewTime() {
return this.newTime;
}
public static class EnchantEvent extends AetherEnchantmentEvent {
private TileEntity tileEntity;
public void setNewTime(int newTime) {
this.newTime = newTime;
}
}
private AetherEnchantment enchantent;
public static class EnchantEvent extends AetherEnchantmentEvent {
private TileEntity tileEntity;
public EnchantEvent(TileEntity tileEntity, AetherEnchantment enchantment) {
this.tileEntity = tileEntity;
this.enchantent = enchantment;
}
private AetherEnchantment enchantent;
public EnchantEvent(TileEntity tileEntity, AetherEnchantment enchantment) {
this.tileEntity = tileEntity;
this.enchantent = enchantment;
}
public TileEntity getTileEntity() {
return this.tileEntity;
}
public AetherEnchantment getEnchantment() {
return this.enchantent;
}
}
public TileEntity getTileEntity() {
return this.tileEntity;
}
public AetherEnchantment getEnchantment() {
return this.enchantent;
}
}
}

View File

@ -1,72 +1,68 @@
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;
}
private AetherFreezable freezable;
public static class SetTimeEvent extends AetherFreezableEvent {
private TileEntity tileEntity;
private int original;
private AetherFreezable freezable;
private int newTime;
private int original;
public SetTimeEvent(
TileEntity tileEntity, AetherFreezable freezable, int original
) {
this.tileEntity = tileEntity;
this.freezable = freezable;
this.original = original;
private int newTime;
this.setNewTime(original);
}
public SetTimeEvent(TileEntity tileEntity, AetherFreezable freezable, int original) {
this.tileEntity = tileEntity;
this.freezable = freezable;
this.original = original;
public TileEntity getTileEntity() {
return this.tileEntity;
}
this.setNewTime(original);
}
public AetherFreezable getFreezable() {
return this.freezable;
}
public TileEntity getTileEntity() {
return this.tileEntity;
}
public int getOriginal() {
return this.original;
}
public AetherFreezable getFreezable() {
return this.freezable;
}
public int getNewTime() {
return this.newTime;
}
public int getOriginal() {
return this.original;
}
public void setNewTime(int newTime) {
this.newTime = newTime;
}
}
public int getNewTime() {
return this.newTime;
}
public static class FreezeEvent extends AetherFreezableEvent {
private TileEntity tileEntity;
public void setNewTime(int newTime) {
this.newTime = newTime;
}
}
private AetherFreezable freezable;
public static class FreezeEvent extends AetherFreezableEvent {
private TileEntity tileEntity;
public FreezeEvent(TileEntity tileEntity, AetherFreezable freezable) {
this.tileEntity = tileEntity;
this.freezable = freezable;
}
private AetherFreezable freezable;
public FreezeEvent(TileEntity tileEntity, AetherFreezable freezable) {
this.tileEntity = tileEntity;
this.freezable = freezable;
}
public TileEntity getTileEntity() {
return this.tileEntity;
}
public AetherFreezable getFreezable() {
return this.freezable;
}
}
public TileEntity getTileEntity() {
return this.tileEntity;
}
public AetherFreezable getFreezable() {
return this.freezable;
}
}
}

View File

@ -1,19 +1,16 @@
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;
private AetherMoaType moaType;
public MoaEvent(AetherMoaType moaType) {
this.moaType = moaType;
}
public AetherMoaType getMoaType() {
return this.moaType;
}
public MoaEvent(AetherMoaType moaType) {
this.moaType = moaType;
}
public AetherMoaType getMoaType() {
return this.moaType;
}
}

View File

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

View File

@ -1,81 +1,87 @@
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 int timeRequired;
public ItemStack input, output;
public ItemStack input, output;
public AetherFreezable(ItemStack input, Block output, int timeRequired) {
this(input, new ItemStack(output), timeRequired);
}
public AetherFreezable(ItemStack input, Block output, int timeRequired) {
this(input, new ItemStack(output), timeRequired);
}
public AetherFreezable(Block input, ItemStack output, int timeRequired) {
this(new ItemStack(input), output, timeRequired);
}
public AetherFreezable(Block input, ItemStack output, int timeRequired) {
this(new ItemStack(input), output, timeRequired);
}
public AetherFreezable(Block input, Block output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherFreezable(Block input, Block output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherFreezable(ItemStack input, Item output, int timeRequired) {
this(input, new ItemStack(output), timeRequired);
}
public AetherFreezable(ItemStack input, Item output, int timeRequired) {
this(input, new ItemStack(output), timeRequired);
}
public AetherFreezable(Item input, ItemStack output, int timeRequired) {
this(new ItemStack(input), output, timeRequired);
}
public AetherFreezable(Item input, ItemStack output, int timeRequired) {
this(new ItemStack(input), output, timeRequired);
}
public AetherFreezable(Item input, Item output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherFreezable(Item input, Item output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherFreezable(Block input, Item output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherFreezable(Block input, Item output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherFreezable(Item input, Block output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherFreezable(Item input, Block output, int timeRequired) {
this(new ItemStack(input), new ItemStack(output), timeRequired);
}
public AetherFreezable(ItemStack input, ItemStack output, int timeRequired) {
this.input = input;
this.output = output;
this.timeRequired = timeRequired;
public AetherFreezable(ItemStack input, ItemStack output, int timeRequired) {
this.input = input;
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() {
return this.timeRequired;
}
public int getTimeRequired() {
return this.timeRequired;
}
public ItemStack getInput() {
return this.input;
}
public ItemStack getInput() {
return this.input;
}
public ItemStack getOutput() {
return this.output;
}
public ItemStack getOutput() {
return this.output;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof AetherFreezable) {
AetherFreezable freezable = (AetherFreezable) obj;
@Override
public boolean equals(Object obj) {
if (obj instanceof AetherFreezable) {
AetherFreezable freezable = (AetherFreezable) obj;
boolean inputCheck
= this.getInput().getItem() == freezable.getInput().getItem()
&& this.getInput().getItemDamage()
== freezable.getInput().getItemDamage();
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;
}
return inputCheck && outputCheck;
}
return false;
}
}

View File

@ -6,43 +6,46 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class AetherFreezableFuel extends RegistryEntry {
public int timeGiven;
public int timeGiven;
public ItemStack fuelStack;
public ItemStack fuelStack;
public AetherFreezableFuel(Block fuelBlock, int timeGiven) {
this(new ItemStack(fuelBlock), timeGiven);
}
public AetherFreezableFuel(Block fuelBlock, int timeGiven) {
this(new ItemStack(fuelBlock), timeGiven);
}
public AetherFreezableFuel(Item fuelItem, int timeGiven) {
this(new ItemStack(fuelItem), timeGiven);
}
public AetherFreezableFuel(Item fuelItem, int timeGiven) {
this(new ItemStack(fuelItem), timeGiven);
}
public AetherFreezableFuel(ItemStack fuelStack, int timeGiven) {
this.timeGiven = timeGiven;
this.fuelStack = fuelStack;
public AetherFreezableFuel(ItemStack fuelStack, int timeGiven) {
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() {
return this.timeGiven;
}
public int getTimeGiven() {
return this.timeGiven;
}
public ItemStack getFuelStack() {
return this.fuelStack;
}
public ItemStack getFuelStack() {
return this.fuelStack;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof AetherFreezableFuel) {
AetherFreezableFuel fuel = (AetherFreezableFuel) obj;
@Override
public boolean equals(Object obj) {
if (obj instanceof AetherFreezableFuel) {
AetherFreezableFuel fuel = (AetherFreezableFuel) obj;
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem() && this.getFuelStack().getItemDamage() == fuel.getFuelStack().getItemDamage();
}
return false;
}
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem()
&& this.getFuelStack().getItemDamage()
== fuel.getFuelStack().getItemDamage();
}
return false;
}
}

View File

@ -1,49 +1,52 @@
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;
private MoaProperties properties;
public int hexColor;
public int hexColor;
public CreativeTabs creativeTab;
public CreativeTabs creativeTab;
public AetherMoaType(int hexColor, MoaProperties properties) {
this.hexColor = hexColor;
this.properties = properties;
public AetherMoaType(int hexColor, MoaProperties properties) {
this.hexColor = hexColor;
this.properties = properties;
this.creativeTab = CreativeTabs.tabMisc;
}
this.creativeTab = CreativeTabs.tabMisc;
}
public AetherMoaType(
int hexColor, MoaProperties properties, CreativeTabs creativeTab
) {
this(hexColor, properties);
public AetherMoaType(int hexColor, MoaProperties properties, CreativeTabs creativeTab) {
this(hexColor, properties);
this.creativeTab = creativeTab;
}
this.creativeTab = creativeTab;
}
public ResourceLocation getTexture(boolean saddled, boolean isBeingRidden) {
if (this.properties.hasCustomTexture()) {
return this.properties.getCustomTexture(saddled, isBeingRidden);
}
public ResourceLocation getTexture(boolean saddled, boolean isBeingRidden) {
if (this.properties.hasCustomTexture()) {
return this.properties.getCustomTexture(saddled, isBeingRidden);
}
return new ResourceLocation(
"aether_legacy",
"textures/entities/moa/" + ("moa_")
+ this.getRegistryName().getResourcePath().toLowerCase() + ".png"
);
}
return new ResourceLocation("aether_legacy", "textures/entities/moa/" + ("moa_") + this.getRegistryName().getResourcePath().toLowerCase() + ".png");
}
public MoaProperties getMoaProperties() {
return this.properties;
}
public MoaProperties getMoaProperties() {
return this.properties;
}
public CreativeTabs getCreativeTab() {
return this.creativeTab;
}
public int getMoaEggColor() {
return this.hexColor;
}
public CreativeTabs getCreativeTab() {
return this.creativeTab;
}
public int getMoaEggColor() {
return this.hexColor;
}
}

View File

@ -3,38 +3,36 @@ package com.gildedgames.the_aether.api.moa;
import net.minecraft.util.ResourceLocation;
public class MoaProperties {
private int maxJumps;
private int maxJumps;
private float moaSpeed;
private float moaSpeed;
private ResourceLocation location = null;
private ResourceLocation location = null;
public MoaProperties(int maxJumps, float moaSpeed) {
this.maxJumps = maxJumps;
this.moaSpeed = moaSpeed;
}
public MoaProperties(int maxJumps, float moaSpeed) {
this.maxJumps = maxJumps;
this.moaSpeed = moaSpeed;
}
public MoaProperties(int maxJumps, float moaSpeed, ResourceLocation location) {
this(maxJumps, moaSpeed);
public MoaProperties(int maxJumps, float moaSpeed, ResourceLocation location) {
this(maxJumps, moaSpeed);
this.location = location;
}
this.location = location;
}
public int getMaxJumps() {
return this.maxJumps;
}
public int getMaxJumps() {
return this.maxJumps;
}
public float getMoaSpeed() {
return this.moaSpeed;
}
public float getMoaSpeed() {
return this.moaSpeed;
}
public boolean hasCustomTexture() {
return this.location != null;
}
public ResourceLocation getCustomTexture(boolean isSaddled, boolean isBeingRidden) {
return this.location;
}
public boolean hasCustomTexture() {
return this.location != null;
}
public ResourceLocation getCustomTexture(boolean isSaddled, boolean isBeingRidden) {
return this.location;
}
}

View File

@ -2,53 +2,50 @@ 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 onUpdate();
public void setInPortal();
public void setInPortal();
public void setFocusedBoss(IAetherBoss boss);
public void setFocusedBoss(IAetherBoss boss);
public IAetherBoss getFocusedBoss();
public IAetherBoss getFocusedBoss();
public void setAccessoryInventory(IAccessoryInventory inventory);
public void setAccessoryInventory(IAccessoryInventory inventory);
public IAccessoryInventory getAccessoryInventory();
public IAccessoryInventory getAccessoryInventory();
public ArrayList<IAetherAbility> getAbilities();
public ArrayList<IAetherAbility> getAbilities();
public EntityLivingBase getEntity();
public EntityLivingBase getEntity();
public boolean setHammerCooldown(int cooldown, String hammerName);
public boolean setHammerCooldown(int cooldown, String hammerName);
public String getHammerName();
public String getHammerName();
public int getHammerCooldown();
public int getHammerCooldown();
public int getHammerMaxCooldown();
public int getHammerMaxCooldown();
public void setJumping(boolean isJumping);
public void setJumping(boolean isJumping);
public boolean isJumping();
public boolean isJumping();
public void setMountSneaking(boolean isSneaking);
public void setMountSneaking(boolean isSneaking);
public boolean isMountSneaking();
public boolean isMountSneaking();
public void updateShardCount(int amount);
public void updateShardCount(int amount);
public int getShardsUsed();
public int getShardsUsed();
public int getMaxShardCount();
public boolean isDonator();
public int getMaxShardCount();
public boolean isDonator();
}

View File

@ -1,58 +1,54 @@
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 dropAccessories();
public void damageAccessory(int damage, AccessoryType type);
public void damageAccessory(int damage, AccessoryType type);
public void damageWornStack(int damage, ItemStack stack);
public void damageWornStack(int damage, ItemStack stack);
public void setAccessorySlot(AccessoryType type, ItemStack stack);
public void setAccessorySlot(AccessoryType type, ItemStack stack);
public ItemStack getStackInSlot(AccessoryType type);
public ItemStack getStackInSlot(AccessoryType type);
public ItemStack removeStackFromAccessorySlot(AccessoryType type);
public ItemStack removeStackFromAccessorySlot(AccessoryType type);
public boolean setAccessorySlot(ItemStack stack);
public boolean setAccessorySlot(ItemStack stack);
public boolean wearingAccessory(ItemStack stack);
public boolean wearingAccessory(ItemStack stack);
public boolean wearingArmor(ItemStack stack);
public boolean wearingArmor(ItemStack stack);
public NBTTagList writeToNBT(NBTTagCompound compound);
public NBTTagList writeToNBT(NBTTagCompound compound);
public void readFromNBT(NBTTagList list);
public void readFromNBT(NBTTagList list);
public void writeData(ByteBuf buf);
public void writeData(ByteBuf buf);
public void readData(ByteBuf buf);
public void readData(ByteBuf buf);
public boolean isWearingZaniteSet();
public boolean isWearingZaniteSet();
public boolean isWearingGravititeSet();
public boolean isWearingGravititeSet();
public boolean isWearingNeptuneSet();
public boolean isWearingNeptuneSet();
public boolean isWearingPhoenixSet();
public boolean isWearingPhoenixSet();
public boolean isWearingObsidianSet();
public boolean isWearingObsidianSet();
public boolean isWearingValkyrieSet();
public boolean isWearingValkyrieSet();
public List<ItemStack> getAccessories();
public int getAccessoryCount(ItemStack stack);
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 void onUpdate();
public boolean shouldExecute();
public boolean shouldExecute();
}

View File

@ -1,11 +1,9 @@
package com.gildedgames.the_aether.api.player.util;
public interface IAetherBoss {
public String getBossName();
public String getBossName();
public float getBossHealth();
public float getMaxBossHealth();
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);
public BlockAether(Material material, String texture) {
super(material);
this.setBlockTextureName(texture);
}
this.setBlockTextureName(texture);
}
}

View File

@ -2,60 +2,56 @@ 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 WorldGenerator treeGenObject = null;
public BlockAetherSapling(WorldGenerator treeGen) {
super();
public BlockAetherSapling(WorldGenerator treeGen) {
super();
float f = 0.4F;
this.treeGenObject = treeGen;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
}
float f = 0.4F;
this.treeGenObject = treeGen;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
}
@Override
public void updateTick(World world, int x, int y, int z, Random random) {
if (!world.isRemote) {
super.updateTick(world, x, y, z, random);
@Override
public void updateTick(World world, int x, int y, int z, Random random) {
if (!world.isRemote) {
super.updateTick(world, x, y, z, random);
if (world.getBlockLightValue(x, y + 1, z) >= 9 && random.nextInt(30) == 0) {
this.growTree(world, x, y, z, random);
}
}
}
if (world.getBlockLightValue(x, y + 1, z) >= 9 && random.nextInt(30) == 0) {
this.growTree(world, x, y, z, random);
}
}
}
public void growTree(World world, int x, int y, int z, Random rand) {
world.setBlock(x, y, z, Blocks.air);
public void growTree(World world, int x, int y, int z, Random rand) {
world.setBlock(x, y, z, Blocks.air);
if (!this.treeGenObject.generate(world, world.rand, x, y, z)) {
world.setBlock(x, y, z, this);
}
}
if (!this.treeGenObject.generate(world, world.rand, x, y, z)) {
world.setBlock(x, y, z, this);
}
}
@Override
public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient) {
return true;
}
@Override
public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient) {
return true;
}
@Override
public boolean func_149852_a(World worldIn, Random rand, int x, int y, int z) {
return true;
}
@Override
public void func_149853_b(World worldIn, Random rand, int x, int y, int z) {
if (worldIn.rand.nextFloat() < 0.45D) {
this.growTree(worldIn, x, y, z, rand);
}
}
@Override
public boolean func_149852_a(World worldIn, Random rand, int x, int y, int z) {
return true;
}
@Override
public void func_149853_b(World worldIn, Random rand, int x, int y, int z) {
if (worldIn.rand.nextFloat() < 0.45D) {
this.growTree(worldIn, x, y, z, rand);
}
}
}

View File

@ -6,32 +6,30 @@ import net.minecraft.init.Blocks;
import net.minecraft.world.World;
public class BlockIcestone extends Block {
public BlockIcestone() {
super(Material.ice);
public BlockIcestone() {
super(Material.ice);
this.setHardness(3F);
this.setTickRandomly(true);
this.setStepSound(soundTypeGlass);
this.setHarvestLevel("pickaxe", 1);
this.setBlockTextureName("aether_legacy:icestone");
}
this.setHardness(3F);
this.setTickRandomly(true);
this.setStepSound(soundTypeGlass);
this.setHarvestLevel("pickaxe", 1);
this.setBlockTextureName("aether_legacy:icestone");
}
@Override
public void onBlockAdded(World worldIn, int xIn, int yIn, int zIn) {
for (int x = xIn - 3; x <= (xIn + 3); ++x) {
for (int y = yIn - 3; y <= (yIn + 3); ++y) {
for (int z = zIn - 3; z <= (zIn + 3); ++z) {
Block block = worldIn.getBlock(x, y, z);
if (block == Blocks.water || block == Blocks.flowing_water) {
worldIn.setBlock(x, y, z, Blocks.ice);
} else if (block == Blocks.lava || block == Blocks.flowing_lava) {
worldIn.setBlock(x, y, z, Blocks.obsidian);
}
}
}
}
}
@Override
public void onBlockAdded(World worldIn, int xIn, int yIn, int zIn) {
for (int x = xIn - 3; x <= (xIn + 3); ++x) {
for (int y = yIn - 3; y <= (yIn + 3); ++y) {
for (int z = zIn - 3; z <= (zIn + 3); ++z) {
Block block = worldIn.getBlock(x, y, z);
if (block == Blocks.water || block == Blocks.flowing_water) {
worldIn.setBlock(x, y, z, Blocks.ice);
} else if (block == Blocks.lava || block == Blocks.flowing_lava) {
worldIn.setBlock(x, y, z, Blocks.obsidian);
}
}
}
}
}
}

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)
{
return BlockSkyrootBed.isBlockHeadOfBed(world.getBlockMetadata(x, y, 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,290 +36,593 @@ 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 aether_grass, enchanted_aether_grass, aether_dirt;
public static Block holystone, mossy_holystone, holystone_brick;
public static Block holystone, mossy_holystone, holystone_brick;
public static Block aercloud, quicksoil, icestone;
public static Block aercloud, quicksoil, icestone;
public static Block ambrosium_ore, zanite_ore, gravitite_ore;
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;
public static Block quicksoil_glass, aerogel;
public static Block enchanted_gravitite, zanite_block;
public static Block enchanted_gravitite, zanite_block;
public static Block berry_bush, berry_bush_stem;
public static Block berry_bush, berry_bush_stem;
public static Block enchanter, freezer, incubator;
public static Block enchanter, freezer, incubator;
public static Block ambrosium_torch;
public static Block ambrosium_torch;
public static Block aether_portal;
public static Block aether_portal;
public static Block chest_mimic, treasure_chest;
public static Block chest_mimic, treasure_chest;
public static Block carved_stone, angelic_stone, hellfire_stone;
public static Block carved_stone, angelic_stone, hellfire_stone;
public static Block sentry_stone, light_angelic_stone, light_hellfire_stone;
public static Block sentry_stone, light_angelic_stone, light_hellfire_stone;
public static Block locked_carved_stone, locked_angelic_stone, locked_hellfire_stone;
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;
public static Block carved_trap, angelic_trap, hellfire_trap;
public static Block purple_flower, white_flower;
public static Block purple_flower, white_flower;
public static Block skyroot_sapling, golden_oak_sapling;
public static Block skyroot_sapling, golden_oak_sapling;
public static Block crystal_leaves, crystal_fruit_leaves;
public static Block crystal_leaves, crystal_fruit_leaves;
public static Block pillar, pillar_top;
public static Block pillar, pillar_top;
public static Block skyroot_fence, skyroot_fence_gate;
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;
public static Block holiday_leaves, decorated_holiday_leaves, present;
public static Block sun_altar;
public static Block sun_altar;
public static Block skyroot_bookshelf;
public static Block skyroot_bookshelf;
public static Block skyroot_bed;
public static Block skyroot_bed;
public static void initialization() {
aether_grass = registerMeta("aether_grass", new BlockAetherGrass());
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)
);
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
);
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")
)
);
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_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"))
);
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"))
);
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);
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);
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
);
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));
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
);
skyroot_bookshelf = register("skyroot_bookshelf", new BlockSkyrootBookshelf());
skyroot_bed = registerBed(
"skyroot_bed",
new BlockSkyrootBed().setBlockTextureName(Aether.find("skyroot_bed"))
);
}
public static void initialization() {
aether_grass = registerMeta("aether_grass", new BlockAetherGrass());
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));
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);
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")));
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_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")));
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")));
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);
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);
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);
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));
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);
skyroot_bookshelf = register("skyroot_bookshelf", new BlockSkyrootBookshelf());
skyroot_bed = registerBed("skyroot_bed", new BlockSkyrootBed().setBlockTextureName(Aether.find("skyroot_bed")));
}
public static void initializeHarvestLevels() {
BlocksAether.aether_grass.setHarvestLevel("shovel", 0);
BlocksAether.enchanted_aether_grass.setHarvestLevel("shovel", 0);
BlocksAether.aether_dirt.setHarvestLevel("shovel", 0);
BlocksAether.holystone.setHarvestLevel("pickaxe", 0);
BlocksAether.mossy_holystone.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_brick.setHarvestLevel("pickaxe", 0);
BlocksAether.aercloud.setHarvestLevel("shovel", 0);
BlocksAether.quicksoil.setHarvestLevel("shovel", 0);
BlocksAether.icestone.setHarvestLevel("pickaxe", 1);
BlocksAether.ambrosium_ore.setHarvestLevel("pickaxe", 0);
BlocksAether.zanite_ore.setHarvestLevel("pickaxe", 1);
BlocksAether.gravitite_ore.setHarvestLevel("pickaxe", 2);
BlocksAether.skyroot_log.setHarvestLevel("axe", 0);
BlocksAether.skyroot_planks.setHarvestLevel("axe", 0);
BlocksAether.aerogel.setHarvestLevel("pickaxe", 3);
BlocksAether.enchanted_gravitite.setHarvestLevel("pickaxe", 2);
BlocksAether.zanite_block.setHarvestLevel("pickaxe", 1);
BlocksAether.berry_bush_stem.setHarvestLevel("axe", 0);
BlocksAether.enchanter.setHarvestLevel("pickaxe", 0);
BlocksAether.freezer.setHarvestLevel("pickaxe", 0);
BlocksAether.incubator.setHarvestLevel("pickaxe", 0);
BlocksAether.carved_stone.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_stone.setHarvestLevel("pickaxe", 0);
BlocksAether.hellfire_stone.setHarvestLevel("pickaxe", 0);
BlocksAether.chest_mimic.setHarvestLevel("axe", 0);
BlocksAether.pillar.setHarvestLevel("pickaxe", 0);
BlocksAether.pillar_top.setHarvestLevel("pickaxe", 0);
BlocksAether.skyroot_fence.setHarvestLevel("axe", 0);
BlocksAether.skyroot_fence_gate.setHarvestLevel("axe", 0);
BlocksAether.carved_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.hellfire_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_brick_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.mossy_holystone_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.aerogel_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.carved_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.hellfire_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.skyroot_stairs.setHarvestLevel("axe", 0);
BlocksAether.mossy_holystone_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_brick_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.aerogel_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.skyroot_double_slab.setHarvestLevel("axe", 0);
BlocksAether.carved_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.hellfire_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.mossy_holystone_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_brick_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.aerogel_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.skyroot_slab.setHarvestLevel("axe", 0);
BlocksAether.carved_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.hellfire_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.mossy_holystone_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_brick_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.aerogel_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.sun_altar.setHarvestLevel("pickaxe", 0);
BlocksAether.skyroot_bookshelf.setHarvestLevel("axe", 0);
BlocksAether.skyroot_bed.setHarvestLevel("axe", 0);
}
public static void initializeHarvestLevels()
{
BlocksAether.aether_grass.setHarvestLevel("shovel", 0);
BlocksAether.enchanted_aether_grass.setHarvestLevel("shovel", 0);
BlocksAether.aether_dirt.setHarvestLevel("shovel", 0);
BlocksAether.holystone.setHarvestLevel("pickaxe", 0);
BlocksAether.mossy_holystone.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_brick.setHarvestLevel("pickaxe", 0);
BlocksAether.aercloud.setHarvestLevel("shovel", 0);
BlocksAether.quicksoil.setHarvestLevel("shovel", 0);
BlocksAether.icestone.setHarvestLevel("pickaxe", 1);
BlocksAether.ambrosium_ore.setHarvestLevel("pickaxe", 0);
BlocksAether.zanite_ore.setHarvestLevel("pickaxe", 1);
BlocksAether.gravitite_ore.setHarvestLevel("pickaxe", 2);
BlocksAether.skyroot_log.setHarvestLevel("axe", 0);
BlocksAether.skyroot_planks.setHarvestLevel("axe", 0);
BlocksAether.aerogel.setHarvestLevel("pickaxe", 3);
BlocksAether.enchanted_gravitite.setHarvestLevel("pickaxe", 2);
BlocksAether.zanite_block.setHarvestLevel("pickaxe", 1);
BlocksAether.berry_bush_stem.setHarvestLevel("axe", 0);
BlocksAether.enchanter.setHarvestLevel("pickaxe", 0);
BlocksAether.freezer.setHarvestLevel("pickaxe", 0);
BlocksAether.incubator.setHarvestLevel("pickaxe", 0);
BlocksAether.carved_stone.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_stone.setHarvestLevel("pickaxe", 0);
BlocksAether.hellfire_stone.setHarvestLevel("pickaxe", 0);
BlocksAether.chest_mimic.setHarvestLevel("axe", 0);
BlocksAether.pillar.setHarvestLevel("pickaxe", 0);
BlocksAether.pillar_top.setHarvestLevel("pickaxe", 0);
BlocksAether.skyroot_fence.setHarvestLevel("axe", 0);
BlocksAether.skyroot_fence_gate.setHarvestLevel("axe", 0);
BlocksAether.carved_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.hellfire_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_brick_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.mossy_holystone_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.aerogel_wall.setHarvestLevel("pickaxe", 0);
BlocksAether.carved_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.hellfire_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.skyroot_stairs.setHarvestLevel("axe", 0);
BlocksAether.mossy_holystone_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_brick_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.aerogel_stairs.setHarvestLevel("pickaxe", 0);
BlocksAether.skyroot_double_slab.setHarvestLevel("axe", 0);
BlocksAether.carved_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.hellfire_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.mossy_holystone_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_brick_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.aerogel_double_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.skyroot_slab.setHarvestLevel("axe", 0);
BlocksAether.carved_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.angelic_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.hellfire_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.mossy_holystone_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.holystone_brick_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.aerogel_slab.setHarvestLevel("pickaxe", 0);
BlocksAether.sun_altar.setHarvestLevel("pickaxe", 0);
BlocksAether.skyroot_bookshelf.setHarvestLevel("axe", 0);
BlocksAether.skyroot_bed.setHarvestLevel("axe", 0);
}
public static boolean isGood(Block block) {
return block == Blocks.air || block == aercloud;
}
public static boolean isGood(Block block) {
return block == Blocks.air || block == aercloud;
}
public static Block registerSlab(String name, Block slab1, Block slab2) {
slab1.setBlockName(name);
slab1.setCreativeTab(AetherCreativeTabs.blocks);
public static Block registerSlab(String name, Block slab1, Block slab2) {
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;
}
return slab1;
}
public static Block register(String name, Block block) {
block.setBlockName(name);
block.setCreativeTab(AetherCreativeTabs.blocks);
public static Block register(String name, Block block) {
block.setBlockName(name);
block.setCreativeTab(AetherCreativeTabs.blocks);
GameRegistry.registerBlock(block, name);
GameRegistry.registerBlock(block, name);
return block;
}
return block;
}
public static Block registerRarity(String name, Block block, EnumRarity rarity) {
block.setBlockName(name);
block.setCreativeTab(AetherCreativeTabs.blocks);
public static Block registerRarity(String name, Block block, EnumRarity rarity) {
block.setBlockName(name);
block.setCreativeTab(AetherCreativeTabs.blocks);
GameRegistry.registerBlock(block, ItemBlockRarity.class, name, rarity);
GameRegistry.registerBlock(block, ItemBlockRarity.class, name, rarity);
return block;
}
return block;
}
public static Block registerMeta(String name, Block block) {
block.setBlockName(name);
block.setCreativeTab(AetherCreativeTabs.blocks);
public static Block registerMeta(String name, Block block) {
block.setBlockName(name);
block.setCreativeTab(AetherCreativeTabs.blocks);
GameRegistry.registerBlock(block, ItemBlockMetadata.class, name);
GameRegistry.registerBlock(block, ItemBlockMetadata.class, name);
return block;
}
return block;
}
public static Block registerBed(String name, Block block) {
block.setBlockName(name);
public static Block registerBed(String name, Block block) {
block.setBlockName(name);
GameRegistry.registerBlock(block, name);
GameRegistry.registerBlock(block, name);
return block;
}
return block;
}
public static Block registerEnchanter(String name, Block block) {
block.setBlockName(name);
block.setCreativeTab(AetherCreativeTabs.blocks);
public static Block registerEnchanter(String name, Block block) {
block.setBlockName(name);
block.setCreativeTab(AetherCreativeTabs.blocks);
GameRegistry.registerBlock(block, ItemBlockEnchanter.class, name);
return block;
}
GameRegistry.registerBlock(block, ItemBlockEnchanter.class, name);
return block;
}
}

View File

@ -9,31 +9,31 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public abstract class BlockAetherContainer extends BlockContainer {
public BlockAetherContainer(Material materialIn) {
super(materialIn);
}
public BlockAetherContainer(Material materialIn) {
super(materialIn);
}
@Override
public void onBlockPlacedBy(
World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack stack
) {
if (stack.hasDisplayName()) {
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
@Override
public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack stack) {
if (stack.hasDisplayName()) {
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
if (tileentity instanceof AetherTileEntity) {
((AetherTileEntity) tileentity).setCustomName(stack.getDisplayName());
}
}
}
if (tileentity instanceof AetherTileEntity) {
((AetherTileEntity) tileentity).setCustomName(stack.getDisplayName());
}
}
}
public static void setState(World worldIn, int x, int y, int z, boolean isActive) {
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
public static void setState(World worldIn, int x, int y, int z, boolean isActive) {
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
worldIn.setBlockMetadataWithNotify(x, y, z, isActive ? 1 : 0, 3);
if (tileentity != null) {
tileentity.validate();
worldIn.setTileEntity(x, y, z, tileentity);
}
}
worldIn.setBlockMetadataWithNotify(x, y, z, isActive ? 1 : 0, 3);
if (tileentity != null) {
tileentity.validate();
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,121 +21,140 @@ 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;
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
@SideOnly(Side.CLIENT)
private IIcon blockIconBottom;
@SideOnly(Side.CLIENT)
private IIcon blockIconBottom;
public BlockEnchanter() {
super(Material.rock);
public BlockEnchanter() {
super(Material.rock);
this.setHardness(2.0F);
}
this.setHardness(2.0F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon(Aether.find("enchanter_side"));
this.blockIconTop = registry.registerIcon(Aether.find("enchanter_bottom"));
this.blockIconBottom = registry.registerIcon(Aether.find("enchanter_bottom"));
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon(Aether.find("enchanter_side"));
this.blockIconTop = registry.registerIcon(Aether.find("enchanter_bottom"));
this.blockIconBottom = registry.registerIcon(Aether.find("enchanter_bottom"));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop
: (side == 0 ? this.blockIconBottom : this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1) {
return this.blockIconTop;
} else if (side == 0) {
return this.blockIconBottom;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1) {
return this.blockIconTop;
} else if (side == 0) {
return this.blockIconBottom;
}
return this.blockIcon;
}
return this.blockIcon;
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityEnchanter();
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityEnchanter();
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Item.getItemFromBlock(BlocksAether.enchanter);
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Item.getItemFromBlock(BlocksAether.enchanter);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
if (world.getBlockMetadata(x, y, z) == 1) {
float f = (float) x + 0.5F;
float f1 = (float) y + 1.0F + (random.nextFloat() * 6F) / 16F;
float f2 = (float) z + 0.5F;
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
if (world.getBlockMetadata(x, y, z) == 1) {
float f = (float) x + 0.5F;
float f1 = (float) y + 1.0F + (random.nextFloat() * 6F) / 16F;
float f2 = (float) z + 0.5F;
world.spawnParticle("smoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
world.spawnParticle("smoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
@Override
public boolean onBlockActivated(
World world,
int x,
int y,
int z,
EntityPlayer player,
int side,
float hitX,
float hitY,
float hitZ
) {
player.openGui(Aether.instance, AetherGuiHandler.enchanter, world, x, y, z);
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
player.openGui(Aether.instance, AetherGuiHandler.enchanter, world, x, y, z);
return true;
}
return true;
}
@Override
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta) {
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
@Override
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta) {
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
if (tileentity instanceof TileEntityEnchanter) {
TileEntityEnchanter tile = (TileEntityEnchanter) tileentity;
if (tileentity instanceof TileEntityEnchanter) {
TileEntityEnchanter tile = (TileEntityEnchanter) tileentity;
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
ItemStack itemstack = tile.getStackInSlot(i1);
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
ItemStack itemstack = tile.getStackInSlot(i1);
if (itemstack != null) {
float f = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f1 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f2 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
if (itemstack != null) {
float f = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f1 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f2 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
while (itemstack.stackSize > 0) {
int j1 = worldIn.rand.nextInt(21) + 10;
while (itemstack.stackSize > 0) {
int j1 = worldIn.rand.nextInt(21) + 10;
if (j1 > itemstack.stackSize) {
j1 = itemstack.stackSize;
}
if (j1 > itemstack.stackSize) {
j1 = itemstack.stackSize;
}
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(
worldIn,
(double) ((float) x + f),
(double) ((float) y + f1),
(double) ((float) z + f2),
new ItemStack(
itemstack.getItem(), j1, itemstack.getItemDamage()
)
);
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(worldIn, (double) ((float) x + f), (double) ((float) y + f1), (double) ((float) z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound(
(NBTTagCompound) itemstack.getTagCompound().copy()
);
}
if (itemstack.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
float f3 = 0.05F;
entityitem.motionX
= (double) ((float) worldIn.rand.nextGaussian() * f3);
entityitem.motionY
= (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
entityitem.motionZ
= (double) ((float) worldIn.rand.nextGaussian() * f3);
worldIn.spawnEntityInWorld(entityitem);
}
}
}
float f3 = 0.05F;
entityitem.motionX = (double) ((float) worldIn.rand.nextGaussian() * f3);
entityitem.motionY = (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double) ((float) worldIn.rand.nextGaussian() * f3);
worldIn.spawnEntityInWorld(entityitem);
}
}
}
worldIn.func_147453_f(x, y, z, this);
}
super.breakBlock(worldIn, x, y, z, block, meta);
}
worldIn.func_147453_f(x, y, z, this);
}
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,121 +21,140 @@ 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;
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
@SideOnly(Side.CLIENT)
private IIcon blockIconBottom;
@SideOnly(Side.CLIENT)
private IIcon blockIconBottom;
public BlockFreezer() {
super(Material.rock);
public BlockFreezer() {
super(Material.rock);
this.setHardness(2.5F);
}
this.setHardness(2.5F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon(Aether.find("freezer_side"));
this.blockIconTop = registry.registerIcon(Aether.find("freezer_top"));
this.blockIconBottom = registry.registerIcon(Aether.find("enchanter_bottom"));
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon(Aether.find("freezer_side"));
this.blockIconTop = registry.registerIcon(Aether.find("freezer_top"));
this.blockIconBottom = registry.registerIcon(Aether.find("enchanter_bottom"));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop
: (side == 0 ? this.blockIconBottom : this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1) {
return this.blockIconTop;
} else if (side == 0) {
return this.blockIconBottom;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1) {
return this.blockIconTop;
} else if (side == 0) {
return this.blockIconBottom;
}
return this.blockIcon;
}
return this.blockIcon;
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityFreezer();
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityFreezer();
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Item.getItemFromBlock(BlocksAether.freezer);
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Item.getItemFromBlock(BlocksAether.freezer);
}
@Override
public boolean onBlockActivated(
World world,
int x,
int y,
int z,
EntityPlayer player,
int side,
float hitX,
float hitY,
float hitZ
) {
player.openGui(Aether.instance, AetherGuiHandler.freezer, world, x, y, z);
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
player.openGui(Aether.instance, AetherGuiHandler.freezer, world, x, y, z);
return true;
}
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
if (world.getBlockMetadata(x, y, z) == 1) {
float f = (float) x + 0.5F;
float f1 = (float) y + 1.0F + (random.nextFloat() * 6F) / 16F;
float f2 = (float) z + 0.5F;
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
if (world.getBlockMetadata(x, y, z) == 1) {
float f = (float) x + 0.5F;
float f1 = (float) y + 1.0F + (random.nextFloat() * 6F) / 16F;
float f2 = (float) z + 0.5F;
world.spawnParticle("smoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
world.spawnParticle("snowshovel", f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
world.spawnParticle("smoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
world.spawnParticle("snowshovel", f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
@Override
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta) {
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
@Override
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta) {
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
if (tileentity instanceof TileEntityFreezer) {
TileEntityFreezer tile = (TileEntityFreezer) tileentity;
if (tileentity instanceof TileEntityFreezer) {
TileEntityFreezer tile = (TileEntityFreezer) tileentity;
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
ItemStack itemstack = tile.getStackInSlot(i1);
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
ItemStack itemstack = tile.getStackInSlot(i1);
if (itemstack != null) {
float f = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f1 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f2 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
if (itemstack != null) {
float f = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f1 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f2 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
while (itemstack.stackSize > 0) {
int j1 = worldIn.rand.nextInt(21) + 10;
while (itemstack.stackSize > 0) {
int j1 = worldIn.rand.nextInt(21) + 10;
if (j1 > itemstack.stackSize) {
j1 = itemstack.stackSize;
}
if (j1 > itemstack.stackSize) {
j1 = itemstack.stackSize;
}
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(
worldIn,
(double) ((float) x + f),
(double) ((float) y + f1),
(double) ((float) z + f2),
new ItemStack(
itemstack.getItem(), j1, itemstack.getItemDamage()
)
);
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(worldIn, (double) ((float) x + f), (double) ((float) y + f1), (double) ((float) z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound(
(NBTTagCompound) itemstack.getTagCompound().copy()
);
}
if (itemstack.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
float f3 = 0.05F;
entityitem.motionX
= (double) ((float) worldIn.rand.nextGaussian() * f3);
entityitem.motionY
= (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
entityitem.motionZ
= (double) ((float) worldIn.rand.nextGaussian() * f3);
worldIn.spawnEntityInWorld(entityitem);
}
}
}
float f3 = 0.05F;
entityitem.motionX = (double) ((float) worldIn.rand.nextGaussian() * f3);
entityitem.motionY = (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double) ((float) worldIn.rand.nextGaussian() * f3);
worldIn.spawnEntityInWorld(entityitem);
}
}
}
worldIn.func_147453_f(x, y, z, this);
}
super.breakBlock(worldIn, x, y, z, block, meta);
}
worldIn.func_147453_f(x, y, z, this);
}
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,121 +21,140 @@ 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;
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
@SideOnly(Side.CLIENT)
private IIcon blockIconBottom;
@SideOnly(Side.CLIENT)
private IIcon blockIconBottom;
public BlockIncubator() {
super(Material.rock);
public BlockIncubator() {
super(Material.rock);
this.setHardness(2.0F);
}
this.setHardness(2.0F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon(Aether.find("incubator_side"));
this.blockIconTop = registry.registerIcon(Aether.find("incubator_top"));
this.blockIconBottom = registry.registerIcon(Aether.find("enchanter_bottom"));
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon(Aether.find("incubator_side"));
this.blockIconTop = registry.registerIcon(Aether.find("incubator_top"));
this.blockIconBottom = registry.registerIcon(Aether.find("enchanter_bottom"));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop
: (side == 0 ? this.blockIconBottom : this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1) {
return this.blockIconTop;
} else if (side == 0) {
return this.blockIconBottom;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1) {
return this.blockIconTop;
} else if (side == 0) {
return this.blockIconBottom;
}
return this.blockIcon;
}
return this.blockIcon;
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityIncubator();
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityIncubator();
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Item.getItemFromBlock(BlocksAether.incubator);
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Item.getItemFromBlock(BlocksAether.incubator);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
if (world.getBlockMetadata(x, y, z) == 1) {
float f = (float) x + 0.5F;
float f1 = (float) y + 1.0F + (random.nextFloat() * 6F) / 16F;
float f2 = (float) z + 0.5F;
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
if (world.getBlockMetadata(x, y, z) == 1) {
float f = (float) x + 0.5F;
float f1 = (float) y + 1.0F + (random.nextFloat() * 6F) / 16F;
float f2 = (float) z + 0.5F;
world.spawnParticle("smoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
world.spawnParticle("smoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
@Override
public boolean onBlockActivated(
World world,
int x,
int y,
int z,
EntityPlayer player,
int side,
float hitX,
float hitY,
float hitZ
) {
player.openGui(Aether.instance, AetherGuiHandler.incubator, world, x, y, z);
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
player.openGui(Aether.instance, AetherGuiHandler.incubator, world, x, y, z);
return true;
}
return true;
}
@Override
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta) {
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
@Override
public void breakBlock(World worldIn, int x, int y, int z, Block block, int meta) {
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
if (tileentity instanceof TileEntityIncubator) {
TileEntityIncubator tile = (TileEntityIncubator) tileentity;
if (tileentity instanceof TileEntityIncubator) {
TileEntityIncubator tile = (TileEntityIncubator) tileentity;
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
ItemStack itemstack = tile.getStackInSlot(i1);
for (int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
ItemStack itemstack = tile.getStackInSlot(i1);
if (itemstack != null) {
float f = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f1 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f2 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
if (itemstack != null) {
float f = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f1 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
float f2 = worldIn.rand.nextFloat() * 0.8F + 0.1F;
while (itemstack.stackSize > 0) {
int j1 = worldIn.rand.nextInt(21) + 10;
while (itemstack.stackSize > 0) {
int j1 = worldIn.rand.nextInt(21) + 10;
if (j1 > itemstack.stackSize) {
j1 = itemstack.stackSize;
}
if (j1 > itemstack.stackSize) {
j1 = itemstack.stackSize;
}
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(
worldIn,
(double) ((float) x + f),
(double) ((float) y + f1),
(double) ((float) z + f2),
new ItemStack(
itemstack.getItem(), j1, itemstack.getItemDamage()
)
);
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(worldIn, (double) ((float) x + f), (double) ((float) y + f1), (double) ((float) z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound(
(NBTTagCompound) itemstack.getTagCompound().copy()
);
}
if (itemstack.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
float f3 = 0.05F;
entityitem.motionX
= (double) ((float) worldIn.rand.nextGaussian() * f3);
entityitem.motionY
= (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
entityitem.motionZ
= (double) ((float) worldIn.rand.nextGaussian() * f3);
worldIn.spawnEntityInWorld(entityitem);
}
}
}
float f3 = 0.05F;
entityitem.motionX = (double) ((float) worldIn.rand.nextGaussian() * f3);
entityitem.motionY = (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double) ((float) worldIn.rand.nextGaussian() * f3);
worldIn.spawnEntityInWorld(entityitem);
}
}
}
worldIn.func_147453_f(x, y, z, this);
}
super.breakBlock(worldIn, x, y, z, block, meta);
}
worldIn.func_147453_f(x, y, z, this);
}
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,103 +20,109 @@ 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;
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
public BlockSunAltar() {
super(Material.rock);
public BlockSunAltar() {
super(Material.rock);
this.setHardness(2.5F);
this.setStepSound(soundTypeMetal);
}
this.setHardness(2.5F);
this.setStepSound(soundTypeMetal);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon(Aether.find("sun_altar_side"));
this.blockIconTop = registry.registerIcon(Aether.find("sun_altar_top"));
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon(Aether.find("sun_altar_side"));
this.blockIconTop = registry.registerIcon(Aether.find("sun_altar_top"));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1
? this.blockIconTop
: (side == 0 ? BlocksAether.hellfire_stone.getBlockTextureFromSide(side)
: this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop : (side == 0 ? BlocksAether.hellfire_stone.getBlockTextureFromSide(side) : this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1) {
return this.blockIconTop;
} else if (side == 0) {
return BlocksAether.hellfire_stone.getBlockTextureFromSide(side);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1) {
return this.blockIconTop;
} else if (side == 0) {
return BlocksAether.hellfire_stone.getBlockTextureFromSide(side);
}
return this.blockIcon;
}
return this.blockIcon;
}
@Override
public boolean onBlockActivated(
World world,
int x,
int y,
int z,
EntityPlayer player,
int side,
float hitX,
float hitY,
float hitZ
) {
if (player.dimension == AetherConfig.getAetherDimensionID()) {
if (world.provider instanceof AetherWorldProvider) {
AetherWorldProvider provider = (AetherWorldProvider) world.provider;
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
MinecraftServer server
= FMLCommonHandler.instance().getMinecraftServerInstance();
if (player.dimension == AetherConfig.getAetherDimensionID())
{
if (world.provider instanceof AetherWorldProvider)
{
AetherWorldProvider provider = (AetherWorldProvider) world.provider;
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())))
{
Aether.proxy.openSunAltar();
}
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 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")));
}
}
return true;
}
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())) {
Aether.proxy.openSunAltar();
} 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 (world.isRemote) {
player.addChatComponentMessage(
new ChatComponentText(I18n.format("gui.sun_altar.message"))
);
}
}
return true;
}
}

View File

@ -1,34 +1,30 @@
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);
public BlockAerogel() {
super(Aether.find("aerogel"), Material.rock, false);
this.setHardness(1.0F);
this.setLightOpacity(3);
this.setResistance(2000F);
this.setStepSound(soundTypeMetal);
this.setHarvestLevel("pickaxe", 0);
}
this.setHardness(1.0F);
this.setLightOpacity(3);
this.setResistance(2000F);
this.setStepSound(soundTypeMetal);
this.setHarvestLevel("pickaxe", 0);
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return 1;
}
@Override
public boolean renderAsNormalBlock() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return 1;
}
@Override
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,28 +9,30 @@ 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);
public BlockAetherFence() {
super(Aether.find("skyroot_planks"), Material.wood);
this.setHardness(2.0F);
this.setResistance(5.0F);
this.setStepSound(soundTypeWood);
}
this.setHardness(2.0F);
this.setResistance(5.0F);
this.setStepSound(soundTypeWood);
}
@Override
public boolean canPlaceTorchOnTop(World world, int x, int y, int z) {
return true;
}
@Override
public boolean canConnectFenceTo(IBlockAccess p_149826_1_, int p_149826_2_, int p_149826_3_, int p_149826_4_) {
Block block = p_149826_1_.getBlock(p_149826_2_, p_149826_3_, p_149826_4_);
return block != this && block != Blocks.fence_gate && block != BlocksAether.skyroot_fence_gate ? (block.getMaterial().isOpaque() && block.renderAsNormalBlock() ? block.getMaterial() != Material.gourd : false) : true;
}
@Override
public boolean canPlaceTorchOnTop(World world, int x, int y, int z) {
return true;
}
@Override
public boolean canConnectFenceTo(
IBlockAccess p_149826_1_, int p_149826_2_, int p_149826_3_, int p_149826_4_
) {
Block block = p_149826_1_.getBlock(p_149826_2_, p_149826_3_, p_149826_4_);
return block != this && block != Blocks.fence_gate
&& block != BlocksAether.skyroot_fence_gate
? (block.getMaterial().isOpaque() && block.renderAsNormalBlock()
? block.getMaterial() != Material.gourd
: false)
: true;
}
}

View File

@ -1,29 +1,25 @@
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();
public BlockAetherFenceGate() {
super();
this.setHardness(2.0F);
this.setResistance(5.0F);
this.setStepSound(soundTypeWood);
this.setBlockTextureName(Aether.find("skyroot_planks"));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
}
this.setHardness(2.0F);
this.setResistance(5.0F);
this.setStepSound(soundTypeWood);
this.setBlockTextureName(Aether.find("skyroot_planks"));
}
@Override
@SideOnly(Side.CLIENT)
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,63 +11,64 @@ 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;
private String name;
public BlockAetherSlab(String name, boolean double_slab, Material materialIn) {
super(double_slab, materialIn);
this.name = name;
public BlockAetherSlab(String name, boolean double_slab, Material materialIn) {
super(double_slab, materialIn);
this.name = name;
this.setLightOpacity(0);
this.setStepSound(materialIn == Material.wood ? soundTypeWood : soundTypeStone);
}
this.setLightOpacity(0);
this.setStepSound(materialIn == Material.wood ? soundTypeWood : soundTypeStone);
}
@Override
public Item
getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
return Item.getItemFromBlock(this.getDroppedSlab());
}
@Override
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
return Item.getItemFromBlock(this.getDroppedSlab());
}
public Block getDroppedSlab() {
if (this == BlocksAether.skyroot_double_slab) {
return BlocksAether.skyroot_slab;
} else if (this == BlocksAether.carved_double_slab) {
return BlocksAether.carved_slab;
} else if (this == BlocksAether.angelic_double_slab) {
return BlocksAether.angelic_slab;
} else if (this == BlocksAether.hellfire_double_slab) {
return BlocksAether.hellfire_slab;
} else if (this == BlocksAether.holystone_brick_double_slab) {
return BlocksAether.holystone_brick_slab;
} else if (this == BlocksAether.holystone_double_slab) {
return BlocksAether.holystone_slab;
} else if (this == BlocksAether.mossy_holystone_double_slab) {
return BlocksAether.mossy_holystone_slab;
} else {
return this;
}
}
public Block getDroppedSlab() {
if (this == BlocksAether.skyroot_double_slab) {
return BlocksAether.skyroot_slab;
} else if (this == BlocksAether.carved_double_slab) {
return BlocksAether.carved_slab;
} else if (this == BlocksAether.angelic_double_slab) {
return BlocksAether.angelic_slab;
} else if (this == BlocksAether.hellfire_double_slab) {
return BlocksAether.hellfire_slab;
} else if (this == BlocksAether.holystone_brick_double_slab) {
return BlocksAether.holystone_brick_slab;
} else if (this == BlocksAether.holystone_double_slab) {
return BlocksAether.holystone_slab;
} else if (this == BlocksAether.mossy_holystone_double_slab) {
return BlocksAether.mossy_holystone_slab;
} else {
return this;
}
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Item.getItemFromBlock(this.getDroppedSlab());
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Item.getItemFromBlock(this.getDroppedSlab());
}
@Override
public int damageDropped(int meta) {
return 0;
}
@Override
public int damageDropped(int meta) {
return 0;
}
@Override
public String func_150002_b(int meta) {
return this.name;
}
@Override
public String func_150002_b(int meta) {
return this.name;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return this == BlocksAether.aerogel_slab || this == BlocksAether.aerogel_double_slab ? 1 : 0;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
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);
public BlockAetherStairs(Block block) {
super(block, 0);
this.setLightOpacity(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,40 +12,38 @@ 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;
private Block block;
public BlockAetherWall(Block block) {
super(block);
public BlockAetherWall(Block block) {
super(block);
this.block = block;
}
this.block = block;
}
@Override
public boolean canPlaceTorchOnTop(World world, int x, int y, int z) {
return true;
}
@Override
public boolean canPlaceTorchOnTop(World world, int x, int y, int z) {
return true;
}
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
public void
getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0));
}
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({"unchecked", "rawtypes"})
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return this.block.getBlockTextureFromSide(p_149691_1_);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return this.block.getBlockTextureFromSide(p_149691_1_);
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return this == BlocksAether.aerogel_wall ? 1 : 0;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return this == BlocksAether.aerogel_wall ? 1 : 0;
}
}

View File

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

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,78 +15,74 @@ 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;
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
public BlockPresent() {
super(Material.grass);
public BlockPresent() {
super(Material.grass);
this.setHardness(0.6F);
this.setStepSound(soundTypeGrass);
this.setBlockTextureName(Aether.find("present_side"));
}
this.setHardness(0.6F);
this.setStepSound(soundTypeGrass);
this.setBlockTextureName(Aether.find("present_side"));
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
super.registerBlockIcons(registry);
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
super.registerBlockIcons(registry);
this.blockIconTop = registry.registerIcon(Aether.find("present_top"));
}
this.blockIconTop = registry.registerIcon(Aether.find("present_top"));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return (side == 1 || side == 0) ? this.blockIconTop : this.blockIcon;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return (side == 1 || side == 0) ? this.blockIconTop : this.blockIcon;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1 || side == 0) {
return this.blockIconTop;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1 || side == 0) {
return this.blockIconTop;
}
return this.blockIcon;
}
return this.blockIcon;
}
@Override
public void
harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
int randomNumber = (int) (((9 - 6 + 1) * world.rand.nextDouble()) + 6);
int crateType = world.rand.nextInt(4);
@Override
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
int randomNumber = (int) (((9 - 6 + 1) * world.rand.nextDouble()) + 6);
int crateType = world.rand.nextInt(4);
if (crateType == 0) {
for (int size = 1; size <= randomNumber; ++size) {
if (!world.isRemote) {
world.spawnEntityInWorld(new EntityXPOrb(world, x, y, z, size));
}
}
} else if (crateType == 1) {
if (world.rand.nextInt(9) == 0) {
this.dropBlockAsItem(
world, x, y, z, new ItemStack(ItemsAether.candy_cane_sword)
);
} else {
for (int size = 1; size <= randomNumber; ++size) {
this.dropBlockAsItem(
world, x, y, z, new ItemStack(ItemsAether.gingerbread_man)
);
}
}
} else {
EntityTNTPresent present = new EntityTNTPresent(world, x, y, z);
if (crateType == 0) {
for (int size = 1; size <= randomNumber; ++size) {
if (!world.isRemote) {
world.spawnEntityInWorld(new EntityXPOrb(world, x, y, z, size));
}
}
} else if (crateType == 1) {
if (world.rand.nextInt(9) == 0) {
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));
}
}
} else {
EntityTNTPresent present = new EntityTNTPresent(world, x, y, z);
if (!world.isRemote) {
world.spawnEntityInWorld(present);
}
world.playSoundAtEntity(present, "game.tnt.primed", 1.0F, 1.0F);
}
}
if (!world.isRemote) {
world.spawnEntityInWorld(present);
}
world.playSoundAtEntity(present, "game.tnt.primed", 1.0F, 1.0F);
}
}
}

View File

@ -2,46 +2,42 @@ 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);
public BlockQuicksoilGlass() {
super(Aether.find("quicksoil_glass"), Material.glass, false);
this.slipperiness = 1.1F;
this.slipperiness = 1.1F;
this.setHardness(0.2F);
this.setLightOpacity(0);
this.setLightLevel(0.7375F);
this.setStepSound(soundTypeGlass);
}
this.setHardness(0.2F);
this.setLightOpacity(0);
this.setLightLevel(0.7375F);
this.setStepSound(soundTypeGlass);
}
@Override
public int quantityDropped(Random random) {
return 0;
}
@Override
public int quantityDropped(Random random) {
return 0;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return 1;
}
@Override
public boolean renderAsNormalBlock() {
return true;
}
@Override
protected boolean canSilkHarvest() {
return true;
}
@Override
public boolean renderAsNormalBlock() {
return true;
}
@Override
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,42 +13,37 @@ 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);
public BlockSkyrootBookshelf() {
super(Material.wood);
this.setHardness(2F);
this.setResistance(5F);
this.setHarvestLevel("axe", 0);
this.setStepSound(soundTypeWood);
this.setBlockTextureName(Aether.find("skyroot_bookshelf"));
}
this.setHardness(2F);
this.setResistance(5F);
this.setHarvestLevel("axe", 0);
this.setStepSound(soundTypeWood);
this.setBlockTextureName(Aether.find("skyroot_bookshelf"));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return p_149691_1_ != 1 && p_149691_1_ != 0
? super.getIcon(p_149691_1_, p_149691_2_)
: BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return p_149691_1_ != 1 && p_149691_1_ != 0 ? super.getIcon(p_149691_1_, p_149691_2_) : BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
}
@Override
public int quantityDropped(Random random) {
return 3;
}
@Override
public int quantityDropped(Random random) {
return 3;
}
@Override
public float getEnchantPowerBonus(World world, int x, int y, int z) {
return 1;
}
@Override
public float getEnchantPowerBonus(World world, int x, int y, int z) {
return 1;
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Items.book;
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Items.book;
}
}

View File

@ -1,19 +1,16 @@
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);
public BlockSkyrootPlanks() {
super(Material.wood);
this.setHardness(2F);
this.setResistance(5F);
this.setStepSound(soundTypeWood);
this.setBlockTextureName(Aether.find("skyroot_planks"));
}
this.setHardness(2F);
this.setResistance(5F);
this.setStepSound(soundTypeWood);
this.setBlockTextureName(Aether.find("skyroot_planks"));
}
}

View File

@ -1,25 +1,24 @@
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);
public BlockZanite() {
super(Material.iron);
this.setHardness(3F);
this.setStepSound(soundTypeMetal);
this.setHarvestLevel("pickaxe", 1);
this.setBlockTextureName(Aether.find("zanite_block"));
}
@Override
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
return true;
}
this.setHardness(3F);
this.setStepSound(soundTypeMetal);
this.setHarvestLevel("pickaxe", 1);
this.setBlockTextureName(Aether.find("zanite_block"));
}
@Override
public boolean isBeaconBase(
IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ
) {
return true;
}
}

View File

@ -10,55 +10,55 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockDungeonBase extends Block {
private Block pickBlock;
private Block pickBlock;
private boolean isLit;
private boolean isLit;
public BlockDungeonBase(boolean isLit) {
this(null, isLit);
}
public BlockDungeonBase(boolean isLit) {
this(null, isLit);
}
public BlockDungeonBase(Block pickBlock, boolean isLit) {
super(Material.rock);
public BlockDungeonBase(Block pickBlock, boolean isLit) {
super(Material.rock);
if (pickBlock != null) {
this.pickBlock = pickBlock;
this.setResistance(6000000.0F);
}
if (pickBlock != null) {
this.pickBlock = pickBlock;
this.setResistance(6000000.0F);
}
this.isLit = isLit;
this.setStepSound(soundTypeStone);
this.setHardness(this.pickBlock != null ? -1F : 0.5F);
this.setCreativeTab(this.pickBlock != null ? null : AetherCreativeTabs.blocks);
}
this.isLit = isLit;
this.setStepSound(soundTypeStone);
this.setHardness(this.pickBlock != null ? -1F : 0.5F);
this.setCreativeTab(this.pickBlock != null ? null : AetherCreativeTabs.blocks);
}
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z) {
Block block = world.getBlock(x, y, z);
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z) {
Block block = world.getBlock(x, y, z);
if (block != this) {
return block.getLightValue(world, x, y, z);
}
if (block != this) {
return block.getLightValue(world, x, y, z);
}
if (this.isLit) {
return (int) (15.0F * 0.75f);
}
if (this.isLit) {
return (int) (15.0F * 0.75f);
}
return super.getLightValue(world, x, y, z);
}
return super.getLightValue(world, x, y, z);
}
@Override
public ItemStack getPickBlock(
MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player
) {
if (this.pickBlock != null) {
return new ItemStack(this.pickBlock);
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
if (this.pickBlock != null) {
return new ItemStack(this.pickBlock);
}
return super.getPickBlock(target, world, x, y, z, player);
}
public Block getUnlockedBlock() {
return this.pickBlock == null ? this : this.pickBlock;
}
return super.getPickBlock(target, world, x, y, z, player);
}
public Block getUnlockedBlock() {
return this.pickBlock == null ? this : this.pickBlock;
}
}

View File

@ -11,45 +11,50 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class BlockDungeonTrap extends Block {
private Block pickBlock;
private Block pickBlock;
public BlockDungeonTrap(Block pickBlock) {
super(Material.rock);
public BlockDungeonTrap(Block pickBlock) {
super(Material.rock);
this.pickBlock = pickBlock;
this.setBlockUnbreakable();
}
this.pickBlock = pickBlock;
this.setBlockUnbreakable();
}
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity entityIn) {
if (entityIn instanceof EntityPlayer) {
world.setBlock(x, y, z, this.pickBlock);
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity entityIn) {
if (entityIn instanceof EntityPlayer) {
world.setBlock(x, y, z, this.pickBlock);
if (this == BlocksAether.carved_trap) {
EntitySentry sentry = new EntitySentry(world, x + 2D, y + 1D, z + 2D);
if (this == BlocksAether.carved_trap) {
EntitySentry sentry = new EntitySentry(world, x + 2D, y + 1D, z + 2D);
if (!world.isRemote) {
world.spawnEntityInWorld(sentry);
}
} else if (this == BlocksAether.angelic_trap) {
EntityValkyrie valkyrie = new EntityValkyrie(world);
valkyrie.setPosition(x + 0.5D, y + 1D, z + 0.5D);
if (!world.isRemote) {
world.spawnEntityInWorld(sentry);
}
} else if (this == BlocksAether.angelic_trap) {
EntityValkyrie valkyrie = new EntityValkyrie(world);
valkyrie.setPosition(x + 0.5D, y + 1D, z + 0.5D);
if (!world.isRemote) {
world.spawnEntityInWorld(valkyrie);
}
} else if (this == BlocksAether.hellfire_trap) {
EntityFireMinion minion = new EntityFireMinion(world);
minion.setPosition(x + 0.5D, y + 1D, z + 0.5D);
if (!world.isRemote) {
world.spawnEntityInWorld(valkyrie);
}
} else if (this == BlocksAether.hellfire_trap) {
EntityFireMinion minion = new EntityFireMinion(world);
minion.setPosition(x + 0.5D, y + 1D, z + 0.5D);
if (!world.isRemote) {
world.spawnEntityInWorld(minion);
}
}
world.playSoundEffect(x, y, z, "random.door_close", 2.0F, world.rand.nextFloat() - world.rand.nextFloat() * 0.2F + 1.2F);
}
}
if (!world.isRemote) {
world.spawnEntityInWorld(minion);
}
}
world.playSoundEffect(
x,
y,
z,
"random.door_close",
2.0F,
world.rand.nextFloat() - world.rand.nextFloat() * 0.2F + 1.2F
);
}
}
}

View File

@ -11,48 +11,66 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class BlockMimicChest extends BlockChest {
public BlockMimicChest() {
super(13);
public BlockMimicChest() {
super(13);
this.setHardness(2.0F);
}
this.setHardness(2.0F);
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityChestMimic();
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityChestMimic();
}
@Override
public boolean onBlockActivated(
World worldIn,
int x,
int y,
int z,
EntityPlayer playerIn,
int side,
float hitX,
float hitY,
float hitZ
) {
this.spawnMimic(worldIn, playerIn, x, y, z);
@Override
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;
}
return true;
}
@Override
public void
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
this.spawnMimic(worldIn, player, x, y, z);
}
@Override
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
this.spawnMimic(worldIn, player, x, y, z);
}
@Override
public ItemStack getPickBlock(
MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player
) {
return new ItemStack(Blocks.chest);
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
return new ItemStack(Blocks.chest);
}
private void spawnMimic(World world, EntityPlayer player, int x, int y, int z) {
if (!world.isRemote) {
EntityMimic mimic = new EntityMimic(world);
if (!player.capabilities.isCreativeMode) {
mimic.setAttackTarget(player);
}
mimic.setPosition((double) x + 0.5D, (double) y + 1.5D, (double) z + 0.5D);
world.spawnEntityInWorld(mimic);
}
world.setBlockToAir(x, y, z);
}
private void spawnMimic(World world, EntityPlayer player, int x, int y, int z) {
if (!world.isRemote) {
EntityMimic mimic = new EntityMimic(world);
if (!player.capabilities.isCreativeMode) {
mimic.setAttackTarget(player);
}
mimic.setPosition((double) x + 0.5D, (double) y + 1.5D, (double) z + 0.5D);
world.spawnEntityInWorld(mimic);
}
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,36 +9,34 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
public class BlockPillar extends BlockRotatedPillar {
private String topTexture;
private String topTexture;
private String sideTexture;
private String sideTexture;
@SideOnly(Side.CLIENT)
protected IIcon sideIcon;
@SideOnly(Side.CLIENT)
protected IIcon sideIcon;
public BlockPillar(String topIcon, String sideTexture) {
super(Material.rock);
public BlockPillar(String topIcon, String sideTexture) {
super(Material.rock);
this.topTexture = topIcon;
this.sideTexture = sideTexture;
this.topTexture = topIcon;
this.sideTexture = sideTexture;
this.setHardness(0.5F);
this.setStepSound(soundTypeMetal);
this.setHarvestLevel("pickaxe", 0);
}
this.setHardness(0.5F);
this.setStepSound(soundTypeMetal);
this.setHarvestLevel("pickaxe", 0);
}
@Override
@SideOnly(Side.CLIENT)
protected IIcon getSideIcon(int meta) {
return this.sideIcon;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.field_150164_N = registry.registerIcon(Aether.find(this.topTexture));
this.sideIcon = registry.registerIcon(Aether.find(this.sideTexture));
}
@Override
@SideOnly(Side.CLIENT)
protected IIcon getSideIcon(int meta) {
return this.sideIcon;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.field_150164_N = registry.registerIcon(Aether.find(this.topTexture));
this.sideIcon = registry.registerIcon(Aether.find(this.sideTexture));
}
}

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,84 +18,102 @@ 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);
public BlockTreasureChest() {
super(56);
this.setHardness(-1.0F);
this.setResistance(2000.0F);
}
this.setHardness(-1.0F);
this.setResistance(2000.0F);
}
@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_);
@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_);
if (treasurechest != null) {
return treasurechest.isLocked() ? this.blockHardness : 5.0F;
} else {
return this.blockHardness;
}
}
if (treasurechest != null)
{
return treasurechest.isLocked() ? this.blockHardness : 5.0F;
}
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);
@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);
return treasurechest.isLocked() ? this.blockResistance : 10.0F;
}
return treasurechest.isLocked() ? this.blockResistance : 10.0F;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_) {
this.blockIcon = p_149651_1_.registerIcon(Aether.find("carved_stone"));
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_) {
this.blockIcon = p_149651_1_.registerIcon(Aether.find("carved_stone"));
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityTreasureChest();
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityTreasureChest();
}
@Override
public boolean onBlockActivated(
World worldIn,
int x,
int y,
int z,
EntityPlayer playerIn,
int side,
float hitX,
float hitY,
float hitZ
) {
if (worldIn.isRemote) {
return true;
}
@Override
public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer playerIn, int side, float hitX, float hitY, float hitZ) {
if (worldIn.isRemote) {
return true;
}
TileEntityTreasureChest treasurechest
= (TileEntityTreasureChest) worldIn.getTileEntity(x, y, z);
TileEntityTreasureChest treasurechest = (TileEntityTreasureChest) worldIn.getTileEntity(x, y, z);
ItemStack guiID = playerIn.getCurrentEquippedItem();
ItemStack guiID = playerIn.getCurrentEquippedItem();
if (treasurechest.isLocked()) {
if (guiID == null
|| guiID != null && guiID.getItem() != ItemsAether.dungeon_key) {
return false;
}
if (treasurechest.isLocked()) {
if (guiID == null || guiID != null && guiID.getItem() != ItemsAether.dungeon_key) {
return false;
}
treasurechest.unlock(guiID.getItemDamage());
treasurechest.unlock(guiID.getItemDamage());
--guiID.stackSize;
} else {
playerIn.openGui(
Aether.instance, AetherGuiHandler.treasure_chest, worldIn, x, y, z
);
}
--guiID.stackSize;
} else {
playerIn.openGui(Aether.instance, AetherGuiHandler.treasure_chest, worldIn, x, y, z);
}
return true;
}
return true;
}
@Override
public int quantityDropped(Random random) {
return 0;
}
@Override
public int getRenderType() {
return CommonProxy.treasureChestRenderID;
}
@Override
public int quantityDropped(Random random) {
return 0;
}
@Override
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,150 +20,163 @@ 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);
public BlockAercloud() {
super(Material.ice);
this.setHardness(0.2F);
this.setStepSound(soundTypeCloth);
this.setBlockTextureName("aether_legacy:aercloud");
}
this.setHardness(0.2F);
this.setStepSound(soundTypeCloth);
this.setBlockTextureName("aether_legacy:aercloud");
}
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
public void
getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
p_149666_3_.add(new ItemStack(this, 1, 0));
p_149666_3_.add(new ItemStack(this, 1, 1));
p_149666_3_.add(new ItemStack(this, 1, 2));
}
@SideOnly(Side.CLIENT)
@SuppressWarnings({"unchecked", "rawtypes"})
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
p_149666_3_.add(new ItemStack(this, 1, 0));
p_149666_3_.add(new ItemStack(this, 1, 1));
p_149666_3_.add(new ItemStack(this, 1, 2));
}
@Override
public void
onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
entity.fallDistance = 0;
@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
entity.fallDistance = 0;
if (world.getBlockMetadata(x, y, z) == 1) {
if (entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
if (world.getBlockMetadata(x, y, z) == 1) {
if (entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
player.triggerAchievement(AchievementsAether.blue_cloud);
player.triggerAchievement(AchievementsAether.blue_cloud);
if (player.isSneaking()) {
if (entity.motionY < 0) {
entity.motionY *= 0.005D;
}
if (player.isSneaking()) {
if (entity.motionY < 0) {
entity.motionY *= 0.005D;
}
return;
}
return;
}
entity.motionY = 2.0D;
} else {
if (entity instanceof EntityArrow) {
if (entity.ticksExisted >= 1200) {
entity.setDead();
}
}
entity.motionY = 2.0D;
} else {
if (entity instanceof EntityArrow)
{
if (entity.ticksExisted >= 1200)
{
entity.setDead();
}
}
entity.motionY = 2.0D;
}
entity.motionY = 2.0D;
}
if (world.isRemote) {
if (!(entity instanceof net.minecraft.client.particle.EntityFX)) {
for (int count = 0; count < 50; count++) {
double xOffset = x + world.rand.nextDouble();
double yOffset = y + world.rand.nextDouble();
double zOffset = z + world.rand.nextDouble();
if (world.isRemote) {
if (!(entity instanceof net.minecraft.client.particle.EntityFX)) {
for (int count = 0; count < 50; count++) {
double xOffset = x + world.rand.nextDouble();
double yOffset = y + world.rand.nextDouble();
double zOffset = z + world.rand.nextDouble();
world.spawnParticle("splash", xOffset, yOffset, zOffset, 0, 0, 0);
}
}
}
} else if (entity.motionY < 0) {
entity.motionY *= 0.005D;
}
}
world.spawnParticle("splash", xOffset, yOffset, zOffset, 0, 0, 0);
}
}
}
} else if (entity.motionY < 0) {
entity.motionY *= 0.005D;
}
}
@Override
public boolean renderAsNormalBlock() {
return true;
}
@Override
public boolean renderAsNormalBlock() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return 1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public int damageDropped(int meta) {
return meta;
}
@Override
public int damageDropped(int meta) {
return meta;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderColor(int meta) {
if (meta == 1) {
return 0xCCFFFF;
} else if (meta == 2) {
return 0xFFFF80;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderColor(int meta) {
if (meta == 1) {
return 0xCCFFFF;
} else if (meta == 2) {
return 0xFFFF80;
}
return this.getBlockColor();
}
return this.getBlockColor();
}
@Override
@SideOnly(Side.CLIENT)
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
int meta = world.getBlockMetadata(x, y, z);
@Override
@SideOnly(Side.CLIENT)
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
int meta = world.getBlockMetadata(x, y, z);
return this.getRenderColor(meta);
}
return this.getRenderColor(meta);
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return stack.getItemDamage() == 1 ? "blue_aercloud" : stack.getItemDamage() == 2 ? "golden_aercloud" : "cold_aercloud";
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return stack.getItemDamage() == 1 ? "blue_aercloud"
: stack.getItemDamage() == 2 ? "golden_aercloud"
: "cold_aercloud";
}
@Override
public int getColorFromItemStack(ItemStack stack, int pass) {
if (stack.getItemDamage() == 1) {
return 0xCCFFFF;
} else if (stack.getItemDamage() == 2) {
return 0xFFFF80;
}
@Override
public int getColorFromItemStack(ItemStack stack, int pass) {
if (stack.getItemDamage() == 1) {
return 0xCCFFFF;
} else if (stack.getItemDamage() == 2) {
return 0xFFFF80;
}
return 0;
}
return 0;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(
IBlockAccess p_149646_1_,
int p_149646_2_,
int p_149646_3_,
int p_149646_4_,
int p_149646_5_
) {
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_) != p_149646_1_.getBlockMetadata(p_149646_2_ - Facing.offsetsXForSide[p_149646_5_], p_149646_3_ - Facing.offsetsYForSide[p_149646_5_], p_149646_4_ - Facing.offsetsZForSide[p_149646_5_])) {
return true;
}
if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_)
!= p_149646_1_.getBlockMetadata(
p_149646_2_ - Facing.offsetsXForSide[p_149646_5_],
p_149646_3_ - Facing.offsetsYForSide[p_149646_5_],
p_149646_4_ - Facing.offsetsZForSide[p_149646_5_]
)) {
return true;
}
if (block == this) {
return false;
}
if (block == this) {
return false;
}
return super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
}
@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);
}
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);
}
}

View File

@ -1,31 +1,29 @@
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);
public BlockAetherDirt() {
super(Material.ground);
this.setHardness(0.2F);
this.setHarvestLevel("shovel", 0);
this.setStepSound(soundTypeGravel);
this.setBlockTextureName("aether_legacy:aether_dirt");
}
this.setHardness(0.2F);
this.setHarvestLevel("shovel", 0);
this.setStepSound(soundTypeGravel);
this.setBlockTextureName("aether_legacy:aether_dirt");
}
@Override
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
}
@Override
public int damageDropped(int meta) {
return 1;
}
@Override
public void
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
}
@Override
public int damageDropped(int meta) {
return 1;
}
}

View File

@ -8,31 +8,39 @@ 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
);
}
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);
}
@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;
}
@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;
}
@Override
public boolean canBlockStay(World world, int x, int y, int z) {
Block soil = world.getBlock(x, y - 1, z);
return (soil != null && this.canPlaceBlockAt(world, x, y, z));
}
@Override
public int getRenderType() {
return CommonProxy.aetherFlowerRenderID;
}
@Override
public boolean canBlockStay(World world, int x, int y, int z) {
Block soil = world.getBlock(x, y - 1, z);
return (soil != null && this.canPlaceBlockAt(world, x, y, z));
}
@Override
public int getRenderType() {
return CommonProxy.aetherFlowerRenderID;
}
}

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,147 +21,180 @@ 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;
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
@SideOnly(Side.CLIENT)
private IIcon blockIconSnowy;
@SideOnly(Side.CLIENT)
private IIcon blockIconSnowy;
public BlockAetherGrass() {
super(Material.grass);
public BlockAetherGrass() {
super(Material.grass);
this.setHardness(0.2F);
this.setTickRandomly(true);
this.setStepSound(soundTypeGrass);
this.setHarvestLevel("shovel", 0);
}
this.setHardness(0.2F);
this.setTickRandomly(true);
this.setStepSound(soundTypeGrass);
this.setHarvestLevel("shovel", 0);
}
@Override
public void updateTick(World worldIn, int x, int y, int z, Random rand) {
if (!worldIn.isRemote) {
if (worldIn.getBlockLightValue(x, y + 1, z) < 4
&& worldIn.getBlockLightOpacity(x, y + 1, z) > 2) {
worldIn.setBlock(x, y, z, BlocksAether.aether_dirt);
} else if (worldIn.getBlockLightValue(x, y + 1, z) >= 9) {
for (int l = 0; l < 4; ++l) {
int i1 = x + rand.nextInt(3) - 1;
int j1 = y + rand.nextInt(5) - 3;
int k1 = z + rand.nextInt(3) - 1;
@Override
public void updateTick(World worldIn, int x, int y, int z, Random rand) {
if (!worldIn.isRemote) {
if (worldIn.getBlockLightValue(x, y + 1, z) < 4 && worldIn.getBlockLightOpacity(x, y + 1, z) > 2) {
worldIn.setBlock(x, y, z, BlocksAether.aether_dirt);
} else if (worldIn.getBlockLightValue(x, y + 1, z) >= 9) {
for (int l = 0; l < 4; ++l) {
int i1 = x + rand.nextInt(3) - 1;
int j1 = y + rand.nextInt(5) - 3;
int k1 = z + rand.nextInt(3) - 1;
if (worldIn.getBlock(i1, j1, k1) == BlocksAether.aether_dirt
&& worldIn.getBlockMetadata(i1, j1, k1) == 0
&& worldIn.getBlockLightValue(i1, j1 + 1, k1) >= 4
&& worldIn.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) {
worldIn.setBlock(i1, j1, k1, BlocksAether.aether_grass);
}
}
}
}
}
if (worldIn.getBlock(i1, j1, k1) == BlocksAether.aether_dirt && worldIn.getBlockMetadata(i1, j1, k1) == 0 && worldIn.getBlockLightValue(i1, j1 + 1, k1) >= 4 && worldIn.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) {
worldIn.setBlock(i1, j1, k1, BlocksAether.aether_grass);
}
}
}
}
}
@Override
public Item getItemDropped(int meta, Random random, int fortune) {
return Item.getItemFromBlock(BlocksAether.aether_dirt);
}
@Override
public Item getItemDropped(int meta, Random random, int fortune) {
return Item.getItemFromBlock(BlocksAether.aether_dirt);
}
@Override
public void
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
}
@Override
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
}
@Override
public int damageDropped(int meta) {
return 1;
}
@Override
public int damageDropped(int meta) {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon("aether_legacy:aether_grass_side");
this.blockIconSnowy
= registry.registerIcon("aether_legacy:aether_grass_side_snowy");
this.blockIconTop = registry.registerIcon("aether_legacy:aether_grass_top");
}
@Override
@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.blockIconTop = registry.registerIcon("aether_legacy:aether_grass_top");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1
? this.blockIconTop
: (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side)
: this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop : (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side) : this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1) {
return this.blockIconTop;
} else if (side == 0) {
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
} else {
Material material = world.getBlock(x, y + 1, z).getMaterial();
return material != Material.snow && material != Material.craftedSnow
? this.blockIcon
: this.blockIconSnowy;
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1)
{
return this.blockIconTop;
}
else if (side == 0)
{
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
}
else
{
Material material = world.getBlock(x, y + 1, z).getMaterial();
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
) {
EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);
@Override
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);
return plantType == EnumPlantType.Plains;
}
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_
) {
return true;
}
@Override
public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) {
return true;
}
@Override
public boolean func_149852_a(
World p_149852_1_,
Random p_149852_2_,
int p_149852_3_,
int p_149852_4_,
int p_149852_5_
) {
return true;
}
@Override
public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) {
return true;
}
@Override
public void func_149853_b(
World p_149853_1_,
Random p_149853_2_,
int p_149853_3_,
int p_149853_4_,
int p_149853_5_
) {
int l = 0;
@Override
public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) {
int l = 0;
while (l < 128) {
int i1 = p_149853_3_;
int j1 = p_149853_4_ + 1;
int k1 = p_149853_5_;
int l1 = 0;
while (l < 128) {
int i1 = p_149853_3_;
int j1 = p_149853_4_ + 1;
int k1 = p_149853_5_;
int l1 = 0;
while (true) {
if (l1 < l / 16) {
i1 += p_149853_2_.nextInt(3) - 1;
j1 += (p_149853_2_.nextInt(3) - 1) * p_149853_2_.nextInt(3) / 2;
k1 += p_149853_2_.nextInt(3) - 1;
while (true) {
if (l1 < l / 16) {
i1 += p_149853_2_.nextInt(3) - 1;
j1 += (p_149853_2_.nextInt(3) - 1) * p_149853_2_.nextInt(3) / 2;
k1 += p_149853_2_.nextInt(3) - 1;
if (p_149853_1_.getBlock(i1, j1 - 1, k1) == BlocksAether.aether_grass && !p_149853_1_.getBlock(i1, j1, k1).isNormalCube()) {
++l1;
continue;
}
} else if (p_149853_1_.isAirBlock(i1, j1, k1)) {
if (p_149853_2_.nextInt(8) != 0) {
if (Blocks.tallgrass.canBlockStay(p_149853_1_, i1, j1, k1)) {
p_149853_1_.setBlock(i1, j1, k1, Blocks.tallgrass, 1, 3);
}
} else if (p_149853_2_.nextInt(12) == 0) {
if (BlocksAether.berry_bush_stem.canBlockStay(p_149853_1_, i1, j1, k1)) {
p_149853_1_.setBlock(i1, j1, k1, BlocksAether.berry_bush_stem, 0, 3);
}
} else {
AetherWorld.aether_biome.plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1);
}
}
++l;
break;
}
}
}
if (p_149853_1_.getBlock(i1, j1 - 1, k1) == BlocksAether.aether_grass
&& !p_149853_1_.getBlock(i1, j1, k1).isNormalCube()) {
++l1;
continue;
}
} else if (p_149853_1_.isAirBlock(i1, j1, k1)) {
if (p_149853_2_.nextInt(8) != 0) {
if (Blocks.tallgrass.canBlockStay(p_149853_1_, i1, j1, k1)) {
p_149853_1_.setBlock(i1, j1, k1, Blocks.tallgrass, 1, 3);
}
} else if (p_149853_2_.nextInt(12) == 0) {
if (BlocksAether.berry_bush_stem.canBlockStay(
p_149853_1_, i1, j1, k1
)) {
p_149853_1_.setBlock(
i1, j1, k1, BlocksAether.berry_bush_stem, 0, 3
);
}
} else {
AetherWorld.aether_biome.plantFlower(
p_149853_1_, p_149853_2_, i1, j1, k1
);
}
}
++l;
break;
}
}
}
}

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,151 +20,162 @@ 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;
@SideOnly(Side.CLIENT)
private IIcon fastIcon;
@SideOnly(Side.CLIENT)
private IIcon fancyIcon;
@SideOnly(Side.CLIENT)
private IIcon fancyIcon;
public BlockAetherLeaves() {
super();
}
public BlockAetherLeaves() {
super();
}
@Override
@SideOnly(Side.CLIENT)
public int getBlockColor() {
return 16777215;
}
@Override
@SideOnly(Side.CLIENT)
public int getBlockColor() {
return 16777215;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderColor(int meta) {
return 16777215;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderColor(int meta) {
return 16777215;
}
@Override
@SideOnly(Side.CLIENT)
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
return 16777215;
}
@Override
@SideOnly(Side.CLIENT)
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
return 16777215;
}
@Override
@SideOnly(Side.CLIENT)
public boolean isOpaqueCube() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean isOpaqueCube() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
super.randomDisplayTick(world, x, y, z, rand);
if (!world.isRemote) {
return;
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
super.randomDisplayTick(world, x, y, z, rand);
if (!world.isRemote) {
return;
}
if (net.minecraft.client.Minecraft.getMinecraft().gameSettings.particleSetting
== 2) {
return;
}
if (net.minecraft.client.Minecraft.getMinecraft().gameSettings.particleSetting == 2) {
return;
}
if (this == BlocksAether.golden_oak_leaves) {
for (int ammount = 0; ammount < 2; ammount++) {
double d = x + (rand.nextFloat() - 0.5D) * 10;
double d1 = y + (rand.nextFloat() - 0.5D) * 10;
double d2 = z + (rand.nextFloat() - 0.5D) * 10;
double d3 = (rand.nextFloat() - 0.5D) * 0.5D;
double d4 = (rand.nextFloat() - 0.5D) * 0.5D;
double d5 = (rand.nextFloat() - 0.5D) * 0.5D;
if (this == BlocksAether.golden_oak_leaves) {
for (int ammount = 0; ammount < 2; ammount++) {
double d = x + (rand.nextFloat() - 0.5D) * 10;
double d1 = y + (rand.nextFloat() - 0.5D) * 10;
double d2 = z + (rand.nextFloat() - 0.5D) * 10;
double d3 = (rand.nextFloat() - 0.5D) * 0.5D;
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);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(obj);
}
}
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 (rand.nextInt(5) == 0) {
for (int l = 0; l < 6; ++l) {
double d = (double) x + ((double) rand.nextFloat() - 0.5D) * 8.0D;
double d1 = (double) y + ((double) rand.nextFloat() - 0.5D) * 8.0D;
double d2 = (double) z + ((double) rand.nextFloat() - 0.5D) * 8.0D;
double d3 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
if (this == BlocksAether.holiday_leaves || this == BlocksAether.decorated_holiday_leaves) {
if (rand.nextInt(5) == 0) {
for (int l = 0; l < 6; ++l) {
double d = (double) x + ((double) rand.nextFloat() - 0.5D) * 8.0D;
double d1 = (double) y + ((double) rand.nextFloat() - 0.5D) * 8.0D;
double d2 = (double) z + ((double) rand.nextFloat() - 0.5D) * 8.0D;
double d3 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
ParticleHolidayLeaves particle
= new ParticleHolidayLeaves(world, d, d1, d2, d3, d4, d5);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(
particle
);
}
}
}
ParticleHolidayLeaves particle = new ParticleHolidayLeaves(world, d, d1, d2, d3, d4, d5);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
}
}
}
if (this == BlocksAether.crystal_leaves
|| this == BlocksAether.crystal_fruit_leaves) {
if (rand.nextInt(5) == 0) {
for (int l = 0; l < 6; ++l) {
double d = (double) x + ((double) rand.nextFloat() - 0.5D) * 6.0D;
double d1 = (double) y + ((double) rand.nextFloat() - 0.5D) * 6.0D;
double d2 = (double) z + ((double) rand.nextFloat() - 0.5D) * 6.0D;
double d3 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
if (this == BlocksAether.crystal_leaves || this == BlocksAether.crystal_fruit_leaves) {
if (rand.nextInt(5) == 0) {
for (int l = 0; l < 6; ++l) {
double d = (double) x + ((double) rand.nextFloat() - 0.5D) * 6.0D;
double d1 = (double) y + ((double) rand.nextFloat() - 0.5D) * 6.0D;
double d2 = (double) z + ((double) rand.nextFloat() - 0.5D) * 6.0D;
double d3 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
ParticleCrystalLeaves particle
= new ParticleCrystalLeaves(world, d, d1, d2, d3, d4, d5);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(
particle
);
}
}
}
}
ParticleCrystalLeaves particle = new ParticleCrystalLeaves(world, d, d1, d2, d3, d4, d5);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
}
}
}
}
@Override
public Item getItemDropped(int meta, Random random, int fortune) {
return this == BlocksAether.skyroot_leaves
? Item.getItemFromBlock(BlocksAether.skyroot_sapling)
: this == BlocksAether.golden_oak_leaves
? Item.getItemFromBlock(BlocksAether.golden_oak_sapling)
: null;
}
@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;
}
@Override
public ArrayList<ItemStack>
getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> drops = super.getDrops(world, x, y, z, metadata, fortune);
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> drops = super.getDrops(world, x, y, z, metadata, fortune);
if (this == BlocksAether.crystal_fruit_leaves) {
drops.add(new ItemStack(ItemsAether.white_apple));
}
if (this == BlocksAether.crystal_fruit_leaves) {
drops.add(new ItemStack(ItemsAether.white_apple));
}
return drops;
}
return drops;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_) {
this.fancyIcon = p_149651_1_.registerIcon(this.getTextureName());
this.fastIcon = p_149651_1_.registerIcon(this.getTextureName() + "_opaque");
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_)
{
this.fancyIcon = p_149651_1_.registerIcon(this.getTextureName());
this.fastIcon = p_149651_1_.registerIcon(this.getTextureName() + "_opaque");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
if (Minecraft.getMinecraft().gameSettings.fancyGraphics) {
return fancyIcon;
} else {
return fastIcon;
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
if (Minecraft.getMinecraft().gameSettings.fancyGraphics)
{
return fancyIcon;
}
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_) {
return true;
}
@Override
public String[] func_150125_e() {
return new String[]{this.getUnlocalizedName()};
}
@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_
) {
return true;
}
@Override
public String[] func_150125_e() {
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,85 +20,122 @@ 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();
}
public BlockAetherLog() {
super();
}
@Override
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);
@Override
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);
int size = meta == 0 ? 2 : 1;
int size = meta == 0 ? 2 : 1;
ItemStack stack = player.getCurrentEquippedItem();
ItemStack stack = player.getCurrentEquippedItem();
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) {
items.add(itemstack);
}
if (this.canSilkHarvest(worldIn, player, x, y, z, meta) && EnchantmentHelper.getSilkTouchModifier(player))
{
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
ItemStack itemstack = this.createStackedBlock(meta);
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) {
if (this == BlocksAether.golden_oak_log) {
this.dropBlockAsItem(
worldIn,
x,
y,
z,
new ItemStack(
ItemsAether.golden_amber, 1 + worldIn.rand.nextInt(2)
)
);
}
if (itemstack != null)
{
items.add(itemstack);
}
this.dropBlockAsItem(
player.worldObj,
x,
y,
z,
meta,
EnchantmentHelper.getEnchantmentLevel(
Enchantment.fortune.effectId, stack
)
);
} else if (stack.getItem() instanceof ItemSkyrootTool) {
for (int i = 0; i < size; ++i) {
this.dropBlockAsItem(
player.worldObj,
x,
y,
z,
meta,
EnchantmentHelper.getEnchantmentLevel(
Enchantment.fortune.effectId, stack
)
);
}
} else {
this.dropBlockAsItem(
player.worldObj,
x,
y,
z,
meta,
EnchantmentHelper.getEnchantmentLevel(
Enchantment.fortune.effectId, stack
)
);
}
} else {
super.harvestBlock(worldIn, player, x, y, z, meta);
}
}
}
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) {
if (this == BlocksAether.golden_oak_log) {
this.dropBlockAsItem(worldIn, x, y, z, new ItemStack(ItemsAether.golden_amber, 1 + worldIn.rand.nextInt(2)));
}
@Override
public Item getItemDropped(int meta, Random random, int fortune) {
return Item.getItemFromBlock(BlocksAether.skyroot_log);
}
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
} else if (stack.getItem() instanceof ItemSkyrootTool) {
for (int i = 0; i < size; ++i) {
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
}
} else {
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
}
} else {
super.harvestBlock(worldIn, player, x, y, z, meta);
}
}
}
@Override
public int damageDropped(int meta) {
return 1;
}
@Override
public Item getItemDropped(int meta, Random random, int fortune) {
return Item.getItemFromBlock(BlocksAether.skyroot_log);
}
@Override
public int damageDropped(int meta) {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.field_150167_a = new IIcon[1];
this.field_150166_b = new IIcon[1];
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");
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.field_150167_a = new IIcon[1];
this.field_150166_b = new IIcon[1];
for (int i = 0; i < this.field_150167_a.length; ++i) {
this.field_150167_a[i]
= registry.registerIcon(this.getTextureName() + "_side");
this.field_150166_b[i]
= registry.registerIcon(this.getTextureName() + "_top");
}
}
}

View File

@ -20,75 +20,89 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockAetherOre extends Block {
public BlockAetherOre(int level) {
super(Material.rock);
public BlockAetherOre(int level) {
super(Material.rock);
this.setHardness(3.0F);
this.setResistance(5.0F);
this.setStepSound(soundTypeStone);
this.setHarvestLevel("pickaxe", level);
}
this.setHardness(3.0F);
this.setResistance(5.0F);
this.setStepSound(soundTypeStone);
this.setHarvestLevel("pickaxe", level);
}
@Override
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);
@Override
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();
ItemStack stack = player.getCurrentEquippedItem();
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack)
> 0) {
super.harvestBlock(worldIn, player, x, y, z, meta);
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0) {
super.harvestBlock(worldIn, player, x, y, z, meta);
return;
}
return;
}
if (stack != null && stack.getItem() instanceof ItemSkyrootTool
&& ((ItemAetherTool) stack.getItem()).toolType
== EnumAetherToolType.PICKAXE) {
for (int i = 0; i < 2; ++i) {
this.dropBlockAsItem(
worldIn,
x,
y,
z,
meta,
EnchantmentHelper.getEnchantmentLevel(
Enchantment.fortune.effectId, stack
)
);
}
} else {
super.harvestBlock(worldIn, player, x, y, z, meta);
}
}
if (stack != null && stack.getItem() instanceof ItemSkyrootTool && ((ItemAetherTool) stack.getItem()).toolType == EnumAetherToolType.PICKAXE) {
for (int i = 0; i < 2; ++i) {
this.dropBlockAsItem(worldIn, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
}
} else {
super.harvestBlock(worldIn, player, x, y, z, meta);
}
}
@Override
public Item getItemDropped(int meta, Random random, int fortune) {
return this == BlocksAether.zanite_ore ? ItemsAether.zanite_gemstone
: ItemsAether.ambrosium_shard;
}
@Override
public Item getItemDropped(int meta, Random random, int fortune) {
return this == BlocksAether.zanite_ore ? ItemsAether.zanite_gemstone : ItemsAether.ambrosium_shard;
}
@Override
public int quantityDroppedWithBonus(int fortune, Random random) {
if (fortune > 0
&& Item.getItemFromBlock(this) != this.getItemDropped(0, random, fortune)) {
int j = random.nextInt(fortune + 2) - 1;
@Override
public int quantityDroppedWithBonus(int fortune, Random random) {
if (fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped(0, random, fortune)) {
int j = random.nextInt(fortune + 2) - 1;
if (j < 0) {
j = 0;
}
if (j < 0) {
j = 0;
}
return this.quantityDropped(random) * (j + 1);
} else {
return this.quantityDropped(random);
}
}
return this.quantityDropped(random) * (j + 1);
} else {
return this.quantityDropped(random);
}
}
@Override
public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) {
Random random = new Random();
@Override
public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) {
Random random = new Random();
if (this.getItemDropped(p_149690_5_, random, p_149690_7_)
!= Item.getItemFromBlock(this)) {
int amount = 0;
if (this.getItemDropped(p_149690_5_, random, p_149690_7_) != Item.getItemFromBlock(this)) {
int amount = 0;
if (this == BlocksAether.ambrosium_ore) {
amount = MathHelper.getRandomIntegerInRange(random, 0, 2);
} else if (this == BlocksAether.zanite_ore) {
amount = MathHelper.getRandomIntegerInRange(random, 2, 5);
}
if (this == BlocksAether.ambrosium_ore) {
amount = MathHelper.getRandomIntegerInRange(random, 0, 2);
} else if (this == BlocksAether.zanite_ore) {
amount = MathHelper.getRandomIntegerInRange(random, 2, 5);
}
return amount;
}
return 0;
}
return amount;
}
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,85 +17,95 @@ 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);
this.setStepSound(soundTypeGrass);
this.setBlockTextureName(Aether.find("berry_bush"));
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
public BlockBerryBush() {
this.setHardness(0.2F);
this.setHarvestLevel("axe", 0);
this.setStepSound(soundTypeGrass);
this.setBlockTextureName(Aether.find("berry_bush"));
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Item.getItemFromBlock(BlocksAether.berry_bush_stem);
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Item.getItemFromBlock(BlocksAether.berry_bush_stem);
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public void
harvestBlock(World world, EntityPlayer entityplayer, int x, int y, int z, int meta) {
int min, max;
@Override
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) {
min = 1;
max = 4;
} else {
min = 1;
max = 3;
}
if (world.getBlock(x, y, z) == BlocksAether.enchanted_aether_grass) {
min = 1;
max = 4;
} else {
min = 1;
max = 3;
}
int randomNum = world.rand.nextInt(max - min + 1) + min;
entityplayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1);
entityplayer.addExhaustion(0.025F);
int randomNum = world.rand.nextInt(max - min + 1) + min;
entityplayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1);
entityplayer.addExhaustion(0.025F);
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
if (randomNum != 0) {
this.dropBlockAsItem(
world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0)
);
}
}
if (randomNum != 0) {
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0));
}
}
@Override
protected void checkAndDropBlock(World world, int x, int y, int z) {
if (!this.canBlockStay(world, x, y, z)) {
int min, max;
@Override
protected void checkAndDropBlock(World world, int x, int y, int z) {
if (!this.canBlockStay(world, x, y, z)) {
int min, max;
if (world.getBlock(x, y, z) == BlocksAether.enchanted_aether_grass) {
min = 1;
max = 4;
} else {
min = 1;
max = 3;
}
if (world.getBlock(x, y, z) == BlocksAether.enchanted_aether_grass) {
min = 1;
max = 4;
} else {
min = 1;
max = 3;
}
int randomNum = world.rand.nextInt(max - min + 1) + min;
this.dropBlockAsItem(
world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0)
);
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
}
}
int randomNum = world.rand.nextInt(max - min + 1) + min;
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0));
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
}
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(
World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_
) {
return AxisAlignedBB.getBoundingBox(
(double) p_149668_2_ + this.minX,
(double) p_149668_3_ + this.minY,
(double) p_149668_4_ + this.minZ,
(double) p_149668_2_ + this.maxX,
(double) p_149668_3_ + this.maxY,
(double) p_149668_4_ + this.maxZ
);
}
@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);
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
return true;
}
@Override
public int getRenderType() {
return CommonProxy.berryBushRenderID;
}
@Override
@SideOnly(Side.CLIENT)
public boolean
shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
return true;
}
@Override
public int getRenderType() {
return CommonProxy.berryBushRenderID;
}
}

View File

@ -4,59 +4,60 @@ 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
);
}
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);
}
@Override
public void updateTick(World world, int x, int y, int z, Random random) {
if (world.isRemote) {
return;
}
@Override
public void updateTick(World world, int x, int y, int z, Random random) {
if (world.isRemote) {
return;
}
super.updateTick(world, x, y, z, random);
super.updateTick(world, x, y, z, random);
if (world.getBlockLightValue(x, y + 1, z) >= 9 && random.nextInt(60) == 0) {
world.setBlock(x, y, z, BlocksAether.berry_bush);
}
}
if (world.getBlockLightValue(x, y + 1, z) >= 9 && random.nextInt(60) == 0) {
world.setBlock(x, y, z, BlocksAether.berry_bush);
}
}
@Override
public AxisAlignedBB
getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
return null;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
return null;
}
@SideOnly(Side.CLIENT)
public boolean
shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
return true;
}
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
return true;
}
@Override
public boolean func_149851_a(World world, int x, int y, int z, boolean isClient) {
return true;
}
@Override
public boolean func_149851_a(World world, int x, int y, int z, boolean isClient) {
return true;
}
@Override
public boolean func_149852_a(World world, Random random, int x, int y, int z) {
return (double) random.nextFloat() < 0.45D;
}
@Override
public void func_149853_b(World world, Random random, int x, int y, int z) {
world.setBlock(x, y, z, BlocksAether.berry_bush);
}
@Override
public boolean func_149852_a(World world, Random random, int x, int y, int z) {
return (double) random.nextFloat() < 0.45D;
}
@Override
public void func_149853_b(World world, Random random, int x, int y, int z) {
world.setBlock(x, y, z, BlocksAether.berry_bush);
}
}

View File

@ -1,50 +1,53 @@
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;
@SideOnly(Side.CLIENT)
private IIcon blockIconTop;
public BlockEnchantedAetherGrass() {
super(Material.grass);
public BlockEnchantedAetherGrass() {
super(Material.grass);
this.setHardness(0.2F);
this.setStepSound(soundTypeGrass);
this.setHarvestLevel("shovel", 0);
}
this.setHardness(0.2F);
this.setStepSound(soundTypeGrass);
this.setHarvestLevel("shovel", 0);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon("aether_legacy:enchanted_aether_grass_side");
this.blockIconTop = registry.registerIcon("aether_legacy:enchanted_aether_grass_top");
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon
= registry.registerIcon("aether_legacy:enchanted_aether_grass_side");
this.blockIconTop
= registry.registerIcon("aether_legacy:enchanted_aether_grass_top");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIconTop : (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side) : this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 1
? this.blockIconTop
: (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side)
: this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1) {
return this.blockIconTop;
} else if (side == 0) {
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
}
return this.blockIcon;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if (side == 1) {
return this.blockIconTop;
} else if (side == 0) {
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
}
return this.blockIcon;
}
}

View File

@ -1,31 +1,29 @@
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);
public BlockHolystone() {
super(Material.rock);
this.setHardness(0.5F);
this.setStepSound(soundTypeStone);
this.setHarvestLevel("pickaxe", 0);
this.setBlockTextureName("aether_legacy:holystone");
}
this.setHardness(0.5F);
this.setStepSound(soundTypeStone);
this.setHarvestLevel("pickaxe", 0);
this.setBlockTextureName("aether_legacy:holystone");
}
@Override
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
}
@Override
public int damageDropped(int meta) {
return 1;
}
@Override
public void
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
}
@Override
public int damageDropped(int meta) {
return 1;
}
}

View File

@ -1,33 +1,31 @@
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);
public BlockQuicksoil() {
super(Material.sand);
this.slipperiness = 1.1F;
this.slipperiness = 1.1F;
this.setHardness(0.5F);
this.setStepSound(soundTypeSand);
this.setHarvestLevel("shovel", 0);
this.setBlockTextureName("aether_legacy:quicksoil");
}
this.setHardness(0.5F);
this.setStepSound(soundTypeSand);
this.setHarvestLevel("shovel", 0);
this.setBlockTextureName("aether_legacy:quicksoil");
}
@Override
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
}
@Override
public int damageDropped(int meta) {
return 1;
}
@Override
public void
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
}
@Override
public int damageDropped(int meta) {
return 1;
}
}

View File

@ -10,148 +10,172 @@ 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;
public final int leftDir;
public int portalBlockCount = 0;
public ChunkCoordinates bottomLeft;
public int height;
public int width;
private final World world;
private final int axis;
public final int rightDir;
public final int leftDir;
public int portalBlockCount = 0;
public ChunkCoordinates bottomLeft;
public int height;
public int width;
public AetherPortalSize(World worldIn, int x, int y, int z, int axis) {
this.world = worldIn;
this.axis = axis;
public AetherPortalSize(World worldIn, int x, int y, int z, int axis) {
this.world = worldIn;
this.axis = axis;
this.leftDir = BlockPortal.field_150001_a[axis][0];
this.rightDir = BlockPortal.field_150001_a[axis][1];
this.leftDir = BlockPortal.field_150001_a[axis][0];
this.rightDir = BlockPortal.field_150001_a[axis][1];
for (int i1 = y;
y > i1 - 21 && y > 0 && this.isEmptyBlock(worldIn.getBlock(x, y - 1, z));
--y) {
;
}
for (int i1 = y; y > i1 - 21 && y > 0 && this.isEmptyBlock(worldIn.getBlock(x, y - 1, z)); --y) {
;
}
int i = this.getDistanceUntilEdge(x, y, z, this.leftDir) - 1;
int i = this.getDistanceUntilEdge(x, y, z, this.leftDir) - 1;
if (i >= 0) {
this.bottomLeft = new ChunkCoordinates(
x + i * Direction.offsetX[this.leftDir],
y,
z + i * Direction.offsetZ[this.leftDir]
);
this.width = this.getDistanceUntilEdge(
this.bottomLeft.posX,
this.bottomLeft.posY,
this.bottomLeft.posZ,
this.rightDir
);
if (i >= 0) {
this.bottomLeft = new ChunkCoordinates(x + i * Direction.offsetX[this.leftDir], y, z + i * Direction.offsetZ[this.leftDir]);
this.width = this.getDistanceUntilEdge(this.bottomLeft.posX, this.bottomLeft.posY, this.bottomLeft.posZ, this.rightDir);
if (this.width < 2 || this.width > 21) {
this.bottomLeft = null;
this.width = 0;
}
}
if (this.width < 2 || this.width > 21) {
this.bottomLeft = null;
this.width = 0;
}
}
if (this.bottomLeft != null) {
this.height = this.calculatePortalHeight();
}
}
if (this.bottomLeft != null) {
this.height = this.calculatePortalHeight();
}
}
protected int getDistanceUntilEdge(int x, int y, int z, int leftDir) {
int j1 = Direction.offsetX[leftDir];
int k1 = Direction.offsetZ[leftDir];
int i1;
Block block;
protected int getDistanceUntilEdge(int x, int y, int z, int leftDir) {
int j1 = Direction.offsetX[leftDir];
int k1 = Direction.offsetZ[leftDir];
int i1;
Block block;
for (i1 = 0; i1 < 22; ++i1) {
block = this.world.getBlock(x + j1 * i1, y, z + k1 * i1);
for (i1 = 0; i1 < 22; ++i1) {
block = this.world.getBlock(x + j1 * i1, y, z + k1 * i1);
if (!this.isEmptyBlock(block)) {
break;
}
if (!this.isEmptyBlock(block)) {
break;
}
Block block1 = this.world.getBlock(x + j1 * i1, y - 1, z + k1 * i1);
Block block1 = this.world.getBlock(x + j1 * i1, y - 1, z + k1 * i1);
if (block1 != Blocks.glowstone) {
break;
}
}
if (block1 != Blocks.glowstone) {
break;
}
}
block = this.world.getBlock(x + j1 * i1, y, z + k1 * i1);
return block == Blocks.glowstone ? i1 : 0;
}
block = this.world.getBlock(x + j1 * i1, y, z + k1 * i1);
return block == Blocks.glowstone ? i1 : 0;
}
public int getHeight() {
return this.height;
}
public int getHeight() {
return this.height;
}
public int getWidth() {
return this.width;
}
public int getWidth() {
return this.width;
}
protected int calculatePortalHeight() {
label24:
protected int calculatePortalHeight() {
label24:
for (this.height = 0; this.height < 21; ++this.height) {
for (int i = 0; i < this.width; ++i) {
int k = this.bottomLeft.posX
+ i * Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]];
int l = this.bottomLeft.posZ
+ i * Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]];
Block block
= this.world.getBlock(k, this.bottomLeft.posY + this.height, l);
for (this.height = 0; this.height < 21; ++this.height) {
for (int i = 0; i < this.width; ++i) {
int k = this.bottomLeft.posX + i * Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]];
int l = this.bottomLeft.posZ + i * Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]];
Block block = this.world.getBlock(k, this.bottomLeft.posY + this.height, l);
if (!this.isEmptyBlock(block)) {
break label24;
}
if (!this.isEmptyBlock(block)) {
break label24;
}
if (block == BlocksAether.aether_portal) {
++this.portalBlockCount;
}
if (block == BlocksAether.aether_portal) {
++this.portalBlockCount;
}
if (i == 0) {
block = this.world.getBlock(
k + Direction.offsetX[BlockPortal.field_150001_a[this.axis][0]],
this.bottomLeft.posY + this.height,
l + Direction.offsetZ[BlockPortal.field_150001_a[this.axis][0]]
);
if (i == 0) {
block = this.world.getBlock(k + Direction.offsetX[BlockPortal.field_150001_a[this.axis][0]], this.bottomLeft.posY + this.height, l + Direction.offsetZ[BlockPortal.field_150001_a[this.axis][0]]);
if (block != Blocks.glowstone) {
break label24;
}
} else if (i == this.width - 1) {
block = this.world.getBlock(
k + Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]],
this.bottomLeft.posY + this.height,
l + Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]]
);
if (block != Blocks.glowstone) {
break label24;
}
} else if (i == this.width - 1) {
block = this.world.getBlock(k + Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]], this.bottomLeft.posY + this.height, l + Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]]);
if (block != Blocks.glowstone) {
break label24;
}
}
}
}
if (block != Blocks.glowstone) {
break label24;
}
}
}
}
for (int j = 0; j < this.width; ++j) {
int i = this.bottomLeft.posX
+ j * Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]];
int k = this.bottomLeft.posY + this.height;
int l = this.bottomLeft.posZ
+ j * Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]];
for (int j = 0; j < this.width; ++j) {
int i = this.bottomLeft.posX + j * Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]];
int k = this.bottomLeft.posY + this.height;
int l = this.bottomLeft.posZ + j * Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]];
if (this.world.getBlock(i, k, l) != Blocks.glowstone) {
this.height = 0;
break;
}
}
if (this.world.getBlock(i, k, l) != Blocks.glowstone) {
this.height = 0;
break;
}
}
if (this.height <= 21 && this.height >= 3) {
return this.height;
} else {
this.bottomLeft = null;
this.width = 0;
this.height = 0;
return 0;
}
}
if (this.height <= 21 && this.height >= 3) {
return this.height;
} else {
this.bottomLeft = null;
this.width = 0;
this.height = 0;
return 0;
}
}
protected boolean isEmptyBlock(Block blockIn) {
return blockIn.getMaterial() == Material.air || blockIn == Blocks.fire
|| blockIn == BlocksAether.aether_portal;
}
protected boolean isEmptyBlock(Block blockIn) {
return blockIn.getMaterial() == Material.air || blockIn == Blocks.fire || blockIn == BlocksAether.aether_portal;
}
public boolean isValid() {
return this.bottomLeft != null && this.width >= 2 && this.width <= 21
&& this.height >= 3 && this.height <= 21;
}
public boolean isValid() {
return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
}
public void placePortalBlocks() {
for (int i = 0; i < this.width; ++i) {
int j = this.bottomLeft.posX + Direction.offsetX[this.rightDir] * i;
int k = this.bottomLeft.posZ + Direction.offsetZ[this.rightDir] * i;
for (int l = 0; l < this.height; ++l) {
int i1 = this.bottomLeft.posY + l;
this.world.setBlock(j, i1, k, BlocksAether.aether_portal, this.axis, 2);
}
}
}
public void placePortalBlocks() {
for (int i = 0; i < this.width; ++i) {
int j = this.bottomLeft.posX + Direction.offsetX[this.rightDir] * i;
int k = this.bottomLeft.posZ + Direction.offsetZ[this.rightDir] * i;
for (int l = 0; l < this.height; ++l) {
int i1 = this.bottomLeft.posY + l;
this.world.setBlock(j, i1, k, BlocksAether.aether_portal, this.axis, 2);
}
}
}
}

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,106 +18,118 @@ 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();
public BlockAetherPortal() {
super();
this.setHardness(-1);
this.setResistance(900000F);
this.setStepSound(soundTypeGlass);
}
this.setHardness(-1);
this.setResistance(900000F);
this.setStepSound(soundTypeGlass);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon(Aether.find("aether_portal"));
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister registry) {
this.blockIcon = registry.registerIcon(Aether.find("aether_portal"));
}
@Override
public void onEntityCollidedWithBlock(
World world, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity entity
) {
if (entity instanceof EntityPlayer) {
PlayerAether.get((EntityPlayer) entity).setInPortal();
} else if ((entity instanceof EntityLivingBase) && entity.ridingEntity == null && entity.riddenByEntity == null) {
((EntityHook) entity.getExtendedProperties("aether_legacy:entity_hook"))
.setInPortal();
}
}
@Override
public void onEntityCollidedWithBlock(World world, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity entity) {
if (entity instanceof EntityPlayer) {
PlayerAether.get((EntityPlayer) entity).setInPortal();
} else if ((entity instanceof EntityLivingBase) && entity.ridingEntity == null && entity.riddenByEntity == null) {
((EntityHook) entity.getExtendedProperties("aether_legacy:entity_hook")).setInPortal();
}
}
public boolean trySpawnPortal(World worldIn, int x, int y, int z) {
AetherPortalSize aetherportal$size = new AetherPortalSize(worldIn, x, y, z, 1);
public boolean trySpawnPortal(World worldIn, int x, int y, int z) {
AetherPortalSize aetherportal$size = new AetherPortalSize(worldIn, x, y, z, 1);
if (aetherportal$size.isValid() && aetherportal$size.portalBlockCount == 0) {
aetherportal$size.placePortalBlocks();
if (aetherportal$size.isValid() && aetherportal$size.portalBlockCount == 0) {
aetherportal$size.placePortalBlocks();
return true;
} else {
AetherPortalSize aetherportal$size1
= new AetherPortalSize(worldIn, x, y, z, 2);
return true;
} else {
AetherPortalSize aetherportal$size1 = new AetherPortalSize(worldIn, x, y, z, 2);
if (aetherportal$size1.isValid()
&& aetherportal$size1.portalBlockCount == 0) {
aetherportal$size1.placePortalBlocks();
if (aetherportal$size1.isValid() && aetherportal$size1.portalBlockCount == 0) {
aetherportal$size1.placePortalBlocks();
return true;
} else {
return false;
}
}
}
return true;
} else {
return false;
}
}
}
@Override
public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block blockIn) {
int l = func_149999_b(worldIn.getBlockMetadata(x, y, z));
@Override
public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block blockIn) {
int l = func_149999_b(worldIn.getBlockMetadata(x, y, z));
if (l == 1) {
AetherPortalSize blockportal$size = new AetherPortalSize(worldIn, x, y, z, 1);
if (l == 1) {
AetherPortalSize blockportal$size = new AetherPortalSize(worldIn, x, y, z, 1);
if (!blockportal$size.isValid()
|| blockportal$size.portalBlockCount
< blockportal$size.width * blockportal$size.height) {
worldIn.setBlock(x, y, z, Blocks.air);
}
} else if (l == 2) {
AetherPortalSize blockportal$size1
= new AetherPortalSize(worldIn, x, y, z, 2);
if (!blockportal$size.isValid() || blockportal$size.portalBlockCount < blockportal$size.width * blockportal$size.height) {
worldIn.setBlock(x, y, z, Blocks.air);
}
} else if (l == 2) {
AetherPortalSize blockportal$size1 = new AetherPortalSize(worldIn, x, y, z, 2);
if (!blockportal$size1.isValid()
|| blockportal$size1.portalBlockCount
< blockportal$size1.width * blockportal$size1.height) {
worldIn.setBlock(x, y, z, Blocks.air);
}
}
}
if (!blockportal$size1.isValid() || blockportal$size1.portalBlockCount < blockportal$size1.width * blockportal$size1.height) {
worldIn.setBlock(x, y, z, Blocks.air);
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
if (rand.nextInt(100) == 0) {
world.playSound(
(double) x + 0.5D,
(double) y + 0.5D,
(double) z + 0.5D,
"portal.portal",
0.5F,
rand.nextFloat() * 0.4F + 0.8F,
false
);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
if (rand.nextInt(100) == 0) {
world.playSound((double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "portal.portal", 0.5F, rand.nextFloat() * 0.4F + 0.8F, false);
}
for (int i = 0; i < 4; ++i) {
double d0 = (double) ((float) x + rand.nextFloat());
double d1 = (double) ((float) y + rand.nextFloat());
double d2 = (double) ((float) z + rand.nextFloat());
double d3 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
int j = rand.nextInt(2) * 2 - 1;
for (int i = 0; i < 4; ++i) {
double d0 = (double) ((float) x + rand.nextFloat());
double d1 = (double) ((float) y + rand.nextFloat());
double d2 = (double) ((float) z + rand.nextFloat());
double d3 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
int j = rand.nextInt(2) * 2 - 1;
if (world.getBlock(x - 1, y, z) != this
&& world.getBlock(x + 1, y, z) != this) {
d0 = (double) x + 0.5D + 0.25D * (double) j;
d3 = (double) (rand.nextFloat() * 2.0F * (float) j);
} else {
d2 = (double) z + 0.5D + 0.25D * (double) j;
d5 = (double) (rand.nextFloat() * 2.0F * (float) j);
}
if (world.getBlock(x - 1, y, z) != this && world.getBlock(x + 1, y, z) != this) {
d0 = (double) x + 0.5D + 0.25D * (double) j;
d3 = (double) (rand.nextFloat() * 2.0F * (float) j);
} else {
d2 = (double) z + 0.5D + 0.25D * (double) j;
d5 = (double) (rand.nextFloat() * 2.0F * (float) j);
}
ParticleAetherPortal particle = new ParticleAetherPortal(world, d0, d1, d2, d3, d4, d5);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
}
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
}
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) {}
}

View File

@ -12,86 +12,88 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockFloating extends Block {
private boolean leveled;
private boolean leveled;
public BlockFloating(Material material, boolean leveled) {
super(material);
public BlockFloating(Material material, boolean leveled) {
super(material);
this.leveled = leveled;
this.leveled = leveled;
this.setTickRandomly(true);
this.setHarvestLevel("pickaxe", 2);
}
this.setTickRandomly(true);
this.setHarvestLevel("pickaxe", 2);
}
@Override
public boolean isBeaconBase(
IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ
) {
return this == BlocksAether.enchanted_gravitite;
}
@Override
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
return this == BlocksAether.enchanted_gravitite;
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
world.scheduleBlockUpdate(x, y, z, this, 3);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
world.scheduleBlockUpdate(x, y, z, this, 3);
}
@Override
public void
onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighborBlock) {
worldIn.scheduleBlockUpdate(x, y, z, this, 3);
}
@Override
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)) {
this.floatBlock(world, x, y, z);
}
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if (!this.leveled || this.leveled && world.isBlockIndirectlyGettingPowered(x, y, z)) {
this.floatBlock(world, x, y, z);
}
}
private void floatBlock(World world, int x, int y, int z) {
boolean floatInstantly = BlockSand.fallInstantly;
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)
);
world.setBlockToAir(x, y, z);
world.spawnEntityInWorld(entity);
}
} else {
world.setBlockToAir(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
{
world.setBlockToAir(x, y, z);
int bottomPos = y - 1;
int bottomPos = y - 1;
while (canContinue(world, x, bottomPos, z) && bottomPos > 0) {
bottomPos = bottomPos - 1;
}
while (canContinue(world, x, bottomPos, z) && bottomPos > 0)
{
bottomPos = bottomPos - 1;
}
if (bottomPos > 0) {
world.setBlock(x, bottomPos + 1, z, this);
}
}
}
}
if (bottomPos > 0)
{
world.setBlock(x, bottomPos + 1, z, this);
}
}
}
}
public static boolean canContinue(World world, int x, int y, int z) {
Block block = world.getBlock(x, y, z);
Material material = block.getMaterial();
public static boolean canContinue(World world, int x, int y, int z) {
Block block = world.getBlock(x, y, z);
Material material = block.getMaterial();
if (block == Blocks.air || block == Blocks.fire) {
return true;
}
if (block == Blocks.air || block == Blocks.fire) {
return true;
}
if (material == Material.water || material == Material.lava) {
return true;
}
return false;
}
if (material == Material.water || material == Material.lava) {
return true;
}
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,420 +53,472 @@ 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
public void onClientTick(TickEvent.ClientTickEvent event) throws Exception {
Minecraft mc = Minecraft.getMinecraft();
TickEvent.Phase phase = event.phase;
TickEvent.Type type = event.type;
if (phase == TickEvent.Phase.END) {
if (type.equals(TickEvent.Type.CLIENT)) {
if (!AetherConfig.triviaDisabled()) {
if (!(mc.loadingScreen instanceof AetherLoadingScreen)) {
mc.loadingScreen = new AetherLoadingScreen(mc);
}
}
if (mc.thePlayer != null && !(mc.thePlayer.movementInput instanceof AetherMovementInput)) {
mc.thePlayer.movementInput = new AetherMovementInput(mc, mc.gameSettings);
}
handleExtendedReach(mc);
}
}
if (phase == TickEvent.Phase.START) {
if (type.equals(TickEvent.Type.CLIENT)) {
if (mc.currentScreen == null || mc.currentScreen.allowUserInput) {
if (!mc.thePlayer.isUsingItem()) {
if (GameSettings.isKeyDown(mc.gameSettings.keyBindPickBlock)) {
this.sendPickupPacket(mc);
}
}
}
}
}
}
private void handleExtendedReach(Minecraft mc)
{
EntityPlayer player = mc.thePlayer;
if (player != null) {
if (Mouse.getEventButton() == 0) {
if (Mouse.getEventButtonState()) {
ItemStack stack = player.getHeldItem();
if (stack != null) {
if (isValkyrieItem(stack.getItem())) {
Vec3 playerVision = player.getLookVec();
AxisAlignedBB reachDistance = player.boundingBox.expand(10.0D, 10.0D, 10.0D);
List<Entity> locatedEntities = player.worldObj.getEntitiesWithinAABB(Entity.class, reachDistance);
Entity found = null;
double foundLen = 0.0D;
for (Object o : locatedEntities) {
if (o == player) {
continue;
}
Entity ent = (Entity) o;
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);
double len = vec.lengthVector();
if (len > 8.0F) {
continue;
}
vec = vec.normalize();
double dot = playerVision.dotProduct(vec);
if (dot < 1.0 - 0.125 / len || !player.canEntityBeSeen(ent)) {
continue;
}
if (foundLen == 0.0 || len < foundLen) {
found = ent;
foundLen = len;
}
}
if (found != null && player.ridingEntity != found) {
stack.damageItem(1, player);
AetherNetwork.sendToServer(new PacketExtendedAttack(found.getEntityId()));
}
}
}
}
}
}
}
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)
{
Minecraft mc = FMLClientHandler.instance().getClient();
if (mc.thePlayer != null && event.gui instanceof GuiDownloadTerrain)
{
GuiEnterAether enterAether = new GuiEnterAether(true);
GuiEnterAether exitAether = new GuiEnterAether(false);
if (mc.thePlayer.dimension == AetherConfig.getAetherDimensionID())
{
event.gui = enterAether;
wasInAether = true;
}
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)) {
return;
}
if (mc.thePlayer.capabilities.isCreativeMode) {
int index = mc.thePlayer.inventoryContainer.inventorySlots.size() - 9 + mc.thePlayer.inventory.currentItem;
mc.playerController.sendSlotPacket(mc.thePlayer.inventory.getStackInSlot(mc.thePlayer.inventory.currentItem), index);
}
}
}
private boolean onPickEntity(MovingObjectPosition target, EntityPlayer player, World world) {
ItemStack result = null;
boolean isCreative = player.capabilities.isCreativeMode;
if (!isCreative) {
return false;
}
if (target.entityHit != null) {
int id = EntitiesAether.getEntityID(target.entityHit);
if (id >= 0 && ItemAetherSpawnEgg.entityEggs.containsKey(id)) {
result = new ItemStack(ItemsAether.aether_spawn_egg, 1, id);
}
}
if (result == null) {
return false;
}
for (int x = 0; x < 9; x++) {
ItemStack stack = player.inventory.getStackInSlot(x);
if (stack != null && stack.isItemEqual(result) && ItemStack.areItemStackTagsEqual(stack, result)) {
player.inventory.currentItem = x;
return true;
}
}
int slot = player.inventory.getFirstEmptyStack();
if (slot < 0 || slot >= 9) {
slot = player.inventory.currentItem;
}
player.inventory.setInventorySlotContents(slot, result);
player.inventory.currentItem = slot;
return true;
}
@SubscribeEvent
public void onBowPulled(FOVUpdateEvent event) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if (player == null || (player != null && player.getCurrentEquippedItem() == null)) {
return;
}
Item item = player.getCurrentEquippedItem().getItem();
if (item == ItemsAether.phoenix_bow) {
int i = player.getItemInUseDuration();
float f1 = (float) i / 20.0F;
if (f1 > 1.0F) {
f1 = 1.0F;
} else {
f1 = f1 * f1;
}
float original = event.fov;
original *= 1.0F - f1 * 0.15F;
event.newfov = original;
}
}
private static final GuiAccessoryButton ACCESSORY_BUTTON = new GuiAccessoryButton(0, 0);
private static final GuiMenuToggleButton MAIN_MENU_BUTTON = new GuiMenuToggleButton(0, 0);
private static int previousSelectedTabIndex = -1;
private static boolean shouldRemoveButton = false;
@SubscribeEvent
@SuppressWarnings("unchecked")
public void onGuiOpened(GuiScreenEvent.InitGuiEvent.Post event) {
if (event.gui instanceof GuiContainer) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
Class<?> clazz = event.gui.getClass();
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) event.gui, "guiLeft", "field_147003_i");
int guiTop = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) event.gui, "guiTop", "field_147009_r");
if (player.capabilities.isCreativeMode) {
if (event.gui instanceof GuiContainerCreative) {
if (((GuiContainerCreative) event.gui).func_147056_g() == CreativeTabs.tabInventory.getTabIndex()) {
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
{
shouldRemoveButton = false;
}
}
}
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)
{
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() == 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)));
}
}
}
@SubscribeEvent
public void onMouseClicked(DrawScreenEvent.Post event) {
if (Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) {
GuiContainerCreative guiScreen = (GuiContainerCreative) Minecraft.getMinecraft().currentScreen;
if (previousSelectedTabIndex != guiScreen.func_147056_g()) {
List<GuiButton> buttonList = ObfuscationReflectionHelper.getPrivateValue(GuiScreen.class, (GuiScreen) guiScreen, 4);
if (guiScreen.func_147056_g() == CreativeTabs.tabInventory.getTabIndex() && !buttonList.contains(ACCESSORY_BUTTON)) {
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) guiScreen, "guiLeft", "field_147003_i");
int guiTop = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) guiScreen, "guiTop", "field_147009_r");
buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 28, guiTop + 38));
} else if (previousSelectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) {
buttonList.remove(ACCESSORY_BUTTON);
}
previousSelectedTabIndex = guiScreen.func_147056_g();
}
}
}
@SubscribeEvent
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());
}
}
@SubscribeEvent
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 (event.button.getClass() == GuiCustomizationScreenButton.class)
{
Minecraft.getMinecraft().displayGuiScreen(new GuiCustomizationScreen(event.gui));
}
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));
}
}
@SubscribeEvent
public void onRenderInvisibility(RenderPlayerEvent.Pre event) {
EntityPlayer player = event.entityPlayer;
PlayerAether playerAether = PlayerAether.get(player);
if (playerAether != null) {
if (playerAether.getAccessoryInventory().wearingAccessory(new ItemStack(ItemsAether.invisibility_cape))) {
event.setCanceled(true);
}
}
PlayerAetherRenderer.instance().setPartialTicks(event.partialRenderTick);
}
@SubscribeEvent
public void onRenderAetherCape(RenderPlayerEvent.Specials.Pre event) {
event.renderCape = !PlayerAetherRenderer.instance().isCapeRendering();
}
@SubscribeEvent
public void onRenderAetherArmor(SetArmorModel event) {
if (event.stack != null && event.stack.getItem() instanceof ItemAetherArmor) {
event.result = PlayerAetherRenderer.instance().renderAetherArmor(PlayerAether.get(event.entityPlayer), event.renderer, event.stack, 3 - event.slot);
}
}
@SubscribeEvent
public void onRenderAccessories(RenderLivingEvent.Post event) {
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());
}
}
}
@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));
shouldRemoveButton = true;
}
}
}
}
private static boolean wasInAether = false;
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) throws Exception {
Minecraft mc = Minecraft.getMinecraft();
TickEvent.Phase phase = event.phase;
TickEvent.Type type = event.type;
if (phase == TickEvent.Phase.END) {
if (type.equals(TickEvent.Type.CLIENT)) {
if (!AetherConfig.triviaDisabled()) {
if (!(mc.loadingScreen instanceof AetherLoadingScreen)) {
mc.loadingScreen = new AetherLoadingScreen(mc);
}
}
if (mc.thePlayer != null
&& !(mc.thePlayer.movementInput instanceof AetherMovementInput)) {
mc.thePlayer.movementInput
= new AetherMovementInput(mc, mc.gameSettings);
}
handleExtendedReach(mc);
}
}
if (phase == TickEvent.Phase.START) {
if (type.equals(TickEvent.Type.CLIENT)) {
if (mc.currentScreen == null || mc.currentScreen.allowUserInput) {
if (!mc.thePlayer.isUsingItem()) {
if (GameSettings.isKeyDown(mc.gameSettings.keyBindPickBlock)) {
this.sendPickupPacket(mc);
}
}
}
}
}
}
private void handleExtendedReach(Minecraft mc) {
EntityPlayer player = mc.thePlayer;
if (player != null) {
if (Mouse.getEventButton() == 0) {
if (Mouse.getEventButtonState()) {
ItemStack stack = player.getHeldItem();
if (stack != null) {
if (isValkyrieItem(stack.getItem())) {
Vec3 playerVision = player.getLookVec();
AxisAlignedBB reachDistance
= player.boundingBox.expand(10.0D, 10.0D, 10.0D);
List<Entity> locatedEntities
= player.worldObj.getEntitiesWithinAABB(
Entity.class, reachDistance
);
Entity found = null;
double foundLen = 0.0D;
for (Object o : locatedEntities) {
if (o == player) {
continue;
}
Entity ent = (Entity) o;
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
);
double len = vec.lengthVector();
if (len > 8.0F) {
continue;
}
vec = vec.normalize();
double dot = playerVision.dotProduct(vec);
if (dot < 1.0 - 0.125 / len
|| !player.canEntityBeSeen(ent)) {
continue;
}
if (foundLen == 0.0 || len < foundLen) {
found = ent;
foundLen = len;
}
}
if (found != null && player.ridingEntity != found) {
stack.damageItem(1, player);
AetherNetwork.sendToServer(
new PacketExtendedAttack(found.getEntityId())
);
}
}
}
}
}
}
}
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) {
Minecraft mc = FMLClientHandler.instance().getClient();
if (mc.thePlayer != null && event.gui instanceof GuiDownloadTerrain) {
GuiEnterAether enterAether = new GuiEnterAether(true);
GuiEnterAether exitAether = new GuiEnterAether(false);
if (mc.thePlayer.dimension == AetherConfig.getAetherDimensionID()) {
event.gui = enterAether;
wasInAether = true;
}
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)) {
return;
}
if (mc.thePlayer.capabilities.isCreativeMode) {
int index = mc.thePlayer.inventoryContainer.inventorySlots.size() - 9
+ mc.thePlayer.inventory.currentItem;
mc.playerController.sendSlotPacket(
mc.thePlayer.inventory.getStackInSlot(
mc.thePlayer.inventory.currentItem
),
index
);
}
}
}
private boolean
onPickEntity(MovingObjectPosition target, EntityPlayer player, World world) {
ItemStack result = null;
boolean isCreative = player.capabilities.isCreativeMode;
if (!isCreative) {
return false;
}
if (target.entityHit != null) {
int id = EntitiesAether.getEntityID(target.entityHit);
if (id >= 0 && ItemAetherSpawnEgg.entityEggs.containsKey(id)) {
result = new ItemStack(ItemsAether.aether_spawn_egg, 1, id);
}
}
if (result == null) {
return false;
}
for (int x = 0; x < 9; x++) {
ItemStack stack = player.inventory.getStackInSlot(x);
if (stack != null && stack.isItemEqual(result)
&& ItemStack.areItemStackTagsEqual(stack, result)) {
player.inventory.currentItem = x;
return true;
}
}
int slot = player.inventory.getFirstEmptyStack();
if (slot < 0 || slot >= 9) {
slot = player.inventory.currentItem;
}
player.inventory.setInventorySlotContents(slot, result);
player.inventory.currentItem = slot;
return true;
}
@SubscribeEvent
public void onBowPulled(FOVUpdateEvent event) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if (player == null
|| (player != null && player.getCurrentEquippedItem() == null)) {
return;
}
Item item = player.getCurrentEquippedItem().getItem();
if (item == ItemsAether.phoenix_bow) {
int i = player.getItemInUseDuration();
float f1 = (float) i / 20.0F;
if (f1 > 1.0F) {
f1 = 1.0F;
} else {
f1 = f1 * f1;
}
float original = event.fov;
original *= 1.0F - f1 * 0.15F;
event.newfov = original;
}
}
private static final GuiAccessoryButton ACCESSORY_BUTTON
= new GuiAccessoryButton(0, 0);
private static final GuiMenuToggleButton MAIN_MENU_BUTTON
= new GuiMenuToggleButton(0, 0);
private static int previousSelectedTabIndex = -1;
private static boolean shouldRemoveButton = false;
@SubscribeEvent
@SuppressWarnings("unchecked")
public void onGuiOpened(GuiScreenEvent.InitGuiEvent.Post event) {
if (event.gui instanceof GuiContainer) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
Class<?> clazz = event.gui.getClass();
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(
GuiContainer.class, (GuiContainer) event.gui, "guiLeft", "field_147003_i"
);
int guiTop = ObfuscationReflectionHelper.getPrivateValue(
GuiContainer.class, (GuiContainer) event.gui, "guiTop", "field_147009_r"
);
if (player.capabilities.isCreativeMode) {
if (event.gui instanceof GuiContainerCreative) {
if (((GuiContainerCreative) event.gui).func_147056_g()
== CreativeTabs.tabInventory.getTabIndex()) {
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 {
shouldRemoveButton = false;
}
}
}
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) {
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() == 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)
));
}
}
}
@SubscribeEvent
public void onMouseClicked(DrawScreenEvent.Post event) {
if (Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) {
GuiContainerCreative guiScreen
= (GuiContainerCreative) Minecraft.getMinecraft().currentScreen;
if (previousSelectedTabIndex != guiScreen.func_147056_g()) {
List<GuiButton> buttonList = ObfuscationReflectionHelper.getPrivateValue(
GuiScreen.class, (GuiScreen) guiScreen, 4
);
if (guiScreen.func_147056_g() == CreativeTabs.tabInventory.getTabIndex()
&& !buttonList.contains(ACCESSORY_BUTTON)) {
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(
GuiContainer.class,
(GuiContainer) guiScreen,
"guiLeft",
"field_147003_i"
);
int guiTop = ObfuscationReflectionHelper.getPrivateValue(
GuiContainer.class,
(GuiContainer) guiScreen,
"guiTop",
"field_147009_r"
);
buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 28, guiTop + 38)
);
} else if (previousSelectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) {
buttonList.remove(ACCESSORY_BUTTON);
}
previousSelectedTabIndex = guiScreen.func_147056_g();
}
}
}
@SubscribeEvent
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());
}
}
@SubscribeEvent
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 (event.button.getClass() == GuiCustomizationScreenButton.class) {
Minecraft.getMinecraft().displayGuiScreen(new GuiCustomizationScreen(event.gui
));
}
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
));
}
}
@SubscribeEvent
public void onRenderInvisibility(RenderPlayerEvent.Pre event) {
EntityPlayer player = event.entityPlayer;
PlayerAether playerAether = PlayerAether.get(player);
if (playerAether != null) {
if (playerAether.getAccessoryInventory().wearingAccessory(
new ItemStack(ItemsAether.invisibility_cape)
)) {
event.setCanceled(true);
}
}
PlayerAetherRenderer.instance().setPartialTicks(event.partialRenderTick);
}
@SubscribeEvent
public void onRenderAetherCape(RenderPlayerEvent.Specials.Pre event) {
event.renderCape = !PlayerAetherRenderer.instance().isCapeRendering();
}
@SubscribeEvent
public void onRenderAetherArmor(SetArmorModel event) {
if (event.stack != null && event.stack.getItem() instanceof ItemAetherArmor) {
event.result = PlayerAetherRenderer.instance().renderAetherArmor(
PlayerAether.get(event.entityPlayer),
event.renderer,
event.stack,
3 - event.slot
);
}
}
@SubscribeEvent
public void onRenderAccessories(RenderLivingEvent.Post event) {
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()
);
}
}
}
@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)
);
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,59 +5,58 @@ 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 Minecraft mc;
private GameSettings gameSettings;
private GameSettings gameSettings;
private boolean currentSneak;
private boolean currentSneak;
private boolean previousSneak;
private boolean previousSneak;
public AetherMovementInput(Minecraft mc, GameSettings gameSettings) {
super(gameSettings);
public AetherMovementInput(Minecraft mc, GameSettings gameSettings) {
super(gameSettings);
this.mc = mc;
this.gameSettings = gameSettings;
}
this.mc = mc;
this.gameSettings = gameSettings;
}
@Override
public void updatePlayerMoveState() {
super.updatePlayerMoveState();
@Override
public void updatePlayerMoveState() {
super.updatePlayerMoveState();
this.jump = this.gameSettings.keyBindJump.getIsKeyPressed();
this.jump = this.gameSettings.keyBindJump.getIsKeyPressed();
boolean isSneaking = this.gameSettings.keyBindSneak.getIsKeyPressed();
boolean isSneaking = this.gameSettings.keyBindSneak.getIsKeyPressed();
this.sneak = isSneaking;
this.sneak = isSneaking;
if (this.mc.thePlayer == null) {
return;
}
if (this.mc.thePlayer == null) {
return;
}
if (this.mc.thePlayer.ridingEntity instanceof EntitySaddleMount) {
if (this.mc.thePlayer.ridingEntity instanceof EntitySaddleMount) {
this.sneak = false;
this.currentSneak = isSneaking;
if (this.mc.thePlayer.ridingEntity instanceof EntitySaddleMount) {
if (this.mc.thePlayer.ridingEntity instanceof EntitySaddleMount) {
this.sneak = false;
this.currentSneak = isSneaking;
if (this.previousSneak != this.currentSneak) {
AetherNetwork.sendToServer(new PacketSendSneaking(this.mc.thePlayer.getEntityId(), this.currentSneak));
this.previousSneak = this.currentSneak;
}
if (((EntityMountable) this.mc.thePlayer.ridingEntity).isOnGround()) {
this.sneak = isSneaking;
}
}
} else if (this.mc.thePlayer.ridingEntity instanceof EntitySwet && !((EntitySwet) this.mc.thePlayer.ridingEntity).isFriendly()) {
this.sneak = false;
}
}
if (this.previousSneak != this.currentSneak) {
AetherNetwork.sendToServer(new PacketSendSneaking(
this.mc.thePlayer.getEntityId(), this.currentSneak
));
this.previousSneak = this.currentSneak;
}
if (((EntityMountable) this.mc.thePlayer.ridingEntity).isOnGround()) {
this.sneak = isSneaking;
}
}
} else if (this.mc.thePlayer.ridingEntity instanceof EntitySwet && !((EntitySwet) this.mc.thePlayer.ridingEntity).isFriendly()) {
this.sneak = false;
}
}
}

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,123 +14,192 @@ 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];
public static final IIcon[] ACCESSORY_ICONS = new IIcon[8];
@Override
public void init() {
try {
File resourcePacks = Minecraft.getMinecraft()
.getResourcePackRepository()
.getDirResourcepacks()
.getCanonicalFile();
@Override
public void init() {
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 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[] 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()) {
file.mkdirs();
}
}
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()
);
}
} catch (IOException ignore) {}
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) { }
berryBushRenderID = RenderingRegistry.getNextAvailableRenderId();
treasureChestRenderID = RenderingRegistry.getNextAvailableRenderId();
aetherFlowerRenderID = RenderingRegistry.getNextAvailableRenderId();
berryBushRenderID = RenderingRegistry.getNextAvailableRenderId();
treasureChestRenderID = RenderingRegistry.getNextAvailableRenderId();
aetherFlowerRenderID = RenderingRegistry.getNextAvailableRenderId();
EntityRenderer previousRenderer = Minecraft.getMinecraft().entityRenderer;
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();
RendersAether.initialization();
AetherKeybinds.initialization();
AetherKeybinds.initialization();
registerEvent(new AetherMusicHandler());
registerEvent(new AetherClientEvents());
registerEvent(new GuiAetherInGame(Minecraft.getMinecraft()));
registerEvent(new AetherMusicHandler());
registerEvent(new AetherClientEvents());
registerEvent(new GuiAetherInGame(Minecraft.getMinecraft()));
AetherClientCompatibility.initialization();
}
AetherClientCompatibility.initialization();
}
public void generateFile(String input, String name, String path) {
try {
File file = new File(path + "/" + name);
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);
FileOutputStream outputStream = new FileOutputStream(file);
if (!file.exists())
{
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(input);
FileOutputStream outputStream = new FileOutputStream(file);
if (inputStream != null) {
int i;
while ((i = inputStream.read()) != -1) {
outputStream.write(i);
}
if (inputStream != null)
{
int i;
while ((i = inputStream.read()) != -1)
{
outputStream.write(i);
}
inputStream.close();
outputStream.close();
}
}
} catch (IOException ignore) {}
}
inputStream.close();
outputStream.close();
}
}
}
catch (IOException ignore) { }
}
@Override
public void sendMessage(EntityPlayer player, String text) {
if (this.getPlayer() == player) {
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(
new ChatComponentText(text)
);
}
}
@Override
public void sendMessage(EntityPlayer player, String text) {
if (this.getPlayer() == player)
{
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(text));
}
}
@Override
public void openSunAltar() {
FMLClientHandler.instance().getClient().displayGuiScreen(new GuiSunAltar());
}
@Override
public EntityPlayer getPlayer() {
return Minecraft.getMinecraft().thePlayer;
}
@Override
public void openSunAltar() {
FMLClientHandler.instance().getClient().displayGuiScreen(new GuiSunAltar());
}
@Override
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,99 +17,96 @@ 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 Minecraft mc = Minecraft.getMinecraft();
private final AetherMusicTicker musicTicker = new AetherMusicTicker(this.mc);
private final AetherMusicTicker musicTicker = new AetherMusicTicker(this.mc);
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) throws Exception {
TickEvent.Phase phase = event.phase;
TickEvent.Type type = event.type;
GuiScreen screen = Minecraft.getMinecraft().currentScreen;
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) throws Exception {
TickEvent.Phase phase = event.phase;
TickEvent.Type type = event.type;
GuiScreen screen = Minecraft.getMinecraft().currentScreen;
if (phase == TickEvent.Phase.END) {
if (type.equals(TickEvent.Type.CLIENT)) {
if (!this.mc.isGamePaused()) {
if (!musicTicker.playingRecord()) {
this.musicTicker.update();
}
}
}
}
if (phase == TickEvent.Phase.END) {
if (type.equals(TickEvent.Type.CLIENT)) {
if (!this.mc.isGamePaused()) {
if (!musicTicker.playingRecord()) {
this.musicTicker.update();
}
}
}
}
if (!(mc.getSoundHandler().isSoundPlaying(musicTicker.getRecord()))) {
musicTicker.trackRecord(null);
}
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()) {
musicTicker.playMenuMusic();
}
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()) {
musicTicker.stopMinecraftMusic();
}
} else {
musicTicker.stopMenuMusic();
}
}
if (musicTicker.playingMinecraftMusic())
{
musicTicker.stopMinecraftMusic();
}
}
else
{
musicTicker.stopMenuMusic();
}
}
@SubscribeEvent
public void onMusicControl(PlaySoundEvent17 event) {
ISound sound = event.result;
GuiScreen screen = Minecraft.getMinecraft().currentScreen;
@SubscribeEvent
public void onMusicControl(PlaySoundEvent17 event) {
ISound sound = event.result;
GuiScreen screen = Minecraft.getMinecraft().currentScreen;
if (sound == null) {
return;
}
if (sound == null) {
return;
}
SoundCategory category = event.category;
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())) {
event.result = null;
if (category == SoundCategory.MUSIC) {
if (this.mc.thePlayer != null && this.mc.thePlayer.dimension == AetherConfig.getAetherDimensionID()) {
if (!sound.getPositionedSoundLocation().toString().contains("aether_legacy") && (this.musicTicker.playingMusic() || !this.musicTicker.playingMusic())) {
event.result = null;
return;
}
}
if (sound.getPositionedSoundLocation().toString().equals(
"minecraft:music.menu"
)) {
musicTicker.trackMinecraftMusic(sound);
return;
}
}
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)) {
event.result = null;
}
}
} else if (category == SoundCategory.RECORDS && !(event.name.contains("note"))) {
this.musicTicker.trackRecord(event.sound);
this.mc.getSoundHandler().stopSounds();
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean() && Minecraft.getMinecraft().theWorld == null && !(screen instanceof GuiScreenWorking))
{
event.result = null;
}
}
} else if (category == SoundCategory.RECORDS && !(event.name.contains("note"))) {
this.musicTicker.trackRecord(event.sound);
this.mc.getSoundHandler().stopSounds();
return;
}
}
return;
}
}
@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");
return PositionedSoundRecord.func_147673_a(sound);
}
@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");
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,164 +14,164 @@ 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;
private int timeUntilNextMusic = 100;
private final Random rand = new Random();
private final Minecraft mc;
private ISound currentMusic, currentRecord, menuMusic, minecraftMusic;
private int timeUntilNextMusic = 100;
public AetherMusicTicker(Minecraft mcIn) {
this.mc = mcIn;
}
public AetherMusicTicker(Minecraft mcIn) {
this.mc = mcIn;
}
public void update() {
TrackType tracktype = this.getRandomTrack();
public void update() {
TrackType tracktype = this.getRandomTrack();
if (this.mc.thePlayer != null) {
if (this.mc.gameSettings.getSoundLevel(SoundCategory.MUSIC) == 0.0F) {
if (this.currentMusic != null) {
this.stopMusic();
this.currentMusic = null;
}
if (this.mc.thePlayer != null) {
if (this.mc.gameSettings.getSoundLevel(SoundCategory.MUSIC) == 0.0F) {
if (this.currentMusic != null) {
this.stopMusic();
this.currentMusic = null;
}
return;
}
return;
}
if (this.mc.thePlayer.dimension != AetherConfig.getAetherDimensionID()) {
this.stopMusic();
} else if (this.mc.thePlayer.dimension == AetherConfig.getAetherDimensionID()) {
if (this.currentMusic != null) {
if (!this.mc.getSoundHandler().isSoundPlaying(this.currentMusic)) {
this.currentMusic = null;
this.timeUntilNextMusic = Math.min(
MathHelper.getRandomIntegerInRange(
this.rand,
tracktype.getMinDelay(),
tracktype.getMaxDelay()
),
this.timeUntilNextMusic
);
}
}
if (this.mc.thePlayer.dimension != AetherConfig.getAetherDimensionID()) {
this.stopMusic();
} else if (this.mc.thePlayer.dimension == AetherConfig.getAetherDimensionID()) {
if (this.currentMusic != null) {
if (!this.mc.getSoundHandler().isSoundPlaying(this.currentMusic)) {
this.currentMusic = null;
this.timeUntilNextMusic = Math.min(MathHelper.getRandomIntegerInRange(this.rand, tracktype.getMinDelay(), tracktype.getMaxDelay()), this.timeUntilNextMusic);
}
}
this.timeUntilNextMusic
= Math.min(this.timeUntilNextMusic, tracktype.getMaxDelay());
this.timeUntilNextMusic = Math.min(this.timeUntilNextMusic, tracktype.getMaxDelay());
if (this.currentMusic == null && this.timeUntilNextMusic-- <= 0) {
this.playMusic(tracktype);
}
}
}
if (this.currentMusic == null && this.timeUntilNextMusic-- <= 0) {
this.playMusic(tracktype);
}
}
}
if (!this.mc.getSoundHandler().isSoundPlaying(this.menuMusic)) {
this.menuMusic = null;
}
}
if (!this.mc.getSoundHandler().isSoundPlaying(this.menuMusic)) {
this.menuMusic = null;
}
}
public boolean playingMusic() {
return this.currentMusic != null;
}
public boolean playingMusic() {
return this.currentMusic != null;
}
public boolean playingRecord() {
return this.currentRecord != null;
}
public boolean playingRecord()
{
return this.currentRecord != null;
}
public boolean playingMenuMusic() {
return this.menuMusic != null;
}
public boolean playingMenuMusic()
{
return this.menuMusic != null;
}
public boolean playingMinecraftMusic() {
return this.minecraftMusic != null;
}
public boolean playingMinecraftMusic()
{
return this.minecraftMusic != null;
}
public ISound getRecord() {
return this.currentRecord;
}
public ISound getRecord()
{
return this.currentRecord;
}
public AetherMusicTicker.TrackType getRandomTrack() {
int num = this.rand.nextInt(4);
public AetherMusicTicker.TrackType getRandomTrack() {
int num = this.rand.nextInt(4);
return num == 0 ? TrackType.TRACK_ONE
: num == 1 ? TrackType.TRACK_TWO
: num == 2 ? TrackType.TRACK_THREE
: TrackType.TRACK_FOUR;
}
return num == 0 ? TrackType.TRACK_ONE : num == 1 ? TrackType.TRACK_TWO : num == 2 ? TrackType.TRACK_THREE : TrackType.TRACK_FOUR;
}
public void playMusic(TrackType requestedMusicType) {
this.currentMusic
= PositionedSoundRecord.func_147673_a(requestedMusicType.getMusicLocation());
this.mc.getSoundHandler().playSound(this.currentMusic);
this.timeUntilNextMusic = Integer.MAX_VALUE;
}
public void playMusic(TrackType requestedMusicType) {
this.currentMusic = PositionedSoundRecord.func_147673_a(requestedMusicType.getMusicLocation());
this.mc.getSoundHandler().playSound(this.currentMusic);
this.timeUntilNextMusic = Integer.MAX_VALUE;
}
public void trackRecord(ISound record) {
this.currentRecord = record;
}
public void trackRecord(ISound record)
{
this.currentRecord = record;
}
public void trackMinecraftMusic(ISound record) {
this.minecraftMusic = record;
}
public void trackMinecraftMusic(ISound record)
{
this.minecraftMusic = record;
}
public void playMenuMusic() {
this.menuMusic
= PositionedSoundRecord.func_147673_a(TrackType.TRACK_MENU.getMusicLocation()
);
this.mc.getSoundHandler().playSound(this.menuMusic);
}
public void playMenuMusic()
{
this.menuMusic = PositionedSoundRecord.func_147673_a(TrackType.TRACK_MENU.getMusicLocation());
this.mc.getSoundHandler().playSound(this.menuMusic);
}
public void stopMusic() {
if (this.currentMusic != null) {
this.mc.getSoundHandler().stopSound(this.currentMusic);
this.currentMusic = null;
this.timeUntilNextMusic = 0;
}
}
public void stopMusic() {
if (this.currentMusic != null) {
this.mc.getSoundHandler().stopSound(this.currentMusic);
this.currentMusic = null;
this.timeUntilNextMusic = 0;
}
}
public void stopMenuMusic() {
if (this.menuMusic != null) {
this.mc.getSoundHandler().stopSound(this.menuMusic);
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) {
this.mc.getSoundHandler().stopSound(this.minecraftMusic);
this.minecraftMusic = null;
}
}
public void stopMinecraftMusic()
{
if (this.minecraftMusic != null)
{
this.mc.getSoundHandler().stopSound(this.minecraftMusic);
this.minecraftMusic = null;
}
}
@SideOnly(Side.CLIENT)
public static enum TrackType {
TRACK_ONE(Aether.locate("music.aether1"), 1200, 1500),
TRACK_TWO(Aether.locate("music.aether2"), 1200, 1500),
TRACK_THREE(Aether.locate("music.aether3"), 1200, 1500),
TRACK_FOUR(Aether.locate("music.aether4"), 1200, 1500),
TRACK_MENU(Aether.locate("music.menu"), 1200, 1500);
@SideOnly(Side.CLIENT)
public static enum TrackType {
TRACK_ONE(Aether.locate("music.aether1"), 1200, 1500),
TRACK_TWO(Aether.locate("music.aether2"), 1200, 1500),
TRACK_THREE(Aether.locate("music.aether3"), 1200, 1500),
TRACK_FOUR(Aether.locate("music.aether4"), 1200, 1500),
TRACK_MENU(Aether.locate("music.menu"), 1200, 1500);
private final ResourceLocation musicLocation;
private final int minDelay;
private final int maxDelay;
private final ResourceLocation musicLocation;
private final int minDelay;
private final int maxDelay;
private TrackType(
ResourceLocation musicLocationIn, int minDelayIn, int maxDelayIn
) {
this.musicLocation = musicLocationIn;
this.minDelay = minDelayIn;
this.maxDelay = maxDelayIn;
}
private TrackType(ResourceLocation musicLocationIn, int minDelayIn, int maxDelayIn) {
this.musicLocation = musicLocationIn;
this.minDelay = minDelayIn;
this.maxDelay = maxDelayIn;
}
public ResourceLocation getMusicLocation() {
return this.musicLocation;
}
public ResourceLocation getMusicLocation() {
return this.musicLocation;
}
public int getMinDelay() {
return this.minDelay;
}
public int getMaxDelay() {
return this.maxDelay;
}
}
public int getMinDelay() {
return this.minDelay;
}
public int getMaxDelay() {
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,131 +9,156 @@ 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 String message = "";
private Minecraft mc;
private Minecraft mc;
private String currentDisplayedTrivia = "";
private String currentDisplayedTrivia = "";
private long systemTime = Minecraft.getSystemTime();
private long systemTime = Minecraft.getSystemTime();
private Framebuffer framebuffer;
private Framebuffer framebuffer;
public AetherLoadingScreen(Minecraft mcIn) {
super(mcIn);
public AetherLoadingScreen(Minecraft mcIn) {
super(mcIn);
this.mc = mcIn;
this.mc = mcIn;
this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false);
this.framebuffer.setFramebufferFilter(9728);
}
this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false);
this.framebuffer.setFramebufferFilter(9728);
}
@Override
public void resetProgressAndMessage(String message) {
super.resetProgressAndMessage(message);
@Override
public void resetProgressAndMessage(String message) {
super.resetProgressAndMessage(message);
this.currentDisplayedTrivia = AetherTrivia.getNewTrivia();
}
this.currentDisplayedTrivia = AetherTrivia.getNewTrivia();
}
@Override
public void displayProgressMessage(String message) {
this.systemTime = 0L;
this.message = message;
this.setLoadingProgress(-1);
this.systemTime = 0L;
}
@Override
public void displayProgressMessage(String message) {
this.systemTime = 0L;
this.message = message;
this.setLoadingProgress(-1);
this.systemTime = 0L;
}
@Override
public void setLoadingProgress(int progress) {
long j = Minecraft.getSystemTime();
@Override
public void setLoadingProgress(int progress) {
long j = Minecraft.getSystemTime();
if (j - this.systemTime >= 100L) {
this.systemTime = j;
ScaledResolution scaledresolution = new ScaledResolution(
this.mc, this.mc.displayWidth, this.mc.displayHeight
);
int k = scaledresolution.getScaleFactor();
int l = scaledresolution.getScaledWidth();
int i1 = scaledresolution.getScaledHeight();
if (j - this.systemTime >= 100L) {
this.systemTime = j;
ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
int k = scaledresolution.getScaleFactor();
int l = scaledresolution.getScaledWidth();
int i1 = scaledresolution.getScaledHeight();
if (OpenGlHelper.isFramebufferEnabled()) {
this.framebuffer.framebufferClear();
} else {
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
}
if (OpenGlHelper.isFramebufferEnabled()) {
this.framebuffer.framebufferClear();
} else {
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
}
this.framebuffer.bindFramebuffer(false);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(
0.0D,
scaledresolution.getScaledWidth_double(),
scaledresolution.getScaledHeight_double(),
0.0D,
100.0D,
300.0D
);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glTranslatef(0.0F, 0.0F, -200.0F);
this.framebuffer.bindFramebuffer(false);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glTranslatef(0.0F, 0.0F, -200.0F);
if (!OpenGlHelper.isFramebufferEnabled()) {
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
}
if (!OpenGlHelper.isFramebufferEnabled()) {
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
}
if (!FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) {
Tessellator tessellator = Tessellator.instance;
this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
float f = 32.0F;
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(4210752);
tessellator.addVertexWithUV(
0.0D, (double) i1, 0.0D, 0.0D, (double) ((float) i1 / f)
);
tessellator.addVertexWithUV(
(double) l,
(double) i1,
0.0D,
(double) ((float) l / f),
(double) ((float) i1 / f)
);
tessellator.addVertexWithUV(
(double) l, 0.0D, 0.0D, (double) ((float) l / f), 0.0D
);
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
tessellator.draw();
if (!FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) {
Tessellator tessellator = Tessellator.instance;
this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
float f = 32.0F;
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(4210752);
tessellator.addVertexWithUV(0.0D, (double) i1, 0.0D, 0.0D, (double) ((float) i1 / f));
tessellator.addVertexWithUV((double) l, (double) i1, 0.0D, (double) ((float) l / f), (double) ((float) i1 / f));
tessellator.addVertexWithUV((double) l, 0.0D, 0.0D, (double) ((float) l / f), 0.0D);
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
tessellator.draw();
if (progress >= 0) {
byte b0 = 100;
byte b1 = 2;
int j1 = l / 2 - b0 / 2;
int k1 = i1 / 2 + 16;
GL11.glDisable(GL11.GL_TEXTURE_2D);
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(8421504);
tessellator.addVertex((double) j1, (double) k1, 0.0D);
tessellator.addVertex((double) j1, (double) (k1 + b1), 0.0D);
tessellator.addVertex((double) (j1 + b0), (double) (k1 + b1), 0.0D);
tessellator.addVertex((double) (j1 + b0), (double) k1, 0.0D);
tessellator.setColorOpaque_I(8454016);
tessellator.addVertex((double) j1, (double) k1, 0.0D);
tessellator.addVertex((double) j1, (double) (k1 + b1), 0.0D);
tessellator.addVertex(
(double) (j1 + progress), (double) (k1 + b1), 0.0D
);
tessellator.addVertex((double) (j1 + progress), (double) k1, 0.0D);
tessellator.draw();
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
if (progress >= 0) {
byte b0 = 100;
byte b1 = 2;
int j1 = l / 2 - b0 / 2;
int k1 = i1 / 2 + 16;
GL11.glDisable(GL11.GL_TEXTURE_2D);
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(8421504);
tessellator.addVertex((double) j1, (double) k1, 0.0D);
tessellator.addVertex((double) j1, (double) (k1 + b1), 0.0D);
tessellator.addVertex((double) (j1 + b0), (double) (k1 + b1), 0.0D);
tessellator.addVertex((double) (j1 + b0), (double) k1, 0.0D);
tessellator.setColorOpaque_I(8454016);
tessellator.addVertex((double) j1, (double) k1, 0.0D);
tessellator.addVertex((double) j1, (double) (k1 + b1), 0.0D);
tessellator.addVertex((double) (j1 + progress), (double) (k1 + b1), 0.0D);
tessellator.addVertex((double) (j1 + progress), (double) k1, 0.0D);
tessellator.draw();
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
this.mc.fontRenderer.drawStringWithShadow(
this.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
);
}
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.framebuffer.unbindFramebuffer();
this.framebuffer.unbindFramebuffer();
if (OpenGlHelper.isFramebufferEnabled()) {
this.framebuffer.framebufferRender(l * k, i1 * k);
}
if (OpenGlHelper.isFramebufferEnabled()) {
this.framebuffer.framebufferRender(l * k, i1 * k);
}
this.mc.func_147120_f();
try {
Thread.yield();
} catch (Exception exception) {
;
}
}
}
this.mc.func_147120_f();
try {
Thread.yield();
} catch (Exception exception) {
;
}
}
}
}

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,53 +11,51 @@ 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;
private Minecraft mc;
public GuiAetherInGame(Minecraft mc) {
super();
this.mc = mc;
}
public GuiAetherInGame(Minecraft mc) {
super();
this.mc = mc;
}
@SubscribeEvent
public void onRenderBlockOverlay(RenderBlockOverlayEvent event) {
if (this.mc.thePlayer != null) {
PlayerAether player = PlayerAether.get(this.mc.thePlayer);
@SubscribeEvent
public void onRenderBlockOverlay(RenderBlockOverlayEvent event) {
if (this.mc.thePlayer != null) {
PlayerAether player = PlayerAether.get(this.mc.thePlayer);
if (player.getAccessoryInventory().isWearingPhoenixSet()
&& event.overlayType == OverlayType.FIRE) {
event.setCanceled(true);
}
}
}
if (player.getAccessoryInventory().isWearingPhoenixSet() && event.overlayType == OverlayType.FIRE) {
event.setCanceled(true);
}
}
}
@SubscribeEvent
public void onRenderGui(RenderGameOverlayEvent event) {
if (event.isCancelable() || event.type != ElementType.TEXT) {
return;
}
@SubscribeEvent
public void onRenderGui(RenderGameOverlayEvent event) {
if (event.isCancelable() || event.type != ElementType.TEXT) {
return;
}
PlayerAether player = PlayerAether.get(this.mc.thePlayer);
PlayerAether player = PlayerAether.get(this.mc.thePlayer);
if (player.getEntity() != null) {
AetherOverlay.renderCure(this.mc);
AetherOverlay.renderPoison(this.mc);
AetherOverlay.renderIronBubble(this.mc);
AetherOverlay.renderCooldown(this.mc);
AetherOverlay.renderJumps(this.mc);
AetherOverlay.renderBossHP(this.mc);
}
if (player.getEntity() != null) {
AetherOverlay.renderCure(this.mc);
AetherOverlay.renderPoison(this.mc);
AetherOverlay.renderIronBubble(this.mc);
AetherOverlay.renderCooldown(this.mc);
AetherOverlay.renderJumps(this.mc);
AetherOverlay.renderBossHP(this.mc);
}
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));
}
}
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)
);
}
}
}

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,57 +2,62 @@ 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;
private TileEntityEnchanter enchanter;
public GuiEnchanter(InventoryPlayer inventory, TileEntityEnchanter tileEntity) {
super(new ContainerEnchanter(inventory, tileEntity));
this.enchanter = tileEntity;
}
public GuiEnchanter(InventoryPlayer inventory, TileEntityEnchanter tileEntity) {
super(new ContainerEnchanter(inventory, tileEntity));
this.enchanter = tileEntity;
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String enchanterName = AetherConfig.legacyAltarName()
? I18n.format("container.aether_legacy.enchanter")
: I18n.format("container.aether_legacy.altar");
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
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
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(TEXTURE);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int i1;
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(TEXTURE);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int i1;
if (this.enchanter.isEnchanting()) {
i1 = this.enchanter.getEnchantmentTimeRemaining(12);
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);
}
if (this.enchanter.isEnchanting()) {
i1 = this.enchanter.getEnchantmentTimeRemaining(12);
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,55 +1,60 @@
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;
private TileEntityFreezer freezer;
public GuiFreezer(InventoryPlayer inventory, TileEntityFreezer tileEntity) {
super(new ContainerFreezer(inventory, tileEntity));
this.freezer = tileEntity;
}
public GuiFreezer(InventoryPlayer inventory, TileEntityFreezer tileEntity) {
super(new ContainerFreezer(inventory, tileEntity));
this.freezer = tileEntity;
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String freezerName = this.freezer.getInventoryName();
@Override
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
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(TEXTURE);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int i1;
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(TEXTURE);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int i1;
if (this.freezer.isFreezing()) {
i1 = this.freezer.getFreezingTimeRemaining(12);
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);
}
if (this.freezer.isFreezing()) {
i1 = this.freezer.getFreezingTimeRemaining(12);
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,57 +1,65 @@
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 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
) {
super(new ContainerIncubator(player, inventoryplayer, tileentityIncubator));
public GuiIncubator(EntityPlayer player, InventoryPlayer inventoryplayer, TileEntityIncubator tileentityIncubator) {
super(new ContainerIncubator(player, inventoryplayer, tileentityIncubator));
this.incubatorInventory = (TileEntityIncubator) tileentityIncubator;
}
this.incubatorInventory = (TileEntityIncubator) tileentityIncubator;
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String incubatorName = this.incubatorInventory.getInventoryName();
@Override
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
protected void drawGuiContainerBackgroundLayer(float f, int ia, int ib) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@Override
protected void drawGuiContainerBackgroundLayer(float f, int ia, int ib) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(TEXTURE_INCUBATOR);
this.mc.renderEngine.bindTexture(TEXTURE_INCUBATOR);
int j = (this.width - this.xSize) / 2;
int k = (this.height - this.ySize) / 2;
int j = (this.width - this.xSize) / 2;
int k = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
if (this.incubatorInventory.isIncubating()) {
int l = this.incubatorInventory.getPowerTimeRemainingScaled(12);
if (this.incubatorInventory.isIncubating()) {
int l = this.incubatorInventory.getPowerTimeRemainingScaled(12);
this.drawTexturedModalRect(j + 74, (k + 47) - l, 176, 12 - l, 14, l + 2);
}
this.drawTexturedModalRect(j + 74, (k + 47) - l, 176, 12 - l, 14, l + 2);
}
int i1 = this.incubatorInventory.getProgressScaled(54);
this.drawTexturedModalRect(j + 103, k + 70 - i1, 179, 70 - i1, 10, i1);
}
int i1 = this.incubatorInventory.getProgressScaled(54);
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,116 +13,148 @@ 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;
private String stringToLoad;
private ItemStack currentItem;
private ItemStack currentItem;
private GuiButton previousPage, nextPage;
private GuiButton previousPage, nextPage;
private int pageNumber;
private int pageNumber;
public GuiLore(InventoryPlayer inventoryplayer) {
super(new ContainerLore(inventoryplayer));
public GuiLore(InventoryPlayer inventoryplayer) {
super(new ContainerLore(inventoryplayer));
this.xSize = 256;
this.ySize = 195;
}
this.xSize = 256;
this.ySize = 195;
}
@SuppressWarnings("unchecked")
public void initGui() {
super.initGui();
@SuppressWarnings("unchecked")
public void initGui() {
super.initGui();
this.previousPage = new GuiLoreButton(
19, this.width / 2 - 110, this.height / 2 + 72, 20, 20, "<"
);
this.nextPage = new GuiLoreButton(
20, this.width / 2 + 90, this.height / 2 + 72, 20, 20, ">"
);
this.previousPage = new GuiLoreButton(19, this.width / 2 - 110, this.height / 2 + 72, 20, 20, "<");
this.nextPage = new GuiLoreButton(20, this.width / 2 + 90, this.height / 2 + 72, 20, 20, ">");
this.buttonList.add(this.previousPage);
this.buttonList.add(this.nextPage);
}
this.buttonList.add(this.previousPage);
this.buttonList.add(this.nextPage);
}
@Override
protected void actionPerformed(GuiButton button) {
if (this.previousPage == button) {
--this.pageNumber;
} else if (this.nextPage == button) {
++this.pageNumber;
}
}
@Override
protected void actionPerformed(GuiButton button) {
if (this.previousPage == button) {
--this.pageNumber;
} else if (this.nextPage == button) {
++this.pageNumber;
}
}
@Override
@SuppressWarnings("unchecked")
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
this.fontRendererObj.drawString("Prev.", 16, 160, 4210752);
this.fontRendererObj.drawString("Next", 218, 160, 4210752);
@Override
@SuppressWarnings("unchecked")
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
this.fontRendererObj.drawString("Prev.", 16, 160, 4210752);
this.fontRendererObj.drawString("Next", 218, 160, 4210752);
this.fontRendererObj.drawString("Book", 32, -5, 4210752);
this.fontRendererObj.drawString("of Lore:", 24, 4, 4210752);
this.fontRendererObj.drawString("Book", 32, -5, 4210752);
this.fontRendererObj.drawString("of Lore:", 24, 4, 4210752);
this.fontRendererObj.drawString("Item :", 75, 0, 4210752);
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()))) {
this.pageNumber = 0;
this.stringToLoad
= I18n.format(AetherLore.getLoreEntryKey(searchedStack));
this.currentItem = searchedStack;
}
if (searchedStack != null) {
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.currentItem = searchedStack;
}
int nameSize = 0;
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;
}
++nameSize;
}
int size = 0;
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++;
}
size++;
}
this.previousPage.enabled = this.pageNumber != 0;
this.nextPage.enabled = size > (15 * (this.pageNumber + 1));
} else {
this.pageNumber = 0;
this.stringToLoad = "";
this.currentItem = null;
}
}
this.previousPage.enabled = this.pageNumber != 0;
this.nextPage.enabled = size > (15 * (this.pageNumber + 1));
} else {
this.pageNumber = 0;
this.stringToLoad = "";
this.currentItem = null;
}
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i1, int i2) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i1, int i2) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int j = (this.width - this.xSize) / 2;
int k = (this.height - this.ySize) / 2;
int j = (this.width - this.xSize) / 2;
int k = (this.height - this.ySize) / 2;
this.mc.renderEngine.bindTexture(TEXTURE_LORE);
Gui.func_152125_a(j, k - 4, 0, 0, 120, 120, this.xSize, this.ySize + 61, 120, 120);
this.mc.renderEngine.bindTexture(TEXTURE_LORE_BOOK);
Gui.func_146110_a(j - 1, k - 20, 0, 0, this.xSize + 20, this.ySize - 60, 275, 315);
Gui.func_146110_a(j + 90, k - 5, 0, 225, this.xSize + 20, this.ySize - 177, 500, 500);
}
this.mc.renderEngine.bindTexture(TEXTURE_LORE);
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
);
}
}

View File

@ -1,61 +1,63 @@
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;
private World world;
public GuiSunAltar() {}
public GuiSunAltar() {
@SuppressWarnings("unchecked")
@Override
public void initGui() {
super.initGui();
}
this.world = this.mc.theWorld;
@SuppressWarnings("unchecked")
@Override
public void initGui() {
super.initGui();
this.buttonList.add(new GuiSunAltarSlider(
this.world, this.width / 2 - 75, this.height / 2, "Select Time"
));
}
this.world = this.mc.theWorld;
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.drawDefaultBackground();
this.mc.renderEngine.bindTexture(TEXTURE);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.buttonList.add(new GuiSunAltarSlider(this.world, this.width / 2 - 75, this.height / 2, "Select Time"));
}
int xSize = 175;
int ySize = 78;
int j = (this.width - xSize) / 2;
int k = (this.height - ySize) / 2;
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.drawDefaultBackground();
this.mc.renderEngine.bindTexture(TEXTURE);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
this.fontRendererObj.drawString(
"Sun Altar",
(this.width - this.fontRendererObj.getStringWidth("Sun Altar")) / 2,
k + 20,
0x404040
);
int xSize = 175;
int ySize = 78;
int j = (this.width - xSize) / 2;
int k = (this.height - ySize) / 2;
super.drawScreen(mouseX, mouseY, partialTicks);
}
this.drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
this.fontRendererObj.drawString("Sun Altar", (this.width - this.fontRendererObj.getStringWidth("Sun Altar")) / 2, k + 20, 0x404040);
@Override
public boolean doesGuiPauseGame() {
return false;
}
super.drawScreen(mouseX, mouseY, partialTicks);
}
@Override
public boolean doesGuiPauseGame() {
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())
{
this.mc.thePlayer.closeScreen();
}
}
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,62 +1,65 @@
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 final int inventoryRows;
private String chestType;
private String chestType;
public GuiTreasureChest(InventoryPlayer playerInventory, TileEntityTreasureChest chestInventory) {
super(new ContainerChest(playerInventory, chestInventory));
public GuiTreasureChest(
InventoryPlayer playerInventory, TileEntityTreasureChest chestInventory
) {
super(new ContainerChest(playerInventory, chestInventory));
this.allowUserInput = false;
this.allowUserInput = false;
this.inventoryRows = chestInventory.getSizeInventory() / 9;
this.inventoryRows = chestInventory.getSizeInventory() / 9;
this.ySize = 114 + this.inventoryRows * 18;
this.ySize = 114 + this.inventoryRows * 18;
if (chestInventory.getKind() == 0) {
this.chestType = I18n.format("gui.treasure_chest.bronze");
} else if (chestInventory.getKind() == 1) {
this.chestType = I18n.format("gui.treasure_chest.silver");
} else if (chestInventory.getKind() == 2) {
this.chestType = I18n.format("gui.treasure_chest.gold");
} else {
this.chestType = I18n.format("gui.treasure_chest.platinum");
}
}
if (chestInventory.getKind() == 0) {
this.chestType = I18n.format("gui.treasure_chest.bronze");
} else if (chestInventory.getKind() == 1) {
this.chestType = I18n.format("gui.treasure_chest.silver");
} else if (chestInventory.getKind() == 2) {
this.chestType = I18n.format("gui.treasure_chest.gold");
} else {
this.chestType = I18n.format("gui.treasure_chest.platinum");
}
}
/**
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
this.fontRendererObj.drawString(this.chestType, 8, 6, 4210752);
}
/**
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
this.fontRendererObj.drawString(this.chestType, 8, 6, 4210752);
}
/**
* Draws the background layer of this container (behind the items).
*/
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
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);
}
/**
* Draws the background layer of this container (behind the items).
*/
protected void
drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
this.drawTexturedModalRect(
i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96
);
}
}

View File

@ -4,41 +4,44 @@ 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, "");
}
public GuiAccessoryButton(int x, int y) {
super(18067, x, y, 12, 12, "");
}
public GuiAccessoryButton setPosition(int x, int y) {
this.xPosition = x;
this.yPosition = y;
public GuiAccessoryButton setPosition(int x, int y) {
this.xPosition = x;
this.yPosition = y;
return this;
}
return this;
}
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
&& mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height;
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
if (this.visible) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPushMatrix();
int i = this.getHoverState(this.field_146123_n);
mc.getTextureManager().bindTexture(
i == 2 ? BUTTON_HOVERED_TEXTURE : BUTTON_TEXTURE
);
GL11.glEnable(GL11.GL_BLEND);
if (this.visible) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPushMatrix();
int i = this.getHoverState(this.field_146123_n);
mc.getTextureManager().bindTexture(i == 2 ? BUTTON_HOVERED_TEXTURE : BUTTON_TEXTURE);
GL11.glEnable(GL11.GL_BLEND);
func_146110_a(this.xPosition - 1, this.yPosition, 0, 0, 14, 14, 14, 14);
GL11.glPopMatrix();
}
}
func_146110_a(this.xPosition - 1, this.yPosition, 0, 0, 14, 14, 14, 14);
GL11.glPopMatrix();
}
}
}

View File

@ -1,108 +1,138 @@
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;
public int scrollMax = 100;
public int scrollHeight = this.scrollMax;
public int scrollHeight = this.scrollMax;
public int scrollMin = 115;
public int scrollMin = 115;
public int scrollCrop = 20;
public int scrollCrop = 20;
public int scrollCropMax = 90;
public int scrollCropMax = 90;
public boolean retracting = false;
public boolean retracting = false;
public GuiAetherButton(int i, int j, int k, String s) {
super(i, j, k, s);
}
public GuiAetherButton(int i, int j, int k, String s) {
super(i, j, k, s);
}
@Override
public int getHoverState(boolean flag) {
byte byte0 = 1;
@Override
public int getHoverState(boolean flag) {
byte byte0 = 1;
if (!this.enabled) {
byte0 = 0;
} else if (flag) {
if (byte0 < 2) {
byte0++;
}
if (this.scrollCrop < this.scrollCropMax) {
this.scrollCrop += 4;
}
if (this.scrollHeight < this.scrollMin) {
this.scrollHeight += 4;
}
} else {
if (this.scrollCrop > this.scrollCropMax) {
this.scrollCrop -= 4;
}
if (this.scrollHeight > this.scrollMax) {
this.scrollHeight -= 4;
}
if (this.scrollHeight == this.scrollMax) {
this.retracting = false;
}
}
if (!this.enabled) {
byte0 = 0;
} else if (flag) {
if (byte0 < 2) {
byte0++;
}
if (this.scrollCrop < this.scrollCropMax) {
this.scrollCrop += 4;
}
if (this.scrollHeight < this.scrollMin) {
this.scrollHeight += 4;
}
} else {
if (this.scrollCrop > this.scrollCropMax) {
this.scrollCrop -= 4;
}
if (this.scrollHeight > this.scrollMax) {
this.scrollHeight -= 4;
}
if (this.scrollHeight == this.scrollMax) {
this.retracting = false;
}
}
return byte0;
}
return byte0;
}
@Override
public void drawButton(Minecraft minecraft, int i, int j) {
if (!this.visible) {
return;
}
@Override
public void drawButton(Minecraft minecraft, int i, int j) {
if (!this.visible) {
return;
}
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
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;
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.mouseDragged(minecraft, i, j);
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;
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.mouseDragged(minecraft, i, j);
GL11.glDisable(GL11.GL_BLEND);
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
);
} else if (flag) {
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
);
}
}
if (!this.enabled) {
this.drawString(fontrenderer, this.displayString, this.xPosition + this.width / 10 + this.scrollHeight - 80, this.yPosition + (this.height - 8) / 2, -6250336);
} else if (flag) {
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);
}
}
@Override
protected void mouseDragged(Minecraft var1, int var2, int var3) {}
@Override
protected void mouseDragged(Minecraft var1, int var2, int var3) {
}
@Override
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;
}
@Override
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;
}
}

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, "?");
}
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,28 +5,52 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
public class GuiDescButton extends GuiButton {
public String descText;
public String descText;
public GuiDescButton(
int buttonId,
int x,
int y,
int widthIn,
int heightIn,
String buttonText,
String descText
) {
super(buttonId, x, y, widthIn, heightIn, buttonText);
this.descText = descText;
}
public GuiDescButton(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText, String descText) {
super(buttonId, x, y, widthIn, heightIn, buttonText);
this.descText = descText;
}
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
super.drawButton(mc, mouseX, mouseY);
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
super.drawButton(mc, mouseX, mouseY);
FontRenderer fontrenderer = mc.fontRenderer;
if (this.visible && this.field_146123_n) {
if (this.displayString == "Q") {
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + (this.width + 50) / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
} else if (this.displayString == "W") {
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + (this.width - 50) / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
} else {
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + this.width / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
}
}
}
FontRenderer fontrenderer = mc.fontRenderer;
if (this.visible && this.field_146123_n) {
if (this.displayString == "Q") {
this.drawCenteredString(
fontrenderer,
this.descText,
this.xPosition + (this.width + 50) / 2,
this.yPosition + (this.height + 24) / 2,
0xfffffF
);
} else if (this.displayString == "W") {
this.drawCenteredString(
fontrenderer,
this.descText,
this.xPosition + (this.width - 50) / 2,
this.yPosition + (this.height + 24) / 2,
0xfffffF
);
} else {
this.drawCenteredString(
fontrenderer,
this.descText,
this.xPosition + this.width / 2,
this.yPosition + (this.height + 24) / 2,
0xfffffF
);
}
}
}
}

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,43 +6,67 @@ 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
) {
super(buttonId, x, y, widthIn, heightIn, buttonText);
}
public GuiLoreButton(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText) {
super(buttonId, x, y, widthIn, heightIn, buttonText);
}
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if (this.visible) {
FontRenderer fontrenderer = mc.fontRenderer;
mc.getTextureManager().bindTexture(BUTTON_TEXTURES);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
&& mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height;
int i = this.getHoverState(this.field_146123_n);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(
GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO
);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.drawTexturedModalRect(
this.xPosition,
this.yPosition,
0,
46 + i * 20,
this.width / 2,
this.height
);
this.drawTexturedModalRect(
this.xPosition + this.width / 2,
this.yPosition,
200 - this.width / 2,
46 + i * 20,
this.width / 2,
this.height
);
this.mouseDragged(mc, mouseX, mouseY);
int j = 14737632;
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if (this.visible) {
FontRenderer fontrenderer = mc.fontRenderer;
mc.getTextureManager().bindTexture(BUTTON_TEXTURES);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
int i = this.getHoverState(this.field_146123_n);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height);
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
this.mouseDragged(mc, mouseX, mouseY);
int j = 14737632;
if (this.packedFGColour != 0) {
j = this.packedFGColour;
} else if (!this.enabled) {
j = 10526880;
} else if (this.field_146123_n) {
j = 16777120;
}
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, j);
}
}
if (this.packedFGColour != 0) {
j = this.packedFGColour;
} else if (!this.enabled) {
j = 10526880;
} else if (this.field_146123_n) {
j = 16777120;
}
this.drawCenteredString(
fontrenderer,
this.displayString,
this.xPosition + this.width / 2,
this.yPosition + (this.height - 8) / 2,
j
);
}
}
}

View File

@ -1,96 +1,110 @@
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 float sliderValue;
public boolean dragging = false;
public boolean dragging = false;
private World world;
private World world;
public GuiSunAltarSlider(World world, int par2, int par3, String par5Str) {
super(1, par2, par3, 150, 20, par5Str);
public GuiSunAltarSlider(World world, int par2, int par3, String par5Str) {
super(1, par2, par3, 150, 20, par5Str);
this.world = world;
}
this.world = world;
}
/**
* Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this
* button and 2 if it IS hovering over this button.
*/
public int getHoverState(boolean par1) {
return 0;
}
/**
* Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over
* this button.
*/
public int getHoverState(boolean par1) {
return 0;
}
@Override
protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) {
if (this.visible) {
if (this.dragging) {
this.sliderValue
= (float) (mouseX - (this.xPosition + 4)) / (float) (this.width - 8);
@Override
protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) {
if (this.visible) {
if (this.dragging) {
this.sliderValue = (float) (mouseX - (this.xPosition + 4)) / (float) (this.width - 8);
long shouldTime = (long) (24000L * sliderValue);
long worldTime = world.getWorldInfo().getWorldTime();
long remainder = worldTime % 24000L;
long add = shouldTime > remainder ? shouldTime - remainder
: shouldTime + 24000 - remainder;
long shouldTime = (long) (24000L * sliderValue);
long worldTime = world.getWorldInfo().getWorldTime();
long remainder = worldTime % 24000L;
long add = shouldTime > remainder ? shouldTime - remainder : shouldTime + 24000 - remainder;
world.getWorldInfo().setWorldTime(worldTime + add);
if (this.sliderValue < 0.0F) {
this.sliderValue = 0.0F;
}
world.getWorldInfo().setWorldTime(worldTime + add);
if (this.sliderValue < 0.0F) {
this.sliderValue = 0.0F;
}
if (this.sliderValue > 1.0F) {
this.sliderValue = 1.0F;
}
}
if (this.sliderValue > 1.0F) {
this.sliderValue = 1.0F;
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.drawTexturedModalRect(
this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)),
this.yPosition,
0,
66,
4,
20
);
this.drawTexturedModalRect(
this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)) + 4,
this.yPosition,
196,
66,
4,
20
);
}
}
}
@Override
public void drawButton(Minecraft par1Minecraft, int mouseX, int mouseY) {
this.sliderValue = (this.world.getWorldInfo().getWorldTime() % 24000) / 24000.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);
}
}
super.drawButton(par1Minecraft, mouseX, mouseY);
}
@Override
public void drawButton(Minecraft par1Minecraft, int mouseX, int mouseY) {
this.sliderValue = (this.world.getWorldInfo().getWorldTime() % 24000) / 24000.0F;
@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);
super.drawButton(par1Minecraft, mouseX, mouseY);
}
if (this.sliderValue < 0.0F) {
this.sliderValue = 0.0F;
}
@Override
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) {
if (super.mousePressed(par1Minecraft, par2, par3)) {
this.sliderValue = (float) (par2 - (this.xPosition + 4)) / (float) (this.width - 8);
if (this.sliderValue > 1.0F) {
this.sliderValue = 1.0F;
}
if (this.sliderValue < 0.0F) {
this.sliderValue = 0.0F;
}
this.dragging = true;
return true;
} else {
return false;
}
}
if (this.sliderValue > 1.0F) {
this.sliderValue = 1.0F;
}
this.dragging = true;
return true;
} else {
return false;
}
}
@Override
public void mouseReleased(int mouseX, int mouseY) {
this.dragging = false;
AetherNetwork.sendToServer(new PacketSetTime(this.sliderValue, Minecraft.getMinecraft().thePlayer.dimension));
}
@Override
public void mouseReleased(int mouseX, int mouseY) {
this.dragging = false;
AetherNetwork.sendToServer(new PacketSetTime(
this.sliderValue, Minecraft.getMinecraft().thePlayer.dimension
));
}
}

View File

@ -8,67 +8,84 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
public class DialogueOption extends Gui {
private int dialogueId;
private int dialogueId;
private String dialogueText;
private String dialogueText;
private int xPosition, yPosition;
private int xPosition, yPosition;
private int height, width;
private int height, width;
private Minecraft mc = Minecraft.getMinecraft();
private Minecraft mc = Minecraft.getMinecraft();
public DialogueOption(String dialogueText) {
this.dialogueText = "[" + dialogueText + "]";
this.height = 12;
this.width = this.mc.fontRenderer.getStringWidth(this.dialogueText) + 2;
}
public DialogueOption(String dialogueText) {
this.dialogueText = "[" + dialogueText + "]";
this.height = 12;
this.width = this.mc.fontRenderer.getStringWidth(this.dialogueText) + 2;
}
public void renderDialogue(int mouseX, int mouseY) {
this.drawGradientRect(
this.xPosition,
this.yPosition,
this.xPosition + this.width,
this.yPosition + this.height,
0x66000000,
0x66000000
);
this.drawString(
this.mc.fontRenderer,
this.isMouseOver(mouseX, mouseY)
? EnumChatFormatting.YELLOW.toString() + this.getDialogueText()
: this.getDialogueText(),
this.xPosition + 2,
this.yPosition + 2,
0xffffff
);
}
public void renderDialogue(int mouseX, int mouseY) {
this.drawGradientRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 0x66000000, 0x66000000);
this.drawString(this.mc.fontRenderer, this.isMouseOver(mouseX, mouseY) ? EnumChatFormatting.YELLOW.toString() + this.getDialogueText() : this.getDialogueText(), this.xPosition + 2, this.yPosition + 2, 0xffffff);
}
public boolean isMouseOver(int mouseX, int mouseY) {
return mouseX >= this.xPosition && mouseY >= this.yPosition
&& mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height;
}
public boolean isMouseOver(int mouseX, int mouseY) {
return mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
}
public void playPressSound(SoundHandler soundHandlerIn) {
soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(
new ResourceLocation("gui.button.press"), 1.0F
));
}
public void playPressSound(SoundHandler soundHandlerIn) {
soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
}
public void setDialogueText(String dialogueText) {
this.dialogueText = "[" + dialogueText + "]";
this.width = this.mc.fontRenderer.getStringWidth(this.dialogueText) + 2;
}
public void setDialogueText(String dialogueText) {
this.dialogueText = "[" + dialogueText + "]";
this.width = this.mc.fontRenderer.getStringWidth(this.dialogueText) + 2;
}
public void setXPosition(int xPosition) {
this.xPosition = xPosition;
}
public void setXPosition(int xPosition) {
this.xPosition = xPosition;
}
public void setYPosition(int yPosition) {
this.yPosition = yPosition;
}
public void setYPosition(int yPosition) {
this.yPosition = yPosition;
}
public void setDialogueId(int id) {
this.dialogueId = id;
}
public void setDialogueId(int id) {
this.dialogueId = id;
}
public int getDialogueId() {
return this.dialogueId;
}
public int getDialogueId() {
return this.dialogueId;
}
public int getHeight() {
return this.height;
}
public int getHeight() {
return this.height;
}
public int getWidth() {
return this.width;
}
public String getDialogueText() {
return this.dialogueText;
}
public int getWidth() {
return this.width;
}
public String getDialogueText() {
return this.dialogueText;
}
}

View File

@ -9,114 +9,132 @@ import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ChatComponentText;
public class GuiDialogue extends GuiScreen {
private ArrayList<DialogueOption> dialogueOptions = new ArrayList<DialogueOption>();
private ArrayList<DialogueOption> dialogueOptions = new ArrayList<DialogueOption>();
private String dialogue;
private String dialogue;
public GuiDialogue(String dialogue) {
this.dialogue = dialogue;
}
public GuiDialogue(String dialogue) {
this.dialogue = dialogue;
}
public GuiDialogue(String dialogue, DialogueOption... options) {
this(dialogue);
public GuiDialogue(String dialogue, DialogueOption... options) {
this(dialogue);
this.addDialogueOptions(options);
}
this.addDialogueOptions(options);
}
public void addDialogueWithOptions(String dialogue, DialogueOption... options) {
this.dialogue = dialogue;
public void addDialogueWithOptions(String dialogue, DialogueOption... options) {
this.dialogue = dialogue;
this.dialogueOptions.clear();
this.dialogueOptions.clear();
this.addDialogueOptions(options);
this.positionDialogueOptions(this.getDialogueOptions());
}
this.addDialogueOptions(options);
this.positionDialogueOptions(this.getDialogueOptions());
}
public void initGui() {
this.positionDialogueOptions(this.getDialogueOptions());
}
public void initGui() {
this.positionDialogueOptions(this.getDialogueOptions());
}
private void positionDialogueOptions(ArrayList<DialogueOption> options) {
int lineNumber = 0;
private void positionDialogueOptions(ArrayList<DialogueOption> options) {
int lineNumber = 0;
for (DialogueOption option : options) {
option.setDialogueId(lineNumber);
option.setXPosition((this.width / 2) - (option.getWidth() / 2));
option.setYPosition(
(this.height / 2)
+ this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300)
.size()
* 12
+ 12 * lineNumber
);
for (DialogueOption option : options) {
option.setDialogueId(lineNumber);
option.setXPosition((this.width / 2) - (option.getWidth() / 2));
option.setYPosition((this.height / 2) + this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300).size() * 12 + 12 * lineNumber);
lineNumber++;
}
}
lineNumber++;
}
}
public void addDialogueOptions(DialogueOption... options) {
for (DialogueOption option : options) {
this.dialogueOptions.add(option);
}
}
public void addDialogueOptions(DialogueOption... options) {
for (DialogueOption option : options) {
this.dialogueOptions.add(option);
}
}
public void addDialogueMessage(String dialogueMessage) {
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(
new ChatComponentText(dialogueMessage)
);
}
public void addDialogueMessage(String dialogueMessage) {
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(dialogueMessage));
}
public void dialogueTreeCompleted() {
this.mc.displayGuiScreen(null);
}
public void dialogueTreeCompleted() {
this.mc.displayGuiScreen(null);
}
@Override
public boolean doesGuiPauseGame() {
return false;
}
@Override
public boolean doesGuiPauseGame() {
return false;
}
@Override
@SuppressWarnings("unchecked")
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
@Override
@SuppressWarnings("unchecked")
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
int optionWidth = 0;
int optionWidth = 0;
for (String theDialogue : ((List<String>) this.fontRendererObj
.listFormattedStringToWidth(this.dialogue, 300))) {
int stringWidth = this.fontRendererObj.getStringWidth(theDialogue);
for (String theDialogue : ((List<String>) this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300))) {
int stringWidth = this.fontRendererObj.getStringWidth(theDialogue);
this.drawGradientRect(
this.width / 2 - stringWidth / 2 - 2,
this.height / 2 + optionWidth * 12 - 2,
this.width / 2 + stringWidth / 2 + 2,
this.height / 2 + optionWidth * 10 + 10,
0x66000000,
0x66000000
);
this.drawString(
this.fontRendererObj,
theDialogue,
this.width / 2 - stringWidth / 2,
this.height / 2 + optionWidth * 10,
0xffffff
);
++optionWidth;
}
this.drawGradientRect(this.width / 2 - stringWidth / 2 - 2, this.height / 2 + optionWidth * 12 - 2, this.width / 2 + stringWidth / 2 + 2, this.height / 2 + optionWidth * 10 + 10, 0x66000000, 0x66000000);
this.drawString(this.fontRendererObj, theDialogue, this.width / 2 - stringWidth / 2, this.height / 2 + optionWidth * 10, 0xffffff);
++optionWidth;
}
for (DialogueOption dialogue : this.dialogueOptions) {
dialogue.renderDialogue(mouseX, mouseY);
}
}
for (DialogueOption dialogue : this.dialogueOptions) {
dialogue.renderDialogue(mouseX, mouseY);
}
}
@Override
public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
if (mouseButton == 0) {
for (DialogueOption dialogue : this.dialogueOptions) {
if (dialogue.isMouseOver(mouseX, mouseY)) {
dialogue.playPressSound(this.mc.getSoundHandler());
@Override
public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
if (mouseButton == 0) {
for (DialogueOption dialogue : this.dialogueOptions) {
if (dialogue.isMouseOver(mouseX, mouseY)) {
dialogue.playPressSound(this.mc.getSoundHandler());
try {
this.dialogueClicked(dialogue);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
try {
this.dialogueClicked(dialogue);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
super.mouseClicked(mouseX, mouseY, mouseButton);
}
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;
}
public String getDialogue() {
return this.dialogue;
}
public ArrayList<DialogueOption> getDialogueOptions() {
return this.dialogueOptions;
}
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,107 +3,118 @@ 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;
private PlayerAether playerAether;
public GuiAccessories(PlayerAether player) {
super(new ContainerAccessories(player.getAccessoryInventory(), player.getEntity())
);
public GuiAccessories(PlayerAether player) {
super(new ContainerAccessories(player.getAccessoryInventory(), player.getEntity()));
this.playerAether = player;
this.allowUserInput = true;
}
this.playerAether = player;
this.allowUserInput = true;
}
@Override
@SuppressWarnings("unchecked")
public void initGui() {
super.initGui();
@Override
@SuppressWarnings("unchecked")
public void initGui() {
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));
}
*/
//this.buttonList.add(new GuiAccessoryButton(this.guiLeft + 8, this.guiTop + 65));
}
//this.buttonList.add(new GuiAccessoryButton(this.guiLeft + 8, this.guiTop + 65));
}
@Override
public void setWorldAndResolution(Minecraft mc, int width, int height) {
super.setWorldAndResolution(mc, width, height);
@Override
public void setWorldAndResolution(Minecraft mc, int width, int height) {
super.setWorldAndResolution(mc, width, height);
for (int size = 0; size < this.buttonList.size(); ++size) {
GuiButton button = (GuiButton) this.buttonList.get(size);
int id = button.id;
for (int size = 0; size < this.buttonList.size(); ++size) {
GuiButton button = (GuiButton) this.buttonList.get(size);
int id = button.id;
if (id == 13211) {
this.setButtonPosition(button, this.width / 2 + 65, this.height / 2 - 23);
}
}
}
if (id == 13211) {
this.setButtonPosition(button, this.width / 2 + 65, this.height / 2 - 23);
}
}
}
private void setButtonPosition(GuiButton button, int xPosition, int yPosition) {
button.xPosition = xPosition;
button.yPosition = yPosition;
}
private void setButtonPosition(GuiButton button, int xPosition, int yPosition) {
button.xPosition = xPosition;
button.yPosition = yPosition;
}
@Override
protected void actionPerformed(GuiButton button) {
if (button.id == 24) {
this.mc.displayGuiScreen(new GuiAetherPerks());
}
@Override
protected void actionPerformed(GuiButton button) {
if (button.id == 24) {
this.mc.displayGuiScreen(new GuiAetherPerks());
}
if (button.id == 18067) {
this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer));
AetherNetwork.sendToServer(new PacketOpenContainer(-1));
}
}
if (button.id == 18067) {
this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer));
AetherNetwork.sendToServer(new PacketOpenContainer(-1));
}
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
this.fontRendererObj.drawString(
I18n.format("container.crafting", new Object[0]), 115, 8, 4210752
);
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 115, 8, 4210752);
}
@Override
protected void
drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
;
GL11.glColor3d(1.0D, 1.0D, 1.0D);
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
;
GL11.glColor3d(1.0D, 1.0D, 1.0D);
this.mc.renderEngine.bindTexture(ACCESSORIES);
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() {
super.handleKeyboardInput();
@Override
public void handleKeyboardInput()
{
super.handleKeyboardInput();
int keyPressed = Keyboard.getEventKey();
int keyPressed = Keyboard.getEventKey();
if (keyPressed == AetherKeybinds.keyBindingAccessories.getKeyCode() && Keyboard.getEventKeyState())
{
Minecraft.getMinecraft().thePlayer.closeScreen();
}
}
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,245 +8,356 @@ 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 boolean enableMoaEditor, enableHaloEditor;
private PlayerAether player;
private PlayerAether player;
private EntityMoa moa;
private EntityMoa moa;
public GuiButton perkMoa, perkHalo;
public GuiButton perkMoa, perkHalo;
private GuiButton defualtSkin, enableHalo, confirmPreference;
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();
private DonatorMoaSkin moaSkin = new DonatorMoaSkin();
protected int guiLeft;
protected int guiLeft;
protected int guiTop;
protected int guiTop;
public GuiAetherPerks() {
super();
public GuiAetherPerks() {
super();
this.mc = Minecraft.getMinecraft();
this.player = PlayerAether.get(this.mc.thePlayer);
this.moaSkin = this.player.donatorMoaSkin;
this.mc = Minecraft.getMinecraft();
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
public void updateScreen() {
this.moaWingMarking.updateCursorCounter();
this.moaWing.updateCursorCounter();
this.moaBody.updateCursorCounter();
this.moaBodyMarking.updateCursorCounter();
this.moaEye.updateCursorCounter();
this.moaOutside.updateCursorCounter();
@Override
public void updateScreen() {
this.moaWingMarking.updateCursorCounter();
this.moaWing.updateCursorCounter();
this.moaBody.updateCursorCounter();
this.moaBodyMarking.updateCursorCounter();
this.moaEye.updateCursorCounter();
this.moaOutside.updateCursorCounter();
if (!this.moaWingMarking.getText().isEmpty()) {
this.moaSkin.setWingMarkingColor(
Integer.decode("0x" + this.moaWingMarking.getText())
);
}
if (!this.moaWingMarking.getText().isEmpty()) {
this.moaSkin.setWingMarkingColor(Integer.decode("0x" + this.moaWingMarking.getText()));
}
if (!this.moaWing.getText().isEmpty()) {
this.moaSkin.setWingColor(Integer.decode("0x" + this.moaWing.getText()));
}
if (!this.moaWing.getText().isEmpty()) {
this.moaSkin.setWingColor(Integer.decode("0x" + this.moaWing.getText()));
}
if (!this.moaBody.getText().isEmpty()) {
this.moaSkin.setBodyColor(Integer.decode("0x" + this.moaBody.getText()));
}
if (!this.moaBody.getText().isEmpty()) {
this.moaSkin.setBodyColor(Integer.decode("0x" + this.moaBody.getText()));
}
if (!this.moaBodyMarking.getText().isEmpty()) {
this.moaSkin.setMarkingColor(
Integer.decode("0x" + this.moaBodyMarking.getText())
);
}
if (!this.moaBodyMarking.getText().isEmpty()) {
this.moaSkin.setMarkingColor(Integer.decode("0x" + this.moaBodyMarking.getText()));
}
if (!this.moaEye.getText().isEmpty()) {
this.moaSkin.setEyeColor(Integer.decode("0x" + this.moaEye.getText()));
}
if (!this.moaEye.getText().isEmpty()) {
this.moaSkin.setEyeColor(Integer.decode("0x" + this.moaEye.getText()));
}
if (!this.moaOutside.getText().isEmpty()) {
this.moaSkin.setOutsideColor(Integer.decode("0x" + this.moaOutside.getText())
);
}
if (!this.moaOutside.getText().isEmpty()) {
this.moaSkin.setOutsideColor(Integer.decode("0x" + this.moaOutside.getText()));
}
this.moaSkin.shouldUseDefualt(this.defualtSkin.displayString.contains("true"));
this.moaSkin.shouldUseDefualt(this.defualtSkin.displayString.contains("true"));
if (!this.enableHaloEditor) {
this.enableHalo.visible = false;
}
if (!this.enableHaloEditor) {
this.enableHalo.visible = false;
}
if (!this.enableMoaEditor) {
this.defualtSkin.visible = false;
this.confirmPreference.visible = false;
}
}
if (!this.enableMoaEditor) {
this.defualtSkin.visible = false;
this.confirmPreference.visible = false;
}
}
@Override
@SuppressWarnings("unchecked")
public void initGui() {
Keyboard.enableRepeatEvents(true);
@Override
@SuppressWarnings("unchecked")
public void initGui() {
Keyboard.enableRepeatEvents(true);
this.guiLeft = (this.width - 176) / 2;
this.guiTop = (this.height - 166) / 2;
this.guiLeft = (this.width - 176) / 2;
this.guiTop = (this.height - 166) / 2;
this.buttonList.add(
this.perkMoa = new GuiButton(1, 4, 17, 100, 20, "Moa Customizer")
);
this.buttonList.add(
this.perkHalo = new GuiButton(5, 110, 17, 100, 20, "Developer Perks")
);
this.buttonList.add(this.perkMoa = new GuiButton(1, 4, 17, 100, 20, "Moa Customizer"));
this.buttonList.add(this.perkHalo = new GuiButton(5, 110, 17, 100, 20, "Developer Perks"));
this.buttonList.add(
this.enableHalo = new GuiButton(
6, this.width / 2 - 50, this.height - 20, 100, 20, "Enable Halo: "
)
);
this.buttonList.add(
this.defualtSkin = new GuiButton(
2,
this.width / 2 - 100,
this.height - 20,
100,
20,
"Default skin: " + this.player.donatorMoaSkin.shouldUseDefualt()
)
);
this.buttonList.add(
this.confirmPreference
= new GuiButton(4, this.width / 2, this.height - 20, 100, 20, "Confirm Skin")
);
this.buttonList.add(this.enableHalo = new GuiButton(6, this.width / 2 - 50, this.height - 20, 100, 20, "Enable Halo: "));
this.buttonList.add(this.defualtSkin = new GuiButton(2, this.width / 2 - 100, this.height - 20, 100, 20, "Default skin: " + this.player.donatorMoaSkin.shouldUseDefualt()));
this.buttonList.add(this.confirmPreference = new GuiButton(4, this.width / 2, this.height - 20, 100, 20, "Confirm Skin"));
if (!AetherRankings.isRankedPlayer(this.player.getEntity().getUniqueID())) {
this.perkHalo.visible = false;
}
if (!AetherRankings.isRankedPlayer(this.player.getEntity().getUniqueID())) {
this.perkHalo.visible = false;
}
this.enableHalo.displayString = this.enableHalo.displayString
+ Boolean.toString(this.player.shouldRenderHalo ? false : true);
this.enableHalo.displayString = this.enableHalo.displayString + Boolean.toString(this.player.shouldRenderHalo ? false : true);
this.moaEye
= new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, 70, 45, 20);
this.moaEye.setMaxStringLength(6);
this.moaEye.setText(Integer.toHexString(this.player.donatorMoaSkin.getEyeColor())
);
this.moaEye = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, 70, 45, 20);
this.moaEye.setMaxStringLength(6);
this.moaEye.setText(Integer.toHexString(this.player.donatorMoaSkin.getEyeColor()));
this.moaWingMarking = new GuiTextField(
this.fontRendererObj, (this.width / 2) + 105, this.height - 40, 45, 20
);
this.moaWingMarking.setMaxStringLength(6);
this.moaWingMarking.setText(
Integer.toHexString(this.player.donatorMoaSkin.getWingMarkingColor())
);
this.moaWingMarking = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, this.height - 40, 45, 20);
this.moaWingMarking.setMaxStringLength(6);
this.moaWingMarking.setText(Integer.toHexString(this.player.donatorMoaSkin.getWingMarkingColor()));
this.moaWing = new GuiTextField(
this.fontRendererObj, (this.width / 2) + 105, this.height / 2 + 15, 45, 20
);
this.moaWing.setMaxStringLength(6);
this.moaWing.setText(Integer.toHexString(this.player.donatorMoaSkin.getWingColor()
));
this.moaWing = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, this.height / 2 + 15, 45, 20);
this.moaWing.setMaxStringLength(6);
this.moaWing.setText(Integer.toHexString(this.player.donatorMoaSkin.getWingColor()));
this.moaBody = new GuiTextField(
this.fontRendererObj, (this.width / 2) - 155, this.height / 2 + 15, 45, 20
);
this.moaBody.setMaxStringLength(6);
this.moaBody.setText(Integer.toHexString(this.player.donatorMoaSkin.getBodyColor()
));
this.moaBody = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, this.height / 2 + 15, 45, 20);
this.moaBody.setMaxStringLength(6);
this.moaBody.setText(Integer.toHexString(this.player.donatorMoaSkin.getBodyColor()));
this.moaBodyMarking = new GuiTextField(
this.fontRendererObj, (this.width / 2) - 155, this.height - 40, 45, 20
);
this.moaBodyMarking.setMaxStringLength(6);
this.moaBodyMarking.setText(
Integer.toHexString(this.player.donatorMoaSkin.getMarkingColor())
);
this.moaBodyMarking = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, this.height - 40, 45, 20);
this.moaBodyMarking.setMaxStringLength(6);
this.moaBodyMarking.setText(Integer.toHexString(this.player.donatorMoaSkin.getMarkingColor()));
this.moaOutside
= new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, 70, 45, 20);
this.moaOutside.setMaxStringLength(6);
this.moaOutside.setText(
Integer.toHexString(this.player.donatorMoaSkin.getOutsideColor())
);
}
this.moaOutside = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, 70, 45, 20);
this.moaOutside.setMaxStringLength(6);
this.moaOutside.setText(Integer.toHexString(this.player.donatorMoaSkin.getOutsideColor()));
}
@Override
protected void keyTyped(char typedChar, int keyCode) {
super.keyTyped(typedChar, keyCode);
@Override
protected void keyTyped(char typedChar, int keyCode) {
super.keyTyped(typedChar, keyCode);
if (this.enableMoaEditor) {
if (keyCode > 1 && keyCode < 12 || keyCode == 14 || keyCode == 30
|| keyCode == 48 || keyCode == 46 || keyCode == 32 || keyCode == 18
|| keyCode == 33) {
this.moaWingMarking.textboxKeyTyped(typedChar, keyCode);
this.moaWing.textboxKeyTyped(typedChar, keyCode);
this.moaBody.textboxKeyTyped(typedChar, keyCode);
this.moaBodyMarking.textboxKeyTyped(typedChar, keyCode);
this.moaEye.textboxKeyTyped(typedChar, keyCode);
this.moaOutside.textboxKeyTyped(typedChar, keyCode);
}
}
}
if (this.enableMoaEditor) {
if (keyCode > 1 && keyCode < 12 || keyCode == 14 || keyCode == 30 || keyCode == 48 || keyCode == 46 || keyCode == 32 || keyCode == 18 || keyCode == 33) {
this.moaWingMarking.textboxKeyTyped(typedChar, keyCode);
this.moaWing.textboxKeyTyped(typedChar, keyCode);
this.moaBody.textboxKeyTyped(typedChar, keyCode);
this.moaBodyMarking.textboxKeyTyped(typedChar, keyCode);
this.moaEye.textboxKeyTyped(typedChar, keyCode);
this.moaOutside.textboxKeyTyped(typedChar, keyCode);
}
}
}
@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
super.mouseClicked(mouseX, mouseY, mouseButton);
@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
super.mouseClicked(mouseX, mouseY, mouseButton);
if (this.enableMoaEditor) {
this.moaWingMarking.mouseClicked(mouseX, mouseY, mouseButton);
this.moaWing.mouseClicked(mouseX, mouseY, mouseButton);
this.moaBody.mouseClicked(mouseX, mouseY, mouseButton);
this.moaBodyMarking.mouseClicked(mouseX, mouseY, mouseButton);
this.moaEye.mouseClicked(mouseX, mouseY, mouseButton);
this.moaOutside.mouseClicked(mouseX, mouseY, mouseButton);
}
}
if (this.enableMoaEditor) {
this.moaWingMarking.mouseClicked(mouseX, mouseY, mouseButton);
this.moaWing.mouseClicked(mouseX, mouseY, mouseButton);
this.moaBody.mouseClicked(mouseX, mouseY, mouseButton);
this.moaBodyMarking.mouseClicked(mouseX, mouseY, mouseButton);
this.moaEye.mouseClicked(mouseX, mouseY, mouseButton);
this.moaOutside.mouseClicked(mouseX, mouseY, mouseButton);
}
}
@Override
public void onGuiClosed() {
Keyboard.enableRepeatEvents(false);
AetherNetwork.sendToServer(new PacketPerkChanged(
this.player.getEntity().getEntityId(), EnumAetherPerkType.Moa, this.moaSkin
));
}
@Override
public void onGuiClosed() {
Keyboard.enableRepeatEvents(false);
AetherNetwork.sendToServer(new PacketPerkChanged(this.player.getEntity().getEntityId(), EnumAetherPerkType.Moa, this.moaSkin));
}
@Override
protected void actionPerformed(GuiButton button) {
if (button.id == 1) {
boolean shouldEnable = this.enableMoaEditor ? false : true;
@Override
protected void actionPerformed(GuiButton button) {
if (button.id == 1) {
boolean shouldEnable = this.enableMoaEditor ? false : true;
this.enableMoaEditor = shouldEnable;
this.enableHaloEditor = false;
this.enableHalo.visible = false;
this.confirmPreference.visible = true;
this.defualtSkin.visible = true;
} else if (button.id == 2) {
boolean enableDefualt
= this.player.donatorMoaSkin.shouldUseDefualt() ? false : true;
this.enableMoaEditor = shouldEnable;
this.enableHaloEditor = false;
this.enableHalo.visible = false;
this.confirmPreference.visible = true;
this.defualtSkin.visible = true;
} else if (button.id == 2) {
boolean enableDefualt = this.player.donatorMoaSkin.shouldUseDefualt() ? false : true;
this.defualtSkin.displayString
= "Use Default: " + Boolean.toString(enableDefualt);
this.player.donatorMoaSkin.shouldUseDefualt(enableDefualt);
} else if (button.id == 4) {
AetherNetwork.sendToServer(new PacketPerkChanged(
this.player.getEntity().getEntityId(),
EnumAetherPerkType.Moa,
this.moaSkin
));
} else if (button.id == 5) {
boolean shouldEnable = this.enableHaloEditor ? false : true;
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));
} else if (button.id == 5) {
boolean shouldEnable = this.enableHaloEditor ? false : true;
this.enableHaloEditor = shouldEnable;
this.enableMoaEditor = false;
this.enableHalo.visible = true;
} else if (button.id == 6) {
boolean enableHalo = this.player.shouldRenderHalo ? false : true;
this.enableHaloEditor = shouldEnable;
this.enableMoaEditor = false;
this.enableHalo.visible = true;
} else if (button.id == 6) {
boolean enableHalo = this.player.shouldRenderHalo ? false : true;
this.player.shouldRenderHalo = enableHalo;
AetherNetwork.sendToServer(new PacketPerkChanged(
this.player.getEntity().getEntityId(), EnumAetherPerkType.Halo, enableHalo
));
this.enableHalo.displayString
= "Enable Halo: " + Boolean.toString(enableHalo);
}
}
this.player.shouldRenderHalo = enableHalo;
AetherNetwork.sendToServer(new PacketPerkChanged(this.player.getEntity().getEntityId(), EnumAetherPerkType.Halo, enableHalo));
this.enableHalo.displayString = "Enable Halo: " + Boolean.toString(enableHalo);
}
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.drawDefaultBackground();
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.drawDefaultBackground();
this.drawCenteredString(this.fontRendererObj, "Donator Options", 45, 4, 16777215);
this.drawCenteredString(this.fontRendererObj, "Donator Options", 45, 4, 16777215);
if (this.enableMoaEditor) {
GuiInventory.func_147046_a(
this.width / 2,
this.height / 2 + (this.height / 2) - 30,
(this.height / 3) - 20,
(float) (this.guiLeft + 51) - (float) mouseX,
(float) (75 - 50) - (float) mouseY,
this.moa
);
if (this.enableMoaEditor) {
GuiInventory.func_147046_a(this.width / 2, this.height / 2 + (this.height / 2) - 30, (this.height / 3) - 20, (float) (this.guiLeft + 51) - (float) mouseX, (float) (75 - 50) - (float) mouseY, this.moa);
/* Left Side*/
/* Left Side*/
this.drawString(
this.fontRendererObj,
"Leg/Beak Color",
(this.width / 2) - 170,
55,
16777215
);
this.drawString(this.fontRendererObj, "Leg/Beak Color", (this.width / 2) - 170, 55, 16777215);
this.drawString(
this.fontRendererObj,
"Body Color",
(this.width / 2) - 160,
this.height / 2,
16777215
);
this.drawString(this.fontRendererObj, "Body Color", (this.width / 2) - 160, this.height / 2, 16777215);
this.drawString(
this.fontRendererObj,
"Body Marking Color",
(this.width / 2) - 180,
this.height - 55,
16777215
);
this.drawString(this.fontRendererObj, "Body Marking Color", (this.width / 2) - 180, this.height - 55, 16777215);
/* Right Side */
/* Right Side */
this.drawString(
this.fontRendererObj, "Eye Color", (this.width / 2) + 104, 55, 16777215
);
this.drawString(this.fontRendererObj, "Eye Color", (this.width / 2) + 104, 55, 16777215);
this.drawString(
this.fontRendererObj,
"Wing Color",
(this.width / 2) + 102,
this.height / 2,
16777215
);
this.drawString(this.fontRendererObj, "Wing Color", (this.width / 2) + 102, this.height / 2, 16777215);
this.drawString(
this.fontRendererObj,
"Wing Marking Color",
(this.width / 2) + 82,
this.height - 55,
16777215
);
this.drawString(this.fontRendererObj, "Wing Marking Color", (this.width / 2) + 82, this.height - 55, 16777215);
this.moaWingMarking.drawTextBox();
this.moaWing.drawTextBox();
this.moaBody.drawTextBox();
this.moaBodyMarking.drawTextBox();
this.moaEye.drawTextBox();
this.moaOutside.drawTextBox();
}
this.moaWingMarking.drawTextBox();
this.moaWing.drawTextBox();
this.moaBody.drawTextBox();
this.moaBodyMarking.drawTextBox();
this.moaEye.drawTextBox();
this.moaOutside.drawTextBox();
}
if (this.enableHaloEditor) {
GuiInventory.func_147046_a(
this.width / 2,
this.height / 2 + (this.height / 2) - 30,
(this.height / 3) - 20,
(float) (this.guiLeft + 51) - (float) mouseX,
(float) (75 - 50) - (float) mouseY,
this.player.getEntity()
);
}
if (this.enableHaloEditor) {
GuiInventory.func_147046_a(this.width / 2, this.height / 2 + (this.height / 2) - 30, (this.height / 3) - 20, (float) (this.guiLeft + 51) - (float) mouseX, (float) (75 - 50) - (float) mouseY, this.player.getEntity());
}
super.drawScreen(mouseX, mouseY, partialTicks);
}
super.drawScreen(mouseX, mouseY, partialTicks);
}
@Override
public void drawWorldBackground(int tint) {
this.drawGradientRect(0, 0, this.width, 50, -1072689136, -804253680);
if (this.mc.theWorld != null) {
this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680);
} else {
this.drawBackground(tint);
}
}
@Override
public void drawWorldBackground(int tint) {
this.drawGradientRect(0, 0, this.width, 50, -1072689136, -804253680);
if (this.mc.theWorld != null) {
this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680);
} else {
this.drawBackground(tint);
}
}
}

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