Compare commits
2 commits
481846b73e
...
93c83c6453
Author | SHA1 | Date | |
---|---|---|---|
LordMZTE | 93c83c6453 | ||
LordMZTE | 1a3c60f456 |
130
.clang-format
Normal file
130
.clang-format
Normal 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"]
|
|
@ -1,10 +1,8 @@
|
||||||
package com.gildedgames.the_aether;
|
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.blocks.BlocksAether;
|
||||||
import com.gildedgames.the_aether.entities.EntitiesAether;
|
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.items.ItemsAether;
|
||||||
import com.gildedgames.the_aether.network.AetherNetwork;
|
import com.gildedgames.the_aether.network.AetherNetwork;
|
||||||
import com.gildedgames.the_aether.player.PlayerAetherEvents;
|
import com.gildedgames.the_aether.player.PlayerAetherEvents;
|
||||||
|
@ -14,23 +12,25 @@ import com.gildedgames.the_aether.registry.achievements.AchievementsAether;
|
||||||
import com.gildedgames.the_aether.registry.creative_tabs.AetherCreativeTabs;
|
import com.gildedgames.the_aether.registry.creative_tabs.AetherCreativeTabs;
|
||||||
import com.gildedgames.the_aether.tileentity.AetherTileEntities;
|
import com.gildedgames.the_aether.tileentity.AetherTileEntities;
|
||||||
import com.gildedgames.the_aether.world.AetherWorld;
|
import com.gildedgames.the_aether.world.AetherWorld;
|
||||||
|
|
||||||
import cpw.mods.fml.common.Mod;
|
import cpw.mods.fml.common.Mod;
|
||||||
import cpw.mods.fml.common.Mod.EventHandler;
|
import cpw.mods.fml.common.Mod.EventHandler;
|
||||||
import cpw.mods.fml.common.Mod.Instance;
|
import cpw.mods.fml.common.Mod.Instance;
|
||||||
import cpw.mods.fml.common.SidedProxy;
|
import cpw.mods.fml.common.SidedProxy;
|
||||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
@Mod(modid = Aether.MOD_ID, version = "v1.1.2.2")
|
@Mod(modid = Aether.MOD_ID, version = "v1.1.2.2")
|
||||||
public class Aether {
|
public class Aether {
|
||||||
|
|
||||||
public static final String MOD_ID = "aether_legacy";
|
public static final String MOD_ID = "aether_legacy";
|
||||||
|
|
||||||
@Instance(Aether.MOD_ID)
|
@Instance(Aether.MOD_ID)
|
||||||
public static Aether instance;
|
public static Aether instance;
|
||||||
|
|
||||||
@SidedProxy(clientSide = "com.gildedgames.the_aether.client.ClientProxy", serverSide = "com.gildedgames.the_aether.CommonProxy")
|
@SidedProxy(
|
||||||
|
clientSide = "com.gildedgames.the_aether.client.ClientProxy",
|
||||||
|
serverSide = "com.gildedgames.the_aether.CommonProxy"
|
||||||
|
)
|
||||||
public static CommonProxy proxy;
|
public static CommonProxy proxy;
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
|
|
@ -6,7 +6,6 @@ import java.io.IOException;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
import net.minecraftforge.common.config.Configuration;
|
||||||
|
|
||||||
public class AetherConfig {
|
public class AetherConfig {
|
||||||
|
|
||||||
public static Configuration config;
|
public static Configuration config;
|
||||||
|
|
||||||
private static int max_life_shards;
|
private static int max_life_shards;
|
||||||
|
@ -35,71 +34,211 @@ public class AetherConfig {
|
||||||
|
|
||||||
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) {
|
public static void init(File location) {
|
||||||
File newFile = new File(location + "/aether" + "/AetherI.cfg");
|
File newFile = new File(
|
||||||
|
location + "/aether"
|
||||||
|
+ "/AetherI.cfg"
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
newFile.createNewFile();
|
newFile.createNewFile();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
config = new Configuration(newFile);
|
config = new Configuration(newFile);
|
||||||
|
|
||||||
config.load();
|
config.load();
|
||||||
|
|
||||||
christmas_content = config.get("Aether World Generation", "Christmas Content", false).getBoolean(false);
|
christmas_content
|
||||||
seasonal_christmas = config.get("Aether World Generation", "Spawns Holiday Trees during December and January automatically. Christmas Content overrides this.", true).getBoolean(true);
|
= config.get("Aether World Generation", "Christmas Content", false)
|
||||||
tallgrass = config.get("Aether World Generation", "Enable Tall Grass", false).getBoolean(false);
|
.getBoolean(false);
|
||||||
|
seasonal_christmas
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Aether World Generation",
|
||||||
|
"Spawns Holiday Trees during December and January automatically. Christmas Content overrides this.",
|
||||||
|
true
|
||||||
|
)
|
||||||
|
.getBoolean(true);
|
||||||
|
tallgrass = config.get("Aether World Generation", "Enable Tall Grass", false)
|
||||||
|
.getBoolean(false);
|
||||||
|
|
||||||
aether_dimension_id = config.get("World Identification", "Aether Dimension ID", 4).getInt(4);
|
aether_dimension_id
|
||||||
aether_biome_id = config.get("World Identification", "Aether Biome ID", 127).getInt(127);
|
= config.get("World Identification", "Aether Dimension ID", 4).getInt(4);
|
||||||
|
aether_biome_id
|
||||||
|
= config.get("World Identification", "Aether Biome ID", 127).getInt(127);
|
||||||
|
|
||||||
skyrootBucketOnly = config.get("Misc", "Activate portal with only Skyroot bucket", false).getBoolean(false);
|
skyrootBucketOnly
|
||||||
valkyrie_cape = config.get("Misc", "Enables the Valkyrie Cape in dungeon loot", true).getBoolean(true);
|
= config.get("Misc", "Activate portal with only Skyroot bucket", false)
|
||||||
golden_feather = config.get("Misc", "Enables the Golden Feather in dungeon loot", false).getBoolean(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);
|
travel_dimension = config.get("Misc", "Dimension below aether", 0).getInt(0);
|
||||||
floating_block_collision = config.get("Misc", "Floating block collision", true).getBoolean(true);
|
floating_block_collision
|
||||||
|
= config.get("Misc", "Floating block collision", true).getBoolean(true);
|
||||||
|
|
||||||
disable_trivia = config.get("Trivia", "Disable random trivia", false).getBoolean(false);
|
disable_trivia
|
||||||
|
= config.get("Trivia", "Disable random trivia", false).getBoolean(false);
|
||||||
|
|
||||||
old_mobs = config.get("Misc", "Enable Legacy Visuals", false).getBoolean(false);
|
old_mobs = config.get("Misc", "Enable Legacy Visuals", false).getBoolean(false);
|
||||||
|
|
||||||
aether_start = config.get("Gameplay", "Spawns Player with Aether Portal Frame", false).getBoolean(false);
|
aether_start
|
||||||
|
= config.get("Gameplay", "Spawns Player with Aether Portal Frame", false)
|
||||||
|
.getBoolean(false);
|
||||||
|
|
||||||
max_life_shards = config.get("Gameplay", "Max Life Shards", 10).getInt(10);
|
max_life_shards = config.get("Gameplay", "Max Life Shards", 10).getInt(10);
|
||||||
|
|
||||||
menu_enabled = config.get("Misc", "Enables the Aether Menu", false).getBoolean(false);
|
menu_enabled
|
||||||
menu_button = config.get("Misc", "Enables the Aether Menu toggle button", true).getBoolean(true);
|
= config.get("Misc", "Enables the Aether Menu", false).getBoolean(false);
|
||||||
|
menu_button = config.get("Misc", "Enables the Aether Menu toggle button", true)
|
||||||
|
.getBoolean(true);
|
||||||
|
|
||||||
install_resourcepack = config.get("Misc", "Determines whether the Aether b1.7.3 resource pack should be generated.", true).getBoolean(true);
|
install_resourcepack
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Misc",
|
||||||
|
"Determines whether the Aether b1.7.3 resource pack should be generated.",
|
||||||
|
true
|
||||||
|
)
|
||||||
|
.getBoolean(true);
|
||||||
|
|
||||||
legacy_altar_name = config.get("Misc", "Changes whether the Altar should be named Enchanter or not.", false).getBoolean(false);
|
legacy_altar_name
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Misc",
|
||||||
|
"Changes whether the Altar should be named Enchanter or not.",
|
||||||
|
false
|
||||||
|
)
|
||||||
|
.getBoolean(false);
|
||||||
|
|
||||||
inebriation_id = config.get("Misc", "Sets the id for the Inebriation effect.", 31).getInt(31);
|
inebriation_id = config.get("Misc", "Sets the id for the Inebriation effect.", 31)
|
||||||
|
.getInt(31);
|
||||||
|
|
||||||
sun_altar_multiplayer = config.get("Gameplay", "Removes the requirement for a player to be an operator to use the Sun Altar in multiplayer.", false).getBoolean(false);
|
sun_altar_multiplayer
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Gameplay",
|
||||||
|
"Removes the requirement for a player to be an operator to use the Sun Altar in multiplayer.",
|
||||||
|
false
|
||||||
|
)
|
||||||
|
.getBoolean(false);
|
||||||
|
|
||||||
repeat_sun_spirit_dialog = config.get("Misc", "If disabed, the Sun Spirit's dialog will only show once per world.", true).getBoolean(true);
|
repeat_sun_spirit_dialog
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Misc",
|
||||||
|
"If disabed, the Sun Spirit's dialog will only show once per world.",
|
||||||
|
true
|
||||||
|
)
|
||||||
|
.getBoolean(true);
|
||||||
|
|
||||||
disable_eternal_day = config.get("Misc", "Disables eternal day making time cycle in the Aether without having to kill the Sun Spirit. This is mainly intended for use in modpacks.", false).getBoolean(false);
|
disable_eternal_day
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Misc",
|
||||||
|
"Disables eternal day making time cycle in the Aether without having to kill the Sun Spirit. This is mainly intended for use in modpacks.",
|
||||||
|
false
|
||||||
|
)
|
||||||
|
.getBoolean(false);
|
||||||
|
|
||||||
//Spawnrates
|
//Spawnrates
|
||||||
phyg_spawnrate = config.get("Spawnrates", "Phyg Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
|
phyg_spawnrate
|
||||||
flyingcow_spawnrate = config.get("Spawnrates", "Flying Cow Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
|
= config
|
||||||
sheepuff_spawnrate = config.get("Spawnrates", "Sheepuff Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
|
.get(
|
||||||
aerbunny_spawnrate = config.get("Spawnrates", "Aerbunny Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
|
"Spawnrates",
|
||||||
moa_spawnrate = config.get("Spawnrates", "Moa Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
|
"Phyg Spawnrate. 1 is always, higher numbers decrease chances.",
|
||||||
aerwhale_spawnrate = config.get("Spawnrates", "Aerwhale Spawnrate. 1 is always, higher numbers decrease chances.", 1).getInt(1);
|
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);
|
.getInt(1);
|
||||||
swet_spawnrate = config.get("Spawnrates", "Swet Spawnrate. 1 is always, higher numbers decrease chances.", 40).getInt(40);
|
flyingcow_spawnrate
|
||||||
aechorplant_spawnrate = config.get("Spawnrates", "Aechor Plant Spawnrate. 1 is always, higher numbers decrease chances.", 55).getInt(55);
|
= config
|
||||||
whirlwind_spawnrate = config.get("Spawnrates", "Whirlwind Spawnrate. 1 is always, higher numbers decrease chances.", 55).getInt(55);
|
.get(
|
||||||
|
"Spawnrates",
|
||||||
|
"Flying Cow Spawnrate. 1 is always, higher numbers decrease chances.",
|
||||||
|
1
|
||||||
|
)
|
||||||
|
.getInt(1);
|
||||||
|
sheepuff_spawnrate
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Spawnrates",
|
||||||
|
"Sheepuff Spawnrate. 1 is always, higher numbers decrease chances.",
|
||||||
|
1
|
||||||
|
)
|
||||||
|
.getInt(1);
|
||||||
|
aerbunny_spawnrate
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Spawnrates",
|
||||||
|
"Aerbunny Spawnrate. 1 is always, higher numbers decrease chances.",
|
||||||
|
1
|
||||||
|
)
|
||||||
|
.getInt(1);
|
||||||
|
moa_spawnrate
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Spawnrates",
|
||||||
|
"Moa Spawnrate. 1 is always, higher numbers decrease chances.",
|
||||||
|
1
|
||||||
|
)
|
||||||
|
.getInt(1);
|
||||||
|
aerwhale_spawnrate
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Spawnrates",
|
||||||
|
"Aerwhale Spawnrate. 1 is always, higher numbers decrease chances.",
|
||||||
|
1
|
||||||
|
)
|
||||||
|
.getInt(1);
|
||||||
|
zephyr_spawnrate
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Spawnrates",
|
||||||
|
"Zephyr Spawnrate. 1 is always, higher numbers decrease chances.",
|
||||||
|
65
|
||||||
|
)
|
||||||
|
.getInt(65);
|
||||||
|
cockatrice_spawnrate
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Spawnrates",
|
||||||
|
"Cockatrice Spawnrate. 1 is always, higher numbers decrease chances.",
|
||||||
|
45
|
||||||
|
)
|
||||||
|
.getInt(45);
|
||||||
|
swet_spawnrate
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Spawnrates",
|
||||||
|
"Swet Spawnrate. 1 is always, higher numbers decrease chances.",
|
||||||
|
40
|
||||||
|
)
|
||||||
|
.getInt(40);
|
||||||
|
aechorplant_spawnrate
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Spawnrates",
|
||||||
|
"Aechor Plant Spawnrate. 1 is always, higher numbers decrease chances.",
|
||||||
|
55
|
||||||
|
)
|
||||||
|
.getInt(55);
|
||||||
|
whirlwind_spawnrate
|
||||||
|
= config
|
||||||
|
.get(
|
||||||
|
"Spawnrates",
|
||||||
|
"Whirlwind Spawnrate. 1 is always, higher numbers decrease chances.",
|
||||||
|
55
|
||||||
|
)
|
||||||
|
.getInt(55);
|
||||||
|
|
||||||
config.save();
|
config.save();
|
||||||
}
|
}
|
||||||
|
@ -144,28 +283,23 @@ public class AetherConfig {
|
||||||
return AetherConfig.skyrootBucketOnly;
|
return AetherConfig.skyrootBucketOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean valkyrieCapeEnabled()
|
public static boolean valkyrieCapeEnabled() {
|
||||||
{
|
|
||||||
return AetherConfig.valkyrie_cape;
|
return AetherConfig.valkyrie_cape;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean goldenFeatherEnabled()
|
public static boolean goldenFeatherEnabled() {
|
||||||
{
|
|
||||||
return AetherConfig.golden_feather;
|
return AetherConfig.golden_feather;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean menuEnabled()
|
public static boolean menuEnabled() {
|
||||||
{
|
|
||||||
return AetherConfig.menu_enabled;
|
return AetherConfig.menu_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean menuButtonEnabled()
|
public static boolean menuButtonEnabled() {
|
||||||
{
|
|
||||||
return AetherConfig.menu_button;
|
return AetherConfig.menu_button;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean installResourcepack()
|
public static boolean installResourcepack() {
|
||||||
{
|
|
||||||
return AetherConfig.install_resourcepack;
|
return AetherConfig.install_resourcepack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,8 +307,7 @@ public class AetherConfig {
|
||||||
return AetherConfig.legacy_altar_name;
|
return AetherConfig.legacy_altar_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getInebriationId()
|
public static int getInebriationId() {
|
||||||
{
|
|
||||||
return AetherConfig.inebriation_id;
|
return AetherConfig.inebriation_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,13 +319,11 @@ public class AetherConfig {
|
||||||
return repeat_sun_spirit_dialog;
|
return repeat_sun_spirit_dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean shouldAetherStart()
|
public static boolean shouldAetherStart() {
|
||||||
{
|
|
||||||
return aether_start;
|
return aether_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean eternalDayDisabled()
|
public static boolean eternalDayDisabled() {
|
||||||
{
|
|
||||||
return disable_eternal_day;
|
return disable_eternal_day;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,33 +334,43 @@ public class AetherConfig {
|
||||||
public static int getPhygSpawnrate() {
|
public static int getPhygSpawnrate() {
|
||||||
return phyg_spawnrate;
|
return phyg_spawnrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getFlyingCowSpawnrate() {
|
public static int getFlyingCowSpawnrate() {
|
||||||
return flyingcow_spawnrate;
|
return flyingcow_spawnrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getSheepuffSpawnrate() {
|
public static int getSheepuffSpawnrate() {
|
||||||
return sheepuff_spawnrate;
|
return sheepuff_spawnrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getAerbunnySpawnrate() {
|
public static int getAerbunnySpawnrate() {
|
||||||
return aerbunny_spawnrate;
|
return aerbunny_spawnrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getMoaSpawnrate() {
|
public static int getMoaSpawnrate() {
|
||||||
return moa_spawnrate;
|
return moa_spawnrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getAerwhaleSpawnrate() {
|
public static int getAerwhaleSpawnrate() {
|
||||||
return aerwhale_spawnrate;
|
return aerwhale_spawnrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getZephyrSpawnrate() {
|
public static int getZephyrSpawnrate() {
|
||||||
return zephyr_spawnrate;
|
return zephyr_spawnrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getCockatriceSpawnrate() {
|
public static int getCockatriceSpawnrate() {
|
||||||
return cockatrice_spawnrate;
|
return cockatrice_spawnrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getSwetSpawnrate() {
|
public static int getSwetSpawnrate() {
|
||||||
return swet_spawnrate;
|
return swet_spawnrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getAechorPlantSpawnrate() {
|
public static int getAechorPlantSpawnrate() {
|
||||||
return aechorplant_spawnrate;
|
return aechorplant_spawnrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getWhirlwindSpawnrate() {
|
public static int getWhirlwindSpawnrate() {
|
||||||
return whirlwind_spawnrate;
|
return whirlwind_spawnrate;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,32 @@
|
||||||
package com.gildedgames.the_aether;
|
package com.gildedgames.the_aether;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.api.player.IPlayerAether;
|
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.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.AetherNetwork;
|
||||||
import com.gildedgames.the_aether.network.packets.PacketSendEternalDay;
|
import com.gildedgames.the_aether.network.packets.PacketSendEternalDay;
|
||||||
import com.gildedgames.the_aether.network.packets.PacketSendShouldCycle;
|
import com.gildedgames.the_aether.network.packets.PacketSendShouldCycle;
|
||||||
import com.gildedgames.the_aether.player.PlayerAether;
|
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.AetherData;
|
||||||
import com.gildedgames.the_aether.world.AetherWorldProvider;
|
import com.gildedgames.the_aether.world.AetherWorldProvider;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
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.InputEvent;
|
||||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||||
|
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
|
||||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.enchantment.EnchantmentHelper;
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
|
@ -41,39 +56,25 @@ import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||||
import net.minecraftforge.event.entity.player.*;
|
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 net.minecraftforge.event.world.WorldEvent;
|
||||||
|
|
||||||
import java.util.Random;
|
public class AetherEventHandler {
|
||||||
|
|
||||||
public class
|
|
||||||
AetherEventHandler {
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void checkBlockBannedEvent(PlayerInteractEvent event) {
|
public void checkBlockBannedEvent(PlayerInteractEvent event) {
|
||||||
if(event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
|
if (event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK)
|
||||||
|
return;
|
||||||
EntityPlayer player = event.entityPlayer;
|
EntityPlayer player = event.entityPlayer;
|
||||||
ItemStack currentStack = player.getCurrentEquippedItem();
|
ItemStack currentStack = player.getCurrentEquippedItem();
|
||||||
|
|
||||||
if (player.dimension == AetherConfig.getAetherDimensionID()) {
|
if (player.dimension == AetherConfig.getAetherDimensionID()) {
|
||||||
if (currentStack != null) {
|
if (currentStack != null) {
|
||||||
if (currentStack.getItem() == Items.flint_and_steel || currentStack.getItem() == Item.getItemFromBlock(Blocks.torch) || currentStack.getItem() == Items.fire_charge) {
|
if (currentStack.getItem() == Items.flint_and_steel
|
||||||
|
|| currentStack.getItem() == Item.getItemFromBlock(Blocks.torch)
|
||||||
|
|| currentStack.getItem() == Items.fire_charge) {
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
event.world.spawnParticle("smoke", event.x, event.y, event.z, 0.0D, 0.0D, 0.0D);
|
event.world.spawnParticle(
|
||||||
|
"smoke", event.x, event.y, event.z, 0.0D, 0.0D, 0.0D
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
|
@ -89,27 +90,41 @@ AetherEventHandler {
|
||||||
if (event.target instanceof EntityAgeable) {
|
if (event.target instanceof EntityAgeable) {
|
||||||
ItemStack itemstack = event.entityPlayer.inventory.getCurrentItem();
|
ItemStack itemstack = event.entityPlayer.inventory.getCurrentItem();
|
||||||
|
|
||||||
if (itemstack != null && itemstack.getItem() == ItemsAether.aether_spawn_egg) {
|
if (itemstack != null
|
||||||
|
&& itemstack.getItem() == ItemsAether.aether_spawn_egg) {
|
||||||
if (!event.entityPlayer.worldObj.isRemote) {
|
if (!event.entityPlayer.worldObj.isRemote) {
|
||||||
Class<?> oclass = EntitiesAether.getClassFromID(itemstack.getItemDamage());
|
Class<?> oclass
|
||||||
|
= EntitiesAether.getClassFromID(itemstack.getItemDamage());
|
||||||
|
|
||||||
if (oclass != null && oclass.isAssignableFrom(this.getClass())) {
|
if (oclass != null && oclass.isAssignableFrom(this.getClass())) {
|
||||||
EntityAgeable entityageable = ((EntityAgeable) event.target).createChild((EntityAgeable) event.target);
|
EntityAgeable entityageable
|
||||||
|
= ((EntityAgeable) event.target)
|
||||||
|
.createChild((EntityAgeable) event.target);
|
||||||
|
|
||||||
if (entityageable != null) {
|
if (entityageable != null) {
|
||||||
entityageable.setGrowingAge(-24000);
|
entityageable.setGrowingAge(-24000);
|
||||||
entityageable.setLocationAndAngles(event.target.posX, event.target.posY, event.target.posZ, 0.0F, 0.0F);
|
entityageable.setLocationAndAngles(
|
||||||
|
event.target.posX,
|
||||||
|
event.target.posY,
|
||||||
|
event.target.posZ,
|
||||||
|
0.0F,
|
||||||
|
0.0F
|
||||||
|
);
|
||||||
event.entityPlayer.worldObj.spawnEntityInWorld(entityageable);
|
event.entityPlayer.worldObj.spawnEntityInWorld(entityageable);
|
||||||
|
|
||||||
if (itemstack.hasDisplayName()) {
|
if (itemstack.hasDisplayName()) {
|
||||||
entityageable.setCustomNameTag(itemstack.getDisplayName());
|
entityageable.setCustomNameTag(itemstack.getDisplayName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!event.entityPlayer.capabilities.isCreativeMode) {
|
if (!event.entityPlayer.capabilities.isCreativeMode) {
|
||||||
--itemstack.stackSize;
|
--itemstack.stackSize;
|
||||||
|
|
||||||
if (itemstack.stackSize <= 0) {
|
if (itemstack.stackSize <= 0) {
|
||||||
event.entityPlayer.inventory.setInventorySlotContents(event.entityPlayer.inventory.currentItem, (ItemStack) null);
|
event.entityPlayer.inventory.setInventorySlotContents(
|
||||||
|
event.entityPlayer.inventory.currentItem,
|
||||||
|
(ItemStack) null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,19 +133,36 @@ AetherEventHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.target instanceof EntityCow || event.target instanceof EntityFlyingCow) {
|
if (event.target instanceof EntityCow
|
||||||
|
|| event.target instanceof EntityFlyingCow) {
|
||||||
EntityPlayer player = event.entityPlayer;
|
EntityPlayer player = event.entityPlayer;
|
||||||
ItemStack heldItem = player.getCurrentEquippedItem();
|
ItemStack heldItem = player.getCurrentEquippedItem();
|
||||||
|
|
||||||
if (heldItem != null && heldItem.getItem() == ItemsAether.skyroot_bucket && EnumSkyrootBucketType.getType(heldItem.getItemDamage()) == EnumSkyrootBucketType.Empty) {
|
if (heldItem != null && heldItem.getItem() == ItemsAether.skyroot_bucket
|
||||||
|
&& EnumSkyrootBucketType.getType(heldItem.getItemDamage())
|
||||||
|
== EnumSkyrootBucketType.Empty) {
|
||||||
if (!player.capabilities.isCreativeMode) {
|
if (!player.capabilities.isCreativeMode) {
|
||||||
--heldItem.stackSize;
|
--heldItem.stackSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (heldItem.stackSize <= 0) {
|
if (heldItem.stackSize <= 0) {
|
||||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta));
|
player.inventory.setInventorySlotContents(
|
||||||
} else if (!player.inventory.addItemStackToInventory(new ItemStack(ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta))) {
|
player.inventory.currentItem,
|
||||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta), false);
|
new ItemStack(
|
||||||
|
ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else if (!player.inventory.addItemStackToInventory(new ItemStack(
|
||||||
|
ItemsAether.skyroot_bucket,
|
||||||
|
1,
|
||||||
|
EnumSkyrootBucketType.Milk.meta
|
||||||
|
))) {
|
||||||
|
player.dropPlayerItemWithRandomChoice(
|
||||||
|
new ItemStack(
|
||||||
|
ItemsAether.skyroot_bucket, 1, EnumSkyrootBucketType.Milk.meta
|
||||||
|
),
|
||||||
|
false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,12 +175,18 @@ AetherEventHandler {
|
||||||
ItemStack stack = event.current;
|
ItemStack stack = event.current;
|
||||||
EntityPlayer player = event.entityPlayer;
|
EntityPlayer player = event.entityPlayer;
|
||||||
|
|
||||||
boolean isWater = (!AetherConfig.activateOnlyWithSkyroot() && stack.getItem() == Items.water_bucket) || (stack.getItem() == ItemsAether.skyroot_bucket && stack.getItemDamage() == 1);
|
boolean isWater = (!AetherConfig.activateOnlyWithSkyroot()
|
||||||
|
&& stack.getItem() == Items.water_bucket)
|
||||||
|
|| (stack.getItem() == ItemsAether.skyroot_bucket
|
||||||
|
&& stack.getItemDamage() == 1);
|
||||||
boolean isLava = stack.getItem() == Items.lava_bucket;
|
boolean isLava = stack.getItem() == Items.lava_bucket;
|
||||||
|
|
||||||
boolean validDimension = (player.dimension == AetherConfig.getTravelDimensionID() || player.dimension == AetherConfig.getAetherDimensionID());
|
boolean validDimension
|
||||||
|
= (player.dimension == AetherConfig.getTravelDimensionID()
|
||||||
|
|| player.dimension == AetherConfig.getAetherDimensionID());
|
||||||
|
|
||||||
if (target != null && target.typeOfHit == MovingObjectType.BLOCK && validDimension) {
|
if (target != null && target.typeOfHit == MovingObjectType.BLOCK
|
||||||
|
&& validDimension) {
|
||||||
int i = target.blockX;
|
int i = target.blockX;
|
||||||
int j = target.blockY;
|
int j = target.blockY;
|
||||||
int k = target.blockZ;
|
int k = target.blockZ;
|
||||||
|
@ -174,9 +212,11 @@ AetherEventHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isWater) {
|
if (isWater) {
|
||||||
if (((BlockAetherPortal) BlocksAether.aether_portal).trySpawnPortal(worldObj, i, j, k)) {
|
if (((BlockAetherPortal) BlocksAether.aether_portal)
|
||||||
|
.trySpawnPortal(worldObj, i, j, k)) {
|
||||||
if (!player.capabilities.isCreativeMode) {
|
if (!player.capabilities.isCreativeMode) {
|
||||||
if (stack.getItem() == ItemsAether.skyroot_bucket && stack.getItemDamage() == 1) {
|
if (stack.getItem() == ItemsAether.skyroot_bucket
|
||||||
|
&& stack.getItemDamage() == 1) {
|
||||||
event.result = new ItemStack(ItemsAether.skyroot_bucket);
|
event.result = new ItemStack(ItemsAether.skyroot_bucket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,12 +266,24 @@ AetherEventHandler {
|
||||||
EntityPlayer player = (EntityPlayer) source.getEntity();
|
EntityPlayer player = (EntityPlayer) source.getEntity();
|
||||||
ItemStack currentItem = player.inventory.getCurrentItem();
|
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||||
|
|
||||||
if (currentItem != null && currentItem.getItem() instanceof ItemSkyrootSword && !(entity instanceof EntityPlayer) && !(entity instanceof EntityWither) && !(entity instanceof EntityValkyrie)) {
|
if (currentItem != null
|
||||||
|
&& currentItem.getItem() instanceof ItemSkyrootSword
|
||||||
|
&& !(entity instanceof EntityPlayer)
|
||||||
|
&& !(entity instanceof EntityWither)
|
||||||
|
&& !(entity instanceof EntityValkyrie)) {
|
||||||
for (EntityItem items : event.drops) {
|
for (EntityItem items : event.drops) {
|
||||||
ItemStack stack = items.getEntityItem();
|
ItemStack stack = items.getEntityItem();
|
||||||
|
|
||||||
if (!(stack.getItem() instanceof ItemDungeonKey) && stack.getItem() != ItemsAether.victory_medal && stack.getItem() != Items.skull) {
|
if (!(stack.getItem() instanceof ItemDungeonKey)
|
||||||
EntityItem item = new EntityItem(entity.worldObj, entity.posX, entity.posY, entity.posZ, items.getEntityItem());
|
&& stack.getItem() != ItemsAether.victory_medal
|
||||||
|
&& stack.getItem() != Items.skull) {
|
||||||
|
EntityItem item = new EntityItem(
|
||||||
|
entity.worldObj,
|
||||||
|
entity.posX,
|
||||||
|
entity.posY,
|
||||||
|
entity.posZ,
|
||||||
|
items.getEntityItem()
|
||||||
|
);
|
||||||
|
|
||||||
entity.worldObj.spawnEntityInWorld(item);
|
entity.worldObj.spawnEntityInWorld(item);
|
||||||
}
|
}
|
||||||
|
@ -242,16 +294,15 @@ AetherEventHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onEntityStruckByLightning(EntityStruckByLightningEvent event)
|
public void onEntityStruckByLightning(EntityStruckByLightningEvent event) {
|
||||||
{
|
if (event.entity instanceof EntityPlayer) {
|
||||||
if (event.entity instanceof EntityPlayer)
|
|
||||||
{
|
|
||||||
EntityPlayer player = (EntityPlayer) event.entity;
|
EntityPlayer player = (EntityPlayer) event.entity;
|
||||||
|
|
||||||
if (player.inventory.getCurrentItem() != null)
|
if (player.inventory.getCurrentItem() != null) {
|
||||||
{
|
if (player.inventory.getCurrentItem().getItem()
|
||||||
if (player.inventory.getCurrentItem().getItem() == ItemsAether.lightning_sword || player.inventory.getCurrentItem().getItem() == ItemsAether.lightning_knife)
|
== ItemsAether.lightning_sword
|
||||||
{
|
|| player.inventory.getCurrentItem().getItem()
|
||||||
|
== ItemsAether.lightning_knife) {
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -259,57 +310,69 @@ AetherEventHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onEntityDamage(LivingAttackEvent event)
|
public void onEntityDamage(LivingAttackEvent event) {
|
||||||
{
|
if (event.entityLiving instanceof EntityAerbunny) {
|
||||||
if (event.entityLiving instanceof EntityAerbunny)
|
|
||||||
{
|
|
||||||
EntityAerbunny aerbunny = (EntityAerbunny) event.entityLiving;
|
EntityAerbunny aerbunny = (EntityAerbunny) event.entityLiving;
|
||||||
|
|
||||||
if (aerbunny.isRiding() && aerbunny.ridingEntity instanceof EntityPlayer)
|
if (aerbunny.isRiding() && aerbunny.ridingEntity instanceof EntityPlayer) {
|
||||||
{
|
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onEntityAttack(AttackEntityEvent event)
|
public void onEntityAttack(AttackEntityEvent event) {
|
||||||
{
|
if (event.entityPlayer.getHeldItem() != null) {
|
||||||
if (event.entityPlayer.getHeldItem() != null)
|
if (event.entityPlayer.getHeldItem().getItem() == ItemsAether.flaming_sword) {
|
||||||
{
|
if (event.target.canAttackWithItem()) {
|
||||||
if (event.entityPlayer.getHeldItem().getItem() == ItemsAether.flaming_sword)
|
if (!event.target.hitByEntity(event.entityPlayer)) {
|
||||||
{
|
if (event.target instanceof EntityLivingBase) {
|
||||||
if (event.target.canAttackWithItem())
|
|
||||||
{
|
|
||||||
if (!event.target.hitByEntity(event.entityPlayer))
|
|
||||||
{
|
|
||||||
if (event.target instanceof EntityLivingBase)
|
|
||||||
{
|
|
||||||
int defaultTime = 30;
|
int defaultTime = 30;
|
||||||
int fireAspectModifier = EnchantmentHelper.getFireAspectModifier(event.entityPlayer);
|
int fireAspectModifier
|
||||||
if (fireAspectModifier > 0)
|
= EnchantmentHelper.getFireAspectModifier(
|
||||||
{
|
event.entityPlayer
|
||||||
|
);
|
||||||
|
if (fireAspectModifier > 0) {
|
||||||
defaultTime += (fireAspectModifier * 4);
|
defaultTime += (fireAspectModifier * 4);
|
||||||
}
|
}
|
||||||
event.target.setFire(defaultTime);
|
event.target.setFire(defaultTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (event.entityPlayer.getHeldItem().getItem() == ItemsAether.pig_slayer) {
|
||||||
else if (event.entityPlayer.getHeldItem().getItem() == ItemsAether.pig_slayer)
|
|
||||||
{
|
|
||||||
String s = EntityList.getEntityString((Entity) event.target);
|
String s = EntityList.getEntityString((Entity) event.target);
|
||||||
|
|
||||||
if (s != null && (s.toLowerCase().contains("pig") || s.toLowerCase().contains("phyg") || s.toLowerCase().contains("taegore") || event.target.getUniqueID().toString().equals("1d680bb6-2a9a-4f25-bf2f-a1af74361d69"))) {
|
if (s != null
|
||||||
if (event.target.worldObj.isRemote)
|
&& (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++) {
|
for (int j = 0; j < 20; j++) {
|
||||||
Random itemRand = new Random();
|
Random itemRand = new Random();
|
||||||
double d = itemRand.nextGaussian() * 0.02D;
|
double d = itemRand.nextGaussian() * 0.02D;
|
||||||
double d1 = itemRand.nextGaussian() * 0.02D;
|
double d1 = itemRand.nextGaussian() * 0.02D;
|
||||||
double d2 = itemRand.nextGaussian() * 0.02D;
|
double d2 = itemRand.nextGaussian() * 0.02D;
|
||||||
double d3 = 5D;
|
double d3 = 5D;
|
||||||
event.target.worldObj.spawnParticle("flame", (event.target.posX + (double) (itemRand.nextFloat() * event.target.width * 2.0F)) - (double) event.target.width - d * d3, (event.target.posY + (double) (itemRand.nextFloat() * event.target.height)) - d1 * d3, (event.target.posZ + (double) (itemRand.nextFloat() * event.target.width * 2.0F)) - (double) event.target.width - d2 * d3, d, d1, d2);
|
event.target.worldObj.spawnParticle(
|
||||||
|
"flame",
|
||||||
|
(event.target.posX
|
||||||
|
+ (double
|
||||||
|
) (itemRand.nextFloat() * event.target.width * 2.0F))
|
||||||
|
- (double) event.target.width - d * d3,
|
||||||
|
(event.target.posY
|
||||||
|
+ (double) (itemRand.nextFloat() * event.target.height))
|
||||||
|
- d1 * d3,
|
||||||
|
(event.target.posZ
|
||||||
|
+ (double
|
||||||
|
) (itemRand.nextFloat() * event.target.width * 2.0F))
|
||||||
|
- (double) event.target.width - d2 * d3,
|
||||||
|
d,
|
||||||
|
d1,
|
||||||
|
d2
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -318,92 +381,95 @@ AetherEventHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGravititeTool(Item stackID) {
|
public boolean isGravititeTool(Item stackID) {
|
||||||
return stackID == ItemsAether.gravitite_shovel || stackID == ItemsAether.gravitite_axe || stackID == ItemsAether.gravitite_pickaxe;
|
return stackID == ItemsAether.gravitite_shovel
|
||||||
|
|| stackID == ItemsAether.gravitite_axe
|
||||||
|
|| stackID == ItemsAether.gravitite_pickaxe;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onWorldTick(TickEvent.WorldTickEvent event)
|
public void onWorldTick(TickEvent.WorldTickEvent event) {
|
||||||
{
|
if (!event.world.isRemote) {
|
||||||
if (!event.world.isRemote)
|
|
||||||
{
|
|
||||||
AetherData data = AetherData.getInstance(event.world);
|
AetherData data = AetherData.getInstance(event.world);
|
||||||
|
|
||||||
WorldProvider provider = event.world.provider;
|
WorldProvider provider = event.world.provider;
|
||||||
|
|
||||||
if (provider instanceof AetherWorldProvider)
|
if (provider instanceof AetherWorldProvider) {
|
||||||
{
|
|
||||||
AetherWorldProvider providerAether = (AetherWorldProvider) provider;
|
AetherWorldProvider providerAether = (AetherWorldProvider) provider;
|
||||||
|
|
||||||
providerAether.setIsEternalDay(data.isEternalDay());
|
providerAether.setIsEternalDay(data.isEternalDay());
|
||||||
AetherNetwork.sendToAll(new PacketSendEternalDay(providerAether.getIsEternalDay()));
|
AetherNetwork.sendToAll(
|
||||||
|
new PacketSendEternalDay(providerAether.getIsEternalDay())
|
||||||
|
);
|
||||||
|
|
||||||
providerAether.setShouldCycleCatchup(data.isShouldCycleCatchup());
|
providerAether.setShouldCycleCatchup(data.isShouldCycleCatchup());
|
||||||
AetherNetwork.sendToAll(new PacketSendShouldCycle(providerAether.getShouldCycleCatchup()));
|
AetherNetwork.sendToAll(
|
||||||
|
new PacketSendShouldCycle(providerAether.getShouldCycleCatchup())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Object entity : event.world.loadedEntityList)
|
for (Object entity : event.world.loadedEntityList) {
|
||||||
{
|
if (entity instanceof EntityItem) {
|
||||||
if (entity instanceof EntityItem)
|
|
||||||
{
|
|
||||||
EntityItem entityItem = (EntityItem) entity;
|
EntityItem entityItem = (EntityItem) entity;
|
||||||
|
|
||||||
if (entityItem.getEntityItem().getItem() == ItemsAether.dungeon_key)
|
if (entityItem.getEntityItem().getItem() == ItemsAether.dungeon_key) {
|
||||||
{
|
ObfuscationReflectionHelper.setPrivateValue(
|
||||||
ObfuscationReflectionHelper.setPrivateValue(Entity.class, entityItem, true, "invulnerable", "field_83001_bt");
|
Entity.class, entityItem, true, "invulnerable", "field_83001_bt"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onPlayerSleepInBed(PlayerWakeUpEvent event)
|
public void onPlayerSleepInBed(PlayerWakeUpEvent event) {
|
||||||
{
|
|
||||||
final World world = event.entityPlayer.worldObj;
|
final World world = event.entityPlayer.worldObj;
|
||||||
|
|
||||||
if (!world.isRemote && event.entityPlayer.dimension == AetherConfig.getAetherDimensionID())
|
if (!world.isRemote
|
||||||
{
|
&& event.entityPlayer.dimension == AetherConfig.getAetherDimensionID()) {
|
||||||
final MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
final MinecraftServer server
|
||||||
|
= FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||||
|
|
||||||
final WorldServer worldServer = server.worldServerForDimension(0);
|
final WorldServer worldServer = server.worldServerForDimension(0);
|
||||||
|
|
||||||
if (worldServer.playerEntities.size() > 0)
|
if (worldServer.playerEntities.size() > 0) {
|
||||||
{
|
if (worldServer.areAllPlayersAsleep()) {
|
||||||
if (worldServer.areAllPlayersAsleep())
|
|
||||||
{
|
|
||||||
performTimeSet(event, world, worldServer);
|
performTimeSet(event, world, worldServer);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
performTimeSet(event, world, worldServer);
|
performTimeSet(event, world, worldServer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onFall(LivingFallEvent event)
|
public void onFall(LivingFallEvent event) {
|
||||||
{
|
if (event.entityLiving instanceof EntityPlayer) {
|
||||||
if (event.entityLiving instanceof EntityPlayer)
|
IPlayerAether playerAether
|
||||||
{
|
= PlayerAether.get((EntityPlayer) event.entityLiving);
|
||||||
IPlayerAether playerAether = PlayerAether.get((EntityPlayer) event.entityLiving);
|
|
||||||
|
|
||||||
if (playerAether.getAccessoryInventory().wearingArmor(new ItemStack(ItemsAether.sentry_boots)) || playerAether.getAccessoryInventory().isWearingGravititeSet() || playerAether.getAccessoryInventory().isWearingValkyrieSet())
|
if (playerAether.getAccessoryInventory().wearingArmor(
|
||||||
{
|
new ItemStack(ItemsAether.sentry_boots)
|
||||||
|
)
|
||||||
|
|| playerAether.getAccessoryInventory().isWearingGravititeSet()
|
||||||
|
|| playerAether.getAccessoryInventory().isWearingValkyrieSet()) {
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void performTimeSet(PlayerWakeUpEvent event, World world, WorldServer worldServer)
|
private void
|
||||||
{
|
performTimeSet(PlayerWakeUpEvent event, World world, WorldServer worldServer) {
|
||||||
if (world.getGameRules().getGameRuleBooleanValue("doDaylightCycle") && event.entityPlayer.isPlayerFullyAsleep())
|
if (world.getGameRules().getGameRuleBooleanValue("doDaylightCycle")
|
||||||
{
|
&& event.entityPlayer.isPlayerFullyAsleep()) {
|
||||||
final long i = worldServer.getWorldInfo().getWorldTime() + 24000L;
|
final long i = worldServer.getWorldInfo().getWorldTime() + 24000L;
|
||||||
|
|
||||||
worldServer.getWorldInfo().setWorldTime(i - i % 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())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,21 @@
|
||||||
package com.gildedgames.the_aether;
|
package com.gildedgames.the_aether;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
|
|
||||||
public class CommonProxy {
|
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 openSunAltar() {
|
public void sendMessage(EntityPlayer player, String text) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void sendMessage(EntityPlayer player, String text) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityPlayer getPlayer() {
|
public EntityPlayer getPlayer() {
|
||||||
return null;
|
return null;
|
||||||
|
@ -32,5 +25,4 @@ public class CommonProxy {
|
||||||
FMLCommonHandler.instance().bus().register(event);
|
FMLCommonHandler.instance().bus().register(event);
|
||||||
MinecraftForge.EVENT_BUS.register(event);
|
MinecraftForge.EVENT_BUS.register(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -12,121 +12,187 @@ import com.gildedgames.the_aether.api.freezables.AetherFreezable;
|
||||||
import com.gildedgames.the_aether.api.freezables.AetherFreezableFuel;
|
import com.gildedgames.the_aether.api.freezables.AetherFreezableFuel;
|
||||||
import com.gildedgames.the_aether.api.moa.AetherMoaType;
|
import com.gildedgames.the_aether.api.moa.AetherMoaType;
|
||||||
import com.gildedgames.the_aether.api.player.IPlayerAether;
|
import com.gildedgames.the_aether.api.player.IPlayerAether;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
public class AetherAPI {
|
public class AetherAPI {
|
||||||
|
private static final HashMap<ResourceLocation, AetherAccessory> iAccessoryRegistry
|
||||||
private static final HashMap<ResourceLocation, AetherAccessory> iAccessoryRegistry = new HashMap<ResourceLocation, AetherAccessory>(4096);
|
= new HashMap<ResourceLocation, AetherAccessory>(4096);
|
||||||
private static final HashMap<ResourceLocation, AetherEnchantment> iEnchantmentRegistry = new HashMap<ResourceLocation, AetherEnchantment>(4096);
|
private static final HashMap<ResourceLocation, AetherEnchantment> iEnchantmentRegistry
|
||||||
private static final HashMap<ResourceLocation, AetherEnchantmentFuel> iEnchantmentFuelRegistry = new HashMap<ResourceLocation, AetherEnchantmentFuel>(4096);
|
= new HashMap<ResourceLocation, AetherEnchantment>(4096);
|
||||||
private static final HashMap<ResourceLocation, AetherFreezable> iFreezableRegistry = new HashMap<ResourceLocation, AetherFreezable>(4096);
|
private static final HashMap<ResourceLocation, AetherEnchantmentFuel>
|
||||||
private static final HashMap<ResourceLocation, AetherFreezableFuel> iFreezableFuelRegistry = new HashMap<ResourceLocation, AetherFreezableFuel>(4096);
|
iEnchantmentFuelRegistry
|
||||||
private static final HashMap<ResourceLocation, AetherMoaType> iMoaTypeRegistry = new HashMap<ResourceLocation, AetherMoaType>(4096);
|
= new HashMap<ResourceLocation, AetherEnchantmentFuel>(4096);
|
||||||
|
private static final HashMap<ResourceLocation, AetherFreezable> iFreezableRegistry
|
||||||
|
= new HashMap<ResourceLocation, AetherFreezable>(4096);
|
||||||
|
private static final HashMap<ResourceLocation, AetherFreezableFuel>
|
||||||
|
iFreezableFuelRegistry = new HashMap<ResourceLocation, AetherFreezableFuel>(4096);
|
||||||
|
private static final HashMap<ResourceLocation, AetherMoaType> iMoaTypeRegistry
|
||||||
|
= new HashMap<ResourceLocation, AetherMoaType>(4096);
|
||||||
|
|
||||||
private static final AetherAPI instance = new AetherAPI();
|
private static final AetherAPI instance = new AetherAPI();
|
||||||
|
|
||||||
public static final IPlayerAether get(EntityPlayer playerIn) {
|
public static final IPlayerAether get(EntityPlayer playerIn) {
|
||||||
return (IPlayerAether) playerIn.getExtendedProperties("aether_legacy:player_aether");
|
return (IPlayerAether
|
||||||
|
) playerIn.getExtendedProperties("aether_legacy:player_aether");
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherAccessory register(AetherAccessory type) {
|
public AetherAccessory register(AetherAccessory type) {
|
||||||
ItemStack stack = type.getAccessoryStack();
|
ItemStack stack = type.getAccessoryStack();
|
||||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
ResourceLocation registryName = new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
);
|
||||||
|
|
||||||
iAccessoryRegistry.put(registryName, (AetherAccessory) type.setRegistryName(registryName));
|
iAccessoryRegistry.put(
|
||||||
|
registryName, (AetherAccessory) type.setRegistryName(registryName)
|
||||||
|
);
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherEnchantment register(AetherEnchantment type) {
|
public AetherEnchantment register(AetherEnchantment type) {
|
||||||
ItemStack stack = type.getInput();
|
ItemStack stack = type.getInput();
|
||||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
ResourceLocation registryName = new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
);
|
||||||
|
|
||||||
iEnchantmentRegistry.put(registryName, (AetherEnchantment) type.setRegistryName(registryName));
|
iEnchantmentRegistry.put(
|
||||||
|
registryName, (AetherEnchantment) type.setRegistryName(registryName)
|
||||||
|
);
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherEnchantmentFuel register(AetherEnchantmentFuel type) {
|
public AetherEnchantmentFuel register(AetherEnchantmentFuel type) {
|
||||||
ItemStack stack = type.getFuelStack();
|
ItemStack stack = type.getFuelStack();
|
||||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
ResourceLocation registryName = new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
);
|
||||||
|
|
||||||
iEnchantmentFuelRegistry.put(registryName, (AetherEnchantmentFuel) type.setRegistryName(registryName));
|
iEnchantmentFuelRegistry.put(
|
||||||
|
registryName, (AetherEnchantmentFuel) type.setRegistryName(registryName)
|
||||||
|
);
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherFreezable register(AetherFreezable type) {
|
public AetherFreezable register(AetherFreezable type) {
|
||||||
ItemStack stack = type.getInput();
|
ItemStack stack = type.getInput();
|
||||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
ResourceLocation registryName = new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
);
|
||||||
|
|
||||||
iFreezableRegistry.put(registryName, (AetherFreezable) type.setRegistryName(registryName));
|
iFreezableRegistry.put(
|
||||||
|
registryName, (AetherFreezable) type.setRegistryName(registryName)
|
||||||
|
);
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherFreezableFuel register(AetherFreezableFuel type) {
|
public AetherFreezableFuel register(AetherFreezableFuel type) {
|
||||||
ItemStack stack = type.getFuelStack();
|
ItemStack stack = type.getFuelStack();
|
||||||
ResourceLocation registryName = new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
ResourceLocation registryName = new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
);
|
||||||
|
|
||||||
iFreezableFuelRegistry.put(registryName, (AetherFreezableFuel) type.setRegistryName(registryName));
|
iFreezableFuelRegistry.put(
|
||||||
|
registryName, (AetherFreezableFuel) type.setRegistryName(registryName)
|
||||||
|
);
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherMoaType register(String modId, String name, AetherMoaType type) {
|
public AetherMoaType register(String modId, String name, AetherMoaType type) {
|
||||||
iMoaTypeRegistry.put(new ResourceLocation(modId, name), (AetherMoaType) type.setRegistryName(modId, name));
|
iMoaTypeRegistry.put(
|
||||||
|
new ResourceLocation(modId, name),
|
||||||
|
(AetherMoaType) type.setRegistryName(modId, name)
|
||||||
|
);
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherMoaType register(ResourceLocation registryName, AetherMoaType type) {
|
public AetherMoaType register(ResourceLocation registryName, AetherMoaType type) {
|
||||||
iMoaTypeRegistry.put(registryName, (AetherMoaType) type.setRegistryName(registryName));
|
iMoaTypeRegistry.put(
|
||||||
|
registryName, (AetherMoaType) type.setRegistryName(registryName)
|
||||||
|
);
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAccessory(ItemStack stack) {
|
public boolean isAccessory(ItemStack stack) {
|
||||||
return iAccessoryRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
return iAccessoryRegistry.containsKey(new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherAccessory getAccessory(ItemStack stack) {
|
public AetherAccessory getAccessory(ItemStack stack) {
|
||||||
return iAccessoryRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
return iAccessoryRegistry.get(new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasEnchantment(ItemStack stack) {
|
public boolean hasEnchantment(ItemStack stack) {
|
||||||
return iEnchantmentRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
return iEnchantmentRegistry.containsKey(new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherEnchantment getEnchantment(ItemStack stack) {
|
public AetherEnchantment getEnchantment(ItemStack stack) {
|
||||||
return iEnchantmentRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
return iEnchantmentRegistry.get(new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnchantmentFuel(ItemStack stack) {
|
public boolean isEnchantmentFuel(ItemStack stack) {
|
||||||
return iEnchantmentFuelRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
return iEnchantmentFuelRegistry.containsKey(new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherEnchantmentFuel getEnchantmentFuel(ItemStack stack) {
|
public AetherEnchantmentFuel getEnchantmentFuel(ItemStack stack) {
|
||||||
return iEnchantmentFuelRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
return iEnchantmentFuelRegistry.get(new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasFreezable(ItemStack stack) {
|
public boolean hasFreezable(ItemStack stack) {
|
||||||
return iFreezableRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
return iFreezableRegistry.containsKey(new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherFreezable getFreezable(ItemStack stack) {
|
public AetherFreezable getFreezable(ItemStack stack) {
|
||||||
return iFreezableRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
return iFreezableRegistry.get(new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFreezableFuel(ItemStack stack) {
|
public boolean isFreezableFuel(ItemStack stack) {
|
||||||
return iFreezableFuelRegistry.containsKey(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
return iFreezableFuelRegistry.containsKey(new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherFreezableFuel getFreezableFuel(ItemStack stack) {
|
public AetherFreezableFuel getFreezableFuel(ItemStack stack) {
|
||||||
return iFreezableFuelRegistry.get(new ResourceLocation(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())));
|
return iFreezableFuelRegistry.get(new ResourceLocation(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<AetherEnchantment> getEnchantmentValues() {
|
public List<AetherEnchantment> getEnchantmentValues() {
|
||||||
|
@ -160,5 +226,4 @@ public class AetherAPI {
|
||||||
public static AetherAPI instance() {
|
public static AetherAPI instance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,7 +3,6 @@ package com.gildedgames.the_aether.api;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
public class RegistryEntry {
|
public class RegistryEntry {
|
||||||
|
|
||||||
private ResourceLocation location;
|
private ResourceLocation location;
|
||||||
|
|
||||||
public RegistryEntry setRegistryName(String modid, String location) {
|
public RegistryEntry setRegistryName(String modid, String location) {
|
||||||
|
@ -27,5 +26,4 @@ public class RegistryEntry {
|
||||||
public ResourceLocation getRegistryName() {
|
public ResourceLocation getRegistryName() {
|
||||||
return this.location;
|
return this.location;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -47,7 +47,5 @@ public enum AccessoryType {
|
||||||
identityMap.func_148746_a(EXTRA_MISC, 7);
|
identityMap.func_148746_a(EXTRA_MISC, 7);
|
||||||
|
|
||||||
return identityMap;
|
return identityMap;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,13 +1,11 @@
|
||||||
package com.gildedgames.the_aether.api.accessories;
|
package com.gildedgames.the_aether.api.accessories;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.api.RegistryEntry;
|
import com.gildedgames.the_aether.api.RegistryEntry;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class AetherAccessory extends RegistryEntry {
|
public class AetherAccessory extends RegistryEntry {
|
||||||
|
|
||||||
private ItemStack accessoryStack;
|
private ItemStack accessoryStack;
|
||||||
|
|
||||||
private AccessoryType accessoryType;
|
private AccessoryType accessoryType;
|
||||||
|
@ -25,9 +23,14 @@ public class AetherAccessory extends RegistryEntry {
|
||||||
public AetherAccessory(ItemStack stack, AccessoryType type) {
|
public AetherAccessory(ItemStack stack, AccessoryType type) {
|
||||||
this.accessoryType = type;
|
this.accessoryType = type;
|
||||||
this.accessoryStack = stack;
|
this.accessoryStack = stack;
|
||||||
this.extraType = type == AccessoryType.RING ? AccessoryType.EXTRA_RING : type == AccessoryType.MISC ? AccessoryType.EXTRA_MISC : null;
|
this.extraType = type == AccessoryType.RING ? AccessoryType.EXTRA_RING
|
||||||
|
: type == AccessoryType.MISC ? AccessoryType.EXTRA_MISC
|
||||||
|
: null;
|
||||||
|
|
||||||
this.setRegistryName(stack.getItem().getUnlocalizedName().toString() + "_meta_" + (stack.isItemStackDamageable() ? 0 : stack.getItemDamage()));
|
this.setRegistryName(
|
||||||
|
stack.getItem().getUnlocalizedName().toString() + "_meta_"
|
||||||
|
+ (stack.isItemStackDamageable() ? 0 : stack.getItemDamage())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccessoryType getAccessoryType() {
|
public AccessoryType getAccessoryType() {
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
package com.gildedgames.the_aether.api.enchantments;
|
package com.gildedgames.the_aether.api.enchantments;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.api.RegistryEntry;
|
import com.gildedgames.the_aether.api.RegistryEntry;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class AetherEnchantment extends RegistryEntry {
|
public class AetherEnchantment extends RegistryEntry {
|
||||||
|
|
||||||
public int timeRequired;
|
public int timeRequired;
|
||||||
|
|
||||||
public ItemStack input, output;
|
public ItemStack input, output;
|
||||||
|
@ -53,7 +51,10 @@ public class AetherEnchantment extends RegistryEntry {
|
||||||
this.output = output;
|
this.output = output;
|
||||||
this.timeRequired = timeRequired;
|
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() {
|
public int getTimeRequired() {
|
||||||
|
@ -73,13 +74,18 @@ public class AetherEnchantment extends RegistryEntry {
|
||||||
if (obj instanceof AetherEnchantment) {
|
if (obj instanceof AetherEnchantment) {
|
||||||
AetherEnchantment freezable = (AetherEnchantment) obj;
|
AetherEnchantment freezable = (AetherEnchantment) obj;
|
||||||
|
|
||||||
boolean inputCheck = this.getInput().getItem() == freezable.getInput().getItem() && this.getInput().getItemDamage() == freezable.getInput().getItemDamage();
|
boolean inputCheck
|
||||||
boolean outputCheck = this.getOutput().getItem() == freezable.getOutput().getItem() && this.getOutput().getItemDamage() == freezable.getOutput().getItemDamage();
|
= 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 inputCheck && outputCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,13 +1,11 @@
|
||||||
package com.gildedgames.the_aether.api.enchantments;
|
package com.gildedgames.the_aether.api.enchantments;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.api.RegistryEntry;
|
import com.gildedgames.the_aether.api.RegistryEntry;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class AetherEnchantmentFuel extends RegistryEntry {
|
public class AetherEnchantmentFuel extends RegistryEntry {
|
||||||
|
|
||||||
public int timeGiven;
|
public int timeGiven;
|
||||||
|
|
||||||
public ItemStack fuelStack;
|
public ItemStack fuelStack;
|
||||||
|
@ -24,7 +22,10 @@ public class AetherEnchantmentFuel extends RegistryEntry {
|
||||||
this.timeGiven = timeGiven;
|
this.timeGiven = timeGiven;
|
||||||
this.fuelStack = fuelStack;
|
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() {
|
public int getTimeGiven() {
|
||||||
|
@ -40,10 +41,11 @@ public class AetherEnchantmentFuel extends RegistryEntry {
|
||||||
if (obj instanceof AetherEnchantmentFuel) {
|
if (obj instanceof AetherEnchantmentFuel) {
|
||||||
AetherEnchantmentFuel fuel = (AetherEnchantmentFuel) obj;
|
AetherEnchantmentFuel fuel = (AetherEnchantmentFuel) obj;
|
||||||
|
|
||||||
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem() && this.getFuelStack().getItemDamage() == fuel.getFuelStack().getItemDamage();
|
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem()
|
||||||
|
&& this.getFuelStack().getItemDamage()
|
||||||
|
== fuel.getFuelStack().getItemDamage();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,10 +1,5 @@
|
||||||
package com.gildedgames.the_aether.api.events;
|
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.accessories.AetherAccessory;
|
||||||
import com.gildedgames.the_aether.api.enchantments.AetherEnchantment;
|
import com.gildedgames.the_aether.api.enchantments.AetherEnchantment;
|
||||||
import com.gildedgames.the_aether.api.events.accessories.ValidAccessoryEvent;
|
import com.gildedgames.the_aether.api.events.accessories.ValidAccessoryEvent;
|
||||||
|
@ -12,13 +7,18 @@ import com.gildedgames.the_aether.api.events.enchantments.AetherEnchantmentEvent
|
||||||
import com.gildedgames.the_aether.api.events.freezables.AetherFreezableEvent;
|
import com.gildedgames.the_aether.api.events.freezables.AetherFreezableEvent;
|
||||||
import com.gildedgames.the_aether.api.events.moas.MoaHatchEvent;
|
import com.gildedgames.the_aether.api.events.moas.MoaHatchEvent;
|
||||||
import com.gildedgames.the_aether.api.freezables.AetherFreezable;
|
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 class AetherHooks {
|
||||||
|
public static boolean
|
||||||
public static boolean isValidAccessory(EntityPlayer player, AetherAccessory accessory) {
|
isValidAccessory(EntityPlayer player, AetherAccessory accessory) {
|
||||||
ValidAccessoryEvent event = new ValidAccessoryEvent(player, 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();
|
||||||
}
|
}
|
||||||
|
@ -29,30 +29,40 @@ public class AetherHooks {
|
||||||
MinecraftForge.EVENT_BUS.post(event);
|
MinecraftForge.EVENT_BUS.post(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onItemEnchant(TileEntity enchanter, AetherEnchantment enchantment) {
|
public static void
|
||||||
AetherEnchantmentEvent.EnchantEvent event = new AetherEnchantmentEvent.EnchantEvent(enchanter, enchantment);
|
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) {
|
public static void onItemFreeze(TileEntity freezer, AetherFreezable freezable) {
|
||||||
AetherFreezableEvent.FreezeEvent event = new AetherFreezableEvent.FreezeEvent(freezer, freezable);
|
AetherFreezableEvent.FreezeEvent event
|
||||||
|
= new AetherFreezableEvent.FreezeEvent(freezer, freezable);
|
||||||
|
|
||||||
MinecraftForge.EVENT_BUS.post(event);
|
MinecraftForge.EVENT_BUS.post(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int onSetEnchantmentTime(TileEntity enchanter, AetherEnchantment enchantment, int original) {
|
public static int onSetEnchantmentTime(
|
||||||
AetherEnchantmentEvent.SetTimeEvent event = new AetherEnchantmentEvent.SetTimeEvent(enchanter, enchantment, original);
|
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) {
|
public static int
|
||||||
AetherFreezableEvent.SetTimeEvent event = new AetherFreezableEvent.SetTimeEvent(freezer, freezable, original);
|
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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
package com.gildedgames.the_aether.api.events.accessories;
|
package com.gildedgames.the_aether.api.events.accessories;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.api.accessories.AetherAccessory;
|
import com.gildedgames.the_aether.api.accessories.AetherAccessory;
|
||||||
|
|
||||||
import cpw.mods.fml.common.eventhandler.Event;
|
import cpw.mods.fml.common.eventhandler.Event;
|
||||||
|
|
||||||
public class AetherAccessoryEvent extends Event {
|
public class AetherAccessoryEvent extends Event {
|
||||||
|
|
||||||
private AetherAccessory accessory;
|
private AetherAccessory accessory;
|
||||||
|
|
||||||
public AetherAccessoryEvent(AetherAccessory accessory) {
|
public AetherAccessoryEvent(AetherAccessory accessory) {
|
||||||
|
@ -15,5 +13,4 @@ public class AetherAccessoryEvent extends Event {
|
||||||
public AetherAccessory getAetherAccessory() {
|
public AetherAccessory getAetherAccessory() {
|
||||||
return this.accessory;
|
return this.accessory;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,16 +1,12 @@
|
||||||
package com.gildedgames.the_aether.api.events.accessories;
|
package com.gildedgames.the_aether.api.events.accessories;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
|
|
||||||
import com.gildedgames.the_aether.api.accessories.AetherAccessory;
|
import com.gildedgames.the_aether.api.accessories.AetherAccessory;
|
||||||
|
|
||||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
@Cancelable
|
@Cancelable
|
||||||
public class ValidAccessoryEvent extends AetherAccessoryEvent {
|
public class ValidAccessoryEvent extends AetherAccessoryEvent {
|
||||||
|
|
||||||
public ValidAccessoryEvent(EntityPlayer player, AetherAccessory accessory) {
|
public ValidAccessoryEvent(EntityPlayer player, AetherAccessory accessory) {
|
||||||
super(accessory);
|
super(accessory);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,16 +1,11 @@
|
||||||
package com.gildedgames.the_aether.api.events.enchantments;
|
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 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 class AetherEnchantmentEvent extends Event {
|
||||||
|
public AetherEnchantmentEvent() {}
|
||||||
public AetherEnchantmentEvent() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class SetTimeEvent extends AetherEnchantmentEvent {
|
public static class SetTimeEvent extends AetherEnchantmentEvent {
|
||||||
private TileEntity tileEntity;
|
private TileEntity tileEntity;
|
||||||
|
@ -21,7 +16,9 @@ public class AetherEnchantmentEvent extends Event {
|
||||||
|
|
||||||
private int newTime;
|
private int newTime;
|
||||||
|
|
||||||
public SetTimeEvent(TileEntity tileEntity, AetherEnchantment enchantment, int original) {
|
public SetTimeEvent(
|
||||||
|
TileEntity tileEntity, AetherEnchantment enchantment, int original
|
||||||
|
) {
|
||||||
this.tileEntity = tileEntity;
|
this.tileEntity = tileEntity;
|
||||||
this.enchantment = enchantment;
|
this.enchantment = enchantment;
|
||||||
this.original = original;
|
this.original = original;
|
||||||
|
@ -68,5 +65,4 @@ public class AetherEnchantmentEvent extends Event {
|
||||||
return this.enchantent;
|
return this.enchantent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,16 +1,11 @@
|
||||||
package com.gildedgames.the_aether.api.events.freezables;
|
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 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 class AetherFreezableEvent extends Event {
|
||||||
|
public AetherFreezableEvent() {}
|
||||||
public AetherFreezableEvent() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class SetTimeEvent extends AetherFreezableEvent {
|
public static class SetTimeEvent extends AetherFreezableEvent {
|
||||||
private TileEntity tileEntity;
|
private TileEntity tileEntity;
|
||||||
|
@ -21,7 +16,9 @@ public class AetherFreezableEvent extends Event {
|
||||||
|
|
||||||
private int newTime;
|
private int newTime;
|
||||||
|
|
||||||
public SetTimeEvent(TileEntity tileEntity, AetherFreezable freezable, int original) {
|
public SetTimeEvent(
|
||||||
|
TileEntity tileEntity, AetherFreezable freezable, int original
|
||||||
|
) {
|
||||||
this.tileEntity = tileEntity;
|
this.tileEntity = tileEntity;
|
||||||
this.freezable = freezable;
|
this.freezable = freezable;
|
||||||
this.original = original;
|
this.original = original;
|
||||||
|
@ -68,5 +65,4 @@ public class AetherFreezableEvent extends Event {
|
||||||
return this.freezable;
|
return this.freezable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,11 +1,9 @@
|
||||||
package com.gildedgames.the_aether.api.events.moas;
|
package com.gildedgames.the_aether.api.events.moas;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.api.moa.AetherMoaType;
|
import com.gildedgames.the_aether.api.moa.AetherMoaType;
|
||||||
|
|
||||||
import cpw.mods.fml.common.eventhandler.Event;
|
import cpw.mods.fml.common.eventhandler.Event;
|
||||||
|
|
||||||
public class MoaEvent extends Event {
|
public class MoaEvent extends Event {
|
||||||
|
|
||||||
private AetherMoaType moaType;
|
private AetherMoaType moaType;
|
||||||
|
|
||||||
public MoaEvent(AetherMoaType moaType) {
|
public MoaEvent(AetherMoaType moaType) {
|
||||||
|
@ -15,5 +13,4 @@ public class MoaEvent extends Event {
|
||||||
public AetherMoaType getMoaType() {
|
public AetherMoaType getMoaType() {
|
||||||
return this.moaType;
|
return this.moaType;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,7 +4,6 @@ import com.gildedgames.the_aether.api.moa.AetherMoaType;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
public class MoaHatchEvent extends MoaEvent {
|
public class MoaHatchEvent extends MoaEvent {
|
||||||
|
|
||||||
private TileEntity incubator;
|
private TileEntity incubator;
|
||||||
|
|
||||||
public MoaHatchEvent(AetherMoaType moaType, TileEntity incubator) {
|
public MoaHatchEvent(AetherMoaType moaType, TileEntity incubator) {
|
||||||
|
@ -16,5 +15,4 @@ public class MoaHatchEvent extends MoaEvent {
|
||||||
public TileEntity getTileEntity() {
|
public TileEntity getTileEntity() {
|
||||||
return this.incubator;
|
return this.incubator;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,13 +1,11 @@
|
||||||
package com.gildedgames.the_aether.api.freezables;
|
package com.gildedgames.the_aether.api.freezables;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.api.RegistryEntry;
|
import com.gildedgames.the_aether.api.RegistryEntry;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class AetherFreezable extends RegistryEntry {
|
public class AetherFreezable extends RegistryEntry {
|
||||||
|
|
||||||
public int timeRequired;
|
public int timeRequired;
|
||||||
|
|
||||||
public ItemStack input, output;
|
public ItemStack input, output;
|
||||||
|
@ -49,7 +47,10 @@ public class AetherFreezable extends RegistryEntry {
|
||||||
this.output = output;
|
this.output = output;
|
||||||
this.timeRequired = timeRequired;
|
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() {
|
public int getTimeRequired() {
|
||||||
|
@ -69,13 +70,18 @@ public class AetherFreezable extends RegistryEntry {
|
||||||
if (obj instanceof AetherFreezable) {
|
if (obj instanceof AetherFreezable) {
|
||||||
AetherFreezable freezable = (AetherFreezable) obj;
|
AetherFreezable freezable = (AetherFreezable) obj;
|
||||||
|
|
||||||
boolean inputCheck = this.getInput().getItem() == freezable.getInput().getItem() && this.getInput().getItemDamage() == freezable.getInput().getItemDamage();
|
boolean inputCheck
|
||||||
boolean outputCheck = this.getOutput().getItem() == freezable.getOutput().getItem() && this.getOutput().getItemDamage() == freezable.getOutput().getItemDamage();
|
= 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 inputCheck && outputCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -6,7 +6,6 @@ import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class AetherFreezableFuel extends RegistryEntry {
|
public class AetherFreezableFuel extends RegistryEntry {
|
||||||
|
|
||||||
public int timeGiven;
|
public int timeGiven;
|
||||||
|
|
||||||
public ItemStack fuelStack;
|
public ItemStack fuelStack;
|
||||||
|
@ -23,7 +22,10 @@ public class AetherFreezableFuel extends RegistryEntry {
|
||||||
this.timeGiven = timeGiven;
|
this.timeGiven = timeGiven;
|
||||||
this.fuelStack = fuelStack;
|
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() {
|
public int getTimeGiven() {
|
||||||
|
@ -39,10 +41,11 @@ public class AetherFreezableFuel extends RegistryEntry {
|
||||||
if (obj instanceof AetherFreezableFuel) {
|
if (obj instanceof AetherFreezableFuel) {
|
||||||
AetherFreezableFuel fuel = (AetherFreezableFuel) obj;
|
AetherFreezableFuel fuel = (AetherFreezableFuel) obj;
|
||||||
|
|
||||||
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem() && this.getFuelStack().getItemDamage() == fuel.getFuelStack().getItemDamage();
|
return this.getFuelStack().getItem() == fuel.getFuelStack().getItem()
|
||||||
|
&& this.getFuelStack().getItemDamage()
|
||||||
|
== fuel.getFuelStack().getItemDamage();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,12 +1,10 @@
|
||||||
package com.gildedgames.the_aether.api.moa;
|
package com.gildedgames.the_aether.api.moa;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.api.RegistryEntry;
|
import com.gildedgames.the_aether.api.RegistryEntry;
|
||||||
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
public class AetherMoaType extends RegistryEntry {
|
public class AetherMoaType extends RegistryEntry {
|
||||||
|
|
||||||
private MoaProperties properties;
|
private MoaProperties properties;
|
||||||
|
|
||||||
public int hexColor;
|
public int hexColor;
|
||||||
|
@ -20,7 +18,9 @@ public class AetherMoaType extends RegistryEntry {
|
||||||
this.creativeTab = CreativeTabs.tabMisc;
|
this.creativeTab = CreativeTabs.tabMisc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherMoaType(int hexColor, MoaProperties properties, CreativeTabs creativeTab) {
|
public AetherMoaType(
|
||||||
|
int hexColor, MoaProperties properties, CreativeTabs creativeTab
|
||||||
|
) {
|
||||||
this(hexColor, properties);
|
this(hexColor, properties);
|
||||||
|
|
||||||
this.creativeTab = creativeTab;
|
this.creativeTab = creativeTab;
|
||||||
|
@ -31,7 +31,11 @@ public class AetherMoaType extends RegistryEntry {
|
||||||
return this.properties.getCustomTexture(saddled, isBeingRidden);
|
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() {
|
public MoaProperties getMoaProperties() {
|
||||||
|
@ -45,5 +49,4 @@ public class AetherMoaType extends RegistryEntry {
|
||||||
public int getMoaEggColor() {
|
public int getMoaEggColor() {
|
||||||
return this.hexColor;
|
return this.hexColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,7 +3,6 @@ package com.gildedgames.the_aether.api.moa;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
public class MoaProperties {
|
public class MoaProperties {
|
||||||
|
|
||||||
private int maxJumps;
|
private int maxJumps;
|
||||||
|
|
||||||
private float moaSpeed;
|
private float moaSpeed;
|
||||||
|
@ -36,5 +35,4 @@ public class MoaProperties {
|
||||||
public ResourceLocation getCustomTexture(boolean isSaddled, boolean isBeingRidden) {
|
public ResourceLocation getCustomTexture(boolean isSaddled, boolean isBeingRidden) {
|
||||||
return this.location;
|
return this.location;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,15 +2,13 @@ package com.gildedgames.the_aether.api.player;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
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.IAccessoryInventory;
|
||||||
import com.gildedgames.the_aether.api.player.util.IAetherAbility;
|
import com.gildedgames.the_aether.api.player.util.IAetherAbility;
|
||||||
import com.gildedgames.the_aether.api.player.util.IAetherBoss;
|
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 interface IPlayerAether extends IExtendedEntityProperties {
|
||||||
|
|
||||||
public void onUpdate();
|
public void onUpdate();
|
||||||
|
|
||||||
public void setInPortal();
|
public void setInPortal();
|
||||||
|
@ -50,5 +48,4 @@ public interface IPlayerAether extends IExtendedEntityProperties {
|
||||||
public int getMaxShardCount();
|
public int getMaxShardCount();
|
||||||
|
|
||||||
public boolean isDonator();
|
public boolean isDonator();
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,18 +1,15 @@
|
||||||
package com.gildedgames.the_aether.api.player.util;
|
package com.gildedgames.the_aether.api.player.util;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
|
||||||
|
|
||||||
import java.util.List;
|
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.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.api.accessories.AccessoryType;
|
|
||||||
|
|
||||||
public interface IAccessoryInventory extends IInventory {
|
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);
|
||||||
|
@ -54,5 +51,4 @@ public interface IAccessoryInventory extends IInventory {
|
||||||
public List<ItemStack> getAccessories();
|
public List<ItemStack> getAccessories();
|
||||||
|
|
||||||
public int getAccessoryCount(ItemStack stack);
|
public int getAccessoryCount(ItemStack stack);
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,9 +1,7 @@
|
||||||
package com.gildedgames.the_aether.api.player.util;
|
package com.gildedgames.the_aether.api.player.util;
|
||||||
|
|
||||||
public interface IAetherAbility {
|
public interface IAetherAbility {
|
||||||
|
|
||||||
public void onUpdate();
|
public void onUpdate();
|
||||||
|
|
||||||
public boolean shouldExecute();
|
public boolean shouldExecute();
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,11 +1,9 @@
|
||||||
package com.gildedgames.the_aether.api.player.util;
|
package com.gildedgames.the_aether.api.player.util;
|
||||||
|
|
||||||
public interface IAetherBoss {
|
public interface IAetherBoss {
|
||||||
|
|
||||||
public String getBossName();
|
public String getBossName();
|
||||||
|
|
||||||
public float getBossHealth();
|
public float getBossHealth();
|
||||||
|
|
||||||
public float getMaxBossHealth();
|
public float getMaxBossHealth();
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,11 +4,9 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockAether extends Block {
|
public class BlockAether extends Block {
|
||||||
|
|
||||||
public BlockAether(Material material, String texture) {
|
public BlockAether(Material material, String texture) {
|
||||||
super(material);
|
super(material);
|
||||||
|
|
||||||
this.setBlockTextureName(texture);
|
this.setBlockTextureName(texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,15 +2,13 @@ package com.gildedgames.the_aether.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import com.gildedgames.the_aether.blocks.natural.BlockAetherFlower;
|
||||||
import net.minecraft.block.IGrowable;
|
import net.minecraft.block.IGrowable;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.blocks.natural.BlockAetherFlower;
|
|
||||||
|
|
||||||
public class BlockAetherSapling extends BlockAetherFlower implements IGrowable {
|
public class BlockAetherSapling extends BlockAetherFlower implements IGrowable {
|
||||||
|
|
||||||
public WorldGenerator treeGenObject = null;
|
public WorldGenerator treeGenObject = null;
|
||||||
|
|
||||||
public BlockAetherSapling(WorldGenerator treeGen) {
|
public BlockAetherSapling(WorldGenerator treeGen) {
|
||||||
|
@ -55,7 +53,5 @@ public class BlockAetherSapling extends BlockAetherFlower implements IGrowable {
|
||||||
if (worldIn.rand.nextFloat() < 0.45D) {
|
if (worldIn.rand.nextFloat() < 0.45D) {
|
||||||
this.growTree(worldIn, x, y, z, rand);
|
this.growTree(worldIn, x, y, z, rand);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -6,7 +6,6 @@ import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockIcestone extends Block {
|
public class BlockIcestone extends Block {
|
||||||
|
|
||||||
public BlockIcestone() {
|
public BlockIcestone() {
|
||||||
super(Material.ice);
|
super(Material.ice);
|
||||||
|
|
||||||
|
@ -33,5 +32,4 @@ public class BlockIcestone extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,8 @@
|
||||||
package com.gildedgames.the_aether.blocks;
|
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.AetherConfig;
|
||||||
import com.gildedgames.the_aether.items.ItemsAether;
|
import com.gildedgames.the_aether.items.ItemsAether;
|
||||||
import com.gildedgames.the_aether.player.PlayerAether;
|
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.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import java.util.Iterator;
|
public class BlockSkyrootBed extends BlockBed {
|
||||||
import java.util.Random;
|
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)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon[] field_149980_b;
|
private IIcon[] field_149980_b;
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
|
@ -31,116 +31,138 @@ public class BlockSkyrootBed extends BlockBed
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon[] field_149983_N;
|
private IIcon[] field_149983_N;
|
||||||
|
|
||||||
public BlockSkyrootBed()
|
public BlockSkyrootBed() {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
this.func_149978_e();
|
this.func_149978_e();
|
||||||
this.disableStats();
|
this.disableStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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_)
|
public boolean onBlockActivated(
|
||||||
{
|
World p_149727_1_,
|
||||||
if (p_149727_1_.isRemote)
|
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;
|
return true;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
int i1 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_);
|
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);
|
int j1 = getDirection(i1);
|
||||||
p_149727_2_ += field_149981_a[j1][0];
|
p_149727_2_ += field_149981_a[j1][0];
|
||||||
p_149727_4_ += field_149981_a[j1][1];
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
i1 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_);
|
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 (p_149727_5_.dimension == AetherConfig.getAetherDimensionID()
|
||||||
{
|
|| p_149727_5_.dimension == 0) {
|
||||||
if (func_149976_c(i1))
|
if (func_149976_c(i1)) {
|
||||||
{
|
|
||||||
EntityPlayer entityplayer1 = null;
|
EntityPlayer entityplayer1 = null;
|
||||||
Iterator iterator = p_149727_1_.playerEntities.iterator();
|
Iterator iterator = p_149727_1_.playerEntities.iterator();
|
||||||
|
|
||||||
while (iterator.hasNext())
|
while (iterator.hasNext()) {
|
||||||
{
|
EntityPlayer entityplayer2 = (EntityPlayer) iterator.next();
|
||||||
EntityPlayer entityplayer2 = (EntityPlayer)iterator.next();
|
|
||||||
|
|
||||||
if (entityplayer2.isPlayerSleeping())
|
if (entityplayer2.isPlayerSleeping()) {
|
||||||
{
|
ChunkCoordinates chunkcoordinates
|
||||||
ChunkCoordinates chunkcoordinates = entityplayer2.playerLocation;
|
= 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;
|
entityplayer1 = entityplayer2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entityplayer1 != null)
|
if (entityplayer1 != null) {
|
||||||
{
|
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation(
|
||||||
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.occupied", new Object[0]));
|
"tile.bed.occupied", new Object[0]
|
||||||
|
));
|
||||||
return true;
|
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)
|
if (enumstatus == EntityPlayer.EnumStatus.OK) {
|
||||||
{
|
func_149979_a(
|
||||||
func_149979_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, true);
|
p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, true
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else
|
if (enumstatus == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW) {
|
||||||
{
|
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation(
|
||||||
if (enumstatus == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW)
|
"tile.bed.noSleep", new Object[0]
|
||||||
{
|
));
|
||||||
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.noSleep", new Object[0]));
|
|
||||||
|
|
||||||
if (p_149727_5_.dimension == AetherConfig.getAetherDimensionID())
|
if (p_149727_5_.dimension
|
||||||
{
|
== AetherConfig.getAetherDimensionID()) {
|
||||||
p_149727_5_.addChatMessage(new ChatComponentTranslation("gui.skyroot_bed.respawn_point"));
|
p_149727_5_.addChatMessage(new ChatComponentTranslation(
|
||||||
p_149727_5_.setSpawnChunk(new ChunkCoordinates(p_149727_2_, p_149727_3_, p_149727_4_), false, AetherConfig.getAetherDimensionID());
|
"gui.skyroot_bed.respawn_point"
|
||||||
PlayerAether.get(p_149727_5_).setBedLocation(new ChunkCoordinates(p_149727_2_, p_149727_3_, p_149727_4_));
|
));
|
||||||
|
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) {
|
||||||
else if (enumstatus == EntityPlayer.EnumStatus.NOT_SAFE)
|
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation(
|
||||||
{
|
"tile.bed.notSafe", new Object[0]
|
||||||
p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.notSafe", new Object[0]));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
double d2 = (double) p_149727_2_ + 0.5D;
|
||||||
{
|
double d0 = (double) p_149727_3_ + 0.5D;
|
||||||
double d2 = (double)p_149727_2_ + 0.5D;
|
double d1 = (double) p_149727_4_ + 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_);
|
p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_);
|
||||||
int k1 = getDirection(i1);
|
int k1 = getDirection(i1);
|
||||||
p_149727_2_ += field_149981_a[k1][0];
|
p_149727_2_ += field_149981_a[k1][0];
|
||||||
p_149727_4_ += field_149981_a[k1][1];
|
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_);
|
p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_);
|
||||||
d2 = (d2 + (double)p_149727_2_ + 0.5D) / 2.0D;
|
d2 = (d2 + (double) p_149727_2_ + 0.5D) / 2.0D;
|
||||||
d0 = (d0 + (double)p_149727_3_ + 0.5D) / 2.0D;
|
d0 = (d0 + (double) p_149727_3_ + 0.5D) / 2.0D;
|
||||||
d1 = (d1 + (double)p_149727_4_ + 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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,55 +170,59 @@ public class BlockSkyrootBed extends BlockBed
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_)
|
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||||
{
|
if (p_149691_1_ == 0) {
|
||||||
if (p_149691_1_ == 0)
|
|
||||||
{
|
|
||||||
return BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
|
return BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
int k = getDirection(p_149691_2_);
|
int k = getDirection(p_149691_2_);
|
||||||
int l = Direction.bedDirection[k][p_149691_1_];
|
int l = Direction.bedDirection[k][p_149691_1_];
|
||||||
int i1 = isBlockHeadOfBed(p_149691_2_) ? 1 : 0;
|
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
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister p_149651_1_)
|
public void registerBlockIcons(IIconRegister p_149651_1_) {
|
||||||
{
|
this.field_149983_N = new IIcon[] {
|
||||||
this.field_149983_N = new IIcon[] {p_149651_1_.registerIcon(this.getTextureName() + "_feet_top"), p_149651_1_.registerIcon(this.getTextureName() + "_head_top")};
|
p_149651_1_.registerIcon(this.getTextureName() + "_feet_top"),
|
||||||
this.field_149980_b = new IIcon[] {p_149651_1_.registerIcon(this.getTextureName() + "_feet_end"), p_149651_1_.registerIcon(this.getTextureName() + "_head_end")};
|
p_149651_1_.registerIcon(this.getTextureName() + "_head_top")
|
||||||
this.field_149982_M = new IIcon[] {p_149651_1_.registerIcon(this.getTextureName() + "_feet_side"), p_149651_1_.registerIcon(this.getTextureName() + "_head_side")};
|
};
|
||||||
|
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);
|
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_)
|
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||||
{
|
return isBlockHeadOfBed(p_149650_1_) ? Item.getItemById(0)
|
||||||
return isBlockHeadOfBed(p_149650_1_) ? Item.getItemById(0) : ItemsAether.skyroot_bed_item;
|
: ItemsAether.skyroot_bed_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@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;
|
return ItemsAether.skyroot_bed_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBedFoot(IBlockAccess world, int x, int y, int z)
|
public boolean isBedFoot(IBlockAccess world, int x, int y, int z) {
|
||||||
{
|
|
||||||
return BlockSkyrootBed.isBlockHeadOfBed(world.getBlockMetadata(x, y, z));
|
return BlockSkyrootBed.isBlockHeadOfBed(world.getBlockMetadata(x, y, z));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,6 @@
|
||||||
package com.gildedgames.the_aether.blocks;
|
package com.gildedgames.the_aether.blocks;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
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.BlockEnchanter;
|
||||||
import com.gildedgames.the_aether.blocks.container.BlockFreezer;
|
import com.gildedgames.the_aether.blocks.container.BlockFreezer;
|
||||||
import com.gildedgames.the_aether.blocks.container.BlockIncubator;
|
import com.gildedgames.the_aether.blocks.container.BlockIncubator;
|
||||||
|
@ -48,12 +36,21 @@ import com.gildedgames.the_aether.blocks.natural.BlockHolystone;
|
||||||
import com.gildedgames.the_aether.blocks.natural.BlockQuicksoil;
|
import com.gildedgames.the_aether.blocks.natural.BlockQuicksoil;
|
||||||
import com.gildedgames.the_aether.blocks.portal.BlockAetherPortal;
|
import com.gildedgames.the_aether.blocks.portal.BlockAetherPortal;
|
||||||
import com.gildedgames.the_aether.blocks.util.BlockFloating;
|
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 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;
|
import net.minecraft.item.EnumRarity;
|
||||||
|
|
||||||
public class BlocksAether {
|
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;
|
||||||
|
@ -62,7 +59,8 @@ public class BlocksAether {
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
@ -84,7 +82,8 @@ public class BlocksAether {
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
@ -98,13 +97,18 @@ public class BlocksAether {
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
@ -116,101 +120,382 @@ public class BlocksAether {
|
||||||
|
|
||||||
public static void initialization() {
|
public static void initialization() {
|
||||||
aether_grass = registerMeta("aether_grass", new BlockAetherGrass());
|
aether_grass = registerMeta("aether_grass", new BlockAetherGrass());
|
||||||
enchanted_aether_grass = registerRarity("enchanted_aether_grass", new BlockEnchantedAetherGrass(), EnumRarity.rare);
|
enchanted_aether_grass = registerRarity(
|
||||||
|
"enchanted_aether_grass", new BlockEnchantedAetherGrass(), EnumRarity.rare
|
||||||
|
);
|
||||||
aether_dirt = registerMeta("aether_dirt", new BlockAetherDirt());
|
aether_dirt = registerMeta("aether_dirt", new BlockAetherDirt());
|
||||||
holystone = registerMeta("holystone", new BlockHolystone());
|
holystone = registerMeta("holystone", new BlockHolystone());
|
||||||
mossy_holystone = registerMeta("mossy_holystone", new BlockHolystone().setBlockTextureName(Aether.find("mossy_holystone")));
|
mossy_holystone = registerMeta(
|
||||||
holystone_brick = register("holystone_brick", new BlockAether(Material.rock, Aether.find("holystone_brick")).setHardness(0.5F).setResistance(10.0F));
|
"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());
|
aercloud = registerMeta("aercloud", new BlockAercloud());
|
||||||
aerogel = registerRarity("aerogel", new BlockAerogel(), ItemsAether.aether_loot);
|
aerogel = registerRarity("aerogel", new BlockAerogel(), ItemsAether.aether_loot);
|
||||||
quicksoil = registerMeta("quicksoil", new BlockQuicksoil());
|
quicksoil = registerMeta("quicksoil", new BlockQuicksoil());
|
||||||
icestone = register("icestone", new BlockIcestone());
|
icestone = register("icestone", new BlockIcestone());
|
||||||
ambrosium_ore = register("ambrosium_ore", new BlockAetherOre(0).setBlockTextureName(Aether.find("ambrosium_ore")));
|
ambrosium_ore = register(
|
||||||
zanite_ore = register("zanite_ore", new BlockAetherOre(1).setBlockTextureName(Aether.find("zanite_ore")));
|
"ambrosium_ore",
|
||||||
gravitite_ore = register("gravitite_ore", new BlockFloating(Material.rock, false).setHardness(5.0F).setBlockTextureName(Aether.find("gravitite_ore")));
|
new BlockAetherOre(0).setBlockTextureName(Aether.find("ambrosium_ore"))
|
||||||
enchanted_gravitite = registerRarity("enchanted_gravitite", new BlockFloating(Material.rock, true).setHardness(5.0F).setBlockTextureName(Aether.find("enchanted_gravitite")), EnumRarity.rare);
|
);
|
||||||
|
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());
|
zanite_block = register("zanite_block", new BlockZanite());
|
||||||
skyroot_leaves = register("skyroot_leaves", new BlockAetherLeaves().setBlockTextureName(Aether.find("skyroot_leaves")));
|
skyroot_leaves = register(
|
||||||
golden_oak_leaves = register("golden_oak_leaves", new BlockAetherLeaves().setBlockTextureName(Aether.find("golden_oak_leaves")));
|
"skyroot_leaves",
|
||||||
crystal_leaves = register("crystal_leaves", new BlockAetherLeaves().setBlockTextureName(Aether.find("crystal_leaves")));
|
new BlockAetherLeaves().setBlockTextureName(Aether.find("skyroot_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")));
|
golden_oak_leaves = register(
|
||||||
decorated_holiday_leaves = register("decorated_holiday_leaves", new BlockAetherLeaves().setBlockTextureName(Aether.find("decorated_holiday_leaves")));
|
"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());
|
present = register("present", new BlockPresent());
|
||||||
skyroot_log = registerMeta("skyroot_log", new BlockAetherLog().setBlockTextureName(Aether.find("skyroot_log")));
|
skyroot_log = registerMeta(
|
||||||
golden_oak_log = registerMeta("golden_oak_log", new BlockAetherLog().setBlockTextureName(Aether.find("golden_oak_log")));
|
"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());
|
skyroot_planks = register("skyroot_planks", new BlockSkyrootPlanks());
|
||||||
quicksoil_glass = registerRarity("quicksoil_glass", new BlockQuicksoilGlass(), EnumRarity.rare);
|
quicksoil_glass = registerRarity(
|
||||||
ambrosium_torch = register("ambrosium_torch", new BlockAmbrosiumTorch().setBlockTextureName(Aether.find("ambrosium_torch")));
|
"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_stem = register("berry_bush_stem", new BlockBerryBushStem());
|
||||||
berry_bush = register("berry_bush", new BlockBerryBush());
|
berry_bush = register("berry_bush", new BlockBerryBush());
|
||||||
purple_flower = register("purple_flower", new BlockAetherFlower().setBlockTextureName(Aether.find("purple_flower")));
|
purple_flower = register(
|
||||||
white_flower = register("white_flower", new BlockAetherFlower().setBlockTextureName(Aether.find("white_flower")));
|
"purple_flower",
|
||||||
skyroot_sapling = register("skyroot_sapling", new BlockAetherSapling(new AetherGenSkyrootTree(false)).setBlockTextureName(Aether.find("skyroot_sapling")));
|
new BlockAetherFlower().setBlockTextureName(Aether.find("purple_flower"))
|
||||||
golden_oak_sapling = register("golden_oak_sapling", new BlockAetherSapling(new AetherGenOakTree()).setBlockTextureName(Aether.find("golden_oak_sapling")));
|
);
|
||||||
|
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());
|
enchanter = registerEnchanter("enchanter", new BlockEnchanter());
|
||||||
freezer = registerMeta("freezer", new BlockFreezer());
|
freezer = registerMeta("freezer", new BlockFreezer());
|
||||||
incubator = registerMeta("incubator", new BlockIncubator());
|
incubator = registerMeta("incubator", new BlockIncubator());
|
||||||
sun_altar = register("sun_altar", new BlockSunAltar());
|
sun_altar = register("sun_altar", new BlockSunAltar());
|
||||||
chest_mimic = register("chest_mimic", new BlockMimicChest());
|
chest_mimic = register("chest_mimic", new BlockMimicChest());
|
||||||
treasure_chest = register("treasure_chest", new BlockTreasureChest());
|
treasure_chest = register("treasure_chest", new BlockTreasureChest());
|
||||||
aether_portal = register("aether_portal", new BlockAetherPortal()).setCreativeTab(null);
|
aether_portal
|
||||||
|
= register("aether_portal", new BlockAetherPortal()).setCreativeTab(null);
|
||||||
pillar = register("pillar", new BlockPillar("pillar_top", "pillar_side"));
|
pillar = register("pillar", new BlockPillar("pillar_top", "pillar_side"));
|
||||||
pillar_top = register("pillar_top", new BlockPillar("pillar_top", "pillar_carved"));
|
pillar_top
|
||||||
carved_stone = register("carved_stone", new BlockDungeonBase(false).setBlockTextureName(Aether.find("carved_stone")));
|
= register("pillar_top", new BlockPillar("pillar_top", "pillar_carved"));
|
||||||
sentry_stone = register("sentry_stone", new BlockDungeonBase(true).setBlockTextureName(Aether.find("sentry_stone")));
|
carved_stone = register(
|
||||||
angelic_stone = register("angelic_stone", new BlockDungeonBase(false).setBlockTextureName(Aether.find("angelic_stone")));
|
"carved_stone",
|
||||||
light_angelic_stone = register("light_angelic_stone", new BlockDungeonBase(true).setBlockTextureName(Aether.find("light_angelic_stone")));
|
new BlockDungeonBase(false).setBlockTextureName(Aether.find("carved_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")));
|
sentry_stone = register(
|
||||||
locked_carved_stone = register("locked_carved_stone", new BlockDungeonBase(carved_stone, false).setBlockTextureName(Aether.find("carved_stone"))).setCreativeTab(null);
|
"sentry_stone",
|
||||||
locked_sentry_stone = register("locked_sentry_stone", new BlockDungeonBase(sentry_stone, true).setBlockTextureName(Aether.find("sentry_stone"))).setCreativeTab(null);
|
new BlockDungeonBase(true).setBlockTextureName(Aether.find("sentry_stone"))
|
||||||
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);
|
angelic_stone = register(
|
||||||
locked_hellfire_stone = register("locked_hellfire_stone", new BlockDungeonBase(hellfire_stone, false).setBlockTextureName(Aether.find("hellfire_stone"))).setCreativeTab(null);
|
"angelic_stone",
|
||||||
locked_light_hellfire_stone = register("locked_light_hellfire_stone", new BlockDungeonBase(light_hellfire_stone, true).setBlockTextureName(Aether.find("light_hellfire_stone"))).setCreativeTab(null);
|
new BlockDungeonBase(false).setBlockTextureName(Aether.find("angelic_stone"))
|
||||||
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);
|
light_angelic_stone = register(
|
||||||
hellfire_trap = register("hellfire_trap", new BlockDungeonTrap(hellfire_stone).setBlockTextureName(Aether.find("hellfire_stone"))).setCreativeTab(null);
|
"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 = register("skyroot_fence", new BlockAetherFence());
|
||||||
skyroot_fence_gate = register("skyroot_fence_gate", new BlockAetherFenceGate());
|
skyroot_fence_gate = register("skyroot_fence_gate", new BlockAetherFenceGate());
|
||||||
carved_wall = register("carved_wall", new BlockAetherWall(carved_stone));
|
carved_wall = register("carved_wall", new BlockAetherWall(carved_stone));
|
||||||
angelic_wall = register("angelic_wall", new BlockAetherWall(angelic_stone));
|
angelic_wall = register("angelic_wall", new BlockAetherWall(angelic_stone));
|
||||||
hellfire_wall = register("hellfire_wall", new BlockAetherWall(hellfire_stone));
|
hellfire_wall = register("hellfire_wall", new BlockAetherWall(hellfire_stone));
|
||||||
holystone_wall = register("holystone_wall", new BlockAetherWall(holystone));
|
holystone_wall = register("holystone_wall", new BlockAetherWall(holystone));
|
||||||
holystone_brick_wall = register("holystone_brick_wall", new BlockAetherWall(holystone_brick));
|
holystone_brick_wall
|
||||||
mossy_holystone_wall = register("mossy_holystone_wall", new BlockAetherWall(mossy_holystone));
|
= register("holystone_brick_wall", new BlockAetherWall(holystone_brick));
|
||||||
aerogel_wall = registerRarity("aerogel_wall", new BlockAetherWall(aerogel), ItemsAether.aether_loot);
|
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));
|
carved_stairs = register("carved_stairs", new BlockAetherStairs(carved_stone));
|
||||||
angelic_stairs = register("angelic_stairs", new BlockAetherStairs(angelic_stone));
|
angelic_stairs = register("angelic_stairs", new BlockAetherStairs(angelic_stone));
|
||||||
hellfire_stairs = register("hellfire_stairs", new BlockAetherStairs(hellfire_stone));
|
hellfire_stairs
|
||||||
skyroot_stairs = register("skyroot_stairs", new BlockAetherStairs(skyroot_planks));
|
= 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_stairs = register("holystone_stairs", new BlockAetherStairs(holystone));
|
||||||
holystone_brick_stairs = register("holystone_brick_stairs", new BlockAetherStairs(holystone_brick));
|
holystone_brick_stairs
|
||||||
mossy_holystone_stairs = register("mossy_holystone_stairs", new BlockAetherStairs(mossy_holystone));
|
= register("holystone_brick_stairs", new BlockAetherStairs(holystone_brick));
|
||||||
aerogel_stairs = registerRarity("aerogel_stairs", new BlockAetherStairs(aerogel), ItemsAether.aether_loot);
|
mossy_holystone_stairs
|
||||||
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);
|
= register("mossy_holystone_stairs", new BlockAetherStairs(mossy_holystone));
|
||||||
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);
|
aerogel_stairs = registerRarity(
|
||||||
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);
|
"aerogel_stairs", new BlockAetherStairs(aerogel), ItemsAether.aether_loot
|
||||||
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);
|
skyroot_double_slab
|
||||||
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);
|
= register(
|
||||||
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);
|
"skyroot_double_slab",
|
||||||
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);
|
new BlockAetherSlab("skyroot_double_slab", true, Material.wood)
|
||||||
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);
|
.setBlockTextureName(Aether.find("skyroot_planks"))
|
||||||
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);
|
.setHardness(2.0F)
|
||||||
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);
|
.setResistance(5.0F)
|
||||||
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);
|
.setCreativeTab(null);
|
||||||
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);
|
carved_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);
|
= register(
|
||||||
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);
|
"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_bookshelf = register("skyroot_bookshelf", new BlockSkyrootBookshelf());
|
||||||
skyroot_bed = registerBed("skyroot_bed", new BlockSkyrootBed().setBlockTextureName(Aether.find("skyroot_bed")));
|
skyroot_bed = registerBed(
|
||||||
|
"skyroot_bed",
|
||||||
|
new BlockSkyrootBed().setBlockTextureName(Aether.find("skyroot_bed"))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initializeHarvestLevels()
|
public static void initializeHarvestLevels() {
|
||||||
{
|
|
||||||
BlocksAether.aether_grass.setHarvestLevel("shovel", 0);
|
BlocksAether.aether_grass.setHarvestLevel("shovel", 0);
|
||||||
BlocksAether.enchanted_aether_grass.setHarvestLevel("shovel", 0);
|
BlocksAether.enchanted_aether_grass.setHarvestLevel("shovel", 0);
|
||||||
BlocksAether.aether_dirt.setHarvestLevel("shovel", 0);
|
BlocksAether.aether_dirt.setHarvestLevel("shovel", 0);
|
||||||
|
@ -285,7 +570,14 @@ public class BlocksAether {
|
||||||
slab1.setBlockName(name);
|
slab1.setBlockName(name);
|
||||||
slab1.setCreativeTab(AetherCreativeTabs.blocks);
|
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;
|
||||||
}
|
}
|
||||||
|
@ -333,5 +625,4 @@ public class BlocksAether {
|
||||||
|
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -9,13 +9,14 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public abstract class BlockAetherContainer extends BlockContainer {
|
public abstract class BlockAetherContainer extends BlockContainer {
|
||||||
|
|
||||||
public BlockAetherContainer(Material materialIn) {
|
public BlockAetherContainer(Material materialIn) {
|
||||||
super(materialIn);
|
super(materialIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack stack) {
|
public void onBlockPlacedBy(
|
||||||
|
World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack stack
|
||||||
|
) {
|
||||||
if (stack.hasDisplayName()) {
|
if (stack.hasDisplayName()) {
|
||||||
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
TileEntity tileentity = worldIn.getTileEntity(x, y, z);
|
||||||
|
|
||||||
|
@ -35,5 +36,4 @@ public abstract class BlockAetherContainer extends BlockContainer {
|
||||||
worldIn.setTileEntity(x, y, z, tileentity);
|
worldIn.setTileEntity(x, y, z, tileentity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -6,6 +6,8 @@ import com.gildedgames.the_aether.Aether;
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
import com.gildedgames.the_aether.blocks.BlocksAether;
|
||||||
import com.gildedgames.the_aether.network.AetherGuiHandler;
|
import com.gildedgames.the_aether.network.AetherGuiHandler;
|
||||||
import com.gildedgames.the_aether.tileentity.TileEntityEnchanter;
|
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.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -19,11 +21,7 @@ import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockEnchanter extends BlockAetherContainer {
|
public class BlockEnchanter extends BlockAetherContainer {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon blockIconTop;
|
private IIcon blockIconTop;
|
||||||
|
|
||||||
|
@ -47,7 +45,8 @@ public class BlockEnchanter extends BlockAetherContainer {
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
|
return side == 1 ? this.blockIconTop
|
||||||
|
: (side == 0 ? this.blockIconBottom : this.blockIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -86,7 +85,17 @@ public class BlockEnchanter extends BlockAetherContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
public boolean onBlockActivated(
|
||||||
|
World world,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int z,
|
||||||
|
EntityPlayer player,
|
||||||
|
int side,
|
||||||
|
float hitX,
|
||||||
|
float hitY,
|
||||||
|
float hitZ
|
||||||
|
) {
|
||||||
player.openGui(Aether.instance, AetherGuiHandler.enchanter, world, x, y, z);
|
player.openGui(Aether.instance, AetherGuiHandler.enchanter, world, x, y, z);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -115,16 +124,29 @@ public class BlockEnchanter extends BlockAetherContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.stackSize -= j1;
|
itemstack.stackSize -= j1;
|
||||||
EntityItem entityitem = new EntityItem(worldIn, (double) ((float) x + f), (double) ((float) y + f1), (double) ((float) z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
EntityItem entityitem = new EntityItem(
|
||||||
|
worldIn,
|
||||||
|
(double) ((float) x + f),
|
||||||
|
(double) ((float) y + f1),
|
||||||
|
(double) ((float) z + f2),
|
||||||
|
new ItemStack(
|
||||||
|
itemstack.getItem(), j1, itemstack.getItemDamage()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
if (itemstack.hasTagCompound()) {
|
if (itemstack.hasTagCompound()) {
|
||||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
entityitem.getEntityItem().setTagCompound(
|
||||||
|
(NBTTagCompound) itemstack.getTagCompound().copy()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
float f3 = 0.05F;
|
float f3 = 0.05F;
|
||||||
entityitem.motionX = (double) ((float) worldIn.rand.nextGaussian() * f3);
|
entityitem.motionX
|
||||||
entityitem.motionY = (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
|
= (double) ((float) worldIn.rand.nextGaussian() * f3);
|
||||||
entityitem.motionZ = (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.spawnEntityInWorld(entityitem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,5 +157,4 @@ public class BlockEnchanter extends BlockAetherContainer {
|
||||||
|
|
||||||
super.breakBlock(worldIn, x, y, z, block, meta);
|
super.breakBlock(worldIn, x, y, z, block, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -6,6 +6,8 @@ import com.gildedgames.the_aether.Aether;
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
import com.gildedgames.the_aether.blocks.BlocksAether;
|
||||||
import com.gildedgames.the_aether.network.AetherGuiHandler;
|
import com.gildedgames.the_aether.network.AetherGuiHandler;
|
||||||
import com.gildedgames.the_aether.tileentity.TileEntityFreezer;
|
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.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -19,11 +21,7 @@ import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockFreezer extends BlockAetherContainer {
|
public class BlockFreezer extends BlockAetherContainer {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon blockIconTop;
|
private IIcon blockIconTop;
|
||||||
|
|
||||||
|
@ -47,7 +45,8 @@ public class BlockFreezer extends BlockAetherContainer {
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
|
return side == 1 ? this.blockIconTop
|
||||||
|
: (side == 0 ? this.blockIconBottom : this.blockIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -73,7 +72,17 @@ public class BlockFreezer extends BlockAetherContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
public boolean onBlockActivated(
|
||||||
|
World world,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int z,
|
||||||
|
EntityPlayer player,
|
||||||
|
int side,
|
||||||
|
float hitX,
|
||||||
|
float hitY,
|
||||||
|
float hitZ
|
||||||
|
) {
|
||||||
player.openGui(Aether.instance, AetherGuiHandler.freezer, world, x, y, z);
|
player.openGui(Aether.instance, AetherGuiHandler.freezer, world, x, y, z);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -115,16 +124,29 @@ public class BlockFreezer extends BlockAetherContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.stackSize -= j1;
|
itemstack.stackSize -= j1;
|
||||||
EntityItem entityitem = new EntityItem(worldIn, (double) ((float) x + f), (double) ((float) y + f1), (double) ((float) z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
EntityItem entityitem = new EntityItem(
|
||||||
|
worldIn,
|
||||||
|
(double) ((float) x + f),
|
||||||
|
(double) ((float) y + f1),
|
||||||
|
(double) ((float) z + f2),
|
||||||
|
new ItemStack(
|
||||||
|
itemstack.getItem(), j1, itemstack.getItemDamage()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
if (itemstack.hasTagCompound()) {
|
if (itemstack.hasTagCompound()) {
|
||||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
entityitem.getEntityItem().setTagCompound(
|
||||||
|
(NBTTagCompound) itemstack.getTagCompound().copy()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
float f3 = 0.05F;
|
float f3 = 0.05F;
|
||||||
entityitem.motionX = (double) ((float) worldIn.rand.nextGaussian() * f3);
|
entityitem.motionX
|
||||||
entityitem.motionY = (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
|
= (double) ((float) worldIn.rand.nextGaussian() * f3);
|
||||||
entityitem.motionZ = (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.spawnEntityInWorld(entityitem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,5 +157,4 @@ public class BlockFreezer extends BlockAetherContainer {
|
||||||
|
|
||||||
super.breakBlock(worldIn, x, y, z, block, meta);
|
super.breakBlock(worldIn, x, y, z, block, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -6,6 +6,8 @@ import com.gildedgames.the_aether.Aether;
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
import com.gildedgames.the_aether.blocks.BlocksAether;
|
||||||
import com.gildedgames.the_aether.network.AetherGuiHandler;
|
import com.gildedgames.the_aether.network.AetherGuiHandler;
|
||||||
import com.gildedgames.the_aether.tileentity.TileEntityIncubator;
|
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.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -19,11 +21,7 @@ import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockIncubator extends BlockAetherContainer {
|
public class BlockIncubator extends BlockAetherContainer {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon blockIconTop;
|
private IIcon blockIconTop;
|
||||||
|
|
||||||
|
@ -47,7 +45,8 @@ public class BlockIncubator extends BlockAetherContainer {
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return side == 1 ? this.blockIconTop : (side == 0 ? this.blockIconBottom : this.blockIcon);
|
return side == 1 ? this.blockIconTop
|
||||||
|
: (side == 0 ? this.blockIconBottom : this.blockIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -86,7 +85,17 @@ public class BlockIncubator extends BlockAetherContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
public boolean onBlockActivated(
|
||||||
|
World world,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int z,
|
||||||
|
EntityPlayer player,
|
||||||
|
int side,
|
||||||
|
float hitX,
|
||||||
|
float hitY,
|
||||||
|
float hitZ
|
||||||
|
) {
|
||||||
player.openGui(Aether.instance, AetherGuiHandler.incubator, world, x, y, z);
|
player.openGui(Aether.instance, AetherGuiHandler.incubator, world, x, y, z);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -115,16 +124,29 @@ public class BlockIncubator extends BlockAetherContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.stackSize -= j1;
|
itemstack.stackSize -= j1;
|
||||||
EntityItem entityitem = new EntityItem(worldIn, (double) ((float) x + f), (double) ((float) y + f1), (double) ((float) z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
EntityItem entityitem = new EntityItem(
|
||||||
|
worldIn,
|
||||||
|
(double) ((float) x + f),
|
||||||
|
(double) ((float) y + f1),
|
||||||
|
(double) ((float) z + f2),
|
||||||
|
new ItemStack(
|
||||||
|
itemstack.getItem(), j1, itemstack.getItemDamage()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
if (itemstack.hasTagCompound()) {
|
if (itemstack.hasTagCompound()) {
|
||||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
entityitem.getEntityItem().setTagCompound(
|
||||||
|
(NBTTagCompound) itemstack.getTagCompound().copy()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
float f3 = 0.05F;
|
float f3 = 0.05F;
|
||||||
entityitem.motionX = (double) ((float) worldIn.rand.nextGaussian() * f3);
|
entityitem.motionX
|
||||||
entityitem.motionY = (double) ((float) worldIn.rand.nextGaussian() * f3 + 0.2F);
|
= (double) ((float) worldIn.rand.nextGaussian() * f3);
|
||||||
entityitem.motionZ = (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.spawnEntityInWorld(entityitem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,5 +157,4 @@ public class BlockIncubator extends BlockAetherContainer {
|
||||||
|
|
||||||
super.breakBlock(worldIn, x, y, z, block, meta);
|
super.breakBlock(worldIn, x, y, z, block, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,6 +4,9 @@ import com.gildedgames.the_aether.Aether;
|
||||||
import com.gildedgames.the_aether.AetherConfig;
|
import com.gildedgames.the_aether.AetherConfig;
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
import com.gildedgames.the_aether.blocks.BlocksAether;
|
||||||
import com.gildedgames.the_aether.world.AetherWorldProvider;
|
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.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
|
@ -17,14 +20,9 @@ import net.minecraft.util.ChatComponentText;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
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;
|
import net.minecraft.world.WorldProvider;
|
||||||
|
|
||||||
public class BlockSunAltar extends Block {
|
public class BlockSunAltar extends Block {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon blockIconTop;
|
private IIcon blockIconTop;
|
||||||
|
|
||||||
|
@ -45,7 +43,10 @@ public class BlockSunAltar extends Block {
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return side == 1 ? this.blockIconTop : (side == 0 ? BlocksAether.hellfire_stone.getBlockTextureFromSide(side) : this.blockIcon);
|
return side == 1
|
||||||
|
? this.blockIconTop
|
||||||
|
: (side == 0 ? BlocksAether.hellfire_stone.getBlockTextureFromSide(side)
|
||||||
|
: this.blockIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -61,59 +62,67 @@ public class BlockSunAltar extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
public boolean onBlockActivated(
|
||||||
|
World world,
|
||||||
if (player.dimension == AetherConfig.getAetherDimensionID())
|
int x,
|
||||||
{
|
int y,
|
||||||
if (world.provider instanceof AetherWorldProvider)
|
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;
|
AetherWorldProvider provider = (AetherWorldProvider) world.provider;
|
||||||
|
|
||||||
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
MinecraftServer server
|
||||||
|
= FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||||
|
|
||||||
if (provider.getIsEternalDay() && provider.getShouldCycleCatchup())
|
if (provider.getIsEternalDay() && provider.getShouldCycleCatchup()) {
|
||||||
{
|
if (server != null
|
||||||
if (server != null && ((server.isDedicatedServer() && (server.getConfigurationManager().func_152596_g(player.getGameProfile()) || AetherConfig.sunAltarMultiplayer()) || !server.isDedicatedServer())))
|
&& ((
|
||||||
{
|
server.isDedicatedServer()
|
||||||
|
&& (server.getConfigurationManager()
|
||||||
|
.func_152596_g(player.getGameProfile())
|
||||||
|
|| AetherConfig.sunAltarMultiplayer())
|
||||||
|
|| !server.isDedicatedServer()
|
||||||
|
))) {
|
||||||
Aether.proxy.openSunAltar();
|
Aether.proxy.openSunAltar();
|
||||||
}
|
} else if (world.isRemote) {
|
||||||
else if (world.isRemote)
|
if (player instanceof EntityPlayerSP
|
||||||
{
|
&& (player.canCommandSenderUseCommand(2, "")
|
||||||
if (player instanceof EntityPlayerSP && (player.canCommandSenderUseCommand(2, "") || AetherConfig.sunAltarMultiplayer()))
|
|| AetherConfig.sunAltarMultiplayer())) {
|
||||||
{
|
|
||||||
Aether.proxy.openSunAltar();
|
Aether.proxy.openSunAltar();
|
||||||
|
} else {
|
||||||
|
player.addChatComponentMessage(new ChatComponentText(
|
||||||
|
I18n.format("gui.sun_altar.permission")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
} else if (!provider.getIsEternalDay()) {
|
||||||
player.addChatComponentMessage(new ChatComponentText(I18n.format("gui.sun_altar.permission")));
|
if (world.isRemote) {
|
||||||
|
player.addChatComponentMessage(new ChatComponentText(
|
||||||
|
I18n.format("gui.sun_altar.eternal_day")
|
||||||
|
));
|
||||||
|
}
|
||||||
|
} else if (!provider.getShouldCycleCatchup()) {
|
||||||
|
if (world.isRemote) {
|
||||||
|
player.addChatComponentMessage(new ChatComponentText(
|
||||||
|
I18n.format("gui.sun_altar.cycle_catchup")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!provider.getIsEternalDay())
|
} else {
|
||||||
{
|
if (world.isRemote) {
|
||||||
if (world.isRemote)
|
player.addChatComponentMessage(
|
||||||
{
|
new ChatComponentText(I18n.format("gui.sun_altar.message"))
|
||||||
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,15 +1,12 @@
|
||||||
package com.gildedgames.the_aether.blocks.decorative;
|
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.BlockBreakable;
|
||||||
import net.minecraft.block.material.Material;
|
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 class BlockAerogel extends BlockBreakable {
|
||||||
|
|
||||||
public BlockAerogel() {
|
public BlockAerogel() {
|
||||||
super(Aether.find("aerogel"), Material.rock, false);
|
super(Aether.find("aerogel"), Material.rock, false);
|
||||||
|
|
||||||
|
@ -30,5 +27,4 @@ public class BlockAerogel extends BlockBreakable {
|
||||||
public boolean renderAsNormalBlock() {
|
public boolean renderAsNormalBlock() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
package com.gildedgames.the_aether.blocks.decorative;
|
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.Block;
|
||||||
import net.minecraft.block.BlockFence;
|
import net.minecraft.block.BlockFence;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
@ -7,11 +9,7 @@ import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
|
||||||
|
|
||||||
public class BlockAetherFence extends BlockFence {
|
public class BlockAetherFence extends BlockFence {
|
||||||
|
|
||||||
public BlockAetherFence() {
|
public BlockAetherFence() {
|
||||||
super(Aether.find("skyroot_planks"), Material.wood);
|
super(Aether.find("skyroot_planks"), Material.wood);
|
||||||
|
|
||||||
|
@ -26,9 +24,15 @@ public class BlockAetherFence extends BlockFence {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canConnectFenceTo(IBlockAccess p_149826_1_, int p_149826_2_, int p_149826_3_, int p_149826_4_) {
|
public boolean canConnectFenceTo(
|
||||||
|
IBlockAccess p_149826_1_, int p_149826_2_, int p_149826_3_, int p_149826_4_
|
||||||
|
) {
|
||||||
Block block = p_149826_1_.getBlock(p_149826_2_, p_149826_3_, p_149826_4_);
|
Block block = p_149826_1_.getBlock(p_149826_2_, p_149826_3_, p_149826_4_);
|
||||||
return block != this && block != Blocks.fence_gate && block != BlocksAether.skyroot_fence_gate ? (block.getMaterial().isOpaque() && block.renderAsNormalBlock() ? block.getMaterial() != Material.gourd : false) : true;
|
return block != this && block != Blocks.fence_gate
|
||||||
|
&& block != BlocksAether.skyroot_fence_gate
|
||||||
|
? (block.getMaterial().isOpaque() && block.renderAsNormalBlock()
|
||||||
|
? block.getMaterial() != Material.gourd
|
||||||
|
: false)
|
||||||
|
: true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,16 +1,13 @@
|
||||||
package com.gildedgames.the_aether.blocks.decorative;
|
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.Aether;
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
import com.gildedgames.the_aether.blocks.BlocksAether;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.block.BlockFenceGate;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
public class BlockAetherFenceGate extends BlockFenceGate {
|
public class BlockAetherFenceGate extends BlockFenceGate {
|
||||||
|
|
||||||
public BlockAetherFenceGate() {
|
public BlockAetherFenceGate() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
@ -25,5 +22,4 @@ public class BlockAetherFenceGate extends BlockFenceGate {
|
||||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||||
return BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
|
return BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,6 +2,7 @@ package com.gildedgames.the_aether.blocks.decorative;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import com.gildedgames.the_aether.blocks.BlocksAether;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
@ -10,10 +11,7 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
|
||||||
|
|
||||||
public class BlockAetherSlab extends BlockSlab {
|
public class BlockAetherSlab extends BlockSlab {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
public BlockAetherSlab(String name, boolean double_slab, Material materialIn) {
|
public BlockAetherSlab(String name, boolean double_slab, Material materialIn) {
|
||||||
|
@ -25,7 +23,8 @@ public class BlockAetherSlab extends BlockSlab {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
|
public Item
|
||||||
|
getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
|
||||||
return Item.getItemFromBlock(this.getDroppedSlab());
|
return Item.getItemFromBlock(this.getDroppedSlab());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +66,9 @@ public class BlockAetherSlab extends BlockSlab {
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public int getRenderBlockPass() {
|
public int getRenderBlockPass() {
|
||||||
return this == BlocksAether.aerogel_slab || this == BlocksAether.aerogel_double_slab ? 1 : 0;
|
return this == BlocksAether.aerogel_slab
|
||||||
|
|| this == BlocksAether.aerogel_double_slab
|
||||||
|
? 1
|
||||||
|
: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,9 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockStairs;
|
import net.minecraft.block.BlockStairs;
|
||||||
|
|
||||||
public class BlockAetherStairs extends BlockStairs {
|
public class BlockAetherStairs extends BlockStairs {
|
||||||
|
|
||||||
public BlockAetherStairs(Block block) {
|
public BlockAetherStairs(Block block) {
|
||||||
super(block, 0);
|
super(block, 0);
|
||||||
|
|
||||||
this.setLightOpacity(0);
|
this.setLightOpacity(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,6 +3,8 @@ package com.gildedgames.the_aether.blocks.decorative;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
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.Block;
|
||||||
import net.minecraft.block.BlockWall;
|
import net.minecraft.block.BlockWall;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
@ -10,11 +12,8 @@ import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockAetherWall extends BlockWall {
|
public class BlockAetherWall extends BlockWall {
|
||||||
|
|
||||||
private Block block;
|
private Block block;
|
||||||
|
|
||||||
public BlockAetherWall(Block block) {
|
public BlockAetherWall(Block block) {
|
||||||
|
@ -30,8 +29,9 @@ public class BlockAetherWall extends BlockWall {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
|
public void
|
||||||
|
getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
|
||||||
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0));
|
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.gildedgames.the_aether.blocks.decorative;
|
||||||
import net.minecraft.block.BlockTorch;
|
import net.minecraft.block.BlockTorch;
|
||||||
|
|
||||||
public class BlockAmbrosiumTorch extends BlockTorch {
|
public class BlockAmbrosiumTorch extends BlockTorch {
|
||||||
|
|
||||||
public BlockAmbrosiumTorch() {
|
public BlockAmbrosiumTorch() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
@ -11,5 +10,4 @@ public class BlockAmbrosiumTorch extends BlockTorch {
|
||||||
this.setLightLevel(0.9375F);
|
this.setLightLevel(0.9375F);
|
||||||
this.setStepSound(soundTypeWood);
|
this.setStepSound(soundTypeWood);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,10 @@
|
||||||
package com.gildedgames.the_aether.blocks.decorative;
|
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.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -10,15 +15,7 @@ import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
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 {
|
public class BlockPresent extends Block {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon blockIconTop;
|
private IIcon blockIconTop;
|
||||||
|
|
||||||
|
@ -55,7 +52,8 @@ public class BlockPresent extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
public void
|
||||||
|
harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
||||||
int randomNumber = (int) (((9 - 6 + 1) * world.rand.nextDouble()) + 6);
|
int randomNumber = (int) (((9 - 6 + 1) * world.rand.nextDouble()) + 6);
|
||||||
int crateType = world.rand.nextInt(4);
|
int crateType = world.rand.nextInt(4);
|
||||||
|
|
||||||
|
@ -67,10 +65,14 @@ public class BlockPresent extends Block {
|
||||||
}
|
}
|
||||||
} else if (crateType == 1) {
|
} else if (crateType == 1) {
|
||||||
if (world.rand.nextInt(9) == 0) {
|
if (world.rand.nextInt(9) == 0) {
|
||||||
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.candy_cane_sword));
|
this.dropBlockAsItem(
|
||||||
|
world, x, y, z, new ItemStack(ItemsAether.candy_cane_sword)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
for (int size = 1; size <= randomNumber; ++size) {
|
for (int size = 1; size <= randomNumber; ++size) {
|
||||||
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.gingerbread_man));
|
this.dropBlockAsItem(
|
||||||
|
world, x, y, z, new ItemStack(ItemsAether.gingerbread_man)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -83,5 +85,4 @@ public class BlockPresent extends Block {
|
||||||
world.playSoundAtEntity(present, "game.tnt.primed", 1.0F, 1.0F);
|
world.playSoundAtEntity(present, "game.tnt.primed", 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,16 +2,13 @@ package com.gildedgames.the_aether.blocks.decorative;
|
||||||
|
|
||||||
import java.util.Random;
|
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.BlockBreakable;
|
||||||
import net.minecraft.block.material.Material;
|
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 class BlockQuicksoilGlass extends BlockBreakable {
|
||||||
|
|
||||||
public BlockQuicksoilGlass() {
|
public BlockQuicksoilGlass() {
|
||||||
super(Aether.find("quicksoil_glass"), Material.glass, false);
|
super(Aether.find("quicksoil_glass"), Material.glass, false);
|
||||||
|
|
||||||
|
@ -43,5 +40,4 @@ public class BlockQuicksoilGlass extends BlockBreakable {
|
||||||
protected boolean canSilkHarvest() {
|
protected boolean canSilkHarvest() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,6 +2,10 @@ package com.gildedgames.the_aether.blocks.decorative;
|
||||||
|
|
||||||
import java.util.Random;
|
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.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
|
@ -9,14 +13,7 @@ import net.minecraft.item.Item;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.World;
|
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 class BlockSkyrootBookshelf extends Block {
|
||||||
|
|
||||||
public BlockSkyrootBookshelf() {
|
public BlockSkyrootBookshelf() {
|
||||||
super(Material.wood);
|
super(Material.wood);
|
||||||
|
|
||||||
|
@ -30,7 +27,9 @@ public class BlockSkyrootBookshelf extends Block {
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||||
return p_149691_1_ != 1 && p_149691_1_ != 0 ? super.getIcon(p_149691_1_, p_149691_2_) : BlocksAether.skyroot_planks.getBlockTextureFromSide(p_149691_1_);
|
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
|
@Override
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
package com.gildedgames.the_aether.blocks.decorative;
|
package com.gildedgames.the_aether.blocks.decorative;
|
||||||
|
|
||||||
|
import com.gildedgames.the_aether.Aether;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
|
||||||
|
|
||||||
public class BlockSkyrootPlanks extends Block {
|
public class BlockSkyrootPlanks extends Block {
|
||||||
|
|
||||||
public BlockSkyrootPlanks() {
|
public BlockSkyrootPlanks() {
|
||||||
super(Material.wood);
|
super(Material.wood);
|
||||||
|
|
||||||
|
@ -15,5 +13,4 @@ public class BlockSkyrootPlanks extends Block {
|
||||||
this.setStepSound(soundTypeWood);
|
this.setStepSound(soundTypeWood);
|
||||||
this.setBlockTextureName(Aether.find("skyroot_planks"));
|
this.setBlockTextureName(Aether.find("skyroot_planks"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,13 +1,11 @@
|
||||||
package com.gildedgames.the_aether.blocks.decorative;
|
package com.gildedgames.the_aether.blocks.decorative;
|
||||||
|
|
||||||
|
import com.gildedgames.the_aether.Aether;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
|
||||||
|
|
||||||
public class BlockZanite extends Block {
|
public class BlockZanite extends Block {
|
||||||
|
|
||||||
public BlockZanite() {
|
public BlockZanite() {
|
||||||
super(Material.iron);
|
super(Material.iron);
|
||||||
|
|
||||||
|
@ -18,8 +16,9 @@ public class BlockZanite extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
public boolean isBeaconBase(
|
||||||
|
IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ
|
||||||
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -10,7 +10,6 @@ import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockDungeonBase extends Block {
|
public class BlockDungeonBase extends Block {
|
||||||
|
|
||||||
private Block pickBlock;
|
private Block pickBlock;
|
||||||
|
|
||||||
private boolean isLit;
|
private boolean isLit;
|
||||||
|
@ -49,7 +48,9 @@ public class BlockDungeonBase extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
public ItemStack getPickBlock(
|
||||||
|
MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player
|
||||||
|
) {
|
||||||
if (this.pickBlock != null) {
|
if (this.pickBlock != null) {
|
||||||
return new ItemStack(this.pickBlock);
|
return new ItemStack(this.pickBlock);
|
||||||
}
|
}
|
||||||
|
@ -60,5 +61,4 @@ public class BlockDungeonBase extends Block {
|
||||||
public Block getUnlockedBlock() {
|
public Block getUnlockedBlock() {
|
||||||
return this.pickBlock == null ? this : this.pickBlock;
|
return this.pickBlock == null ? this : this.pickBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -11,7 +11,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockDungeonTrap extends Block {
|
public class BlockDungeonTrap extends Block {
|
||||||
|
|
||||||
private Block pickBlock;
|
private Block pickBlock;
|
||||||
|
|
||||||
public BlockDungeonTrap(Block pickBlock) {
|
public BlockDungeonTrap(Block pickBlock) {
|
||||||
|
@ -48,8 +47,14 @@ public class BlockDungeonTrap extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
world.playSoundEffect(x, y, z, "random.door_close", 2.0F, world.rand.nextFloat() - world.rand.nextFloat() * 0.2F + 1.2F);
|
world.playSoundEffect(
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
z,
|
||||||
|
"random.door_close",
|
||||||
|
2.0F,
|
||||||
|
world.rand.nextFloat() - world.rand.nextFloat() * 0.2F + 1.2F
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -11,7 +11,6 @@ import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockMimicChest extends BlockChest {
|
public class BlockMimicChest extends BlockChest {
|
||||||
|
|
||||||
public BlockMimicChest() {
|
public BlockMimicChest() {
|
||||||
super(13);
|
super(13);
|
||||||
|
|
||||||
|
@ -24,21 +23,41 @@ public class BlockMimicChest extends BlockChest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer playerIn, int side, float hitX, float hitY, float hitZ) {
|
public boolean onBlockActivated(
|
||||||
|
World worldIn,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int z,
|
||||||
|
EntityPlayer playerIn,
|
||||||
|
int side,
|
||||||
|
float hitX,
|
||||||
|
float hitY,
|
||||||
|
float hitZ
|
||||||
|
) {
|
||||||
this.spawnMimic(worldIn, playerIn, x, y, z);
|
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
|
@Override
|
||||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
public void
|
||||||
|
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||||
this.spawnMimic(worldIn, player, x, y, z);
|
this.spawnMimic(worldIn, player, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
public ItemStack getPickBlock(
|
||||||
|
MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player
|
||||||
|
) {
|
||||||
return new ItemStack(Blocks.chest);
|
return new ItemStack(Blocks.chest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,5 +73,4 @@ public class BlockMimicChest extends BlockChest {
|
||||||
|
|
||||||
world.setBlockToAir(x, y, z);
|
world.setBlockToAir(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
package com.gildedgames.the_aether.blocks.dungeon;
|
package com.gildedgames.the_aether.blocks.dungeon;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
import com.gildedgames.the_aether.Aether;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.block.BlockRotatedPillar;
|
import net.minecraft.block.BlockRotatedPillar;
|
||||||
|
@ -10,7 +9,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
public class BlockPillar extends BlockRotatedPillar {
|
public class BlockPillar extends BlockRotatedPillar {
|
||||||
|
|
||||||
private String topTexture;
|
private String topTexture;
|
||||||
|
|
||||||
private String sideTexture;
|
private String sideTexture;
|
||||||
|
@ -41,5 +39,4 @@ public class BlockPillar extends BlockRotatedPillar {
|
||||||
this.field_150164_N = registry.registerIcon(Aether.find(this.topTexture));
|
this.field_150164_N = registry.registerIcon(Aether.find(this.topTexture));
|
||||||
this.sideIcon = registry.registerIcon(Aether.find(this.sideTexture));
|
this.sideIcon = registry.registerIcon(Aether.find(this.sideTexture));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -7,6 +7,8 @@ import com.gildedgames.the_aether.CommonProxy;
|
||||||
import com.gildedgames.the_aether.items.ItemsAether;
|
import com.gildedgames.the_aether.items.ItemsAether;
|
||||||
import com.gildedgames.the_aether.network.AetherGuiHandler;
|
import com.gildedgames.the_aether.network.AetherGuiHandler;
|
||||||
import com.gildedgames.the_aether.tileentity.TileEntityTreasureChest;
|
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.block.BlockChest;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
@ -16,11 +18,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.Explosion;
|
import net.minecraft.world.Explosion;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockTreasureChest extends BlockChest {
|
public class BlockTreasureChest extends BlockChest {
|
||||||
|
|
||||||
public BlockTreasureChest() {
|
public BlockTreasureChest() {
|
||||||
super(56);
|
super(56);
|
||||||
|
|
||||||
|
@ -29,23 +27,32 @@ public class BlockTreasureChest extends BlockChest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getBlockHardness(World p_149712_1_, int p_149712_2_, int p_149712_3_, int p_149712_4_)
|
public float getBlockHardness(
|
||||||
{
|
World p_149712_1_, int p_149712_2_, int p_149712_3_, int p_149712_4_
|
||||||
TileEntityTreasureChest treasurechest = (TileEntityTreasureChest) p_149712_1_.getTileEntity(p_149712_2_, p_149712_3_, p_149712_4_);
|
) {
|
||||||
|
TileEntityTreasureChest treasurechest = (TileEntityTreasureChest
|
||||||
|
) p_149712_1_.getTileEntity(p_149712_2_, p_149712_3_, p_149712_4_);
|
||||||
|
|
||||||
if (treasurechest != null)
|
if (treasurechest != null) {
|
||||||
{
|
|
||||||
return treasurechest.isLocked() ? this.blockHardness : 5.0F;
|
return treasurechest.isLocked() ? this.blockHardness : 5.0F;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return this.blockHardness;
|
return this.blockHardness;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ)
|
public float getExplosionResistance(
|
||||||
{
|
Entity par1Entity,
|
||||||
TileEntityTreasureChest treasurechest = (TileEntityTreasureChest) world.getTileEntity(x, y, z);
|
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;
|
||||||
}
|
}
|
||||||
|
@ -62,17 +69,29 @@ public class BlockTreasureChest extends BlockChest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer playerIn, int side, float hitX, float hitY, float hitZ) {
|
public boolean onBlockActivated(
|
||||||
|
World worldIn,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int z,
|
||||||
|
EntityPlayer playerIn,
|
||||||
|
int side,
|
||||||
|
float hitX,
|
||||||
|
float hitY,
|
||||||
|
float hitZ
|
||||||
|
) {
|
||||||
if (worldIn.isRemote) {
|
if (worldIn.isRemote) {
|
||||||
return true;
|
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 (treasurechest.isLocked()) {
|
||||||
if (guiID == null || guiID != null && guiID.getItem() != ItemsAether.dungeon_key) {
|
if (guiID == null
|
||||||
|
|| guiID != null && guiID.getItem() != ItemsAether.dungeon_key) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +99,9 @@ public class BlockTreasureChest extends BlockChest {
|
||||||
|
|
||||||
--guiID.stackSize;
|
--guiID.stackSize;
|
||||||
} else {
|
} else {
|
||||||
playerIn.openGui(Aether.instance, AetherGuiHandler.treasure_chest, worldIn, x, y, z);
|
playerIn.openGui(
|
||||||
|
Aether.instance, AetherGuiHandler.treasure_chest, worldIn, x, y, z
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -95,5 +116,4 @@ public class BlockTreasureChest extends BlockChest {
|
||||||
public int getRenderType() {
|
public int getRenderType() {
|
||||||
return CommonProxy.treasureChestRenderID;
|
return CommonProxy.treasureChestRenderID;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,6 +5,8 @@ import java.util.List;
|
||||||
import com.gildedgames.the_aether.items.block.IColoredBlock;
|
import com.gildedgames.the_aether.items.block.IColoredBlock;
|
||||||
import com.gildedgames.the_aether.items.block.INamedBlock;
|
import com.gildedgames.the_aether.items.block.INamedBlock;
|
||||||
import com.gildedgames.the_aether.registry.achievements.AchievementsAether;
|
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.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
@ -18,11 +20,7 @@ import net.minecraft.util.Facing;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
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 class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
|
||||||
|
|
||||||
public BlockAercloud() {
|
public BlockAercloud() {
|
||||||
super(Material.ice);
|
super(Material.ice);
|
||||||
|
|
||||||
|
@ -32,15 +30,17 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
|
public void
|
||||||
|
getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
|
||||||
p_149666_3_.add(new ItemStack(this, 1, 0));
|
p_149666_3_.add(new ItemStack(this, 1, 0));
|
||||||
p_149666_3_.add(new ItemStack(this, 1, 1));
|
p_149666_3_.add(new ItemStack(this, 1, 1));
|
||||||
p_149666_3_.add(new ItemStack(this, 1, 2));
|
p_149666_3_.add(new ItemStack(this, 1, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
public void
|
||||||
|
onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||||
entity.fallDistance = 0;
|
entity.fallDistance = 0;
|
||||||
|
|
||||||
if (world.getBlockMetadata(x, y, z) == 1) {
|
if (world.getBlockMetadata(x, y, z) == 1) {
|
||||||
|
@ -59,10 +59,8 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
|
||||||
|
|
||||||
entity.motionY = 2.0D;
|
entity.motionY = 2.0D;
|
||||||
} else {
|
} else {
|
||||||
if (entity instanceof EntityArrow)
|
if (entity instanceof EntityArrow) {
|
||||||
{
|
if (entity.ticksExisted >= 1200) {
|
||||||
if (entity.ticksExisted >= 1200)
|
|
||||||
{
|
|
||||||
entity.setDead();
|
entity.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,7 +127,9 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack) {
|
public String getUnlocalizedName(ItemStack stack) {
|
||||||
return stack.getItemDamage() == 1 ? "blue_aercloud" : stack.getItemDamage() == 2 ? "golden_aercloud" : "cold_aercloud";
|
return stack.getItemDamage() == 1 ? "blue_aercloud"
|
||||||
|
: stack.getItemDamage() == 2 ? "golden_aercloud"
|
||||||
|
: "cold_aercloud";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -145,10 +145,21 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
|
public boolean shouldSideBeRendered(
|
||||||
|
IBlockAccess p_149646_1_,
|
||||||
|
int p_149646_2_,
|
||||||
|
int p_149646_3_,
|
||||||
|
int p_149646_4_,
|
||||||
|
int p_149646_5_
|
||||||
|
) {
|
||||||
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
|
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
|
||||||
|
|
||||||
if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_) != p_149646_1_.getBlockMetadata(p_149646_2_ - Facing.offsetsXForSide[p_149646_5_], p_149646_3_ - Facing.offsetsYForSide[p_149646_5_], p_149646_4_ - Facing.offsetsZForSide[p_149646_5_])) {
|
if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_)
|
||||||
|
!= p_149646_1_.getBlockMetadata(
|
||||||
|
p_149646_2_ - Facing.offsetsXForSide[p_149646_5_],
|
||||||
|
p_149646_3_ - Facing.offsetsYForSide[p_149646_5_],
|
||||||
|
p_149646_4_ - Facing.offsetsZForSide[p_149646_5_]
|
||||||
|
)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,12 +167,16 @@ public class BlockAercloud extends Block implements IColoredBlock, INamedBlock {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
|
return super.shouldSideBeRendered(
|
||||||
|
p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
public AxisAlignedBB
|
||||||
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);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,14 +1,12 @@
|
||||||
package com.gildedgames.the_aether.blocks.natural;
|
package com.gildedgames.the_aether.blocks.natural;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
|
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockAetherDirt extends Block {
|
public class BlockAetherDirt extends Block {
|
||||||
|
|
||||||
public BlockAetherDirt() {
|
public BlockAetherDirt() {
|
||||||
super(Material.ground);
|
super(Material.ground);
|
||||||
|
|
||||||
|
@ -19,7 +17,8 @@ public class BlockAetherDirt extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
public void
|
||||||
|
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||||
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,5 +26,4 @@ public class BlockAetherDirt extends Block {
|
||||||
public int damageDropped(int meta) {
|
public int damageDropped(int meta) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -8,20 +8,29 @@ import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockAetherFlower extends BlockBush {
|
public class BlockAetherFlower extends BlockBush {
|
||||||
|
public AxisAlignedBB FLOWER_AABB = AxisAlignedBB.getBoundingBox(
|
||||||
public AxisAlignedBB FLOWER_AABB = AxisAlignedBB.getBoundingBox(0.30000001192092896D, 0.0D, 0.30000001192092896D, 0.699999988079071D, 0.6000000238418579D, 0.699999988079071D);
|
0.30000001192092896D,
|
||||||
|
0.0D,
|
||||||
|
0.30000001192092896D,
|
||||||
|
0.699999988079071D,
|
||||||
|
0.6000000238418579D,
|
||||||
|
0.699999988079071D
|
||||||
|
);
|
||||||
|
|
||||||
public BlockAetherFlower() {
|
public BlockAetherFlower() {
|
||||||
this.setHardness(0.0F);
|
this.setHardness(0.0F);
|
||||||
this.setTickRandomly(true);
|
this.setTickRandomly(true);
|
||||||
this.setStepSound(soundTypeGrass);
|
this.setStepSound(soundTypeGrass);
|
||||||
this.setBlockBounds(0.5F - 0.2F, 0.0F, 0.5F - 0.2F, 0.5F + 0.2F, 0.2F * 3.0F, 0.5F + 0.2F);
|
this.setBlockBounds(
|
||||||
|
0.5F - 0.2F, 0.0F, 0.5F - 0.2F, 0.5F + 0.2F, 0.2F * 3.0F, 0.5F + 0.2F
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
|
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
|
||||||
Block soil = world.getBlock(x, y - 1, z);
|
Block soil = world.getBlock(x, y - 1, z);
|
||||||
return soil == BlocksAether.aether_grass || soil == BlocksAether.aether_dirt || soil == BlocksAether.enchanted_aether_grass;
|
return soil == BlocksAether.aether_grass || soil == BlocksAether.aether_dirt
|
||||||
|
|| soil == BlocksAether.enchanted_aether_grass;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,5 +43,4 @@ public class BlockAetherFlower extends BlockBush {
|
||||||
public int getRenderType() {
|
public int getRenderType() {
|
||||||
return CommonProxy.aetherFlowerRenderID;
|
return CommonProxy.aetherFlowerRenderID;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,6 +5,8 @@ import java.util.Random;
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
import com.gildedgames.the_aether.blocks.BlocksAether;
|
||||||
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
|
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
|
||||||
import com.gildedgames.the_aether.world.AetherWorld;
|
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.Block;
|
||||||
import net.minecraft.block.IGrowable;
|
import net.minecraft.block.IGrowable;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
@ -19,11 +21,7 @@ import net.minecraftforge.common.EnumPlantType;
|
||||||
import net.minecraftforge.common.IPlantable;
|
import net.minecraftforge.common.IPlantable;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
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 {
|
public class BlockAetherGrass extends Block implements IGrowable {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon blockIconTop;
|
private IIcon blockIconTop;
|
||||||
|
|
||||||
|
@ -42,7 +40,8 @@ public class BlockAetherGrass extends Block implements IGrowable {
|
||||||
@Override
|
@Override
|
||||||
public void updateTick(World worldIn, int x, int y, int z, Random rand) {
|
public void updateTick(World worldIn, int x, int y, int z, Random rand) {
|
||||||
if (!worldIn.isRemote) {
|
if (!worldIn.isRemote) {
|
||||||
if (worldIn.getBlockLightValue(x, y + 1, z) < 4 && worldIn.getBlockLightOpacity(x, y + 1, z) > 2) {
|
if (worldIn.getBlockLightValue(x, y + 1, z) < 4
|
||||||
|
&& worldIn.getBlockLightOpacity(x, y + 1, z) > 2) {
|
||||||
worldIn.setBlock(x, y, z, BlocksAether.aether_dirt);
|
worldIn.setBlock(x, y, z, BlocksAether.aether_dirt);
|
||||||
} else if (worldIn.getBlockLightValue(x, y + 1, z) >= 9) {
|
} else if (worldIn.getBlockLightValue(x, y + 1, z) >= 9) {
|
||||||
for (int l = 0; l < 4; ++l) {
|
for (int l = 0; l < 4; ++l) {
|
||||||
|
@ -50,7 +49,10 @@ public class BlockAetherGrass extends Block implements IGrowable {
|
||||||
int j1 = y + rand.nextInt(5) - 3;
|
int j1 = y + rand.nextInt(5) - 3;
|
||||||
int k1 = z + rand.nextInt(3) - 1;
|
int k1 = z + rand.nextInt(3) - 1;
|
||||||
|
|
||||||
if (worldIn.getBlock(i1, j1, k1) == BlocksAether.aether_dirt && worldIn.getBlockMetadata(i1, j1, k1) == 0 && worldIn.getBlockLightValue(i1, j1 + 1, k1) >= 4 && worldIn.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) {
|
if (worldIn.getBlock(i1, j1, k1) == BlocksAether.aether_dirt
|
||||||
|
&& worldIn.getBlockMetadata(i1, j1, k1) == 0
|
||||||
|
&& worldIn.getBlockLightValue(i1, j1 + 1, k1) >= 4
|
||||||
|
&& worldIn.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) {
|
||||||
worldIn.setBlock(i1, j1, k1, BlocksAether.aether_grass);
|
worldIn.setBlock(i1, j1, k1, BlocksAether.aether_grass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +66,8 @@ public class BlockAetherGrass extends Block implements IGrowable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
public void
|
||||||
|
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||||
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,53 +80,79 @@ public class BlockAetherGrass extends Block implements IGrowable {
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister registry) {
|
public void registerBlockIcons(IIconRegister registry) {
|
||||||
this.blockIcon = registry.registerIcon("aether_legacy:aether_grass_side");
|
this.blockIcon = registry.registerIcon("aether_legacy:aether_grass_side");
|
||||||
this.blockIconSnowy = registry.registerIcon("aether_legacy:aether_grass_side_snowy");
|
this.blockIconSnowy
|
||||||
|
= registry.registerIcon("aether_legacy:aether_grass_side_snowy");
|
||||||
this.blockIconTop = registry.registerIcon("aether_legacy:aether_grass_top");
|
this.blockIconTop = registry.registerIcon("aether_legacy:aether_grass_top");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return side == 1 ? this.blockIconTop : (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side) : this.blockIcon);
|
return side == 1
|
||||||
|
? this.blockIconTop
|
||||||
|
: (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side)
|
||||||
|
: this.blockIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
if (side == 1)
|
if (side == 1) {
|
||||||
{
|
|
||||||
return this.blockIconTop;
|
return this.blockIconTop;
|
||||||
}
|
} else if (side == 0) {
|
||||||
else if (side == 0)
|
|
||||||
{
|
|
||||||
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
|
return BlocksAether.aether_dirt.getBlockTextureFromSide(side);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
Material material = world.getBlock(x, y + 1, z).getMaterial();
|
Material material = world.getBlock(x, y + 1, z).getMaterial();
|
||||||
return material != Material.snow && material != Material.craftedSnow ? this.blockIcon : this.blockIconSnowy;
|
return material != Material.snow && material != Material.craftedSnow
|
||||||
|
? this.blockIcon
|
||||||
|
: this.blockIconSnowy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
|
public boolean canSustainPlant(
|
||||||
|
IBlockAccess world,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int z,
|
||||||
|
ForgeDirection direction,
|
||||||
|
IPlantable plantable
|
||||||
|
) {
|
||||||
EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);
|
EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);
|
||||||
|
|
||||||
return plantType == EnumPlantType.Plains;
|
return plantType == EnumPlantType.Plains;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) {
|
public boolean func_149851_a(
|
||||||
|
World p_149851_1_,
|
||||||
|
int p_149851_2_,
|
||||||
|
int p_149851_3_,
|
||||||
|
int p_149851_4_,
|
||||||
|
boolean p_149851_5_
|
||||||
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) {
|
public boolean func_149852_a(
|
||||||
|
World p_149852_1_,
|
||||||
|
Random p_149852_2_,
|
||||||
|
int p_149852_3_,
|
||||||
|
int p_149852_4_,
|
||||||
|
int p_149852_5_
|
||||||
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) {
|
public void func_149853_b(
|
||||||
|
World p_149853_1_,
|
||||||
|
Random p_149853_2_,
|
||||||
|
int p_149853_3_,
|
||||||
|
int p_149853_4_,
|
||||||
|
int p_149853_5_
|
||||||
|
) {
|
||||||
int l = 0;
|
int l = 0;
|
||||||
|
|
||||||
while (l < 128) {
|
while (l < 128) {
|
||||||
|
@ -138,7 +167,8 @@ public class BlockAetherGrass extends Block implements IGrowable {
|
||||||
j1 += (p_149853_2_.nextInt(3) - 1) * p_149853_2_.nextInt(3) / 2;
|
j1 += (p_149853_2_.nextInt(3) - 1) * p_149853_2_.nextInt(3) / 2;
|
||||||
k1 += p_149853_2_.nextInt(3) - 1;
|
k1 += p_149853_2_.nextInt(3) - 1;
|
||||||
|
|
||||||
if (p_149853_1_.getBlock(i1, j1 - 1, k1) == BlocksAether.aether_grass && !p_149853_1_.getBlock(i1, j1, k1).isNormalCube()) {
|
if (p_149853_1_.getBlock(i1, j1 - 1, k1) == BlocksAether.aether_grass
|
||||||
|
&& !p_149853_1_.getBlock(i1, j1, k1).isNormalCube()) {
|
||||||
++l1;
|
++l1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -148,11 +178,17 @@ public class BlockAetherGrass extends Block implements IGrowable {
|
||||||
p_149853_1_.setBlock(i1, j1, k1, Blocks.tallgrass, 1, 3);
|
p_149853_1_.setBlock(i1, j1, k1, Blocks.tallgrass, 1, 3);
|
||||||
}
|
}
|
||||||
} else if (p_149853_2_.nextInt(12) == 0) {
|
} else if (p_149853_2_.nextInt(12) == 0) {
|
||||||
if (BlocksAether.berry_bush_stem.canBlockStay(p_149853_1_, i1, j1, k1)) {
|
if (BlocksAether.berry_bush_stem.canBlockStay(
|
||||||
p_149853_1_.setBlock(i1, j1, k1, BlocksAether.berry_bush_stem, 0, 3);
|
p_149853_1_, i1, j1, k1
|
||||||
|
)) {
|
||||||
|
p_149853_1_.setBlock(
|
||||||
|
i1, j1, k1, BlocksAether.berry_bush_stem, 0, 3
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
AetherWorld.aether_biome.plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1);
|
AetherWorld.aether_biome.plantFlower(
|
||||||
|
p_149853_1_, p_149853_2_, i1, j1, k1
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,5 +197,4 @@ public class BlockAetherGrass extends Block implements IGrowable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -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.ParticleGoldenOakLeaves;
|
||||||
import com.gildedgames.the_aether.entities.particles.ParticleHolidayLeaves;
|
import com.gildedgames.the_aether.entities.particles.ParticleHolidayLeaves;
|
||||||
import com.gildedgames.the_aether.items.ItemsAether;
|
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.block.BlockLeaves;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -17,12 +20,7 @@ import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
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 {
|
public class BlockAetherLeaves extends BlockLeaves {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon fastIcon;
|
private IIcon fastIcon;
|
||||||
|
|
||||||
|
@ -65,7 +63,8 @@ public class BlockAetherLeaves extends BlockLeaves {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (net.minecraft.client.Minecraft.getMinecraft().gameSettings.particleSetting == 2) {
|
if (net.minecraft.client.Minecraft.getMinecraft().gameSettings.particleSetting
|
||||||
|
== 2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,12 +77,14 @@ public class BlockAetherLeaves extends BlockLeaves {
|
||||||
double d4 = (rand.nextFloat() - 0.5D) * 0.5D;
|
double d4 = (rand.nextFloat() - 0.5D) * 0.5D;
|
||||||
double d5 = (rand.nextFloat() - 0.5D) * 0.5D;
|
double d5 = (rand.nextFloat() - 0.5D) * 0.5D;
|
||||||
|
|
||||||
ParticleGoldenOakLeaves obj = new ParticleGoldenOakLeaves(world, d, d1, d2, d3, d4, d5);
|
ParticleGoldenOakLeaves obj
|
||||||
|
= new ParticleGoldenOakLeaves(world, d, d1, d2, d3, d4, d5);
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(obj);
|
FMLClientHandler.instance().getClient().effectRenderer.addEffect(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this == BlocksAether.holiday_leaves || this == BlocksAether.decorated_holiday_leaves) {
|
if (this == BlocksAether.holiday_leaves
|
||||||
|
|| this == BlocksAether.decorated_holiday_leaves) {
|
||||||
if (rand.nextInt(5) == 0) {
|
if (rand.nextInt(5) == 0) {
|
||||||
for (int l = 0; l < 6; ++l) {
|
for (int l = 0; l < 6; ++l) {
|
||||||
double d = (double) x + ((double) rand.nextFloat() - 0.5D) * 8.0D;
|
double d = (double) x + ((double) rand.nextFloat() - 0.5D) * 8.0D;
|
||||||
|
@ -93,13 +94,17 @@ public class BlockAetherLeaves extends BlockLeaves {
|
||||||
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||||
double d5 = ((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);
|
ParticleHolidayLeaves particle
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
= new ParticleHolidayLeaves(world, d, d1, d2, d3, d4, d5);
|
||||||
|
FMLClientHandler.instance().getClient().effectRenderer.addEffect(
|
||||||
|
particle
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this == BlocksAether.crystal_leaves || this == BlocksAether.crystal_fruit_leaves) {
|
if (this == BlocksAether.crystal_leaves
|
||||||
|
|| this == BlocksAether.crystal_fruit_leaves) {
|
||||||
if (rand.nextInt(5) == 0) {
|
if (rand.nextInt(5) == 0) {
|
||||||
for (int l = 0; l < 6; ++l) {
|
for (int l = 0; l < 6; ++l) {
|
||||||
double d = (double) x + ((double) rand.nextFloat() - 0.5D) * 6.0D;
|
double d = (double) x + ((double) rand.nextFloat() - 0.5D) * 6.0D;
|
||||||
|
@ -109,8 +114,11 @@ public class BlockAetherLeaves extends BlockLeaves {
|
||||||
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||||
double d5 = ((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);
|
ParticleCrystalLeaves particle
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
= new ParticleCrystalLeaves(world, d, d1, d2, d3, d4, d5);
|
||||||
|
FMLClientHandler.instance().getClient().effectRenderer.addEffect(
|
||||||
|
particle
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,11 +126,16 @@ public class BlockAetherLeaves extends BlockLeaves {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int meta, Random random, int fortune) {
|
public Item getItemDropped(int meta, Random random, int fortune) {
|
||||||
return this == BlocksAether.skyroot_leaves ? Item.getItemFromBlock(BlocksAether.skyroot_sapling) : this == BlocksAether.golden_oak_leaves ? Item.getItemFromBlock(BlocksAether.golden_oak_sapling) : null;
|
return this == BlocksAether.skyroot_leaves
|
||||||
|
? Item.getItemFromBlock(BlocksAether.skyroot_sapling)
|
||||||
|
: this == BlocksAether.golden_oak_leaves
|
||||||
|
? Item.getItemFromBlock(BlocksAether.golden_oak_sapling)
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
public ArrayList<ItemStack>
|
||||||
|
getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||||
ArrayList<ItemStack> drops = super.getDrops(world, x, y, z, metadata, fortune);
|
ArrayList<ItemStack> drops = super.getDrops(world, x, y, z, metadata, fortune);
|
||||||
|
|
||||||
if (this == BlocksAether.crystal_fruit_leaves) {
|
if (this == BlocksAether.crystal_fruit_leaves) {
|
||||||
|
@ -134,8 +147,7 @@ public class BlockAetherLeaves extends BlockLeaves {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister p_149651_1_)
|
public void registerBlockIcons(IIconRegister p_149651_1_) {
|
||||||
{
|
|
||||||
this.fancyIcon = p_149651_1_.registerIcon(this.getTextureName());
|
this.fancyIcon = p_149651_1_.registerIcon(this.getTextureName());
|
||||||
this.fastIcon = p_149651_1_.registerIcon(this.getTextureName() + "_opaque");
|
this.fastIcon = p_149651_1_.registerIcon(this.getTextureName() + "_opaque");
|
||||||
}
|
}
|
||||||
|
@ -143,25 +155,27 @@ public class BlockAetherLeaves extends BlockLeaves {
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
if (Minecraft.getMinecraft().gameSettings.fancyGraphics)
|
if (Minecraft.getMinecraft().gameSettings.fancyGraphics) {
|
||||||
{
|
|
||||||
return fancyIcon;
|
return fancyIcon;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
return fastIcon;
|
return fastIcon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
|
public boolean shouldSideBeRendered(
|
||||||
|
IBlockAccess p_149646_1_,
|
||||||
|
int p_149646_2_,
|
||||||
|
int p_149646_3_,
|
||||||
|
int p_149646_4_,
|
||||||
|
int p_149646_5_
|
||||||
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] func_150125_e() {
|
public String[] func_150125_e() {
|
||||||
return new String[]{this.getUnlocalizedName()};
|
return new String[] { this.getUnlocalizedName() };
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -7,7 +7,8 @@ import com.gildedgames.the_aether.blocks.BlocksAether;
|
||||||
import com.gildedgames.the_aether.items.ItemsAether;
|
import com.gildedgames.the_aether.items.ItemsAether;
|
||||||
import com.gildedgames.the_aether.items.tools.*;
|
import com.gildedgames.the_aether.items.tools.*;
|
||||||
import com.gildedgames.the_aether.items.util.EnumAetherToolType;
|
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.block.BlockLog;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.enchantment.Enchantment;
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
@ -19,19 +20,16 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.stats.StatList;
|
import net.minecraft.stats.StatList;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
|
|
||||||
public class BlockAetherLog extends BlockLog {
|
public class BlockAetherLog extends BlockLog {
|
||||||
|
|
||||||
public BlockAetherLog() {
|
public BlockAetherLog() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
public void
|
||||||
|
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||||
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
||||||
player.addExhaustion(0.025F);
|
player.addExhaustion(0.025F);
|
||||||
|
|
||||||
|
@ -39,38 +37,77 @@ public class BlockAetherLog extends BlockLog {
|
||||||
|
|
||||||
ItemStack stack = player.getCurrentEquippedItem();
|
ItemStack stack = player.getCurrentEquippedItem();
|
||||||
|
|
||||||
|
if (this.canSilkHarvest(worldIn, player, x, y, z, meta)
|
||||||
if (this.canSilkHarvest(worldIn, player, x, y, z, meta) && EnchantmentHelper.getSilkTouchModifier(player))
|
&& EnchantmentHelper.getSilkTouchModifier(player)) {
|
||||||
{
|
|
||||||
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
||||||
ItemStack itemstack = this.createStackedBlock(meta);
|
ItemStack itemstack = this.createStackedBlock(meta);
|
||||||
|
|
||||||
if (itemstack != null)
|
if (itemstack != null) {
|
||||||
{
|
|
||||||
items.add(itemstack);
|
items.add(itemstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
ForgeEventFactory.fireBlockHarvesting(items, worldIn, this, x, y, z, meta, 0, 1.0f, true, player);
|
ForgeEventFactory.fireBlockHarvesting(
|
||||||
for (ItemStack is : items)
|
items, worldIn, this, x, y, z, meta, 0, 1.0f, true, player
|
||||||
{
|
);
|
||||||
|
for (ItemStack is : items) {
|
||||||
this.dropBlockAsItem(worldIn, x, y, z, is);
|
this.dropBlockAsItem(worldIn, x, y, z, is);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
if (stack != null
|
||||||
{
|
&& ((stack.getItem() instanceof ItemAetherTool
|
||||||
if (stack != null && ((stack.getItem() instanceof ItemAetherTool && ((ItemAetherTool) stack.getItem()).toolType == EnumAetherToolType.AXE) || stack.getItem() == Items.diamond_axe)) {
|
&& ((ItemAetherTool) stack.getItem()).toolType
|
||||||
if (stack.getItem() instanceof ItemZaniteTool || stack.getItem() instanceof ItemGravititeTool || stack.getItem() instanceof ItemValkyrieTool || stack.getItem() == Items.diamond_axe) {
|
== 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) {
|
if (this == BlocksAether.golden_oak_log) {
|
||||||
this.dropBlockAsItem(worldIn, x, y, z, new ItemStack(ItemsAether.golden_amber, 1 + worldIn.rand.nextInt(2)));
|
this.dropBlockAsItem(
|
||||||
|
worldIn,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
z,
|
||||||
|
new ItemStack(
|
||||||
|
ItemsAether.golden_amber, 1 + worldIn.rand.nextInt(2)
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
this.dropBlockAsItem(
|
||||||
|
player.worldObj,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
z,
|
||||||
|
meta,
|
||||||
|
EnchantmentHelper.getEnchantmentLevel(
|
||||||
|
Enchantment.fortune.effectId, stack
|
||||||
|
)
|
||||||
|
);
|
||||||
} else if (stack.getItem() instanceof ItemSkyrootTool) {
|
} else if (stack.getItem() instanceof ItemSkyrootTool) {
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
this.dropBlockAsItem(
|
||||||
|
player.worldObj,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
z,
|
||||||
|
meta,
|
||||||
|
EnchantmentHelper.getEnchantmentLevel(
|
||||||
|
Enchantment.fortune.effectId, stack
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.dropBlockAsItem(player.worldObj, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
this.dropBlockAsItem(
|
||||||
|
player.worldObj,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
z,
|
||||||
|
meta,
|
||||||
|
EnchantmentHelper.getEnchantmentLevel(
|
||||||
|
Enchantment.fortune.effectId, stack
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||||
|
@ -95,9 +132,10 @@ public class BlockAetherLog extends BlockLog {
|
||||||
this.field_150166_b = new IIcon[1];
|
this.field_150166_b = new IIcon[1];
|
||||||
|
|
||||||
for (int i = 0; i < this.field_150167_a.length; ++i) {
|
for (int i = 0; i < this.field_150167_a.length; ++i) {
|
||||||
this.field_150167_a[i] = registry.registerIcon(this.getTextureName() + "_side");
|
this.field_150167_a[i]
|
||||||
this.field_150166_b[i] = registry.registerIcon(this.getTextureName() + "_top");
|
= registry.registerIcon(this.getTextureName() + "_side");
|
||||||
|
this.field_150166_b[i]
|
||||||
|
= registry.registerIcon(this.getTextureName() + "_top");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -20,7 +20,6 @@ import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockAetherOre extends Block {
|
public class BlockAetherOre extends Block {
|
||||||
|
|
||||||
public BlockAetherOre(int level) {
|
public BlockAetherOre(int level) {
|
||||||
super(Material.rock);
|
super(Material.rock);
|
||||||
|
|
||||||
|
@ -31,21 +30,34 @@ public class BlockAetherOre extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
public void
|
||||||
|
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||||
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
||||||
player.addExhaustion(0.025F);
|
player.addExhaustion(0.025F);
|
||||||
|
|
||||||
ItemStack stack = player.getCurrentEquippedItem();
|
ItemStack stack = player.getCurrentEquippedItem();
|
||||||
|
|
||||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0) {
|
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack)
|
||||||
|
> 0) {
|
||||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stack != null && stack.getItem() instanceof ItemSkyrootTool && ((ItemAetherTool) stack.getItem()).toolType == EnumAetherToolType.PICKAXE) {
|
if (stack != null && stack.getItem() instanceof ItemSkyrootTool
|
||||||
|
&& ((ItemAetherTool) stack.getItem()).toolType
|
||||||
|
== EnumAetherToolType.PICKAXE) {
|
||||||
for (int i = 0; i < 2; ++i) {
|
for (int i = 0; i < 2; ++i) {
|
||||||
this.dropBlockAsItem(worldIn, x, y, z, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
|
this.dropBlockAsItem(
|
||||||
|
worldIn,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
z,
|
||||||
|
meta,
|
||||||
|
EnchantmentHelper.getEnchantmentLevel(
|
||||||
|
Enchantment.fortune.effectId, stack
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.harvestBlock(worldIn, player, x, y, z, meta);
|
super.harvestBlock(worldIn, player, x, y, z, meta);
|
||||||
|
@ -54,12 +66,14 @@ public class BlockAetherOre extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int meta, Random random, int fortune) {
|
public Item getItemDropped(int meta, Random random, int fortune) {
|
||||||
return this == BlocksAether.zanite_ore ? ItemsAether.zanite_gemstone : ItemsAether.ambrosium_shard;
|
return this == BlocksAether.zanite_ore ? ItemsAether.zanite_gemstone
|
||||||
|
: ItemsAether.ambrosium_shard;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int quantityDroppedWithBonus(int fortune, Random random) {
|
public int quantityDroppedWithBonus(int fortune, Random random) {
|
||||||
if (fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped(0, random, fortune)) {
|
if (fortune > 0
|
||||||
|
&& Item.getItemFromBlock(this) != this.getItemDropped(0, random, fortune)) {
|
||||||
int j = random.nextInt(fortune + 2) - 1;
|
int j = random.nextInt(fortune + 2) - 1;
|
||||||
|
|
||||||
if (j < 0) {
|
if (j < 0) {
|
||||||
|
@ -76,7 +90,8 @@ public class BlockAetherOre extends Block {
|
||||||
public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) {
|
public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) {
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
|
|
||||||
if (this.getItemDropped(p_149690_5_, random, p_149690_7_) != Item.getItemFromBlock(this)) {
|
if (this.getItemDropped(p_149690_5_, random, p_149690_7_)
|
||||||
|
!= Item.getItemFromBlock(this)) {
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
|
|
||||||
if (this == BlocksAether.ambrosium_ore) {
|
if (this == BlocksAether.ambrosium_ore) {
|
||||||
|
@ -90,5 +105,4 @@ public class BlockAetherOre extends Block {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -6,6 +6,8 @@ import com.gildedgames.the_aether.Aether;
|
||||||
import com.gildedgames.the_aether.CommonProxy;
|
import com.gildedgames.the_aether.CommonProxy;
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
import com.gildedgames.the_aether.blocks.BlocksAether;
|
||||||
import com.gildedgames.the_aether.items.ItemsAether;
|
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.Block;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -15,11 +17,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockBerryBush extends BlockAetherFlower {
|
public class BlockBerryBush extends BlockAetherFlower {
|
||||||
|
|
||||||
public BlockBerryBush() {
|
public BlockBerryBush() {
|
||||||
this.setHardness(0.2F);
|
this.setHardness(0.2F);
|
||||||
this.setHarvestLevel("axe", 0);
|
this.setHarvestLevel("axe", 0);
|
||||||
|
@ -39,7 +37,8 @@ public class BlockBerryBush extends BlockAetherFlower {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void harvestBlock(World world, EntityPlayer entityplayer, int x, int y, int z, int meta) {
|
public void
|
||||||
|
harvestBlock(World world, EntityPlayer entityplayer, int x, int y, int z, int meta) {
|
||||||
int min, max;
|
int min, max;
|
||||||
|
|
||||||
if (world.getBlock(x, y, z) == BlocksAether.enchanted_aether_grass) {
|
if (world.getBlock(x, y, z) == BlocksAether.enchanted_aether_grass) {
|
||||||
|
@ -57,7 +56,9 @@ public class BlockBerryBush extends BlockAetherFlower {
|
||||||
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
|
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
|
||||||
|
|
||||||
if (randomNum != 0) {
|
if (randomNum != 0) {
|
||||||
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0));
|
this.dropBlockAsItem(
|
||||||
|
world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,19 +76,31 @@ public class BlockBerryBush extends BlockAetherFlower {
|
||||||
}
|
}
|
||||||
|
|
||||||
int randomNum = world.rand.nextInt(max - min + 1) + min;
|
int randomNum = world.rand.nextInt(max - min + 1) + min;
|
||||||
this.dropBlockAsItem(world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0));
|
this.dropBlockAsItem(
|
||||||
|
world, x, y, z, new ItemStack(ItemsAether.blueberry, randomNum, 0)
|
||||||
|
);
|
||||||
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
|
world.setBlock(x, y, z, BlocksAether.berry_bush_stem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) {
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(
|
||||||
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);
|
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
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
public boolean
|
||||||
|
shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,5 +108,4 @@ public class BlockBerryBush extends BlockAetherFlower {
|
||||||
public int getRenderType() {
|
public int getRenderType() {
|
||||||
return CommonProxy.berryBushRenderID;
|
return CommonProxy.berryBushRenderID;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,21 +4,21 @@ import java.util.Random;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
import com.gildedgames.the_aether.Aether;
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
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.block.IGrowable;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
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 class BlockBerryBushStem extends BlockAetherFlower implements IGrowable {
|
||||||
|
|
||||||
public BlockBerryBushStem() {
|
public BlockBerryBushStem() {
|
||||||
this.setHardness(0.2F);
|
this.setHardness(0.2F);
|
||||||
this.setStepSound(soundTypeGrass);
|
this.setStepSound(soundTypeGrass);
|
||||||
this.setBlockTextureName(Aether.find("berry_bush_stem"));
|
this.setBlockTextureName(Aether.find("berry_bush_stem"));
|
||||||
this.setBlockBounds(0.5F - 0.4F, 0.0F, 0.5F - 0.4F, 0.5F + 0.4F, 0.4F * 2.0F, 0.5F + 0.4F);
|
this.setBlockBounds(
|
||||||
|
0.5F - 0.4F, 0.0F, 0.5F - 0.4F, 0.5F + 0.4F, 0.4F * 2.0F, 0.5F + 0.4F
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -35,12 +35,14 @@ public class BlockBerryBushStem extends BlockAetherFlower implements IGrowable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
public AxisAlignedBB
|
||||||
|
getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
public boolean
|
||||||
|
shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,5 +60,4 @@ public class BlockBerryBushStem extends BlockAetherFlower implements IGrowable {
|
||||||
public void func_149853_b(World world, Random random, int x, int y, int z) {
|
public void func_149853_b(World world, Random random, int x, int y, int z) {
|
||||||
world.setBlock(x, y, z, BlocksAether.berry_bush);
|
world.setBlock(x, y, z, BlocksAether.berry_bush);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,15 +1,14 @@
|
||||||
package com.gildedgames.the_aether.blocks.natural;
|
package com.gildedgames.the_aether.blocks.natural;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.blocks.BlocksAether;
|
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.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockEnchantedAetherGrass extends Block {
|
public class BlockEnchantedAetherGrass extends Block {
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon blockIconTop;
|
private IIcon blockIconTop;
|
||||||
|
@ -25,14 +24,19 @@ public class BlockEnchantedAetherGrass extends Block {
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister registry) {
|
public void registerBlockIcons(IIconRegister registry) {
|
||||||
this.blockIcon = registry.registerIcon("aether_legacy:enchanted_aether_grass_side");
|
this.blockIcon
|
||||||
this.blockIconTop = registry.registerIcon("aether_legacy:enchanted_aether_grass_top");
|
= registry.registerIcon("aether_legacy:enchanted_aether_grass_side");
|
||||||
|
this.blockIconTop
|
||||||
|
= registry.registerIcon("aether_legacy:enchanted_aether_grass_top");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return side == 1 ? this.blockIconTop : (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side) : this.blockIcon);
|
return side == 1
|
||||||
|
? this.blockIconTop
|
||||||
|
: (side == 0 ? BlocksAether.aether_dirt.getBlockTextureFromSide(side)
|
||||||
|
: this.blockIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -46,5 +50,4 @@ public class BlockEnchantedAetherGrass extends Block {
|
||||||
|
|
||||||
return this.blockIcon;
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,14 +1,12 @@
|
||||||
package com.gildedgames.the_aether.blocks.natural;
|
package com.gildedgames.the_aether.blocks.natural;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
|
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockHolystone extends Block {
|
public class BlockHolystone extends Block {
|
||||||
|
|
||||||
public BlockHolystone() {
|
public BlockHolystone() {
|
||||||
super(Material.rock);
|
super(Material.rock);
|
||||||
|
|
||||||
|
@ -19,7 +17,8 @@ public class BlockHolystone extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
public void
|
||||||
|
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||||
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,5 +26,4 @@ public class BlockHolystone extends Block {
|
||||||
public int damageDropped(int meta) {
|
public int damageDropped(int meta) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,14 +1,12 @@
|
||||||
package com.gildedgames.the_aether.blocks.natural;
|
package com.gildedgames.the_aether.blocks.natural;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
|
import com.gildedgames.the_aether.items.util.DoubleDropHelper;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockQuicksoil extends Block {
|
public class BlockQuicksoil extends Block {
|
||||||
|
|
||||||
public BlockQuicksoil() {
|
public BlockQuicksoil() {
|
||||||
super(Material.sand);
|
super(Material.sand);
|
||||||
|
|
||||||
|
@ -21,7 +19,8 @@ public class BlockQuicksoil extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
public void
|
||||||
|
harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
|
||||||
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
DoubleDropHelper.dropBlock(player, x, y, z, this, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,5 +28,4 @@ public class BlockQuicksoil extends Block {
|
||||||
public int damageDropped(int meta) {
|
public int damageDropped(int meta) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -10,7 +10,6 @@ import net.minecraft.util.Direction;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class AetherPortalSize {
|
public class AetherPortalSize {
|
||||||
|
|
||||||
private final World world;
|
private final World world;
|
||||||
private final int axis;
|
private final int axis;
|
||||||
public final int rightDir;
|
public final int rightDir;
|
||||||
|
@ -27,15 +26,26 @@ public class AetherPortalSize {
|
||||||
this.leftDir = BlockPortal.field_150001_a[axis][0];
|
this.leftDir = BlockPortal.field_150001_a[axis][0];
|
||||||
this.rightDir = BlockPortal.field_150001_a[axis][1];
|
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) {
|
if (i >= 0) {
|
||||||
this.bottomLeft = new ChunkCoordinates(x + i * Direction.offsetX[this.leftDir], y, z + i * Direction.offsetZ[this.leftDir]);
|
this.bottomLeft = new ChunkCoordinates(
|
||||||
this.width = this.getDistanceUntilEdge(this.bottomLeft.posX, this.bottomLeft.posY, this.bottomLeft.posZ, this.rightDir);
|
x + i * Direction.offsetX[this.leftDir],
|
||||||
|
y,
|
||||||
|
z + i * Direction.offsetZ[this.leftDir]
|
||||||
|
);
|
||||||
|
this.width = this.getDistanceUntilEdge(
|
||||||
|
this.bottomLeft.posX,
|
||||||
|
this.bottomLeft.posY,
|
||||||
|
this.bottomLeft.posZ,
|
||||||
|
this.rightDir
|
||||||
|
);
|
||||||
|
|
||||||
if (this.width < 2 || this.width > 21) {
|
if (this.width < 2 || this.width > 21) {
|
||||||
this.bottomLeft = null;
|
this.bottomLeft = null;
|
||||||
|
@ -85,9 +95,12 @@ public class AetherPortalSize {
|
||||||
|
|
||||||
for (this.height = 0; this.height < 21; ++this.height) {
|
for (this.height = 0; this.height < 21; ++this.height) {
|
||||||
for (int i = 0; i < this.width; ++i) {
|
for (int i = 0; i < this.width; ++i) {
|
||||||
int k = this.bottomLeft.posX + i * Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]];
|
int k = this.bottomLeft.posX
|
||||||
int l = this.bottomLeft.posZ + i * Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]];
|
+ i * Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]];
|
||||||
Block block = this.world.getBlock(k, this.bottomLeft.posY + this.height, l);
|
int l = this.bottomLeft.posZ
|
||||||
|
+ i * Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]];
|
||||||
|
Block block
|
||||||
|
= this.world.getBlock(k, this.bottomLeft.posY + this.height, l);
|
||||||
|
|
||||||
if (!this.isEmptyBlock(block)) {
|
if (!this.isEmptyBlock(block)) {
|
||||||
break label24;
|
break label24;
|
||||||
|
@ -98,13 +111,21 @@ public class AetherPortalSize {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
block = this.world.getBlock(k + Direction.offsetX[BlockPortal.field_150001_a[this.axis][0]], this.bottomLeft.posY + this.height, l + Direction.offsetZ[BlockPortal.field_150001_a[this.axis][0]]);
|
block = this.world.getBlock(
|
||||||
|
k + Direction.offsetX[BlockPortal.field_150001_a[this.axis][0]],
|
||||||
|
this.bottomLeft.posY + this.height,
|
||||||
|
l + Direction.offsetZ[BlockPortal.field_150001_a[this.axis][0]]
|
||||||
|
);
|
||||||
|
|
||||||
if (block != Blocks.glowstone) {
|
if (block != Blocks.glowstone) {
|
||||||
break label24;
|
break label24;
|
||||||
}
|
}
|
||||||
} else if (i == this.width - 1) {
|
} else if (i == this.width - 1) {
|
||||||
block = this.world.getBlock(k + Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]], this.bottomLeft.posY + this.height, l + Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]]);
|
block = this.world.getBlock(
|
||||||
|
k + Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]],
|
||||||
|
this.bottomLeft.posY + this.height,
|
||||||
|
l + Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]]
|
||||||
|
);
|
||||||
|
|
||||||
if (block != Blocks.glowstone) {
|
if (block != Blocks.glowstone) {
|
||||||
break label24;
|
break label24;
|
||||||
|
@ -114,9 +135,11 @@ public class AetherPortalSize {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < this.width; ++j) {
|
for (int j = 0; j < this.width; ++j) {
|
||||||
int i = this.bottomLeft.posX + j * Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]];
|
int i = this.bottomLeft.posX
|
||||||
|
+ j * Direction.offsetX[BlockPortal.field_150001_a[this.axis][1]];
|
||||||
int k = this.bottomLeft.posY + this.height;
|
int k = this.bottomLeft.posY + this.height;
|
||||||
int l = this.bottomLeft.posZ + j * Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]];
|
int l = this.bottomLeft.posZ
|
||||||
|
+ j * Direction.offsetZ[BlockPortal.field_150001_a[this.axis][1]];
|
||||||
|
|
||||||
if (this.world.getBlock(i, k, l) != Blocks.glowstone) {
|
if (this.world.getBlock(i, k, l) != Blocks.glowstone) {
|
||||||
this.height = 0;
|
this.height = 0;
|
||||||
|
@ -135,11 +158,13 @@ public class AetherPortalSize {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isEmptyBlock(Block blockIn) {
|
protected boolean isEmptyBlock(Block blockIn) {
|
||||||
return blockIn.getMaterial() == Material.air || blockIn == Blocks.fire || blockIn == BlocksAether.aether_portal;
|
return blockIn.getMaterial() == Material.air || blockIn == Blocks.fire
|
||||||
|
|| blockIn == BlocksAether.aether_portal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
return this.bottomLeft != null && this.width >= 2 && this.width <= 21
|
||||||
|
&& this.height >= 3 && this.height <= 21;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void placePortalBlocks() {
|
public void placePortalBlocks() {
|
||||||
|
@ -153,5 +178,4 @@ public class AetherPortalSize {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -6,6 +6,9 @@ import com.gildedgames.the_aether.Aether;
|
||||||
import com.gildedgames.the_aether.entities.particles.ParticleAetherPortal;
|
import com.gildedgames.the_aether.entities.particles.ParticleAetherPortal;
|
||||||
import com.gildedgames.the_aether.entities.util.EntityHook;
|
import com.gildedgames.the_aether.entities.util.EntityHook;
|
||||||
import com.gildedgames.the_aether.player.PlayerAether;
|
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.Block;
|
||||||
import net.minecraft.block.BlockPortal;
|
import net.minecraft.block.BlockPortal;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -15,12 +18,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.world.World;
|
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 class BlockAetherPortal extends BlockPortal {
|
||||||
|
|
||||||
public BlockAetherPortal() {
|
public BlockAetherPortal() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
@ -36,11 +34,14 @@ public class BlockAetherPortal extends BlockPortal {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEntityCollidedWithBlock(World world, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity entity) {
|
public void onEntityCollidedWithBlock(
|
||||||
|
World world, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity entity
|
||||||
|
) {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
PlayerAether.get((EntityPlayer) entity).setInPortal();
|
PlayerAether.get((EntityPlayer) entity).setInPortal();
|
||||||
} else if ((entity instanceof EntityLivingBase) && entity.ridingEntity == null && entity.riddenByEntity == null) {
|
} else if ((entity instanceof EntityLivingBase) && entity.ridingEntity == null && entity.riddenByEntity == null) {
|
||||||
((EntityHook) entity.getExtendedProperties("aether_legacy:entity_hook")).setInPortal();
|
((EntityHook) entity.getExtendedProperties("aether_legacy:entity_hook"))
|
||||||
|
.setInPortal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,9 +53,11 @@ public class BlockAetherPortal extends BlockPortal {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
AetherPortalSize aetherportal$size1 = new AetherPortalSize(worldIn, x, y, z, 2);
|
AetherPortalSize aetherportal$size1
|
||||||
|
= new AetherPortalSize(worldIn, x, y, z, 2);
|
||||||
|
|
||||||
if (aetherportal$size1.isValid() && aetherportal$size1.portalBlockCount == 0) {
|
if (aetherportal$size1.isValid()
|
||||||
|
&& aetherportal$size1.portalBlockCount == 0) {
|
||||||
aetherportal$size1.placePortalBlocks();
|
aetherportal$size1.placePortalBlocks();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -71,13 +74,18 @@ public class BlockAetherPortal extends BlockPortal {
|
||||||
if (l == 1) {
|
if (l == 1) {
|
||||||
AetherPortalSize blockportal$size = new AetherPortalSize(worldIn, x, y, z, 1);
|
AetherPortalSize blockportal$size = new AetherPortalSize(worldIn, x, y, z, 1);
|
||||||
|
|
||||||
if (!blockportal$size.isValid() || blockportal$size.portalBlockCount < blockportal$size.width * blockportal$size.height) {
|
if (!blockportal$size.isValid()
|
||||||
|
|| blockportal$size.portalBlockCount
|
||||||
|
< blockportal$size.width * blockportal$size.height) {
|
||||||
worldIn.setBlock(x, y, z, Blocks.air);
|
worldIn.setBlock(x, y, z, Blocks.air);
|
||||||
}
|
}
|
||||||
} else if (l == 2) {
|
} else if (l == 2) {
|
||||||
AetherPortalSize blockportal$size1 = new AetherPortalSize(worldIn, x, y, z, 2);
|
AetherPortalSize blockportal$size1
|
||||||
|
= new AetherPortalSize(worldIn, x, y, z, 2);
|
||||||
|
|
||||||
if (!blockportal$size1.isValid() || blockportal$size1.portalBlockCount < blockportal$size1.width * blockportal$size1.height) {
|
if (!blockportal$size1.isValid()
|
||||||
|
|| blockportal$size1.portalBlockCount
|
||||||
|
< blockportal$size1.width * blockportal$size1.height) {
|
||||||
worldIn.setBlock(x, y, z, Blocks.air);
|
worldIn.setBlock(x, y, z, Blocks.air);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +95,15 @@ public class BlockAetherPortal extends BlockPortal {
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||||
if (rand.nextInt(100) == 0) {
|
if (rand.nextInt(100) == 0) {
|
||||||
world.playSound((double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "portal.portal", 0.5F, rand.nextFloat() * 0.4F + 0.8F, false);
|
world.playSound(
|
||||||
|
(double) x + 0.5D,
|
||||||
|
(double) y + 0.5D,
|
||||||
|
(double) z + 0.5D,
|
||||||
|
"portal.portal",
|
||||||
|
0.5F,
|
||||||
|
rand.nextFloat() * 0.4F + 0.8F,
|
||||||
|
false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
|
@ -99,7 +115,8 @@ public class BlockAetherPortal extends BlockPortal {
|
||||||
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
double d5 = ((double) rand.nextFloat() - 0.5D) * 0.5D;
|
||||||
int j = rand.nextInt(2) * 2 - 1;
|
int j = rand.nextInt(2) * 2 - 1;
|
||||||
|
|
||||||
if (world.getBlock(x - 1, y, z) != this && world.getBlock(x + 1, y, z) != this) {
|
if (world.getBlock(x - 1, y, z) != this
|
||||||
|
&& world.getBlock(x + 1, y, z) != this) {
|
||||||
d0 = (double) x + 0.5D + 0.25D * (double) j;
|
d0 = (double) x + 0.5D + 0.25D * (double) j;
|
||||||
d3 = (double) (rand.nextFloat() * 2.0F * (float) j);
|
d3 = (double) (rand.nextFloat() * 2.0F * (float) j);
|
||||||
} else {
|
} else {
|
||||||
|
@ -107,14 +124,12 @@ public class BlockAetherPortal extends BlockPortal {
|
||||||
d5 = (double) (rand.nextFloat() * 2.0F * (float) j);
|
d5 = (double) (rand.nextFloat() * 2.0F * (float) j);
|
||||||
}
|
}
|
||||||
|
|
||||||
ParticleAetherPortal particle = new ParticleAetherPortal(world, d0, d1, d2, d3, d4, d5);
|
ParticleAetherPortal particle
|
||||||
|
= new ParticleAetherPortal(world, d0, d1, d2, d3, d4, d5);
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
public void updateTick(World world, int x, int y, int z, Random rand) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -12,7 +12,6 @@ import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockFloating extends Block {
|
public class BlockFloating extends Block {
|
||||||
|
|
||||||
private boolean leveled;
|
private boolean leveled;
|
||||||
|
|
||||||
public BlockFloating(Material material, boolean leveled) {
|
public BlockFloating(Material material, boolean leveled) {
|
||||||
|
@ -25,7 +24,9 @@ public class BlockFloating extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
public boolean isBeaconBase(
|
||||||
|
IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ
|
||||||
|
) {
|
||||||
return this == BlocksAether.enchanted_gravitite;
|
return this == BlocksAether.enchanted_gravitite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,13 +36,15 @@ public class BlockFloating extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighborBlock) {
|
public void
|
||||||
|
onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighborBlock) {
|
||||||
worldIn.scheduleBlockUpdate(x, y, z, this, 3);
|
worldIn.scheduleBlockUpdate(x, y, z, this, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||||
if (!this.leveled || this.leveled && world.isBlockIndirectlyGettingPowered(x, y, z)) {
|
if (!this.leveled
|
||||||
|
|| this.leveled && world.isBlockIndirectlyGettingPowered(x, y, z)) {
|
||||||
this.floatBlock(world, x, y, z);
|
this.floatBlock(world, x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,30 +52,30 @@ public class BlockFloating extends Block {
|
||||||
private void floatBlock(World world, int x, int y, int z) {
|
private void floatBlock(World world, int x, int y, int z) {
|
||||||
boolean floatInstantly = BlockSand.fallInstantly;
|
boolean floatInstantly = BlockSand.fallInstantly;
|
||||||
|
|
||||||
if (canContinue(world, x, y + 1, z) && y >= 0)
|
if (canContinue(world, x, y + 1, z) && y >= 0) {
|
||||||
{
|
if (!floatInstantly) {
|
||||||
if (!floatInstantly)
|
if (!world.isRemote) {
|
||||||
{
|
EntityFloatingBlock entity = new EntityFloatingBlock(
|
||||||
if (!world.isRemote)
|
world,
|
||||||
{
|
x,
|
||||||
EntityFloatingBlock entity = new EntityFloatingBlock(world, x, y, z, world.getBlock(x, y, z), world.getBlockMetadata(x, y, z));
|
y,
|
||||||
|
z,
|
||||||
|
world.getBlock(x, y, z),
|
||||||
|
world.getBlockMetadata(x, y, z)
|
||||||
|
);
|
||||||
world.setBlockToAir(x, y, z);
|
world.setBlockToAir(x, y, z);
|
||||||
world.spawnEntityInWorld(entity);
|
world.spawnEntityInWorld(entity);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
world.setBlockToAir(x, y, z);
|
world.setBlockToAir(x, y, z);
|
||||||
|
|
||||||
int bottomPos = y - 1;
|
int bottomPos = y - 1;
|
||||||
|
|
||||||
while (canContinue(world, x, bottomPos, z) && bottomPos > 0)
|
while (canContinue(world, x, bottomPos, z) && bottomPos > 0) {
|
||||||
{
|
|
||||||
bottomPos = bottomPos - 1;
|
bottomPos = bottomPos - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bottomPos > 0)
|
if (bottomPos > 0) {
|
||||||
{
|
|
||||||
world.setBlock(x, bottomPos + 1, z, this);
|
world.setBlock(x, bottomPos + 1, z, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,5 +96,4 @@ public class BlockFloating extends Block {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,20 +3,34 @@ package com.gildedgames.the_aether.client;
|
||||||
import java.security.Key;
|
import java.security.Key;
|
||||||
import java.util.List;
|
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.GuiCustomizationScreen;
|
||||||
import com.gildedgames.the_aether.client.gui.GuiEnterAether;
|
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.GuiAccessoryButton;
|
||||||
import com.gildedgames.the_aether.client.gui.button.GuiCapeButton;
|
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.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.inventory.GuiAccessories;
|
||||||
import com.gildedgames.the_aether.client.gui.menu.AetherMainMenu;
|
import com.gildedgames.the_aether.client.gui.menu.AetherMainMenu;
|
||||||
import com.gildedgames.the_aether.client.gui.menu.GuiMenuToggleButton;
|
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.PacketCapeChanged;
|
||||||
import com.gildedgames.the_aether.network.packets.PacketExtendedAttack;
|
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 com.gildedgames.the_aether.player.perks.AetherRankings;
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
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.InputEvent;
|
||||||
|
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.*;
|
import net.minecraft.client.gui.*;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
@ -39,27 +53,10 @@ import net.minecraft.world.World;
|
||||||
import net.minecraftforge.client.event.*;
|
import net.minecraftforge.client.event.*;
|
||||||
import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent;
|
import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent;
|
||||||
import net.minecraftforge.client.event.RenderPlayerEvent.SetArmorModel;
|
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.Keyboard;
|
||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
|
|
||||||
public class AetherClientEvents {
|
public class AetherClientEvents {
|
||||||
|
|
||||||
private static boolean wasInAether = false;
|
private static boolean wasInAether = false;
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
@ -76,8 +73,10 @@ public class AetherClientEvents {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mc.thePlayer != null && !(mc.thePlayer.movementInput instanceof AetherMovementInput)) {
|
if (mc.thePlayer != null
|
||||||
mc.thePlayer.movementInput = new AetherMovementInput(mc, mc.gameSettings);
|
&& !(mc.thePlayer.movementInput instanceof AetherMovementInput)) {
|
||||||
|
mc.thePlayer.movementInput
|
||||||
|
= new AetherMovementInput(mc, mc.gameSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleExtendedReach(mc);
|
handleExtendedReach(mc);
|
||||||
|
@ -97,8 +96,7 @@ public class AetherClientEvents {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleExtendedReach(Minecraft mc)
|
private void handleExtendedReach(Minecraft mc) {
|
||||||
{
|
|
||||||
EntityPlayer player = mc.thePlayer;
|
EntityPlayer player = mc.thePlayer;
|
||||||
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
|
@ -109,9 +107,13 @@ public class AetherClientEvents {
|
||||||
if (stack != null) {
|
if (stack != null) {
|
||||||
if (isValkyrieItem(stack.getItem())) {
|
if (isValkyrieItem(stack.getItem())) {
|
||||||
Vec3 playerVision = player.getLookVec();
|
Vec3 playerVision = player.getLookVec();
|
||||||
AxisAlignedBB reachDistance = player.boundingBox.expand(10.0D, 10.0D, 10.0D);
|
AxisAlignedBB reachDistance
|
||||||
|
= player.boundingBox.expand(10.0D, 10.0D, 10.0D);
|
||||||
|
|
||||||
List<Entity> locatedEntities = player.worldObj.getEntitiesWithinAABB(Entity.class, reachDistance);
|
List<Entity> locatedEntities
|
||||||
|
= player.worldObj.getEntitiesWithinAABB(
|
||||||
|
Entity.class, reachDistance
|
||||||
|
);
|
||||||
|
|
||||||
Entity found = null;
|
Entity found = null;
|
||||||
double foundLen = 0.0D;
|
double foundLen = 0.0D;
|
||||||
|
@ -123,11 +125,17 @@ public class AetherClientEvents {
|
||||||
|
|
||||||
Entity ent = (Entity) o;
|
Entity ent = (Entity) o;
|
||||||
|
|
||||||
if (!ent.canBeCollidedWith() && !(ent instanceof EntityDragon)) {
|
if (!ent.canBeCollidedWith()
|
||||||
|
&& !(ent instanceof EntityDragon)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vec3 vec = Vec3.createVectorHelper(ent.posX - player.posX, ent.boundingBox.minY + ent.height / 2f - player.posY - player.getEyeHeight(), ent.posZ - player.posZ);
|
Vec3 vec = Vec3.createVectorHelper(
|
||||||
|
ent.posX - player.posX,
|
||||||
|
ent.boundingBox.minY + ent.height / 2f - player.posY
|
||||||
|
- player.getEyeHeight(),
|
||||||
|
ent.posZ - player.posZ
|
||||||
|
);
|
||||||
double len = vec.lengthVector();
|
double len = vec.lengthVector();
|
||||||
|
|
||||||
if (len > 8.0F) {
|
if (len > 8.0F) {
|
||||||
|
@ -137,7 +145,8 @@ public class AetherClientEvents {
|
||||||
vec = vec.normalize();
|
vec = vec.normalize();
|
||||||
double dot = playerVision.dotProduct(vec);
|
double dot = playerVision.dotProduct(vec);
|
||||||
|
|
||||||
if (dot < 1.0 - 0.125 / len || !player.canEntityBeSeen(ent)) {
|
if (dot < 1.0 - 0.125 / len
|
||||||
|
|| !player.canEntityBeSeen(ent)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,7 +159,9 @@ public class AetherClientEvents {
|
||||||
if (found != null && player.ridingEntity != found) {
|
if (found != null && player.ridingEntity != found) {
|
||||||
stack.damageItem(1, player);
|
stack.damageItem(1, player);
|
||||||
|
|
||||||
AetherNetwork.sendToServer(new PacketExtendedAttack(found.getEntityId()));
|
AetherNetwork.sendToServer(
|
||||||
|
new PacketExtendedAttack(found.getEntityId())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,36 +170,33 @@ public class AetherClientEvents {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValkyrieItem(Item stackID)
|
public boolean isValkyrieItem(Item stackID) {
|
||||||
{
|
return stackID == ItemsAether.valkyrie_shovel
|
||||||
return stackID == ItemsAether.valkyrie_shovel || stackID == ItemsAether.valkyrie_axe || stackID == ItemsAether.valkyrie_pickaxe || stackID == ItemsAether.valkyrie_lance;
|
|| stackID == ItemsAether.valkyrie_axe
|
||||||
|
|| stackID == ItemsAether.valkyrie_pickaxe
|
||||||
|
|| stackID == ItemsAether.valkyrie_lance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onOpenGui(GuiOpenEvent event)
|
public void onOpenGui(GuiOpenEvent event) {
|
||||||
{
|
|
||||||
Minecraft mc = FMLClientHandler.instance().getClient();
|
Minecraft mc = FMLClientHandler.instance().getClient();
|
||||||
|
|
||||||
if (mc.thePlayer != null && event.gui instanceof GuiDownloadTerrain)
|
if (mc.thePlayer != null && event.gui instanceof GuiDownloadTerrain) {
|
||||||
{
|
|
||||||
GuiEnterAether enterAether = new GuiEnterAether(true);
|
GuiEnterAether enterAether = new GuiEnterAether(true);
|
||||||
GuiEnterAether exitAether = new GuiEnterAether(false);
|
GuiEnterAether exitAether = new GuiEnterAether(false);
|
||||||
|
|
||||||
if (mc.thePlayer.dimension == AetherConfig.getAetherDimensionID())
|
if (mc.thePlayer.dimension == AetherConfig.getAetherDimensionID()) {
|
||||||
{
|
|
||||||
event.gui = enterAether;
|
event.gui = enterAether;
|
||||||
wasInAether = true;
|
wasInAether = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (wasInAether)
|
else if (wasInAether) {
|
||||||
{
|
|
||||||
event.gui = exitAether;
|
event.gui = exitAether;
|
||||||
wasInAether = false;
|
wasInAether = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void sendPickupPacket(Minecraft mc) {
|
private void sendPickupPacket(Minecraft mc) {
|
||||||
if (mc.objectMouseOver != null) {
|
if (mc.objectMouseOver != null) {
|
||||||
if (!this.onPickEntity(mc.objectMouseOver, mc.thePlayer, mc.theWorld)) {
|
if (!this.onPickEntity(mc.objectMouseOver, mc.thePlayer, mc.theWorld)) {
|
||||||
|
@ -196,14 +204,21 @@ public class AetherClientEvents {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mc.thePlayer.capabilities.isCreativeMode) {
|
if (mc.thePlayer.capabilities.isCreativeMode) {
|
||||||
int index = mc.thePlayer.inventoryContainer.inventorySlots.size() - 9 + mc.thePlayer.inventory.currentItem;
|
int index = mc.thePlayer.inventoryContainer.inventorySlots.size() - 9
|
||||||
|
+ mc.thePlayer.inventory.currentItem;
|
||||||
|
|
||||||
mc.playerController.sendSlotPacket(mc.thePlayer.inventory.getStackInSlot(mc.thePlayer.inventory.currentItem), index);
|
mc.playerController.sendSlotPacket(
|
||||||
|
mc.thePlayer.inventory.getStackInSlot(
|
||||||
|
mc.thePlayer.inventory.currentItem
|
||||||
|
),
|
||||||
|
index
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean onPickEntity(MovingObjectPosition target, EntityPlayer player, World world) {
|
private boolean
|
||||||
|
onPickEntity(MovingObjectPosition target, EntityPlayer player, World world) {
|
||||||
ItemStack result = null;
|
ItemStack result = null;
|
||||||
boolean isCreative = player.capabilities.isCreativeMode;
|
boolean isCreative = player.capabilities.isCreativeMode;
|
||||||
|
|
||||||
|
@ -226,7 +241,8 @@ public class AetherClientEvents {
|
||||||
for (int x = 0; x < 9; x++) {
|
for (int x = 0; x < 9; x++) {
|
||||||
ItemStack stack = player.inventory.getStackInSlot(x);
|
ItemStack stack = player.inventory.getStackInSlot(x);
|
||||||
|
|
||||||
if (stack != null && stack.isItemEqual(result) && ItemStack.areItemStackTagsEqual(stack, result)) {
|
if (stack != null && stack.isItemEqual(result)
|
||||||
|
&& ItemStack.areItemStackTagsEqual(stack, result)) {
|
||||||
player.inventory.currentItem = x;
|
player.inventory.currentItem = x;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -249,7 +265,8 @@ public class AetherClientEvents {
|
||||||
public void onBowPulled(FOVUpdateEvent event) {
|
public void onBowPulled(FOVUpdateEvent event) {
|
||||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||||
|
|
||||||
if (player == null || (player != null && player.getCurrentEquippedItem() == null)) {
|
if (player == null
|
||||||
|
|| (player != null && player.getCurrentEquippedItem() == null)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,9 +290,11 @@ public class AetherClientEvents {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final GuiAccessoryButton ACCESSORY_BUTTON = new GuiAccessoryButton(0, 0);
|
private static final GuiAccessoryButton ACCESSORY_BUTTON
|
||||||
|
= new GuiAccessoryButton(0, 0);
|
||||||
|
|
||||||
private static final GuiMenuToggleButton MAIN_MENU_BUTTON = new GuiMenuToggleButton(0, 0);
|
private static final GuiMenuToggleButton MAIN_MENU_BUTTON
|
||||||
|
= new GuiMenuToggleButton(0, 0);
|
||||||
|
|
||||||
private static int previousSelectedTabIndex = -1;
|
private static int previousSelectedTabIndex = -1;
|
||||||
|
|
||||||
|
@ -288,60 +307,78 @@ public class AetherClientEvents {
|
||||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||||
Class<?> clazz = event.gui.getClass();
|
Class<?> clazz = event.gui.getClass();
|
||||||
|
|
||||||
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) event.gui, "guiLeft", "field_147003_i");
|
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(
|
||||||
int guiTop = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) event.gui, "guiTop", "field_147009_r");
|
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 (player.capabilities.isCreativeMode) {
|
||||||
if (event.gui instanceof GuiContainerCreative) {
|
if (event.gui instanceof GuiContainerCreative) {
|
||||||
if (((GuiContainerCreative) event.gui).func_147056_g() == CreativeTabs.tabInventory.getTabIndex()) {
|
if (((GuiContainerCreative) event.gui).func_147056_g()
|
||||||
event.buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 28, guiTop + 38));
|
== CreativeTabs.tabInventory.getTabIndex()) {
|
||||||
previousSelectedTabIndex = 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)
|
} else if (clazz == GuiInventory.class) {
|
||||||
{
|
event.buttonList.add(
|
||||||
if (!shouldRemoveButton)
|
ACCESSORY_BUTTON.setPosition(guiLeft + 26, guiTop + 65)
|
||||||
{
|
);
|
||||||
event.buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 8, guiTop + 65));
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if (clazz == GuiAccessories.class) {
|
||||||
|
if (!shouldRemoveButton) {
|
||||||
|
event.buttonList.add(
|
||||||
|
ACCESSORY_BUTTON.setPosition(guiLeft + 8, guiTop + 65)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
shouldRemoveButton = false;
|
shouldRemoveButton = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AetherConfig.config.get("Misc", "Enables the Aether Menu toggle button", false).getBoolean() && event.gui instanceof GuiMainMenu)
|
if (AetherConfig.config
|
||||||
{
|
.get("Misc", "Enables the Aether Menu toggle button", false)
|
||||||
|
.getBoolean()
|
||||||
|
&& event.gui instanceof GuiMainMenu) {
|
||||||
event.buttonList.add(MAIN_MENU_BUTTON.setPosition(event.gui.width - 24, 4));
|
event.buttonList.add(MAIN_MENU_BUTTON.setPosition(event.gui.width - 24, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean() && event.gui.getClass() == GuiMainMenu.class)
|
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean()
|
||||||
{
|
&& event.gui.getClass() == GuiMainMenu.class) {
|
||||||
Minecraft.getMinecraft().displayGuiScreen(new AetherMainMenu());
|
Minecraft.getMinecraft().displayGuiScreen(new AetherMainMenu());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.gui.getClass() == GuiOptions.class)
|
if (event.gui.getClass() == GuiOptions.class) {
|
||||||
{
|
if (Minecraft.getMinecraft().thePlayer != null) {
|
||||||
if (Minecraft.getMinecraft().thePlayer != null)
|
if (AetherRankings.isRankedPlayer(
|
||||||
{
|
Minecraft.getMinecraft().thePlayer.getUniqueID()
|
||||||
if (AetherRankings.isRankedPlayer(Minecraft.getMinecraft().thePlayer.getUniqueID()))
|
)) {
|
||||||
{
|
event.buttonList.add(new GuiCustomizationScreenButton(
|
||||||
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")));
|
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 (event.gui.getClass() == ScreenChatOptions.class) {
|
||||||
{
|
if (Minecraft.getMinecraft().thePlayer != null) {
|
||||||
if (Minecraft.getMinecraft().thePlayer != null)
|
|
||||||
{
|
|
||||||
int i = 13;
|
int i = 13;
|
||||||
event.buttonList.add(new GuiCapeButton(event.gui.width / 2 - 155 + i % 2 * 160, event.gui.height / 6 + 24 * (i >> 1)));
|
event.buttonList.add(new GuiCapeButton(
|
||||||
|
event.gui.width / 2 - 155 + i % 2 * 160,
|
||||||
|
event.gui.height / 6 + 24 * (i >> 1)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -349,16 +386,31 @@ public class AetherClientEvents {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onMouseClicked(DrawScreenEvent.Post event) {
|
public void onMouseClicked(DrawScreenEvent.Post event) {
|
||||||
if (Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) {
|
if (Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) {
|
||||||
GuiContainerCreative guiScreen = (GuiContainerCreative) Minecraft.getMinecraft().currentScreen;
|
GuiContainerCreative guiScreen
|
||||||
|
= (GuiContainerCreative) Minecraft.getMinecraft().currentScreen;
|
||||||
|
|
||||||
if (previousSelectedTabIndex != guiScreen.func_147056_g()) {
|
if (previousSelectedTabIndex != guiScreen.func_147056_g()) {
|
||||||
List<GuiButton> buttonList = ObfuscationReflectionHelper.getPrivateValue(GuiScreen.class, (GuiScreen) guiScreen, 4);
|
List<GuiButton> buttonList = ObfuscationReflectionHelper.getPrivateValue(
|
||||||
|
GuiScreen.class, (GuiScreen) guiScreen, 4
|
||||||
|
);
|
||||||
|
|
||||||
if (guiScreen.func_147056_g() == CreativeTabs.tabInventory.getTabIndex() && !buttonList.contains(ACCESSORY_BUTTON)) {
|
if (guiScreen.func_147056_g() == CreativeTabs.tabInventory.getTabIndex()
|
||||||
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) guiScreen, "guiLeft", "field_147003_i");
|
&& !buttonList.contains(ACCESSORY_BUTTON)) {
|
||||||
int guiTop = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer) guiScreen, "guiTop", "field_147009_r");
|
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(
|
||||||
|
GuiContainer.class,
|
||||||
|
(GuiContainer) guiScreen,
|
||||||
|
"guiLeft",
|
||||||
|
"field_147003_i"
|
||||||
|
);
|
||||||
|
int guiTop = ObfuscationReflectionHelper.getPrivateValue(
|
||||||
|
GuiContainer.class,
|
||||||
|
(GuiContainer) guiScreen,
|
||||||
|
"guiTop",
|
||||||
|
"field_147009_r"
|
||||||
|
);
|
||||||
|
|
||||||
buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 28, guiTop + 38));
|
buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 28, guiTop + 38)
|
||||||
|
);
|
||||||
} else if (previousSelectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) {
|
} else if (previousSelectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) {
|
||||||
buttonList.remove(ACCESSORY_BUTTON);
|
buttonList.remove(ACCESSORY_BUTTON);
|
||||||
}
|
}
|
||||||
|
@ -369,10 +421,10 @@ public class AetherClientEvents {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onDrawGui(GuiScreenEvent.DrawScreenEvent.Pre event)
|
public void onDrawGui(GuiScreenEvent.DrawScreenEvent.Pre event) {
|
||||||
{
|
if (!AetherConfig.config.get("Misc", "Enables the Aether Menu", false)
|
||||||
if (!AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean() && event.gui.getClass() == AetherMainMenu.class)
|
.getBoolean()
|
||||||
{
|
&& event.gui.getClass() == AetherMainMenu.class) {
|
||||||
Minecraft.getMinecraft().displayGuiScreen(new GuiMainMenu());
|
Minecraft.getMinecraft().displayGuiScreen(new GuiMainMenu());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -381,23 +433,27 @@ public class AetherClientEvents {
|
||||||
public void onButtonPressed(GuiScreenEvent.ActionPerformedEvent.Pre event) {
|
public void onButtonPressed(GuiScreenEvent.ActionPerformedEvent.Pre event) {
|
||||||
Class<?> clazz = event.gui.getClass();
|
Class<?> clazz = event.gui.getClass();
|
||||||
|
|
||||||
if ((clazz == GuiInventory.class || clazz == GuiContainerCreative.class) && event.button.id == 18067) {
|
if ((clazz == GuiInventory.class || clazz == GuiContainerCreative.class)
|
||||||
AetherNetwork.sendToServer(new PacketOpenContainer(AetherGuiHandler.accessories));
|
&& event.button.id == 18067) {
|
||||||
|
AetherNetwork.sendToServer(
|
||||||
|
new PacketOpenContainer(AetherGuiHandler.accessories)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.button.getClass() == GuiCustomizationScreenButton.class)
|
if (event.button.getClass() == GuiCustomizationScreenButton.class) {
|
||||||
{
|
Minecraft.getMinecraft().displayGuiScreen(new GuiCustomizationScreen(event.gui
|
||||||
Minecraft.getMinecraft().displayGuiScreen(new GuiCustomizationScreen(event.gui));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.button.getClass() == GuiCapeButton.class)
|
if (event.button.getClass() == GuiCapeButton.class) {
|
||||||
{
|
|
||||||
PlayerAether player = PlayerAether.get(Minecraft.getMinecraft().thePlayer);
|
PlayerAether player = PlayerAether.get(Minecraft.getMinecraft().thePlayer);
|
||||||
|
|
||||||
boolean enableCape = !player.shouldRenderCape;
|
boolean enableCape = !player.shouldRenderCape;
|
||||||
|
|
||||||
player.shouldRenderCape = enableCape;
|
player.shouldRenderCape = enableCape;
|
||||||
AetherNetwork.sendToServer(new PacketCapeChanged(player.getEntity().getEntityId(), player.shouldRenderCape));
|
AetherNetwork.sendToServer(new PacketCapeChanged(
|
||||||
|
player.getEntity().getEntityId(), player.shouldRenderCape
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,7 +463,9 @@ public class AetherClientEvents {
|
||||||
PlayerAether playerAether = PlayerAether.get(player);
|
PlayerAether playerAether = PlayerAether.get(player);
|
||||||
|
|
||||||
if (playerAether != null) {
|
if (playerAether != null) {
|
||||||
if (playerAether.getAccessoryInventory().wearingAccessory(new ItemStack(ItemsAether.invisibility_cape))) {
|
if (playerAether.getAccessoryInventory().wearingAccessory(
|
||||||
|
new ItemStack(ItemsAether.invisibility_cape)
|
||||||
|
)) {
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -423,7 +481,12 @@ public class AetherClientEvents {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onRenderAetherArmor(SetArmorModel event) {
|
public void onRenderAetherArmor(SetArmorModel event) {
|
||||||
if (event.stack != null && event.stack.getItem() instanceof ItemAetherArmor) {
|
if (event.stack != null && event.stack.getItem() instanceof ItemAetherArmor) {
|
||||||
event.result = PlayerAetherRenderer.instance().renderAetherArmor(PlayerAether.get(event.entityPlayer), event.renderer, event.stack, 3 - event.slot);
|
event.result = PlayerAetherRenderer.instance().renderAetherArmor(
|
||||||
|
PlayerAether.get(event.entityPlayer),
|
||||||
|
event.renderer,
|
||||||
|
event.stack,
|
||||||
|
3 - event.slot
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,27 +495,30 @@ public class AetherClientEvents {
|
||||||
if (event.entity instanceof EntityPlayer) {
|
if (event.entity instanceof EntityPlayer) {
|
||||||
PlayerAether playerAether = PlayerAether.get((EntityPlayer) event.entity);
|
PlayerAether playerAether = PlayerAether.get((EntityPlayer) event.entity);
|
||||||
|
|
||||||
if (event.renderer instanceof RenderPlayer)
|
if (event.renderer instanceof RenderPlayer) {
|
||||||
{
|
PlayerAetherRenderer.instance().renderAccessories(
|
||||||
PlayerAetherRenderer.instance().renderAccessories(playerAether, (RenderPlayer) event.renderer, event.x, event.y, event.z, PlayerAetherRenderer.instance().getPartialTicks());
|
playerAether,
|
||||||
|
(RenderPlayer) event.renderer,
|
||||||
|
event.x,
|
||||||
|
event.y,
|
||||||
|
event.z,
|
||||||
|
PlayerAetherRenderer.instance().getPartialTicks()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onKeyInputEvent(InputEvent.KeyInputEvent event)
|
public void onKeyInputEvent(InputEvent.KeyInputEvent event) {
|
||||||
{
|
if (Minecraft.getMinecraft().thePlayer != null) {
|
||||||
if (Minecraft.getMinecraft().thePlayer != null)
|
if (AetherKeybinds.keyBindingAccessories.isPressed()) {
|
||||||
{
|
if (Minecraft.getMinecraft().currentScreen == null) {
|
||||||
if (AetherKeybinds.keyBindingAccessories.isPressed())
|
AetherNetwork.sendToServer(
|
||||||
{
|
new PacketOpenContainer(AetherGuiHandler.accessories)
|
||||||
if (Minecraft.getMinecraft().currentScreen == null)
|
);
|
||||||
{
|
|
||||||
AetherNetwork.sendToServer(new PacketOpenContainer(AetherGuiHandler.accessories));
|
|
||||||
shouldRemoveButton = true;
|
shouldRemoveButton = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,17 +4,16 @@ import cpw.mods.fml.client.registry.ClientRegistry;
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
public class AetherKeybinds
|
public class AetherKeybinds {
|
||||||
{
|
|
||||||
public static KeyBinding[] keyBindings = new KeyBinding[1];
|
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;
|
keyBindings[0] = keyBindingAccessories;
|
||||||
|
|
||||||
for (int i = 0; i < keyBindings.length; ++i)
|
for (int i = 0; i < keyBindings.length; ++i) {
|
||||||
{
|
|
||||||
ClientRegistry.registerKeyBinding(keyBindings[i]);
|
ClientRegistry.registerKeyBinding(keyBindings[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,11 @@ import com.gildedgames.the_aether.entities.util.EntityMountable;
|
||||||
import com.gildedgames.the_aether.entities.util.EntitySaddleMount;
|
import com.gildedgames.the_aether.entities.util.EntitySaddleMount;
|
||||||
import com.gildedgames.the_aether.network.AetherNetwork;
|
import com.gildedgames.the_aether.network.AetherNetwork;
|
||||||
import com.gildedgames.the_aether.network.packets.PacketSendSneaking;
|
import com.gildedgames.the_aether.network.packets.PacketSendSneaking;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.settings.GameSettings;
|
import net.minecraft.client.settings.GameSettings;
|
||||||
import net.minecraft.util.MovementInputFromOptions;
|
import net.minecraft.util.MovementInputFromOptions;
|
||||||
|
|
||||||
public class AetherMovementInput extends MovementInputFromOptions {
|
public class AetherMovementInput extends MovementInputFromOptions {
|
||||||
|
|
||||||
private Minecraft mc;
|
private Minecraft mc;
|
||||||
|
|
||||||
private GameSettings gameSettings;
|
private GameSettings gameSettings;
|
||||||
|
@ -47,7 +45,9 @@ public class AetherMovementInput extends MovementInputFromOptions {
|
||||||
this.currentSneak = isSneaking;
|
this.currentSneak = isSneaking;
|
||||||
|
|
||||||
if (this.previousSneak != this.currentSneak) {
|
if (this.previousSneak != this.currentSneak) {
|
||||||
AetherNetwork.sendToServer(new PacketSendSneaking(this.mc.thePlayer.getEntityId(), this.currentSneak));
|
AetherNetwork.sendToServer(new PacketSendSneaking(
|
||||||
|
this.mc.thePlayer.getEntityId(), this.currentSneak
|
||||||
|
));
|
||||||
this.previousSneak = this.currentSneak;
|
this.previousSneak = this.currentSneak;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,5 +59,4 @@ public class AetherMovementInput extends MovementInputFromOptions {
|
||||||
this.sneak = false;
|
this.sneak = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,12 +1,11 @@
|
||||||
package com.gildedgames.the_aether.client;
|
package com.gildedgames.the_aether.client;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.AetherConfig;
|
import java.io.File;
|
||||||
import net.minecraft.client.Minecraft;
|
import java.io.FileOutputStream;
|
||||||
import net.minecraft.client.renderer.EntityRenderer;
|
import java.io.IOException;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import java.io.InputStream;
|
||||||
import net.minecraft.util.ChatComponentText;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
|
|
||||||
|
import com.gildedgames.the_aether.AetherConfig;
|
||||||
import com.gildedgames.the_aether.CommonProxy;
|
import com.gildedgames.the_aether.CommonProxy;
|
||||||
import com.gildedgames.the_aether.client.audio.AetherMusicHandler;
|
import com.gildedgames.the_aether.client.audio.AetherMusicHandler;
|
||||||
import com.gildedgames.the_aether.client.gui.AetherLoadingScreen;
|
import com.gildedgames.the_aether.client.gui.AetherLoadingScreen;
|
||||||
|
@ -15,61 +14,130 @@ import com.gildedgames.the_aether.client.gui.GuiSunAltar;
|
||||||
import com.gildedgames.the_aether.client.renders.AetherEntityRenderer;
|
import com.gildedgames.the_aether.client.renders.AetherEntityRenderer;
|
||||||
import com.gildedgames.the_aether.client.renders.RendersAether;
|
import com.gildedgames.the_aether.client.renders.RendersAether;
|
||||||
import com.gildedgames.the_aether.compatibility.client.AetherClientCompatibility;
|
import com.gildedgames.the_aether.compatibility.client.AetherClientCompatibility;
|
||||||
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import java.io.File;
|
import net.minecraft.client.renderer.EntityRenderer;
|
||||||
import java.io.FileOutputStream;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import java.io.IOException;
|
import net.minecraft.util.ChatComponentText;
|
||||||
import java.io.InputStream;
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
public class ClientProxy extends CommonProxy {
|
public class ClientProxy extends CommonProxy {
|
||||||
|
|
||||||
public static final IIcon[] ACCESSORY_ICONS = new IIcon[8];
|
public static final IIcon[] ACCESSORY_ICONS = new IIcon[8];
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
try
|
try {
|
||||||
{
|
File resourcePacks = Minecraft.getMinecraft()
|
||||||
File resourcePacks = Minecraft.getMinecraft().getResourcePackRepository().getDirResourcepacks().getCanonicalFile();
|
.getResourcePackRepository()
|
||||||
|
.getDirResourcepacks()
|
||||||
|
.getCanonicalFile();
|
||||||
|
|
||||||
File buckets = new File(resourcePacks + "/Aether b1.7.3 Textures/assets/aether_legacy/textures/items/misc/buckets");
|
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 weapons = new File(
|
||||||
File armor = new File(resourcePacks + "/Aether b1.7.3 Textures/assets/aether_legacy/textures/items/armor");
|
resourcePacks
|
||||||
File accessories = new File(resourcePacks + "/Aether b1.7.3 Textures/assets/aether_legacy/textures/items/accessories");
|
+ "/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())
|
if (AetherConfig.installResourcepack()) {
|
||||||
{
|
for (File file : directories) {
|
||||||
for (File file : directories)
|
if (!file.exists()) {
|
||||||
{
|
|
||||||
if (!file.exists())
|
|
||||||
{
|
|
||||||
file.mkdirs();
|
file.mkdirs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
generateFile("data/Aether_b1.7.3/pack.mcmeta", "pack.mcmeta", resourcePacks.getAbsolutePath() + "/Aether b1.7.3 Textures");
|
generateFile(
|
||||||
generateFile("data/Aether_b1.7.3/pack.png", "pack.png", resourcePacks.getAbsolutePath() + "/Aether b1.7.3 Textures");
|
"data/Aether_b1.7.3/pack.mcmeta",
|
||||||
generateFile("data/Aether_b1.7.3/skyroot_remedy_bucket.png", "skyroot_remedy_bucket.png", buckets.getAbsolutePath());
|
"pack.mcmeta",
|
||||||
generateFile("data/Aether_b1.7.3/weapons/bow_pulling_0.png", "bow_pulling_0.png", weapons.getAbsolutePath());
|
resourcePacks.getAbsolutePath() + "/Aether b1.7.3 Textures"
|
||||||
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(
|
||||||
generateFile("data/Aether_b1.7.3/weapons/flaming_sword.png", "flaming_sword.png", weapons.getAbsolutePath());
|
"data/Aether_b1.7.3/pack.png",
|
||||||
generateFile("data/Aether_b1.7.3/weapons/holy_sword.png", "holy_sword.png", weapons.getAbsolutePath());
|
"pack.png",
|
||||||
generateFile("data/Aether_b1.7.3/weapons/lightning_sword.png", "lightning_sword.png", weapons.getAbsolutePath());
|
resourcePacks.getAbsolutePath() + "/Aether b1.7.3 Textures"
|
||||||
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(
|
||||||
generateFile("data/Aether_b1.7.3/armor/phoenix_leggings.png", "phoenix_leggings.png", armor.getAbsolutePath());
|
"data/Aether_b1.7.3/skyroot_remedy_bucket.png",
|
||||||
generateFile("data/Aether_b1.7.3/armor/phoenix_chestplate.png", "phoenix_chestplate.png", armor.getAbsolutePath());
|
"skyroot_remedy_bucket.png",
|
||||||
generateFile("data/Aether_b1.7.3/armor/phoenix_helmet.png", "phoenix_helmet.png", armor.getAbsolutePath());
|
buckets.getAbsolutePath()
|
||||||
generateFile("data/Aether_b1.7.3/accessories/phoenix_gloves.png", "phoenix_gloves.png", accessories.getAbsolutePath());
|
);
|
||||||
generateFile("data/Aether_b1.7.3/accessories/agility_cape.png", "agility_cape.png", accessories.getAbsolutePath());
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/weapons/bow_pulling_0.png",
|
||||||
|
"bow_pulling_0.png",
|
||||||
|
weapons.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/weapons/bow_pulling_1.png",
|
||||||
|
"bow_pulling_1.png",
|
||||||
|
weapons.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/weapons/bow_pulling_2.png",
|
||||||
|
"bow_pulling_2.png",
|
||||||
|
weapons.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/weapons/flaming_sword.png",
|
||||||
|
"flaming_sword.png",
|
||||||
|
weapons.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/weapons/holy_sword.png",
|
||||||
|
"holy_sword.png",
|
||||||
|
weapons.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/weapons/lightning_sword.png",
|
||||||
|
"lightning_sword.png",
|
||||||
|
weapons.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/weapons/phoenix_bow.png",
|
||||||
|
"phoenix_bow.png",
|
||||||
|
weapons.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/armor/phoenix_boots.png",
|
||||||
|
"phoenix_boots.png",
|
||||||
|
armor.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/armor/phoenix_leggings.png",
|
||||||
|
"phoenix_leggings.png",
|
||||||
|
armor.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/armor/phoenix_chestplate.png",
|
||||||
|
"phoenix_chestplate.png",
|
||||||
|
armor.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/armor/phoenix_helmet.png",
|
||||||
|
"phoenix_helmet.png",
|
||||||
|
armor.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/accessories/phoenix_gloves.png",
|
||||||
|
"phoenix_gloves.png",
|
||||||
|
accessories.getAbsolutePath()
|
||||||
|
);
|
||||||
|
generateFile(
|
||||||
|
"data/Aether_b1.7.3/accessories/agility_cape.png",
|
||||||
|
"agility_cape.png",
|
||||||
|
accessories.getAbsolutePath()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
} catch (IOException ignore) {}
|
||||||
catch (IOException ignore) { }
|
|
||||||
|
|
||||||
berryBushRenderID = RenderingRegistry.getNextAvailableRenderId();
|
berryBushRenderID = RenderingRegistry.getNextAvailableRenderId();
|
||||||
treasureChestRenderID = RenderingRegistry.getNextAvailableRenderId();
|
treasureChestRenderID = RenderingRegistry.getNextAvailableRenderId();
|
||||||
|
@ -77,7 +145,11 @@ public class ClientProxy extends CommonProxy {
|
||||||
|
|
||||||
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();
|
||||||
|
|
||||||
|
@ -90,21 +162,18 @@ public class ClientProxy extends CommonProxy {
|
||||||
AetherClientCompatibility.initialization();
|
AetherClientCompatibility.initialization();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateFile(String input, String name, String path)
|
public void generateFile(String input, String name, String path) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
File file = new File(path + "/" + name);
|
File file = new File(path + "/" + name);
|
||||||
|
|
||||||
if (!file.exists())
|
if (!file.exists()) {
|
||||||
{
|
InputStream inputStream
|
||||||
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(input);
|
= this.getClass().getClassLoader().getResourceAsStream(input);
|
||||||
FileOutputStream outputStream = new FileOutputStream(file);
|
FileOutputStream outputStream = new FileOutputStream(file);
|
||||||
|
|
||||||
if (inputStream != null)
|
if (inputStream != null) {
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
while ((i = inputStream.read()) != -1)
|
while ((i = inputStream.read()) != -1) {
|
||||||
{
|
|
||||||
outputStream.write(i);
|
outputStream.write(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,15 +181,15 @@ public class ClientProxy extends CommonProxy {
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (IOException ignore) {}
|
||||||
catch (IOException ignore) { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendMessage(EntityPlayer player, String text) {
|
public void sendMessage(EntityPlayer player, String text) {
|
||||||
if (this.getPlayer() == player)
|
if (this.getPlayer() == player) {
|
||||||
{
|
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(
|
||||||
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(text));
|
new ChatComponentText(text)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,5 +202,4 @@ public class ClientProxy extends CommonProxy {
|
||||||
public EntityPlayer getPlayer() {
|
public EntityPlayer getPlayer() {
|
||||||
return Minecraft.getMinecraft().thePlayer;
|
return Minecraft.getMinecraft().thePlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,11 @@ package com.gildedgames.the_aether.client.audio;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
import com.gildedgames.the_aether.Aether;
|
||||||
import com.gildedgames.the_aether.AetherConfig;
|
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.Minecraft;
|
||||||
import net.minecraft.client.audio.ISound;
|
import net.minecraft.client.audio.ISound;
|
||||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||||
|
@ -12,15 +17,7 @@ import net.minecraft.client.gui.GuiScreenWorking;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.event.sound.PlaySoundEvent17;
|
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 {
|
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);
|
||||||
|
@ -41,25 +38,21 @@ public class AetherMusicHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(mc.getSoundHandler().isSoundPlaying(musicTicker.getRecord())))
|
if (!(mc.getSoundHandler().isSoundPlaying(musicTicker.getRecord()))) {
|
||||||
{
|
|
||||||
musicTicker.trackRecord(null);
|
musicTicker.trackRecord(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean() && Minecraft.getMinecraft().theWorld == null && !(screen instanceof GuiScreenWorking))
|
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean()
|
||||||
{
|
&& Minecraft.getMinecraft().theWorld == null
|
||||||
if (!musicTicker.playingMenuMusic())
|
&& !(screen instanceof GuiScreenWorking)) {
|
||||||
{
|
if (!musicTicker.playingMenuMusic()) {
|
||||||
musicTicker.playMenuMusic();
|
musicTicker.playMenuMusic();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (musicTicker.playingMinecraftMusic())
|
if (musicTicker.playingMinecraftMusic()) {
|
||||||
{
|
|
||||||
musicTicker.stopMinecraftMusic();
|
musicTicker.stopMinecraftMusic();
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
musicTicker.stopMenuMusic();
|
musicTicker.stopMenuMusic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,19 +69,27 @@ public class AetherMusicHandler {
|
||||||
SoundCategory category = event.category;
|
SoundCategory category = event.category;
|
||||||
|
|
||||||
if (category == SoundCategory.MUSIC) {
|
if (category == SoundCategory.MUSIC) {
|
||||||
if (this.mc.thePlayer != null && this.mc.thePlayer.dimension == AetherConfig.getAetherDimensionID()) {
|
if (this.mc.thePlayer != null
|
||||||
if (!sound.getPositionedSoundLocation().toString().contains("aether_legacy") && (this.musicTicker.playingMusic() || !this.musicTicker.playingMusic())) {
|
&& this.mc.thePlayer.dimension == AetherConfig.getAetherDimensionID()) {
|
||||||
|
if (!sound.getPositionedSoundLocation().toString().contains(
|
||||||
|
"aether_legacy"
|
||||||
|
)
|
||||||
|
&& (this.musicTicker.playingMusic()
|
||||||
|
|| !this.musicTicker.playingMusic())) {
|
||||||
event.result = null;
|
event.result = null;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sound.getPositionedSoundLocation().toString().equals("minecraft:music.menu"))
|
if (sound.getPositionedSoundLocation().toString().equals(
|
||||||
{
|
"minecraft:music.menu"
|
||||||
|
)) {
|
||||||
musicTicker.trackMinecraftMusic(sound);
|
musicTicker.trackMinecraftMusic(sound);
|
||||||
|
|
||||||
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false).getBoolean() && Minecraft.getMinecraft().theWorld == null && !(screen instanceof GuiScreenWorking))
|
if (AetherConfig.config.get("Misc", "Enables the Aether Menu", false)
|
||||||
{
|
.getBoolean()
|
||||||
|
&& Minecraft.getMinecraft().theWorld == null
|
||||||
|
&& !(screen instanceof GuiScreenWorking)) {
|
||||||
event.result = null;
|
event.result = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,9 +103,10 @@ public class AetherMusicHandler {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public static ISound getAchievementSound(int number) {
|
public static ISound getAchievementSound(int number) {
|
||||||
ResourceLocation sound = number == 1 ? Aether.locate("achievement_bronze") : number == 2 ? Aether.locate("achievement_silver") : Aether.locate("achievement");
|
ResourceLocation sound = number == 1 ? Aether.locate("achievement_bronze")
|
||||||
|
: number == 2 ? Aether.locate("achievement_silver")
|
||||||
|
: Aether.locate("achievement");
|
||||||
|
|
||||||
return PositionedSoundRecord.func_147673_a(sound);
|
return PositionedSoundRecord.func_147673_a(sound);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,6 +4,8 @@ import java.util.Random;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
import com.gildedgames.the_aether.Aether;
|
||||||
import com.gildedgames.the_aether.AetherConfig;
|
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.Minecraft;
|
||||||
import net.minecraft.client.audio.ISound;
|
import net.minecraft.client.audio.ISound;
|
||||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||||
|
@ -12,12 +14,8 @@ import net.minecraft.server.gui.IUpdatePlayerListBox;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class AetherMusicTicker implements IUpdatePlayerListBox {
|
public class AetherMusicTicker implements IUpdatePlayerListBox {
|
||||||
|
|
||||||
private final Random rand = new Random();
|
private final Random rand = new Random();
|
||||||
private final Minecraft mc;
|
private final Minecraft mc;
|
||||||
private ISound currentMusic, currentRecord, menuMusic, minecraftMusic;
|
private ISound currentMusic, currentRecord, menuMusic, minecraftMusic;
|
||||||
|
@ -46,11 +44,19 @@ public class AetherMusicTicker implements IUpdatePlayerListBox {
|
||||||
if (this.currentMusic != null) {
|
if (this.currentMusic != null) {
|
||||||
if (!this.mc.getSoundHandler().isSoundPlaying(this.currentMusic)) {
|
if (!this.mc.getSoundHandler().isSoundPlaying(this.currentMusic)) {
|
||||||
this.currentMusic = null;
|
this.currentMusic = null;
|
||||||
this.timeUntilNextMusic = Math.min(MathHelper.getRandomIntegerInRange(this.rand, tracktype.getMinDelay(), tracktype.getMaxDelay()), this.timeUntilNextMusic);
|
this.timeUntilNextMusic = Math.min(
|
||||||
|
MathHelper.getRandomIntegerInRange(
|
||||||
|
this.rand,
|
||||||
|
tracktype.getMinDelay(),
|
||||||
|
tracktype.getMaxDelay()
|
||||||
|
),
|
||||||
|
this.timeUntilNextMusic
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.timeUntilNextMusic = Math.min(this.timeUntilNextMusic, tracktype.getMaxDelay());
|
this.timeUntilNextMusic
|
||||||
|
= Math.min(this.timeUntilNextMusic, tracktype.getMaxDelay());
|
||||||
|
|
||||||
if (this.currentMusic == null && this.timeUntilNextMusic-- <= 0) {
|
if (this.currentMusic == null && this.timeUntilNextMusic-- <= 0) {
|
||||||
this.playMusic(tracktype);
|
this.playMusic(tracktype);
|
||||||
|
@ -67,51 +73,50 @@ public class AetherMusicTicker implements IUpdatePlayerListBox {
|
||||||
return this.currentMusic != null;
|
return this.currentMusic != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean playingRecord()
|
public boolean playingRecord() {
|
||||||
{
|
|
||||||
return this.currentRecord != null;
|
return this.currentRecord != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean playingMenuMusic()
|
public boolean playingMenuMusic() {
|
||||||
{
|
|
||||||
return this.menuMusic != null;
|
return this.menuMusic != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean playingMinecraftMusic()
|
public boolean playingMinecraftMusic() {
|
||||||
{
|
|
||||||
return this.minecraftMusic != null;
|
return this.minecraftMusic != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ISound getRecord()
|
public ISound getRecord() {
|
||||||
{
|
|
||||||
return this.currentRecord;
|
return this.currentRecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AetherMusicTicker.TrackType getRandomTrack() {
|
public AetherMusicTicker.TrackType getRandomTrack() {
|
||||||
int num = this.rand.nextInt(4);
|
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) {
|
public void playMusic(TrackType requestedMusicType) {
|
||||||
this.currentMusic = PositionedSoundRecord.func_147673_a(requestedMusicType.getMusicLocation());
|
this.currentMusic
|
||||||
|
= PositionedSoundRecord.func_147673_a(requestedMusicType.getMusicLocation());
|
||||||
this.mc.getSoundHandler().playSound(this.currentMusic);
|
this.mc.getSoundHandler().playSound(this.currentMusic);
|
||||||
this.timeUntilNextMusic = Integer.MAX_VALUE;
|
this.timeUntilNextMusic = Integer.MAX_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void trackRecord(ISound record)
|
public void trackRecord(ISound record) {
|
||||||
{
|
|
||||||
this.currentRecord = record;
|
this.currentRecord = record;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void trackMinecraftMusic(ISound record)
|
public void trackMinecraftMusic(ISound record) {
|
||||||
{
|
|
||||||
this.minecraftMusic = record;
|
this.minecraftMusic = record;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playMenuMusic()
|
public void playMenuMusic() {
|
||||||
{
|
this.menuMusic
|
||||||
this.menuMusic = PositionedSoundRecord.func_147673_a(TrackType.TRACK_MENU.getMusicLocation());
|
= PositionedSoundRecord.func_147673_a(TrackType.TRACK_MENU.getMusicLocation()
|
||||||
|
);
|
||||||
this.mc.getSoundHandler().playSound(this.menuMusic);
|
this.mc.getSoundHandler().playSound(this.menuMusic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,19 +128,15 @@ public class AetherMusicTicker implements IUpdatePlayerListBox {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopMenuMusic()
|
public void stopMenuMusic() {
|
||||||
{
|
if (this.menuMusic != null) {
|
||||||
if (this.menuMusic != null)
|
|
||||||
{
|
|
||||||
this.mc.getSoundHandler().stopSound(this.menuMusic);
|
this.mc.getSoundHandler().stopSound(this.menuMusic);
|
||||||
this.menuMusic = null;
|
this.menuMusic = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopMinecraftMusic()
|
public void stopMinecraftMusic() {
|
||||||
{
|
if (this.minecraftMusic != null) {
|
||||||
if (this.minecraftMusic != null)
|
|
||||||
{
|
|
||||||
this.mc.getSoundHandler().stopSound(this.minecraftMusic);
|
this.mc.getSoundHandler().stopSound(this.minecraftMusic);
|
||||||
this.minecraftMusic = null;
|
this.minecraftMusic = null;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +154,9 @@ public class AetherMusicTicker implements IUpdatePlayerListBox {
|
||||||
private final int minDelay;
|
private final int minDelay;
|
||||||
private final int maxDelay;
|
private final int maxDelay;
|
||||||
|
|
||||||
private TrackType(ResourceLocation musicLocationIn, int minDelayIn, int maxDelayIn) {
|
private TrackType(
|
||||||
|
ResourceLocation musicLocationIn, int minDelayIn, int maxDelayIn
|
||||||
|
) {
|
||||||
this.musicLocation = musicLocationIn;
|
this.musicLocation = musicLocationIn;
|
||||||
this.minDelay = minDelayIn;
|
this.minDelay = minDelayIn;
|
||||||
this.maxDelay = maxDelayIn;
|
this.maxDelay = maxDelayIn;
|
||||||
|
@ -171,5 +174,4 @@ public class AetherMusicTicker implements IUpdatePlayerListBox {
|
||||||
return this.maxDelay;
|
return this.maxDelay;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
package com.gildedgames.the_aether.client.gui;
|
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.LoadingScreenRenderer;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.Gui;
|
import net.minecraft.client.gui.Gui;
|
||||||
|
@ -7,15 +9,9 @@ import net.minecraft.client.gui.ScaledResolution;
|
||||||
import net.minecraft.client.renderer.OpenGlHelper;
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.shader.Framebuffer;
|
import net.minecraft.client.shader.Framebuffer;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
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 {
|
public class AetherLoadingScreen extends LoadingScreenRenderer {
|
||||||
|
|
||||||
private String message = "";
|
private String message = "";
|
||||||
|
|
||||||
private Minecraft mc;
|
private Minecraft mc;
|
||||||
|
@ -56,7 +52,9 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
|
||||||
|
|
||||||
if (j - this.systemTime >= 100L) {
|
if (j - this.systemTime >= 100L) {
|
||||||
this.systemTime = j;
|
this.systemTime = j;
|
||||||
ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
|
ScaledResolution scaledresolution = new ScaledResolution(
|
||||||
|
this.mc, this.mc.displayWidth, this.mc.displayHeight
|
||||||
|
);
|
||||||
int k = scaledresolution.getScaleFactor();
|
int k = scaledresolution.getScaleFactor();
|
||||||
int l = scaledresolution.getScaledWidth();
|
int l = scaledresolution.getScaledWidth();
|
||||||
int i1 = scaledresolution.getScaledHeight();
|
int i1 = scaledresolution.getScaledHeight();
|
||||||
|
@ -70,7 +68,14 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
|
||||||
this.framebuffer.bindFramebuffer(false);
|
this.framebuffer.bindFramebuffer(false);
|
||||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||||
GL11.glLoadIdentity();
|
GL11.glLoadIdentity();
|
||||||
GL11.glOrtho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D);
|
GL11.glOrtho(
|
||||||
|
0.0D,
|
||||||
|
scaledresolution.getScaledWidth_double(),
|
||||||
|
scaledresolution.getScaledHeight_double(),
|
||||||
|
0.0D,
|
||||||
|
100.0D,
|
||||||
|
300.0D
|
||||||
|
);
|
||||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||||
GL11.glLoadIdentity();
|
GL11.glLoadIdentity();
|
||||||
GL11.glTranslatef(0.0F, 0.0F, -200.0F);
|
GL11.glTranslatef(0.0F, 0.0F, -200.0F);
|
||||||
|
@ -85,9 +90,19 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
|
||||||
float f = 32.0F;
|
float f = 32.0F;
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
tessellator.setColorOpaque_I(4210752);
|
tessellator.setColorOpaque_I(4210752);
|
||||||
tessellator.addVertexWithUV(0.0D, (double) i1, 0.0D, 0.0D, (double) ((float) i1 / f));
|
tessellator.addVertexWithUV(
|
||||||
tessellator.addVertexWithUV((double) l, (double) i1, 0.0D, (double) ((float) l / f), (double) ((float) i1 / f));
|
0.0D, (double) i1, 0.0D, 0.0D, (double) ((float) i1 / f)
|
||||||
tessellator.addVertexWithUV((double) l, 0.0D, 0.0D, (double) ((float) l / f), 0.0D);
|
);
|
||||||
|
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.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
|
@ -106,7 +121,9 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
|
||||||
tessellator.setColorOpaque_I(8454016);
|
tessellator.setColorOpaque_I(8454016);
|
||||||
tessellator.addVertex((double) j1, (double) k1, 0.0D);
|
tessellator.addVertex((double) j1, (double) k1, 0.0D);
|
||||||
tessellator.addVertex((double) j1, (double) (k1 + b1), 0.0D);
|
tessellator.addVertex((double) j1, (double) (k1 + b1), 0.0D);
|
||||||
tessellator.addVertex((double) (j1 + progress), (double) (k1 + b1), 0.0D);
|
tessellator.addVertex(
|
||||||
|
(double) (j1 + progress), (double) (k1 + b1), 0.0D
|
||||||
|
);
|
||||||
tessellator.addVertex((double) (j1 + progress), (double) k1, 0.0D);
|
tessellator.addVertex((double) (j1 + progress), (double) k1, 0.0D);
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
|
@ -114,8 +131,19 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
|
||||||
|
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
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.mc.fontRenderer.drawStringWithShadow(this.currentDisplayedTrivia, (l - this.mc.fontRenderer.getStringWidth(this.currentDisplayedTrivia)) / 2, i1 - 16, 0xffff99);
|
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();
|
||||||
|
@ -133,5 +161,4 @@ public class AetherLoadingScreen extends LoadingScreenRenderer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,8 @@
|
||||||
package com.gildedgames.the_aether.client.gui;
|
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.Minecraft;
|
||||||
import net.minecraft.client.gui.Gui;
|
import net.minecraft.client.gui.Gui;
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
|
@ -8,13 +11,7 @@ import net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
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 {
|
public class GuiAetherInGame extends Gui {
|
||||||
|
|
||||||
private Minecraft mc;
|
private Minecraft mc;
|
||||||
|
|
||||||
public GuiAetherInGame(Minecraft mc) {
|
public GuiAetherInGame(Minecraft mc) {
|
||||||
|
@ -27,7 +24,8 @@ public class GuiAetherInGame extends Gui {
|
||||||
if (this.mc.thePlayer != null) {
|
if (this.mc.thePlayer != null) {
|
||||||
PlayerAether player = PlayerAether.get(this.mc.thePlayer);
|
PlayerAether player = PlayerAether.get(this.mc.thePlayer);
|
||||||
|
|
||||||
if (player.getAccessoryInventory().isWearingPhoenixSet() && event.overlayType == OverlayType.FIRE) {
|
if (player.getAccessoryInventory().isWearingPhoenixSet()
|
||||||
|
&& event.overlayType == OverlayType.FIRE) {
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,11 +48,14 @@ public class GuiAetherInGame extends Gui {
|
||||||
AetherOverlay.renderBossHP(this.mc);
|
AetherOverlay.renderBossHP(this.mc);
|
||||||
}
|
}
|
||||||
|
|
||||||
float portalTime = player.prevTimeInPortal + (player.timeInPortal - player.prevTimeInPortal) * event.partialTicks;
|
float portalTime = player.prevTimeInPortal
|
||||||
|
+ (player.timeInPortal - player.prevTimeInPortal) * event.partialTicks;
|
||||||
|
|
||||||
if (portalTime > 0.0F) {
|
if (portalTime > 0.0F) {
|
||||||
AetherOverlay.renderAetherPortal(portalTime, new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight));
|
AetherOverlay.renderAetherPortal(
|
||||||
|
portalTime,
|
||||||
|
new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -15,75 +15,82 @@ import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiCustomizationScreen extends GuiScreen
|
public class GuiCustomizationScreen extends GuiScreen {
|
||||||
{
|
|
||||||
private final GuiScreen parentScreen;
|
private final GuiScreen parentScreen;
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
public GuiCustomizationScreen(GuiScreen parentScreenIn)
|
public GuiCustomizationScreen(GuiScreen parentScreenIn) {
|
||||||
{
|
|
||||||
this.parentScreen = parentScreenIn;
|
this.parentScreen = parentScreenIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui()
|
public void initGui() {
|
||||||
{
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
this.title = I18n.format("gui.options.perk_customization.title");
|
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;
|
++i;
|
||||||
|
|
||||||
if (AetherRankings.isDeveloper(Minecraft.getMinecraft().thePlayer.getUniqueID()))
|
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)));
|
this.buttonList.add(new GuiGlowButton(
|
||||||
|
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1)
|
||||||
|
));
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i % 2 == 1)
|
if (i % 2 == 1) {
|
||||||
{
|
|
||||||
++i;
|
++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
|
@Override
|
||||||
protected void actionPerformed(GuiButton button)
|
protected void actionPerformed(GuiButton button) {
|
||||||
{
|
if (button.enabled) {
|
||||||
if (button.enabled)
|
if (button.id == 200) {
|
||||||
{
|
|
||||||
if (button.id == 200)
|
|
||||||
{
|
|
||||||
this.mc.gameSettings.saveOptions();
|
this.mc.gameSettings.saveOptions();
|
||||||
this.mc.displayGuiScreen(this.parentScreen);
|
this.mc.displayGuiScreen(this.parentScreen);
|
||||||
}
|
} else if (button.id == 201) {
|
||||||
else if (button.id == 201)
|
|
||||||
{
|
|
||||||
PlayerAether player = PlayerAether.get(mc.thePlayer);
|
PlayerAether player = PlayerAether.get(mc.thePlayer);
|
||||||
|
|
||||||
boolean enableHalo = !player.shouldRenderHalo;
|
boolean enableHalo = !player.shouldRenderHalo;
|
||||||
|
|
||||||
player.shouldRenderHalo = enableHalo;
|
player.shouldRenderHalo = enableHalo;
|
||||||
AetherNetwork.sendToServer(new PacketPerkChanged(player.getEntity().getEntityId(), EnumAetherPerkType.Halo, player.shouldRenderHalo));
|
AetherNetwork.sendToServer(new PacketPerkChanged(
|
||||||
}
|
player.getEntity().getEntityId(),
|
||||||
else if (button.id == 202)
|
EnumAetherPerkType.Halo,
|
||||||
{
|
player.shouldRenderHalo
|
||||||
|
));
|
||||||
|
} else if (button.id == 202) {
|
||||||
PlayerAether player = PlayerAether.get(mc.thePlayer);
|
PlayerAether player = PlayerAether.get(mc.thePlayer);
|
||||||
|
|
||||||
boolean enableGlow = !player.shouldRenderGlow;
|
boolean enableGlow = !player.shouldRenderGlow;
|
||||||
|
|
||||||
player.shouldRenderGlow = enableGlow;
|
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
|
@Override
|
||||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||||
{
|
|
||||||
this.drawDefaultBackground();
|
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);
|
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,23 +2,20 @@ package com.gildedgames.the_aether.client.gui;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
import com.gildedgames.the_aether.Aether;
|
||||||
import com.gildedgames.the_aether.AetherConfig;
|
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.gui.inventory.GuiContainer;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
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)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiEnchanter extends GuiContainer {
|
public class GuiEnchanter extends GuiContainer {
|
||||||
|
private static final ResourceLocation TEXTURE
|
||||||
private static final ResourceLocation TEXTURE = Aether.locate("textures/gui/altar.png");
|
= Aether.locate("textures/gui/altar.png");
|
||||||
|
|
||||||
private TileEntityEnchanter enchanter;
|
private TileEntityEnchanter enchanter;
|
||||||
|
|
||||||
|
@ -29,12 +26,19 @@ public class GuiEnchanter extends GuiContainer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||||
String enchanterName = AetherConfig.legacyAltarName() ?
|
String enchanterName = AetherConfig.legacyAltarName()
|
||||||
I18n.format("container.aether_legacy.enchanter")
|
? I18n.format("container.aether_legacy.enchanter")
|
||||||
: I18n.format("container.aether_legacy.altar");
|
: I18n.format("container.aether_legacy.altar");
|
||||||
|
|
||||||
this.fontRendererObj.drawString(enchanterName, this.xSize / 2 - this.fontRendererObj.getStringWidth(enchanterName) / 2, 6, 4210752);
|
this.fontRendererObj.drawString(
|
||||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
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
|
@Override
|
||||||
|
@ -48,11 +52,12 @@ public class GuiEnchanter extends GuiContainer {
|
||||||
|
|
||||||
if (this.enchanter.isEnchanting()) {
|
if (this.enchanter.isEnchanting()) {
|
||||||
i1 = this.enchanter.getEnchantmentTimeRemaining(12);
|
i1 = this.enchanter.getEnchantmentTimeRemaining(12);
|
||||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2);
|
this.drawTexturedModalRect(
|
||||||
|
k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
i1 = this.enchanter.getEnchantmentProgressScaled(24);
|
i1 = this.enchanter.getEnchantmentProgressScaled(24);
|
||||||
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
|
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,40 +4,56 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
|
||||||
public class GuiEnterAether extends GuiScreen
|
public class GuiEnterAether extends GuiScreen {
|
||||||
{
|
|
||||||
public boolean aether;
|
public boolean aether;
|
||||||
|
|
||||||
public GuiEnterAether(boolean dimension)
|
public GuiEnterAether(boolean dimension) {
|
||||||
{
|
|
||||||
aether = dimension;
|
aether = dimension;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initGui()
|
public void initGui() {
|
||||||
{
|
|
||||||
this.buttonList.clear();
|
this.buttonList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||||
{
|
|
||||||
this.drawBackground(0);
|
this.drawBackground(0);
|
||||||
|
|
||||||
if (aether)
|
if (aether) {
|
||||||
{
|
this.drawCenteredString(
|
||||||
this.drawCenteredString(this.fontRendererObj, I18n.format("gui.loading.enteraether"), this.width / 2, this.height / 2 - 45, 16777215);
|
this.fontRendererObj,
|
||||||
this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain"), this.width / 2, this.height / 2 - 25, 16777215);
|
I18n.format("gui.loading.enteraether"),
|
||||||
}
|
this.width / 2,
|
||||||
else
|
this.height / 2 - 45,
|
||||||
{
|
16777215
|
||||||
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);
|
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);
|
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean doesGuiPauseGame()
|
public boolean doesGuiPauseGame() {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
package com.gildedgames.the_aether.client.gui;
|
package com.gildedgames.the_aether.client.gui;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
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.gui.inventory.GuiContainer;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
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)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiFreezer extends GuiContainer {
|
public class GuiFreezer extends GuiContainer {
|
||||||
|
private static final ResourceLocation TEXTURE
|
||||||
private static final ResourceLocation TEXTURE = Aether.locate("textures/gui/altar.png");
|
= Aether.locate("textures/gui/altar.png");
|
||||||
|
|
||||||
private TileEntityFreezer freezer;
|
private TileEntityFreezer freezer;
|
||||||
|
|
||||||
|
@ -30,8 +27,15 @@ public class GuiFreezer extends GuiContainer {
|
||||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||||
String freezerName = this.freezer.getInventoryName();
|
String freezerName = this.freezer.getInventoryName();
|
||||||
|
|
||||||
this.fontRendererObj.drawString(freezerName, this.xSize / 2 - this.fontRendererObj.getStringWidth(freezerName) / 2, 6, 4210752);
|
this.fontRendererObj.drawString(
|
||||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
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
|
@Override
|
||||||
|
@ -45,11 +49,12 @@ public class GuiFreezer extends GuiContainer {
|
||||||
|
|
||||||
if (this.freezer.isFreezing()) {
|
if (this.freezer.isFreezing()) {
|
||||||
i1 = this.freezer.getFreezingTimeRemaining(12);
|
i1 = this.freezer.getFreezingTimeRemaining(12);
|
||||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2);
|
this.drawTexturedModalRect(
|
||||||
|
k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
i1 = this.freezer.getFreezingProgressScaled(24);
|
i1 = this.freezer.getFreezingProgressScaled(24);
|
||||||
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
|
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,24 +1,26 @@
|
||||||
package com.gildedgames.the_aether.client.gui;
|
package com.gildedgames.the_aether.client.gui;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
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.gui.inventory.GuiContainer;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
import com.gildedgames.the_aether.inventory.ContainerIncubator;
|
|
||||||
import com.gildedgames.the_aether.tileentity.TileEntityIncubator;
|
|
||||||
|
|
||||||
public class GuiIncubator extends GuiContainer {
|
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) {
|
public GuiIncubator(
|
||||||
|
EntityPlayer player,
|
||||||
|
InventoryPlayer inventoryplayer,
|
||||||
|
TileEntityIncubator tileentityIncubator
|
||||||
|
) {
|
||||||
super(new ContainerIncubator(player, inventoryplayer, tileentityIncubator));
|
super(new ContainerIncubator(player, inventoryplayer, tileentityIncubator));
|
||||||
|
|
||||||
this.incubatorInventory = (TileEntityIncubator) tileentityIncubator;
|
this.incubatorInventory = (TileEntityIncubator) tileentityIncubator;
|
||||||
|
@ -28,8 +30,15 @@ public class GuiIncubator extends GuiContainer {
|
||||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||||
String incubatorName = this.incubatorInventory.getInventoryName();
|
String incubatorName = this.incubatorInventory.getInventoryName();
|
||||||
|
|
||||||
this.fontRendererObj.drawString(incubatorName, this.xSize / 2 - this.fontRendererObj.getStringWidth(incubatorName) / 2, 6, 4210752);
|
this.fontRendererObj.drawString(
|
||||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 0x404040);
|
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
|
@Override
|
||||||
|
@ -53,5 +62,4 @@ public class GuiIncubator extends GuiContainer {
|
||||||
|
|
||||||
this.drawTexturedModalRect(j + 103, k + 70 - i1, 179, 70 - i1, 10, i1);
|
this.drawTexturedModalRect(j + 103, k + 70 - i1, 179, 70 - i1, 10, i1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,6 +3,9 @@ package com.gildedgames.the_aether.client.gui;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
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.Gui;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
@ -10,18 +13,14 @@ import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
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 {
|
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;
|
||||||
|
|
||||||
|
@ -42,8 +41,12 @@ public class GuiLore extends GuiContainer {
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
|
||||||
this.previousPage = new GuiLoreButton(19, this.width / 2 - 110, this.height / 2 + 72, 20, 20, "<");
|
this.previousPage = new GuiLoreButton(
|
||||||
this.nextPage = new GuiLoreButton(20, this.width / 2 + 90, this.height / 2 + 72, 20, 20, ">");
|
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.previousPage);
|
||||||
this.buttonList.add(this.nextPage);
|
this.buttonList.add(this.nextPage);
|
||||||
|
@ -69,30 +72,57 @@ public class GuiLore extends GuiContainer {
|
||||||
|
|
||||||
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 (searchedStack != null) {
|
||||||
if (this.currentItem == null || (searchedStack.getItem() != this.currentItem.getItem() || (!searchedStack.isItemStackDamageable() && searchedStack.getItemDamage() != this.currentItem.getItemDamage()))) {
|
if (this.currentItem == null
|
||||||
|
|| (searchedStack.getItem() != this.currentItem.getItem()
|
||||||
|
|| (!searchedStack.isItemStackDamageable()
|
||||||
|
&& searchedStack.getItemDamage()
|
||||||
|
!= this.currentItem.getItemDamage()))) {
|
||||||
this.pageNumber = 0;
|
this.pageNumber = 0;
|
||||||
this.stringToLoad = I18n.format(AetherLore.getLoreEntryKey(searchedStack));
|
this.stringToLoad
|
||||||
|
= I18n.format(AetherLore.getLoreEntryKey(searchedStack));
|
||||||
this.currentItem = searchedStack;
|
this.currentItem = searchedStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
int nameSize = 0;
|
int nameSize = 0;
|
||||||
|
|
||||||
for (String name : ((List<String>) this.fontRendererObj.listFormattedStringToWidth(searchedStack.getItem().getItemStackDisplayName(searchedStack), 109))) {
|
for (String name :
|
||||||
this.drawCenteredString(this.fontRendererObj, searchedStack.getRarity().rarityColor.toString() + name, 71, 18 + (10 * nameSize), 4210752);
|
((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))) {
|
for (String lore :
|
||||||
if (size >= 15 * this.pageNumber && size + (nameSize - 1) <= 15 * (this.pageNumber + 1)) {
|
((List<String>) this.fontRendererObj.listFormattedStringToWidth(
|
||||||
int actualSize = this.pageNumber >= 1 ? size - ((15 - (nameSize - 1)) * this.pageNumber) : size + (nameSize - 1);
|
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++;
|
||||||
|
@ -115,11 +145,16 @@ public class GuiLore extends GuiContainer {
|
||||||
int k = (this.height - this.ySize) / 2;
|
int k = (this.height - this.ySize) / 2;
|
||||||
|
|
||||||
this.mc.renderEngine.bindTexture(TEXTURE_LORE);
|
this.mc.renderEngine.bindTexture(TEXTURE_LORE);
|
||||||
Gui.func_152125_a(j, k - 4, 0, 0, 120, 120, this.xSize, this.ySize + 61, 120, 120);
|
Gui.func_152125_a(
|
||||||
|
j, k - 4, 0, 0, 120, 120, this.xSize, this.ySize + 61, 120, 120
|
||||||
|
);
|
||||||
|
|
||||||
this.mc.renderEngine.bindTexture(TEXTURE_LORE_BOOK);
|
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(
|
||||||
Gui.func_146110_a(j + 90, k - 5, 0, 225, this.xSize + 20, this.ySize - 177, 500, 500);
|
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
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,23 +1,19 @@
|
||||||
package com.gildedgames.the_aether.client.gui;
|
package com.gildedgames.the_aether.client.gui;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
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.client.gui.GuiScreen;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
import com.gildedgames.the_aether.client.gui.button.GuiSunAltarSlider;
|
|
||||||
|
|
||||||
public class GuiSunAltar extends GuiScreen {
|
public class GuiSunAltar extends GuiScreen {
|
||||||
|
private static final ResourceLocation TEXTURE
|
||||||
private static final ResourceLocation TEXTURE = Aether.locate("textures/gui/sun_altar.png");
|
= Aether.locate("textures/gui/sun_altar.png");
|
||||||
|
|
||||||
private World world;
|
private World world;
|
||||||
|
|
||||||
public GuiSunAltar() {
|
public GuiSunAltar() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
|
@ -26,7 +22,9 @@ public class GuiSunAltar extends GuiScreen {
|
||||||
|
|
||||||
this.world = this.mc.theWorld;
|
this.world = this.mc.theWorld;
|
||||||
|
|
||||||
this.buttonList.add(new GuiSunAltarSlider(this.world, this.width / 2 - 75, this.height / 2, "Select Time"));
|
this.buttonList.add(new GuiSunAltarSlider(
|
||||||
|
this.world, this.width / 2 - 75, this.height / 2, "Select Time"
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -41,7 +39,12 @@ public class GuiSunAltar extends GuiScreen {
|
||||||
int k = (this.height - ySize) / 2;
|
int k = (this.height - ySize) / 2;
|
||||||
|
|
||||||
this.drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
|
this.drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
|
||||||
this.fontRendererObj.drawString("Sun Altar", (this.width - this.fontRendererObj.getStringWidth("Sun Altar")) / 2, k + 20, 0x404040);
|
this.fontRendererObj.drawString(
|
||||||
|
"Sun Altar",
|
||||||
|
(this.width - this.fontRendererObj.getStringWidth("Sun Altar")) / 2,
|
||||||
|
k + 20,
|
||||||
|
0x404040
|
||||||
|
);
|
||||||
|
|
||||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
@ -51,10 +54,9 @@ public class GuiSunAltar extends GuiScreen {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void keyTyped(char p_73869_1_, int p_73869_2_)
|
protected void keyTyped(char p_73869_1_, int p_73869_2_) {
|
||||||
{
|
if (p_73869_2_ == 1
|
||||||
if (p_73869_2_ == 1 || p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode())
|
|| p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
|
||||||
{
|
|
||||||
this.mc.thePlayer.closeScreen();
|
this.mc.thePlayer.closeScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
package com.gildedgames.the_aether.client.gui;
|
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.gui.inventory.GuiContainer;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.ContainerChest;
|
import net.minecraft.inventory.ContainerChest;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
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)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiTreasureChest extends GuiContainer {
|
public class GuiTreasureChest extends GuiContainer {
|
||||||
private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("textures/gui/container/generic_54.png");
|
private 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) {
|
public GuiTreasureChest(
|
||||||
|
InventoryPlayer playerInventory, TileEntityTreasureChest chestInventory
|
||||||
|
) {
|
||||||
super(new ContainerChest(playerInventory, chestInventory));
|
super(new ContainerChest(playerInventory, chestInventory));
|
||||||
|
|
||||||
this.allowUserInput = false;
|
this.allowUserInput = false;
|
||||||
|
@ -51,12 +51,15 @@ public class GuiTreasureChest extends GuiContainer {
|
||||||
/**
|
/**
|
||||||
* Draws the background layer of this container (behind the items).
|
* Draws the background layer of this container (behind the items).
|
||||||
*/
|
*/
|
||||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
protected void
|
||||||
|
drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.mc.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
|
this.mc.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
|
||||||
int i = (this.width - this.xSize) / 2;
|
int i = (this.width - this.xSize) / 2;
|
||||||
int j = (this.height - this.ySize) / 2;
|
int j = (this.height - this.ySize) / 2;
|
||||||
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
|
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
|
||||||
this.drawTexturedModalRect(i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96);
|
this.drawTexturedModalRect(
|
||||||
|
i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,14 +4,14 @@ import com.gildedgames.the_aether.Aether;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public class GuiAccessoryButton extends GuiButton {
|
public class GuiAccessoryButton extends GuiButton {
|
||||||
|
protected static final ResourceLocation BUTTON_TEXTURE
|
||||||
|
= Aether.locate("textures/gui/inventory/button/cloud.png");
|
||||||
|
|
||||||
protected static final ResourceLocation BUTTON_TEXTURE = Aether.locate("textures/gui/inventory/button/cloud.png");
|
protected static final ResourceLocation BUTTON_HOVERED_TEXTURE
|
||||||
|
= Aether.locate("textures/gui/inventory/button/cloud_hover.png");
|
||||||
protected static final ResourceLocation BUTTON_HOVERED_TEXTURE = Aether.locate("textures/gui/inventory/button/cloud_hover.png");
|
|
||||||
|
|
||||||
public GuiAccessoryButton(int x, int y) {
|
public GuiAccessoryButton(int x, int y) {
|
||||||
super(18067, x, y, 12, 12, "");
|
super(18067, x, y, 12, 12, "");
|
||||||
|
@ -26,13 +26,17 @@ public class GuiAccessoryButton extends GuiButton {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
|
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
|
||||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
|
||||||
|
&& mouseX < this.xPosition + this.width
|
||||||
|
&& mouseY < this.yPosition + this.height;
|
||||||
|
|
||||||
if (this.visible) {
|
if (this.visible) {
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
int i = this.getHoverState(this.field_146123_n);
|
int i = this.getHoverState(this.field_146123_n);
|
||||||
mc.getTextureManager().bindTexture(i == 2 ? BUTTON_HOVERED_TEXTURE : BUTTON_TEXTURE);
|
mc.getTextureManager().bindTexture(
|
||||||
|
i == 2 ? BUTTON_HOVERED_TEXTURE : BUTTON_TEXTURE
|
||||||
|
);
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
|
||||||
func_146110_a(this.xPosition - 1, this.yPosition, 0, 0, 14, 14, 14, 14);
|
func_146110_a(this.xPosition - 1, this.yPosition, 0, 0, 14, 14, 14, 14);
|
||||||
|
@ -40,5 +44,4 @@ public class GuiAccessoryButton extends GuiButton {
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,20 +1,18 @@
|
||||||
package com.gildedgames.the_aether.client.gui.button;
|
package com.gildedgames.the_aether.client.gui.button;
|
||||||
|
|
||||||
import com.gildedgames.the_aether.Aether;
|
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.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiAetherButton extends GuiButton {
|
public class GuiAetherButton extends GuiButton {
|
||||||
|
protected static final ResourceLocation buttonTextures
|
||||||
protected static final ResourceLocation buttonTextures = Aether.locate("textures/gui/buttons.png");
|
= Aether.locate("textures/gui/buttons.png");
|
||||||
|
|
||||||
public int scrollMax = 100;
|
public int scrollMax = 100;
|
||||||
|
|
||||||
|
@ -75,34 +73,66 @@ public class GuiAetherButton extends GuiButton {
|
||||||
FontRenderer fontrenderer = minecraft.fontRenderer;
|
FontRenderer fontrenderer = minecraft.fontRenderer;
|
||||||
minecraft.renderEngine.bindTexture(buttonTextures);
|
minecraft.renderEngine.bindTexture(buttonTextures);
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
boolean flag = i >= this.xPosition && j >= this.yPosition && i < this.xPosition + this.width && j < this.yPosition + this.height;
|
boolean flag = i >= this.xPosition && j >= this.yPosition
|
||||||
|
&& i < this.xPosition + this.width && j < this.yPosition + this.height;
|
||||||
int k = this.getHoverState(flag);
|
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.drawTexturedModalRect(this.xPosition + this.scrollHeight + this.width / 2 - 90, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height);
|
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);
|
this.mouseDragged(minecraft, i, j);
|
||||||
|
|
||||||
GL11.glDisable(GL11.GL_BLEND);
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
|
||||||
if (!this.enabled) {
|
if (!this.enabled) {
|
||||||
this.drawString(fontrenderer, this.displayString, this.xPosition + this.width / 10 + this.scrollHeight - 80, this.yPosition + (this.height - 8) / 2, -6250336);
|
this.drawString(
|
||||||
|
fontrenderer,
|
||||||
|
this.displayString,
|
||||||
|
this.xPosition + this.width / 10 + this.scrollHeight - 80,
|
||||||
|
this.yPosition + (this.height - 8) / 2,
|
||||||
|
-6250336
|
||||||
|
);
|
||||||
} else if (flag) {
|
} else if (flag) {
|
||||||
this.drawString(fontrenderer, this.displayString, this.xPosition + this.width / 10 + this.scrollHeight - 80, this.yPosition + (this.height - 8) / 2, 0x77cccc);
|
this.drawString(
|
||||||
|
fontrenderer,
|
||||||
|
this.displayString,
|
||||||
|
this.xPosition + this.width / 10 + this.scrollHeight - 80,
|
||||||
|
this.yPosition + (this.height - 8) / 2,
|
||||||
|
0x77cccc
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.drawString(fontrenderer, this.displayString, this.xPosition + this.width / 10 + this.scrollHeight - 80, this.yPosition + (this.height - 8) / 2, 14737632);
|
this.drawString(
|
||||||
|
fontrenderer,
|
||||||
|
this.displayString,
|
||||||
|
this.xPosition + this.width / 10 + this.scrollHeight - 80,
|
||||||
|
this.yPosition + (this.height - 8) / 2,
|
||||||
|
14737632
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void mouseDragged(Minecraft var1, int var2, int var3) {
|
protected void mouseDragged(Minecraft var1, int var2, int var3) {}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mouseReleased(int var1, int var2) {
|
public void mouseReleased(int var1, int var2) {}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean mousePressed(Minecraft var1, int var2, int var3) {
|
public boolean mousePressed(Minecraft var1, int var2, int var3) {
|
||||||
return this.enabled && this.visible && var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height;
|
return this.enabled && this.visible && var2 >= this.xPosition
|
||||||
|
&& var3 >= this.yPosition && var2 < this.xPosition + this.width
|
||||||
|
&& var3 < this.yPosition + this.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,9 +3,7 @@ package com.gildedgames.the_aether.client.gui.button;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
|
||||||
public class GuiButtonPerks extends GuiButton {
|
public class GuiButtonPerks extends GuiButton {
|
||||||
|
|
||||||
public GuiButtonPerks(int xPos, int yPos) {
|
public GuiButtonPerks(int xPos, int yPos) {
|
||||||
super(24, xPos, yPos, 20, 20, "?");
|
super(24, xPos, yPos, 20, 20, "?");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,24 +5,20 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
|
||||||
public class GuiCapeButton extends GuiButton
|
public class GuiCapeButton extends GuiButton {
|
||||||
{
|
public GuiCapeButton(int xPos, int yPos) {
|
||||||
public GuiCapeButton(int xPos, int yPos)
|
|
||||||
{
|
|
||||||
super(203, xPos, yPos, 150, 20, I18n.format("gui.button.aether_cape"));
|
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);
|
PlayerAether player = PlayerAether.get(mc.thePlayer);
|
||||||
|
|
||||||
if (player.shouldRenderCape)
|
if (player.shouldRenderCape) {
|
||||||
{
|
this.displayString
|
||||||
this.displayString = I18n.format("gui.button.aether_cape") + " " + I18n.format("options.on");
|
= I18n.format("gui.button.aether_cape") + " " + I18n.format("options.on");
|
||||||
}
|
} else {
|
||||||
else
|
this.displayString = I18n.format("gui.button.aether_cape") + " "
|
||||||
{
|
+ I18n.format("options.off");
|
||||||
this.displayString = I18n.format("gui.button.aether_cape") + " " + I18n.format("options.off");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.drawButton(mc, mouseX, mouseY);
|
super.drawButton(mc, mouseX, mouseY);
|
||||||
|
|
|
@ -2,10 +2,15 @@ package com.gildedgames.the_aether.client.gui.button;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
|
||||||
public class GuiCustomizationScreenButton extends GuiButton
|
public class GuiCustomizationScreenButton extends GuiButton {
|
||||||
{
|
public GuiCustomizationScreenButton(
|
||||||
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_)
|
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_);
|
super(p_i1021_1_, p_i1021_2_, p_i1021_3_, p_i1021_4_, p_i1021_5_, p_i1021_6_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,17 @@ import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
|
||||||
public class GuiDescButton extends 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) {
|
public GuiDescButton(
|
||||||
|
int buttonId,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int widthIn,
|
||||||
|
int heightIn,
|
||||||
|
String buttonText,
|
||||||
|
String descText
|
||||||
|
) {
|
||||||
super(buttonId, x, y, widthIn, heightIn, buttonText);
|
super(buttonId, x, y, widthIn, heightIn, buttonText);
|
||||||
this.descText = descText;
|
this.descText = descText;
|
||||||
}
|
}
|
||||||
|
@ -20,13 +27,30 @@ public class GuiDescButton extends GuiButton {
|
||||||
|
|
||||||
if (this.visible && this.field_146123_n) {
|
if (this.visible && this.field_146123_n) {
|
||||||
if (this.displayString == "Q") {
|
if (this.displayString == "Q") {
|
||||||
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + (this.width + 50) / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
|
this.drawCenteredString(
|
||||||
|
fontrenderer,
|
||||||
|
this.descText,
|
||||||
|
this.xPosition + (this.width + 50) / 2,
|
||||||
|
this.yPosition + (this.height + 24) / 2,
|
||||||
|
0xfffffF
|
||||||
|
);
|
||||||
} else if (this.displayString == "W") {
|
} else if (this.displayString == "W") {
|
||||||
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + (this.width - 50) / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
|
this.drawCenteredString(
|
||||||
|
fontrenderer,
|
||||||
|
this.descText,
|
||||||
|
this.xPosition + (this.width - 50) / 2,
|
||||||
|
this.yPosition + (this.height + 24) / 2,
|
||||||
|
0xfffffF
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.drawCenteredString(fontrenderer, this.descText, this.xPosition + this.width / 2, this.yPosition + (this.height + 24) / 2, 0xfffffF);
|
this.drawCenteredString(
|
||||||
|
fontrenderer,
|
||||||
|
this.descText,
|
||||||
|
this.xPosition + this.width / 2,
|
||||||
|
this.yPosition + (this.height + 24) / 2,
|
||||||
|
0xfffffF
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,24 +5,20 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
|
||||||
public class GuiGlowButton extends GuiButton
|
public class GuiGlowButton extends GuiButton {
|
||||||
{
|
public GuiGlowButton(int xPos, int yPos) {
|
||||||
public GuiGlowButton(int xPos, int yPos)
|
|
||||||
{
|
|
||||||
super(202, xPos, yPos, 150, 20, I18n.format("gui.button.glow"));
|
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);
|
PlayerAether player = PlayerAether.get(mc.thePlayer);
|
||||||
|
|
||||||
if (player.shouldRenderGlow)
|
if (player.shouldRenderGlow) {
|
||||||
{
|
this.displayString
|
||||||
this.displayString = I18n.format("gui.button.glow") + " " + I18n.format("options.on");
|
= I18n.format("gui.button.glow") + " " + I18n.format("options.on");
|
||||||
}
|
} else {
|
||||||
else
|
this.displayString
|
||||||
{
|
= I18n.format("gui.button.glow") + " " + I18n.format("options.off");
|
||||||
this.displayString = I18n.format("gui.button.glow") + " " + I18n.format("options.off");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.drawButton(mc, mouseX, mouseY);
|
super.drawButton(mc, mouseX, mouseY);
|
||||||
|
|
|
@ -5,24 +5,20 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
|
||||||
public class GuiHaloButton extends GuiButton
|
public class GuiHaloButton extends GuiButton {
|
||||||
{
|
public GuiHaloButton(int xPos, int yPos) {
|
||||||
public GuiHaloButton(int xPos, int yPos)
|
|
||||||
{
|
|
||||||
super(201, xPos, yPos, 150, 20, I18n.format("gui.button.halo"));
|
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);
|
PlayerAether player = PlayerAether.get(mc.thePlayer);
|
||||||
|
|
||||||
if (player.shouldRenderHalo)
|
if (player.shouldRenderHalo) {
|
||||||
{
|
this.displayString
|
||||||
this.displayString = I18n.format("gui.button.halo") + " " + I18n.format("options.on");
|
= I18n.format("gui.button.halo") + " " + I18n.format("options.on");
|
||||||
}
|
} else {
|
||||||
else
|
this.displayString
|
||||||
{
|
= I18n.format("gui.button.halo") + " " + I18n.format("options.off");
|
||||||
this.displayString = I18n.format("gui.button.halo") + " " + I18n.format("options.off");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.drawButton(mc, mouseX, mouseY);
|
super.drawButton(mc, mouseX, mouseY);
|
||||||
|
|
|
@ -6,14 +6,15 @@ import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.renderer.OpenGlHelper;
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public class GuiLoreButton extends GuiButton {
|
public class GuiLoreButton extends GuiButton {
|
||||||
|
protected static final ResourceLocation BUTTON_TEXTURES
|
||||||
|
= Aether.locate("textures/gui/lore_widgets.png");
|
||||||
|
|
||||||
protected static final ResourceLocation BUTTON_TEXTURES = Aether.locate("textures/gui/lore_widgets.png");
|
public GuiLoreButton(
|
||||||
|
int buttonId, int x, int y, int widthIn, int heightIn, String buttonText
|
||||||
public GuiLoreButton(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText) {
|
) {
|
||||||
super(buttonId, x, y, widthIn, heightIn, buttonText);
|
super(buttonId, x, y, widthIn, heightIn, buttonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,13 +24,31 @@ public class GuiLoreButton extends GuiButton {
|
||||||
FontRenderer fontrenderer = mc.fontRenderer;
|
FontRenderer fontrenderer = mc.fontRenderer;
|
||||||
mc.getTextureManager().bindTexture(BUTTON_TEXTURES);
|
mc.getTextureManager().bindTexture(BUTTON_TEXTURES);
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
|
||||||
|
&& mouseX < this.xPosition + this.width
|
||||||
|
&& mouseY < this.yPosition + this.height;
|
||||||
int i = this.getHoverState(this.field_146123_n);
|
int i = this.getHoverState(this.field_146123_n);
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
|
OpenGlHelper.glBlendFunc(
|
||||||
|
GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO
|
||||||
|
);
|
||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
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.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
|
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);
|
this.mouseDragged(mc, mouseX, mouseY);
|
||||||
int j = 14737632;
|
int j = 14737632;
|
||||||
|
|
||||||
|
@ -41,8 +60,13 @@ public class GuiLoreButton extends GuiButton {
|
||||||
j = 16777120;
|
j = 16777120;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, j);
|
this.drawCenteredString(
|
||||||
|
fontrenderer,
|
||||||
|
this.displayString,
|
||||||
|
this.xPosition + this.width / 2,
|
||||||
|
this.yPosition + (this.height - 8) / 2,
|
||||||
|
j
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,16 +1,13 @@
|
||||||
package com.gildedgames.the_aether.client.gui.button;
|
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.AetherNetwork;
|
||||||
import com.gildedgames.the_aether.network.packets.PacketSetTime;
|
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 class GuiSunAltarSlider extends GuiButton {
|
||||||
|
|
||||||
public float sliderValue;
|
public float sliderValue;
|
||||||
|
|
||||||
public boolean dragging = false;
|
public boolean dragging = false;
|
||||||
|
@ -24,8 +21,8 @@ public class GuiSunAltarSlider extends GuiButton {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over
|
* Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this
|
||||||
* this button.
|
* button and 2 if it IS hovering over this button.
|
||||||
*/
|
*/
|
||||||
public int getHoverState(boolean par1) {
|
public int getHoverState(boolean par1) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -35,12 +32,14 @@ public class GuiSunAltarSlider extends GuiButton {
|
||||||
protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) {
|
protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) {
|
||||||
if (this.visible) {
|
if (this.visible) {
|
||||||
if (this.dragging) {
|
if (this.dragging) {
|
||||||
this.sliderValue = (float) (mouseX - (this.xPosition + 4)) / (float) (this.width - 8);
|
this.sliderValue
|
||||||
|
= (float) (mouseX - (this.xPosition + 4)) / (float) (this.width - 8);
|
||||||
|
|
||||||
long shouldTime = (long) (24000L * sliderValue);
|
long shouldTime = (long) (24000L * sliderValue);
|
||||||
long worldTime = world.getWorldInfo().getWorldTime();
|
long worldTime = world.getWorldInfo().getWorldTime();
|
||||||
long remainder = worldTime % 24000L;
|
long remainder = worldTime % 24000L;
|
||||||
long add = shouldTime > remainder ? shouldTime - remainder : shouldTime + 24000 - remainder;
|
long add = shouldTime > remainder ? shouldTime - remainder
|
||||||
|
: shouldTime + 24000 - remainder;
|
||||||
|
|
||||||
world.getWorldInfo().setWorldTime(worldTime + add);
|
world.getWorldInfo().setWorldTime(worldTime + add);
|
||||||
if (this.sliderValue < 0.0F) {
|
if (this.sliderValue < 0.0F) {
|
||||||
|
@ -50,12 +49,25 @@ public class GuiSunAltarSlider extends GuiButton {
|
||||||
if (this.sliderValue > 1.0F) {
|
if (this.sliderValue > 1.0F) {
|
||||||
this.sliderValue = 1.0F;
|
this.sliderValue = 1.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 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.drawTexturedModalRect(this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20);
|
this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)),
|
||||||
|
this.yPosition,
|
||||||
|
0,
|
||||||
|
66,
|
||||||
|
4,
|
||||||
|
20
|
||||||
|
);
|
||||||
|
this.drawTexturedModalRect(
|
||||||
|
this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)) + 4,
|
||||||
|
this.yPosition,
|
||||||
|
196,
|
||||||
|
66,
|
||||||
|
4,
|
||||||
|
20
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +81,8 @@ public class GuiSunAltarSlider extends GuiButton {
|
||||||
@Override
|
@Override
|
||||||
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) {
|
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) {
|
||||||
if (super.mousePressed(par1Minecraft, par2, par3)) {
|
if (super.mousePressed(par1Minecraft, par2, par3)) {
|
||||||
this.sliderValue = (float) (par2 - (this.xPosition + 4)) / (float) (this.width - 8);
|
this.sliderValue
|
||||||
|
= (float) (par2 - (this.xPosition + 4)) / (float) (this.width - 8);
|
||||||
|
|
||||||
if (this.sliderValue < 0.0F) {
|
if (this.sliderValue < 0.0F) {
|
||||||
this.sliderValue = 0.0F;
|
this.sliderValue = 0.0F;
|
||||||
|
@ -90,7 +103,8 @@ public class GuiSunAltarSlider extends GuiButton {
|
||||||
public void mouseReleased(int mouseX, int mouseY) {
|
public void mouseReleased(int mouseX, int mouseY) {
|
||||||
this.dragging = false;
|
this.dragging = false;
|
||||||
|
|
||||||
AetherNetwork.sendToServer(new PacketSetTime(this.sliderValue, Minecraft.getMinecraft().thePlayer.dimension));
|
AetherNetwork.sendToServer(new PacketSetTime(
|
||||||
|
this.sliderValue, Minecraft.getMinecraft().thePlayer.dimension
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -8,7 +8,6 @@ import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
public class DialogueOption extends Gui {
|
public class DialogueOption extends Gui {
|
||||||
|
|
||||||
private int dialogueId;
|
private int dialogueId;
|
||||||
|
|
||||||
private String dialogueText;
|
private String dialogueText;
|
||||||
|
@ -26,16 +25,35 @@ public class DialogueOption extends Gui {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderDialogue(int mouseX, int mouseY) {
|
public void renderDialogue(int mouseX, int mouseY) {
|
||||||
this.drawGradientRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 0x66000000, 0x66000000);
|
this.drawGradientRect(
|
||||||
this.drawString(this.mc.fontRenderer, this.isMouseOver(mouseX, mouseY) ? EnumChatFormatting.YELLOW.toString() + this.getDialogueText() : this.getDialogueText(), this.xPosition + 2, this.yPosition + 2, 0xffffff);
|
this.xPosition,
|
||||||
|
this.yPosition,
|
||||||
|
this.xPosition + this.width,
|
||||||
|
this.yPosition + this.height,
|
||||||
|
0x66000000,
|
||||||
|
0x66000000
|
||||||
|
);
|
||||||
|
this.drawString(
|
||||||
|
this.mc.fontRenderer,
|
||||||
|
this.isMouseOver(mouseX, mouseY)
|
||||||
|
? EnumChatFormatting.YELLOW.toString() + this.getDialogueText()
|
||||||
|
: this.getDialogueText(),
|
||||||
|
this.xPosition + 2,
|
||||||
|
this.yPosition + 2,
|
||||||
|
0xffffff
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMouseOver(int mouseX, int mouseY) {
|
public boolean isMouseOver(int mouseX, int mouseY) {
|
||||||
return mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
return mouseX >= this.xPosition && mouseY >= this.yPosition
|
||||||
|
&& mouseX < this.xPosition + this.width
|
||||||
|
&& mouseY < this.yPosition + this.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playPressSound(SoundHandler soundHandlerIn) {
|
public void playPressSound(SoundHandler soundHandlerIn) {
|
||||||
soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(
|
||||||
|
new ResourceLocation("gui.button.press"), 1.0F
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDialogueText(String dialogueText) {
|
public void setDialogueText(String dialogueText) {
|
||||||
|
@ -70,5 +88,4 @@ public class DialogueOption extends Gui {
|
||||||
public String getDialogueText() {
|
public String getDialogueText() {
|
||||||
return this.dialogueText;
|
return this.dialogueText;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -9,7 +9,6 @@ import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
|
||||||
public class GuiDialogue extends GuiScreen {
|
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;
|
||||||
|
@ -43,7 +42,13 @@ public class GuiDialogue extends GuiScreen {
|
||||||
for (DialogueOption option : options) {
|
for (DialogueOption option : options) {
|
||||||
option.setDialogueId(lineNumber);
|
option.setDialogueId(lineNumber);
|
||||||
option.setXPosition((this.width / 2) - (option.getWidth() / 2));
|
option.setXPosition((this.width / 2) - (option.getWidth() / 2));
|
||||||
option.setYPosition((this.height / 2) + this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300).size() * 12 + 12 * lineNumber);
|
option.setYPosition(
|
||||||
|
(this.height / 2)
|
||||||
|
+ this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300)
|
||||||
|
.size()
|
||||||
|
* 12
|
||||||
|
+ 12 * lineNumber
|
||||||
|
);
|
||||||
|
|
||||||
lineNumber++;
|
lineNumber++;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +61,9 @@ public class GuiDialogue extends GuiScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addDialogueMessage(String dialogueMessage) {
|
public void addDialogueMessage(String dialogueMessage) {
|
||||||
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(dialogueMessage));
|
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(
|
||||||
|
new ChatComponentText(dialogueMessage)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dialogueTreeCompleted() {
|
public void dialogueTreeCompleted() {
|
||||||
|
@ -75,11 +82,25 @@ public class GuiDialogue extends GuiScreen {
|
||||||
|
|
||||||
int optionWidth = 0;
|
int optionWidth = 0;
|
||||||
|
|
||||||
for (String theDialogue : ((List<String>) this.fontRendererObj.listFormattedStringToWidth(this.dialogue, 300))) {
|
for (String theDialogue : ((List<String>) this.fontRendererObj
|
||||||
|
.listFormattedStringToWidth(this.dialogue, 300))) {
|
||||||
int stringWidth = this.fontRendererObj.getStringWidth(theDialogue);
|
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.drawGradientRect(
|
||||||
this.drawString(this.fontRendererObj, theDialogue, this.width / 2 - stringWidth / 2, this.height / 2 + optionWidth * 10, 0xffffff);
|
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;
|
++optionWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,9 +128,7 @@ public class GuiDialogue extends GuiScreen {
|
||||||
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() {
|
public ArrayList<DialogueOption> getDialogueOptions() {
|
||||||
return this.dialogueOptions;
|
return this.dialogueOptions;
|
||||||
|
@ -118,5 +137,4 @@ public class GuiDialogue extends GuiScreen {
|
||||||
public String getDialogue() {
|
public String getDialogue() {
|
||||||
return this.dialogue;
|
return this.dialogue;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -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.DialogueOption;
|
||||||
import com.gildedgames.the_aether.client.gui.dialogue.GuiDialogue;
|
import com.gildedgames.the_aether.client.gui.dialogue.GuiDialogue;
|
||||||
import com.gildedgames.the_aether.entities.bosses.valkyrie_queen.EntityValkyrieQueen;
|
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.client.resources.I18n;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.EnumDifficulty;
|
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 {
|
public class GuiValkyrieDialogue extends GuiDialogue {
|
||||||
|
|
||||||
private EntityValkyrieQueen valkyrieQueen;
|
private EntityValkyrieQueen valkyrieQueen;
|
||||||
|
|
||||||
private String title;
|
private String title;
|
||||||
|
@ -21,7 +19,13 @@ public class GuiValkyrieDialogue extends GuiDialogue {
|
||||||
private int medalSlotId = -1;
|
private int medalSlotId = -1;
|
||||||
|
|
||||||
public GuiValkyrieDialogue(EntityValkyrieQueen valkyrieQueen) {
|
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.title = this.getDialogue();
|
||||||
this.valkyrieQueen = valkyrieQueen;
|
this.valkyrieQueen = valkyrieQueen;
|
||||||
|
@ -31,44 +35,65 @@ public class GuiValkyrieDialogue extends GuiDialogue {
|
||||||
public void dialogueClicked(DialogueOption dialogue) {
|
public void dialogueClicked(DialogueOption dialogue) {
|
||||||
if (this.getDialogueOptions().size() == 3) {
|
if (this.getDialogueOptions().size() == 3) {
|
||||||
if (dialogue.getDialogueId() == 0) {
|
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();
|
this.dialogueTreeCompleted();
|
||||||
} else if (dialogue.getDialogueId() == 1) {
|
} 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) {
|
} 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();
|
this.dialogueTreeCompleted();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (dialogue.getDialogueId() == 0) {
|
if (dialogue.getDialogueId() == 0) {
|
||||||
if (this.mc.theWorld.difficultySetting == EnumDifficulty.PEACEFUL) {
|
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();
|
this.dialogueTreeCompleted();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.medalSlotId != -1) {
|
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.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();
|
this.dialogueTreeCompleted();
|
||||||
} else {
|
} else {
|
||||||
this.addDialogueMessage(this.title + ": " + I18n.format("gui.valkyrie.dialog.nomedals"));
|
this.addDialogueMessage(
|
||||||
|
this.title + ": " + I18n.format("gui.valkyrie.dialog.nomedals")
|
||||||
|
);
|
||||||
this.dialogueTreeCompleted();
|
this.dialogueTreeCompleted();
|
||||||
}
|
}
|
||||||
} else if (dialogue.getDialogueId() == 1) {
|
} 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();
|
this.dialogueTreeCompleted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getMedalDiaulogue() {
|
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];
|
ItemStack stack = this.mc.thePlayer.inventory.mainInventory[slotId];
|
||||||
|
|
||||||
if (stack != null && stack.getItem() == ItemsAether.victory_medal) {
|
if (stack != null && stack.getItem() == ItemsAether.victory_medal) {
|
||||||
|
@ -76,12 +101,12 @@ public class GuiValkyrieDialogue extends GuiDialogue {
|
||||||
this.medalSlotId = slotId;
|
this.medalSlotId = slotId;
|
||||||
return I18n.format("gui.valkyrie.dialog.player.havemedals");
|
return I18n.format("gui.valkyrie.dialog.player.havemedals");
|
||||||
} else {
|
} 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)";
|
return I18n.format("gui.valkyrie.dialog.player.lackmedals") + " (0/10)";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -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.DialogueOption;
|
||||||
import com.gildedgames.the_aether.client.gui.dialogue.GuiDialogue;
|
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.AetherNetwork;
|
||||||
import com.gildedgames.the_aether.network.packets.PacketDialogueClicked;
|
import com.gildedgames.the_aether.network.packets.PacketDialogueClicked;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
public class GuiServerDialogue extends GuiDialogue {
|
public class GuiServerDialogue extends GuiDialogue {
|
||||||
|
|
||||||
private String dialogueName;
|
private String dialogueName;
|
||||||
|
|
||||||
public GuiServerDialogue(String dialogueName, String dialogue, ArrayList<String> dialogueText) {
|
public GuiServerDialogue(
|
||||||
|
String dialogueName, String dialogue, ArrayList<String> dialogueText
|
||||||
|
) {
|
||||||
super(dialogue);
|
super(dialogue);
|
||||||
|
|
||||||
this.dialogueName = dialogueName;
|
this.dialogueName = dialogueName;
|
||||||
|
@ -23,13 +24,14 @@ public class GuiServerDialogue extends GuiDialogue {
|
||||||
dialogueOptions.add(new DialogueOption(dialogueForOption));
|
dialogueOptions.add(new DialogueOption(dialogueForOption));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addDialogueOptions(dialogueOptions.toArray(new DialogueOption[]{}));
|
this.addDialogueOptions(dialogueOptions.toArray(new DialogueOption[] {}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dialogueClicked(DialogueOption dialogue) {
|
public void dialogueClicked(DialogueOption dialogue) {
|
||||||
AetherNetwork.sendToServer(new PacketDialogueClicked(this.dialogueName, dialogue.getDialogueId()));
|
AetherNetwork.sendToServer(
|
||||||
|
new PacketDialogueClicked(this.dialogueName, dialogue.getDialogueId())
|
||||||
|
);
|
||||||
this.dialogueTreeCompleted();
|
this.dialogueTreeCompleted();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,30 +3,29 @@ package com.gildedgames.the_aether.client.gui.inventory;
|
||||||
import com.gildedgames.the_aether.Aether;
|
import com.gildedgames.the_aether.Aether;
|
||||||
import com.gildedgames.the_aether.client.AetherKeybinds;
|
import com.gildedgames.the_aether.client.AetherKeybinds;
|
||||||
import com.gildedgames.the_aether.client.gui.button.GuiAccessoryButton;
|
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.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
import org.lwjgl.opengl.GL11;
|
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 {
|
public class GuiAccessories extends GuiContainer {
|
||||||
|
private static final ResourceLocation ACCESSORIES
|
||||||
private static final ResourceLocation ACCESSORIES = Aether.locate("textures/gui/inventory/accessories.png");
|
= Aether.locate("textures/gui/inventory/accessories.png");
|
||||||
|
|
||||||
private PlayerAether playerAether;
|
private PlayerAether playerAether;
|
||||||
|
|
||||||
public GuiAccessories(PlayerAether player) {
|
public GuiAccessories(PlayerAether player) {
|
||||||
super(new ContainerAccessories(player.getAccessoryInventory(), player.getEntity()));
|
super(new ContainerAccessories(player.getAccessoryInventory(), player.getEntity())
|
||||||
|
);
|
||||||
|
|
||||||
this.playerAether = player;
|
this.playerAether = player;
|
||||||
this.allowUserInput = true;
|
this.allowUserInput = true;
|
||||||
|
@ -38,8 +37,9 @@ public class GuiAccessories extends GuiContainer {
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (AetherRankings.isRankedPlayer(this.playerAether.getEntity().getUniqueID()) || this.playerAether.isDonator()) {
|
if (AetherRankings.isRankedPlayer(this.playerAether.getEntity().getUniqueID()) ||
|
||||||
this.buttonList.add(new GuiButtonPerks(this.width / 2 - 108, this.height / 2 - 83));
|
this.playerAether.isDonator()) { this.buttonList.add(new GuiButtonPerks(this.width
|
||||||
|
/ 2 - 108, this.height / 2 - 83));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -79,30 +79,41 @@ public class GuiAccessories extends GuiContainer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||||
this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 115, 8, 4210752);
|
this.fontRendererObj.drawString(
|
||||||
|
I18n.format("container.crafting", new Object[0]), 115, 8, 4210752
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
protected void
|
||||||
|
drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||||
;
|
;
|
||||||
GL11.glColor3d(1.0D, 1.0D, 1.0D);
|
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
|
@Override
|
||||||
public void handleKeyboardInput()
|
public void handleKeyboardInput() {
|
||||||
{
|
|
||||||
super.handleKeyboardInput();
|
super.handleKeyboardInput();
|
||||||
|
|
||||||
int keyPressed = Keyboard.getEventKey();
|
int keyPressed = Keyboard.getEventKey();
|
||||||
|
|
||||||
if (keyPressed == AetherKeybinds.keyBindingAccessories.getKeyCode() && Keyboard.getEventKeyState())
|
if (keyPressed == AetherKeybinds.keyBindingAccessories.getKeyCode()
|
||||||
{
|
&& Keyboard.getEventKeyState()) {
|
||||||
Minecraft.getMinecraft().thePlayer.closeScreen();
|
Minecraft.getMinecraft().thePlayer.closeScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,5 @@
|
||||||
package com.gildedgames.the_aether.client.gui.inventory;
|
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.passive.mountable.EntityMoa;
|
||||||
import com.gildedgames.the_aether.entities.util.AetherMoaTypes;
|
import com.gildedgames.the_aether.entities.util.AetherMoaTypes;
|
||||||
import com.gildedgames.the_aether.network.AetherNetwork;
|
import com.gildedgames.the_aether.network.AetherNetwork;
|
||||||
|
@ -16,9 +8,14 @@ import com.gildedgames.the_aether.player.PlayerAether;
|
||||||
import com.gildedgames.the_aether.player.perks.AetherRankings;
|
import com.gildedgames.the_aether.player.perks.AetherRankings;
|
||||||
import com.gildedgames.the_aether.player.perks.util.DonatorMoaSkin;
|
import com.gildedgames.the_aether.player.perks.util.DonatorMoaSkin;
|
||||||
import com.gildedgames.the_aether.player.perks.util.EnumAetherPerkType;
|
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 {
|
public class GuiAetherPerks extends GuiScreen {
|
||||||
|
|
||||||
private boolean enableMoaEditor, enableHaloEditor;
|
private boolean enableMoaEditor, enableHaloEditor;
|
||||||
|
|
||||||
private PlayerAether player;
|
private PlayerAether player;
|
||||||
|
@ -29,7 +26,8 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
|
|
||||||
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();
|
||||||
|
|
||||||
|
@ -44,7 +42,9 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
this.player = PlayerAether.get(this.mc.thePlayer);
|
this.player = PlayerAether.get(this.mc.thePlayer);
|
||||||
this.moaSkin = this.player.donatorMoaSkin;
|
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
|
@Override
|
||||||
|
@ -57,7 +57,9 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
this.moaOutside.updateCursorCounter();
|
this.moaOutside.updateCursorCounter();
|
||||||
|
|
||||||
if (!this.moaWingMarking.getText().isEmpty()) {
|
if (!this.moaWingMarking.getText().isEmpty()) {
|
||||||
this.moaSkin.setWingMarkingColor(Integer.decode("0x" + this.moaWingMarking.getText()));
|
this.moaSkin.setWingMarkingColor(
|
||||||
|
Integer.decode("0x" + this.moaWingMarking.getText())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.moaWing.getText().isEmpty()) {
|
if (!this.moaWing.getText().isEmpty()) {
|
||||||
|
@ -69,7 +71,9 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.moaBodyMarking.getText().isEmpty()) {
|
if (!this.moaBodyMarking.getText().isEmpty()) {
|
||||||
this.moaSkin.setMarkingColor(Integer.decode("0x" + this.moaBodyMarking.getText()));
|
this.moaSkin.setMarkingColor(
|
||||||
|
Integer.decode("0x" + this.moaBodyMarking.getText())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.moaEye.getText().isEmpty()) {
|
if (!this.moaEye.getText().isEmpty()) {
|
||||||
|
@ -77,7 +81,8 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.moaOutside.getText().isEmpty()) {
|
if (!this.moaOutside.getText().isEmpty()) {
|
||||||
this.moaSkin.setOutsideColor(Integer.decode("0x" + this.moaOutside.getText()));
|
this.moaSkin.setOutsideColor(Integer.decode("0x" + this.moaOutside.getText())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.moaSkin.shouldUseDefualt(this.defualtSkin.displayString.contains("true"));
|
this.moaSkin.shouldUseDefualt(this.defualtSkin.displayString.contains("true"));
|
||||||
|
@ -100,42 +105,82 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
this.guiLeft = (this.width - 176) / 2;
|
this.guiLeft = (this.width - 176) / 2;
|
||||||
this.guiTop = (this.height - 166) / 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.buttonList.add(this.perkHalo = new GuiButton(5, 110, 17, 100, 20, "Developer Perks"));
|
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.buttonList.add(this.defualtSkin = new GuiButton(2, this.width / 2 - 100, this.height - 20, 100, 20, "Default skin: " + this.player.donatorMoaSkin.shouldUseDefualt()));
|
this.enableHalo = new GuiButton(
|
||||||
this.buttonList.add(this.confirmPreference = new GuiButton(4, this.width / 2, this.height - 20, 100, 20, "Confirm Skin"));
|
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())) {
|
if (!AetherRankings.isRankedPlayer(this.player.getEntity().getUniqueID())) {
|
||||||
this.perkHalo.visible = false;
|
this.perkHalo.visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.enableHalo.displayString = this.enableHalo.displayString + Boolean.toString(this.player.shouldRenderHalo ? false : true);
|
this.enableHalo.displayString = this.enableHalo.displayString
|
||||||
|
+ Boolean.toString(this.player.shouldRenderHalo ? false : true);
|
||||||
|
|
||||||
this.moaEye = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, 70, 45, 20);
|
this.moaEye
|
||||||
|
= new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, 70, 45, 20);
|
||||||
this.moaEye.setMaxStringLength(6);
|
this.moaEye.setMaxStringLength(6);
|
||||||
this.moaEye.setText(Integer.toHexString(this.player.donatorMoaSkin.getEyeColor()));
|
this.moaEye.setText(Integer.toHexString(this.player.donatorMoaSkin.getEyeColor())
|
||||||
|
);
|
||||||
|
|
||||||
this.moaWingMarking = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, this.height - 40, 45, 20);
|
this.moaWingMarking = new GuiTextField(
|
||||||
|
this.fontRendererObj, (this.width / 2) + 105, this.height - 40, 45, 20
|
||||||
|
);
|
||||||
this.moaWingMarking.setMaxStringLength(6);
|
this.moaWingMarking.setMaxStringLength(6);
|
||||||
this.moaWingMarking.setText(Integer.toHexString(this.player.donatorMoaSkin.getWingMarkingColor()));
|
this.moaWingMarking.setText(
|
||||||
|
Integer.toHexString(this.player.donatorMoaSkin.getWingMarkingColor())
|
||||||
|
);
|
||||||
|
|
||||||
this.moaWing = new GuiTextField(this.fontRendererObj, (this.width / 2) + 105, this.height / 2 + 15, 45, 20);
|
this.moaWing = new GuiTextField(
|
||||||
|
this.fontRendererObj, (this.width / 2) + 105, this.height / 2 + 15, 45, 20
|
||||||
|
);
|
||||||
this.moaWing.setMaxStringLength(6);
|
this.moaWing.setMaxStringLength(6);
|
||||||
this.moaWing.setText(Integer.toHexString(this.player.donatorMoaSkin.getWingColor()));
|
this.moaWing.setText(Integer.toHexString(this.player.donatorMoaSkin.getWingColor()
|
||||||
|
));
|
||||||
|
|
||||||
this.moaBody = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, this.height / 2 + 15, 45, 20);
|
this.moaBody = new GuiTextField(
|
||||||
|
this.fontRendererObj, (this.width / 2) - 155, this.height / 2 + 15, 45, 20
|
||||||
|
);
|
||||||
this.moaBody.setMaxStringLength(6);
|
this.moaBody.setMaxStringLength(6);
|
||||||
this.moaBody.setText(Integer.toHexString(this.player.donatorMoaSkin.getBodyColor()));
|
this.moaBody.setText(Integer.toHexString(this.player.donatorMoaSkin.getBodyColor()
|
||||||
|
));
|
||||||
|
|
||||||
this.moaBodyMarking = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, this.height - 40, 45, 20);
|
this.moaBodyMarking = new GuiTextField(
|
||||||
|
this.fontRendererObj, (this.width / 2) - 155, this.height - 40, 45, 20
|
||||||
|
);
|
||||||
this.moaBodyMarking.setMaxStringLength(6);
|
this.moaBodyMarking.setMaxStringLength(6);
|
||||||
this.moaBodyMarking.setText(Integer.toHexString(this.player.donatorMoaSkin.getMarkingColor()));
|
this.moaBodyMarking.setText(
|
||||||
|
Integer.toHexString(this.player.donatorMoaSkin.getMarkingColor())
|
||||||
|
);
|
||||||
|
|
||||||
this.moaOutside = new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, 70, 45, 20);
|
this.moaOutside
|
||||||
|
= new GuiTextField(this.fontRendererObj, (this.width / 2) - 155, 70, 45, 20);
|
||||||
this.moaOutside.setMaxStringLength(6);
|
this.moaOutside.setMaxStringLength(6);
|
||||||
this.moaOutside.setText(Integer.toHexString(this.player.donatorMoaSkin.getOutsideColor()));
|
this.moaOutside.setText(
|
||||||
|
Integer.toHexString(this.player.donatorMoaSkin.getOutsideColor())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -143,7 +188,9 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
super.keyTyped(typedChar, keyCode);
|
super.keyTyped(typedChar, keyCode);
|
||||||
|
|
||||||
if (this.enableMoaEditor) {
|
if (this.enableMoaEditor) {
|
||||||
if (keyCode > 1 && keyCode < 12 || keyCode == 14 || keyCode == 30 || keyCode == 48 || keyCode == 46 || keyCode == 32 || keyCode == 18 || keyCode == 33) {
|
if (keyCode > 1 && keyCode < 12 || keyCode == 14 || keyCode == 30
|
||||||
|
|| keyCode == 48 || keyCode == 46 || keyCode == 32 || keyCode == 18
|
||||||
|
|| keyCode == 33) {
|
||||||
this.moaWingMarking.textboxKeyTyped(typedChar, keyCode);
|
this.moaWingMarking.textboxKeyTyped(typedChar, keyCode);
|
||||||
this.moaWing.textboxKeyTyped(typedChar, keyCode);
|
this.moaWing.textboxKeyTyped(typedChar, keyCode);
|
||||||
this.moaBody.textboxKeyTyped(typedChar, keyCode);
|
this.moaBody.textboxKeyTyped(typedChar, keyCode);
|
||||||
|
@ -171,7 +218,9 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
@Override
|
@Override
|
||||||
public void onGuiClosed() {
|
public void onGuiClosed() {
|
||||||
Keyboard.enableRepeatEvents(false);
|
Keyboard.enableRepeatEvents(false);
|
||||||
AetherNetwork.sendToServer(new PacketPerkChanged(this.player.getEntity().getEntityId(), EnumAetherPerkType.Moa, this.moaSkin));
|
AetherNetwork.sendToServer(new PacketPerkChanged(
|
||||||
|
this.player.getEntity().getEntityId(), EnumAetherPerkType.Moa, this.moaSkin
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -185,12 +234,18 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
this.confirmPreference.visible = true;
|
this.confirmPreference.visible = true;
|
||||||
this.defualtSkin.visible = true;
|
this.defualtSkin.visible = true;
|
||||||
} else if (button.id == 2) {
|
} else if (button.id == 2) {
|
||||||
boolean enableDefualt = this.player.donatorMoaSkin.shouldUseDefualt() ? false : true;
|
boolean enableDefualt
|
||||||
|
= this.player.donatorMoaSkin.shouldUseDefualt() ? false : true;
|
||||||
|
|
||||||
this.defualtSkin.displayString = "Use Default: " + Boolean.toString(enableDefualt);
|
this.defualtSkin.displayString
|
||||||
|
= "Use Default: " + Boolean.toString(enableDefualt);
|
||||||
this.player.donatorMoaSkin.shouldUseDefualt(enableDefualt);
|
this.player.donatorMoaSkin.shouldUseDefualt(enableDefualt);
|
||||||
} else if (button.id == 4) {
|
} else if (button.id == 4) {
|
||||||
AetherNetwork.sendToServer(new PacketPerkChanged(this.player.getEntity().getEntityId(), EnumAetherPerkType.Moa, this.moaSkin));
|
AetherNetwork.sendToServer(new PacketPerkChanged(
|
||||||
|
this.player.getEntity().getEntityId(),
|
||||||
|
EnumAetherPerkType.Moa,
|
||||||
|
this.moaSkin
|
||||||
|
));
|
||||||
} else if (button.id == 5) {
|
} else if (button.id == 5) {
|
||||||
boolean shouldEnable = this.enableHaloEditor ? false : true;
|
boolean shouldEnable = this.enableHaloEditor ? false : true;
|
||||||
|
|
||||||
|
@ -201,8 +256,11 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
boolean enableHalo = this.player.shouldRenderHalo ? false : true;
|
boolean enableHalo = this.player.shouldRenderHalo ? false : true;
|
||||||
|
|
||||||
this.player.shouldRenderHalo = enableHalo;
|
this.player.shouldRenderHalo = enableHalo;
|
||||||
AetherNetwork.sendToServer(new PacketPerkChanged(this.player.getEntity().getEntityId(), EnumAetherPerkType.Halo, enableHalo));
|
AetherNetwork.sendToServer(new PacketPerkChanged(
|
||||||
this.enableHalo.displayString = "Enable Halo: " + Boolean.toString(enableHalo);
|
this.player.getEntity().getEntityId(), EnumAetherPerkType.Halo, enableHalo
|
||||||
|
));
|
||||||
|
this.enableHalo.displayString
|
||||||
|
= "Enable Halo: " + Boolean.toString(enableHalo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,23 +271,62 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
this.drawCenteredString(this.fontRendererObj, "Donator Options", 45, 4, 16777215);
|
this.drawCenteredString(this.fontRendererObj, "Donator Options", 45, 4, 16777215);
|
||||||
|
|
||||||
if (this.enableMoaEditor) {
|
if (this.enableMoaEditor) {
|
||||||
GuiInventory.func_147046_a(this.width / 2, this.height / 2 + (this.height / 2) - 30, (this.height / 3) - 20, (float) (this.guiLeft + 51) - (float) mouseX, (float) (75 - 50) - (float) mouseY, this.moa);
|
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.moaWingMarking.drawTextBox();
|
||||||
this.moaWing.drawTextBox();
|
this.moaWing.drawTextBox();
|
||||||
|
@ -240,7 +337,14 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.enableHaloEditor) {
|
if (this.enableHaloEditor) {
|
||||||
GuiInventory.func_147046_a(this.width / 2, this.height / 2 + (this.height / 2) - 30, (this.height / 3) - 20, (float) (this.guiLeft + 51) - (float) mouseX, (float) (75 - 50) - (float) mouseY, this.player.getEntity());
|
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);
|
||||||
|
@ -256,5 +360,4 @@ public class GuiAetherPerks extends GuiScreen {
|
||||||
this.drawBackground(tint);
|
this.drawBackground(tint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue